diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-08 00:44:12 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-08 00:51:30 +0200 |
commit | aefbc69aac9f7c793725153eefce2631555bfd1f (patch) | |
tree | dc43d7d5cb5cf84373ee43a02998349d1deb3e0c /src/gui/setup.cpp | |
parent | 3b229e19c2b7545a71a066383872acd5d9348e41 (diff) | |
download | mana-aefbc69aac9f7c793725153eefce2631555bfd1f.tar.gz mana-aefbc69aac9f7c793725153eefce2631555bfd1f.tar.bz2 mana-aefbc69aac9f7c793725153eefce2631555bfd1f.tar.xz mana-aefbc69aac9f7c793725153eefce2631555bfd1f.zip |
Associated setup tab name with the tab itself
Keeps things together in the right place and allowed writing a bit more
generic code in the Setup class.
Diffstat (limited to 'src/gui/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 7eb740b1..50068c6e 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -85,31 +85,19 @@ Setup::Setup(): TabbedArea *panel = new TabbedArea; panel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40)); - SetupTab *tab; - - tab = new Setup_Video(); - panel->addTab(_("Video"), tab); - mTabs.push_back(tab); - - tab = new Setup_Audio(); - panel->addTab(_("Audio"), tab); - mTabs.push_back(tab); - - tab = new Setup_Joystick(); - panel->addTab(_("Joystick"), tab); - mTabs.push_back(tab); - - tab = new Setup_Keyboard(); - panel->addTab(_("Keyboard"), tab); - mTabs.push_back(tab); - - tab = new Setup_Colors(); - panel->addTab(_("Colors"), tab); - mTabs.push_back(tab); - - tab = new Setup_Players(); - panel->addTab(_("Players"), tab); - mTabs.push_back(tab); + mTabs.push_back(new Setup_Video); + mTabs.push_back(new Setup_Audio); + mTabs.push_back(new Setup_Joystick); + mTabs.push_back(new Setup_Keyboard); + mTabs.push_back(new Setup_Colors); + mTabs.push_back(new Setup_Players); + + for (std::list<SetupTab*>::iterator i = mTabs.begin(), i_end = mTabs.end(); + i != i_end; ++i) + { + SetupTab *tab = *i; + panel->addTab(tab->getName(), tab); + } add(panel); |