summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-22 03:50:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-22 03:50:43 +0300
commit49ab517a6c51a14ab7ae72143f4364b1e1416a2f (patch)
tree5ba7d8a917ef0b3b232645646c7b951e2ada492b /src/gui
parent8021cb4011f2884d96d65b207f82757be7cf84a5 (diff)
downloadplus-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.gz
plus-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.bz2
plus-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.xz
plus-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.zip
Cache some settings om chat window.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chatwindow.cpp12
-rw-r--r--src/gui/chatwindow.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index a91a8fc82..191348897 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -163,7 +163,8 @@ ChatWindow::ChatWindow():
mChatHistoryIndex(0),
mGMLoaded(false),
mHaveMouse(false),
- mAutoHide(false)
+ mAutoHide(false),
+ mShowBattleEvents(false)
{
listen(CHANNEL_NOTICES);
listen(CHANNEL_ATTRIBUTES);
@@ -230,12 +231,15 @@ ChatWindow::ChatWindow():
parseHighlights();
config.addListener("autohideChat", this);
+ config.addListener("showBattleEvents", this);
+
mAutoHide = config.getBoolValue("autohideChat");
+ mShowBattleEvents = config.getBoolValue("showBattleEvents");
}
ChatWindow::~ChatWindow()
{
- config.removeListener("autohideChat", this);
+ config.removeListeners(this);
saveState();
config.setValue("ReturnToggles", mReturnToggles);
removeAllWhispers();
@@ -917,7 +921,7 @@ void ChatWindow::processEvent(Channels channel, const DepricatedEvent &event)
}
else if (channel == CHANNEL_ATTRIBUTES)
{
- if (!config.getBoolValue("showBattleEvents"))
+ if (!mShowBattleEvents)
return;
if (event.getName() == EVENT_UPDATEATTRIBUTE)
@@ -1651,6 +1655,8 @@ void ChatWindow::optionChanged(const std::string &name)
{
if (name == "autohideChat")
mAutoHide = config.getBoolValue("autohideChat");
+ else if (name == "showBattleEvents")
+ mShowBattleEvents = config.getBoolValue("showBattleEvents");
}
void ChatWindow::mouseMoved(gcn::MouseEvent &event)
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h
index 05882aa69..336f0cb72 100644
--- a/src/gui/chatwindow.h
+++ b/src/gui/chatwindow.h
@@ -352,6 +352,7 @@ class ChatWindow : public Window,
bool mGMLoaded;
bool mHaveMouse;
bool mAutoHide;
+ bool mShowBattleEvents;
};
extern ChatWindow *chatWindow;