diff options
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 16 |
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) |