diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-11 03:03:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-11 03:03:53 +0300 |
commit | dd5a317dbfdb24d905ade4ebea458e370619f61f (patch) | |
tree | 85287ebf514aced1106d0b25744ba0a580659f28 /src | |
parent | 22c81087c05cf216c8ab0ff29c82677db96e9ed7 (diff) | |
download | manaverse-dd5a317dbfdb24d905ade4ebea458e370619f61f.tar.gz manaverse-dd5a317dbfdb24d905ade4ebea458e370619f61f.tar.bz2 manaverse-dd5a317dbfdb24d905ade4ebea458e370619f61f.tar.xz manaverse-dd5a317dbfdb24d905ade4ebea458e370619f61f.zip |
Save whisper tabs state to configuration after each change.
Before was only after correct game disconnect.
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 12 | ||||
-rw-r--r-- | src/gui/quitdialog.cpp | 8 | ||||
-rw-r--r-- | src/gui/quitdialog.h | 1 |
5 files changed, 14 insertions, 11 deletions
diff --git a/src/client.cpp b/src/client.cpp index 01543d8be..092f81a93 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1289,8 +1289,6 @@ int Client::exec() case STATE_ERROR: logger->log1("State: ERROR"); logger->log("Error: %s\n", errorMessage.c_str()); - if (chatWindow) - chatWindow->saveState(); mCurrentDialog = new OkDialog(_("Error"), errorMessage); mCurrentDialog->addActionListener(&errorListener); mCurrentDialog = NULL; // OkDialog deletes itself diff --git a/src/game.cpp b/src/game.cpp index 9a5128f37..40b6896b7 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -532,8 +532,6 @@ void Game::logic() map->saveExtraLayer(); } Client::closeDialogs(); - if (chatWindow) - chatWindow->saveState(); disconnectedDialog = new OkDialog(_("Network Error"), errorMessage, false); disconnectedDialog->addActionListener(&errorListener); diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 79618ad04..9cf9e536e 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -1245,26 +1245,38 @@ void PopupMenu::handleLink(const std::string &link, else if (link == "enable highlight" && mTab) { mTab->setAllowHighlight(true); + if (chatWindow) + chatWindow->saveState(); } else if (link == "disable highlight" && mTab) { mTab->setAllowHighlight(false); + if (chatWindow) + chatWindow->saveState(); } else if (link == "dont remove name" && mTab) { mTab->setRemoveNames(false); + if (chatWindow) + chatWindow->saveState(); } else if (link == "remove name" && mTab) { mTab->setRemoveNames(true); + if (chatWindow) + chatWindow->saveState(); } else if (link == "disable away" && mTab) { mTab->setNoAway(true); + if (chatWindow) + chatWindow->saveState(); } else if (link == "enable away" && mTab) { mTab->setNoAway(false); + if (chatWindow) + chatWindow->saveState(); } else if (link == "remove attack" && being) { diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 28a3332bf..f66872b5d 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -53,7 +53,6 @@ QuitDialog::QuitDialog(QuitDialog** pointerToMe): mForceQuit = new RadioButton(_("Quit"), "quitdialog"); mLogoutQuit = new RadioButton(_("Quit"), "quitdialog"); - mSaveState = new CheckBox(_("Save state"), true); mSwitchAccountServer = new RadioButton(_("Switch server"), "quitdialog"); mSwitchCharacter = new RadioButton(_("Switch character"), "quitdialog"); mOkButton = new Button(_("OK"), "ok", this); @@ -91,9 +90,8 @@ QuitDialog::QuitDialog(QuitDialog** pointerToMe): place = getPlacer(0, 1); - place(0, 0, mSaveState, 3); - place(1, 1, mOkButton, 1); - place(2, 1, mCancelButton, 1); + place(1, 0, mOkButton, 1); + place(2, 0, mCancelButton, 1); reflowLayout(200, 0); setLocationRelativeTo(getParent()); @@ -133,8 +131,6 @@ void QuitDialog::action(const gcn::ActionEvent &event) if (map) map->saveExtraLayer(); } - if (chatWindow && mSaveState->isSelected()) - chatWindow->saveState(); if (mForceQuit->isSelected()) { diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h index d68910596..380a85528 100644 --- a/src/gui/quitdialog.h +++ b/src/gui/quitdialog.h @@ -65,7 +65,6 @@ class QuitDialog : public Window, public gcn::ActionListener, std::vector<gcn::RadioButton*> mOptions; gcn::RadioButton *mLogoutQuit; - gcn::CheckBox *mSaveState; gcn::RadioButton *mForceQuit; gcn::RadioButton *mSwitchAccountServer; gcn::RadioButton *mSwitchCharacter; |