summaryrefslogtreecommitdiff
path: root/src/gui/windows/setupwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-19 22:02:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-20 00:26:53 +0300
commite3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91 (patch)
tree2959d64c52fb2d9df7ca30fb5a400e17570c4861 /src/gui/windows/setupwindow.cpp
parentac9d9925b52789abc07795d5ed52dd0de620c757 (diff)
downloadplus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.gz
plus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.bz2
plus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.xz
plus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.zip
Add quick settings page for yellow bar options.
Diffstat (limited to 'src/gui/windows/setupwindow.cpp')
-rw-r--r--src/gui/windows/setupwindow.cpp27
1 files changed, 19 insertions, 8 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)