summaryrefslogtreecommitdiff
path: root/src/gui/setup_players.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-15 13:39:01 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-15 13:39:01 -0600
commit72278cfec112e06b50ba06185fb59a2ce390d955 (patch)
tree306c21014780a12ed5a16bc85d57ada223055bad /src/gui/setup_players.cpp
parente8a1b2386bb2c28cfce0eb28d7e7067d51bb6701 (diff)
downloadmana-client-72278cfec112e06b50ba06185fb59a2ce390d955.tar.gz
mana-client-72278cfec112e06b50ba06185fb59a2ce390d955.tar.bz2
mana-client-72278cfec112e06b50ba06185fb59a2ce390d955.tar.xz
mana-client-72278cfec112e06b50ba06185fb59a2ce390d955.zip
Add a config option to always use whipser tabs
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r--src/gui/setup_players.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 9a3d6967..9f084e60 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -217,6 +217,7 @@ public:
#define ACTION_DELETE "delete"
#define ACTION_TABLE "table"
#define ACTION_STRATEGY "strategy"
+#define ACTION_WHISPER_TAB "whisper tab"
Setup_Players::Setup_Players():
mPlayerTableTitleModel(new StaticTableModel(1, COLUMNS_NR)),
@@ -230,7 +231,9 @@ Setup_Players::Setup_Players():
player_relations.getDefault() & PlayerRelation::TRADE)),
mDefaultWhisper(new CheckBox(_("Allow whispers"),
player_relations.getDefault() & PlayerRelation::WHISPER)),
- mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this))
+ mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this)),
+ mWhisperTab(config.getValue("whispertab", false)),
+ mWhisperTabCheckBox(new CheckBox(_("Put all whispers in tabs"), mWhisperTab))
{
setName(_("Players"));
@@ -275,6 +278,9 @@ Setup_Players::Setup_Players():
mIgnoreActionChoicesBox->setSelected(ignore_strategy_index);
mIgnoreActionChoicesBox->adjustHeight();
+ mWhisperTabCheckBox->setActionEventId(ACTION_WHISPER_TAB);
+ mWhisperTabCheckBox->addActionListener(this);
+
reset();
// Do the layout
@@ -284,6 +290,7 @@ Setup_Players::Setup_Players():
place(0, 0, mPlayerTitleTable, 4);
place(0, 1, mPlayerScrollArea, 4, 4).setPadding(2);
place(0, 5, mDeleteButton);
+ place(0, 6, mWhisperTabCheckBox);
place(2, 5, ignore_action_label);
place(2, 6, mIgnoreActionChoicesBox, 2).setPadding(2);
place(2, 7, mPersistIgnores);
@@ -334,10 +341,13 @@ void Setup_Players::apply()
PlayerRelation::TRADE : 0)
| (mDefaultWhisper->isSelected() ?
PlayerRelation::WHISPER : 0));
+ config.setValue("whispertab", mWhisperTab);
}
void Setup_Players::cancel()
{
+ mWhisperTab = config.getValue("whispertab", false);
+ mWhisperTabCheckBox->setSelected(mWhisperTab);
}
void Setup_Players::action(const gcn::ActionEvent &event)
@@ -377,6 +387,10 @@ void Setup_Players::action(const gcn::ActionEvent &event)
player_relations.setPlayerIgnoreStrategy(s);
}
+ else if (event.getId() == ACTION_WHISPER_TAB)
+ {
+ mWhisperTab = mWhisperTabCheckBox->isSelected();
+ }
}
void Setup_Players::updatedPlayer(const std::string &name)