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/setuptab.h | |
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/setuptab.h')
-rw-r--r-- | src/gui/setuptab.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/gui/setuptab.h b/src/gui/setuptab.h index c4f9f1dd..7b92e2fe 100644 --- a/src/gui/setuptab.h +++ b/src/gui/setuptab.h @@ -24,11 +24,39 @@ #include "gui/widgets/gccontainer.h" +#include <string> + +/** + * A container for the contents of a tab in the setup window. + */ class SetupTab : public GCContainer { - public: - virtual void apply() = 0; - virtual void cancel() = 0; +public: + SetupTab(); + + const std::string &getName() const + { return mName; } + + /** + * Called when the Apply button is pressed in the setup window. + */ + virtual void apply() = 0; + + /** + * Called when the Cancel button is pressed in the setup window. + */ + virtual void cancel() = 0; + +protected: + /** + * Sets the name displayed on the tab. Should be set in the + * constructor of a subclass. + */ + void setName(const std::string &name) + { mName = name; } + +private: + std::string mName; }; #endif |