diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-19 22:02:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-20 00:26:53 +0300 |
commit | e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91 (patch) | |
tree | 2959d64c52fb2d9df7ca30fb5a400e17570c4861 /src/gui/windows | |
parent | ac9d9925b52789abc07795d5ed52dd0de620c757 (diff) | |
download | manaverse-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.gz manaverse-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.bz2 manaverse-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.xz manaverse-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.zip |
Add quick settings page for yellow bar options.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/setupwindow.cpp | 27 | ||||
-rw-r--r-- | src/gui/windows/setupwindow.h | 5 |
2 files changed, 23 insertions, 9 deletions
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 3f04d0e69..d92ff0560 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -37,6 +37,7 @@ #include "gui/widgets/tabs/setup_other.h" #include "gui/widgets/tabs/setup_perfomance.h" #include "gui/widgets/tabs/setup_players.h" +#include "gui/widgets/tabs/setup_quick.h" #include "gui/widgets/tabs/setup_relations.h" #include "gui/widgets/tabs/setup_theme.h" #include "gui/widgets/tabs/setup_touch.h" @@ -64,6 +65,7 @@ SetupWindow::SetupWindow() : mWindowsToReset(), mButtons(), mModsTab(nullptr), + mQuickTab(nullptr), mResetWindows(nullptr), mPanel(new TabbedArea(this)), mVersion(new Label(this, FULL_VERSION)) @@ -206,10 +208,13 @@ void SetupWindow::setInGame(const bool inGame) void SetupWindow::externalUpdate() { - unloadModTab(); + unloadAdditionalTabs(); mModsTab = new Setup_Mods(this); mTabs.push_back(mModsTab); mPanel->addTab(mModsTab->getName(), mModsTab); + mQuickTab = new Setup_Quick(this); + mTabs.push_back(mQuickTab); + mPanel->addTab(mQuickTab->getName(), mQuickTab); FOR_EACH (std::list<SetupTab*>::const_iterator, it, mTabs) { if (*it) @@ -217,17 +222,23 @@ void SetupWindow::externalUpdate() } } -void SetupWindow::unloadModTab() +void SetupWindow::unloadTab(SetupTab *page) { - if (mModsTab) + if (page) { - mTabs.remove(mModsTab); - Tab *const tab = mPanel->getTab(mModsTab->getName()); - mPanel->removeTab(tab); - delete2(mModsTab) + mTabs.remove(page); + mPanel->removeTab(mPanel->getTab(page->getName())); } } +void SetupWindow::unloadAdditionalTabs() +{ + unloadTab(mModsTab); + unloadTab(mQuickTab); + delete2(mModsTab); + delete2(mQuickTab); +} + void SetupWindow::externalUnload() { FOR_EACH (std::list<SetupTab*>::const_iterator, it, mTabs) @@ -235,7 +246,7 @@ void SetupWindow::externalUnload() if (*it) (*it)->externalUnloaded(); } - unloadModTab(); + unloadAdditionalTabs(); } void SetupWindow::registerWindowForReset(Window *const window) diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h index d890f3f02..adf0cca43 100644 --- a/src/gui/windows/setupwindow.h +++ b/src/gui/windows/setupwindow.h @@ -76,12 +76,15 @@ class SetupWindow final : public Window, void widgetResized(const Event &event) override final; private: - void unloadModTab(); + void unloadAdditionalTabs(); + + void unloadTab(SetupTab *page); std::list<SetupTab*> mTabs; std::list<Window*> mWindowsToReset; std::vector<Button*> mButtons; SetupTab *mModsTab; + SetupTab *mQuickTab; Button *mResetWindows; TabbedArea *mPanel; Label *mVersion; |