From 844e9a7a72faca6a212e788a3adc45e17f41dca6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 1 May 2010 21:27:58 +0300 Subject: Add chat logging. Add option in players setup page. Add command line option. Signed-off-by: Jared Adams --- src/gui/setup_players.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gui/setup_players.cpp') 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) -- cgit v1.2.3-70-g09d2