summaryrefslogtreecommitdiff
path: root/src/gui/setup_players.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-05-01 21:27:58 +0300
committerJared Adams <jaxad0127@gmail.com>2010-05-01 17:06:27 -0600
commit844e9a7a72faca6a212e788a3adc45e17f41dca6 (patch)
treef488e4c149687ea3d60f39c042c241df7275b581 /src/gui/setup_players.cpp
parentc22ea2f169f58e765fc699fcd71bfd3a3cd4f859 (diff)
downloadmana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.gz
mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.bz2
mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.xz
mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.zip
Add chat logging.
Add option in players setup page. Add command line option. Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r--src/gui/setup_players.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 06bae0ef..d92d7917 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -216,6 +216,7 @@ public:
#define ACTION_STRATEGY "strategy"
#define ACTION_WHISPER_TAB "whisper tab"
#define ACTION_SHOW_GENDER "show gender"
+#define ACTION_ENABLE_CHAT_LOG "enable log"
Setup_Players::Setup_Players():
mPlayerTableTitleModel(new StaticTableModel(1, COLUMNS_NR)),
@@ -231,7 +232,9 @@ Setup_Players::Setup_Players():
mWhisperTab(config.getValue("whispertab", false)),
mWhisperTabCheckBox(new CheckBox(_("Put all whispers in tabs"), mWhisperTab)),
mShowGender(config.getValue("showgender", false)),
- mShowGenderCheckBox(new CheckBox(_("Show gender"), mShowGender))
+ mShowGenderCheckBox(new CheckBox(_("Show gender"), mShowGender)),
+ mEnableChatLog(config.getValue("enableChatLog", false)),
+ mEnableChatLogCheckBox(new CheckBox(_("Enable Chat log"), mEnableChatLog))
{
setName(_("Players"));
@@ -281,6 +284,9 @@ Setup_Players::Setup_Players():
mShowGenderCheckBox->setActionEventId(ACTION_SHOW_GENDER);
mShowGenderCheckBox->addActionListener(this);
+ mEnableChatLogCheckBox->setActionEventId(ACTION_ENABLE_CHAT_LOG);
+ mEnableChatLogCheckBox->addActionListener(this);
+
reset();
// Do the layout
@@ -291,6 +297,7 @@ Setup_Players::Setup_Players():
place(0, 1, mPlayerScrollArea, 4, 4).setPadding(2);
place(0, 5, mDeleteButton);
place(0, 6, mShowGenderCheckBox, 2).setPadding(2);
+ place(0, 7, mEnableChatLogCheckBox, 2).setPadding(2);
place(2, 5, ignore_action_label);
place(2, 6, mIgnoreActionChoicesBox, 2).setPadding(2);
place(2, 7, mDefaultTrading);
@@ -349,6 +356,8 @@ void Setup_Players::apply()
if (beingManager && mShowGender != showGender)
beingManager->updatePlayerNames();
+
+ config.setValue("enableChatLog", mEnableChatLog);
}
void Setup_Players::cancel()
@@ -357,6 +366,8 @@ void Setup_Players::cancel()
mWhisperTabCheckBox->setSelected(mWhisperTab);
mShowGender = config.getValue("showgender", false);
mShowGenderCheckBox->setSelected(mShowGender);
+ mEnableChatLog = config.getValue("enableChatLog", false);
+ mEnableChatLogCheckBox->setSelected(mEnableChatLog);
}
void Setup_Players::action(const gcn::ActionEvent &event)
@@ -404,6 +415,10 @@ void Setup_Players::action(const gcn::ActionEvent &event)
{
mShowGender = mShowGenderCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_ENABLE_CHAT_LOG)
+ {
+ mEnableChatLog = mEnableChatLogCheckBox->isSelected();
+ }
}
void Setup_Players::updatedPlayer(const std::string &name)