Changeset 7598 in orxonox.OLD for branches/qt_gui/src/lib/gui
- Timestamp:
- May 11, 2006, 5:37:13 PM (19 years ago)
- Location:
- branches/qt_gui/src/lib/gui
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/gui/gui.cc
r7555 r7598 17 17 18 18 #include "gui.h" 19 #include "gui_saveable.h" 20 19 21 20 22 namespace OrxGui … … 40 42 } 41 43 44 45 void Gui::loadAll() 46 { 47 std::vector<SaveableGroup*>::iterator loadElem; 48 for (loadElem = this->groups.begin(); loadElem != this->groups.end(); ++loadElem) 49 { 50 (*loadElem)->load(); 51 } 52 53 } 54 55 void Gui::saveAll() 56 { 57 58 } 42 59 43 60 /** -
branches/qt_gui/src/lib/gui/gui.h
r7555 r7598 42 42 43 43 unsigned int getState() const { return this->state; }; 44 44 void loadAll(); 45 void saveAll(); 45 46 46 47 void addSaveableGroup(SaveableGroup* saveableGroup); -
branches/qt_gui/src/lib/gui/gui_saveable.cc
r7595 r7598 55 55 56 56 57 void Saveable::load( const MultiType& value)57 void Saveable::load() 58 58 { 59 Preferences::getInstance()->setMultiType(this->group->getName(), this->getName(), value); 59 this->value() = Preferences::getInstance()->getMultiType(this->group->getName(), this->getName(), this->_value); 60 PRINTF(4)("Loaded to '%s' of group '%s' value ", this->getName(), this->group->getName()); 61 this->value().debug(); 62 60 63 } 61 64 62 const MultiType&Saveable::save()65 void Saveable::save() 63 66 { 64 Preferences::getInstance()-> getMultiType(this->group->getName(), this->getName(), 0);67 Preferences::getInstance()->setMultiType(this->group->getName(), this->getName(), this->value()); 65 68 } 66 69 … … 112 115 * @param value the Value to load. 113 116 */ 114 void SaveableGroup::load( const MultiType& value)117 void SaveableGroup::load() 115 118 { 119 std::vector<Saveable*>::iterator elem; 120 for (elem = this->saveables.begin(); elem != this->saveables.end(); ++elem) 121 (*elem)->load(); 116 122 } 117 123 … … 120 126 * @returns nothing. 121 127 */ 122 const MultiType&SaveableGroup::save()128 void SaveableGroup::save() 123 129 {} 124 130 -
branches/qt_gui/src/lib/gui/gui_saveable.h
r7595 r7598 25 25 void makeSaveable(); 26 26 27 virtual void load( const MultiType& value);28 virtual const MultiType&save();27 virtual void load(); 28 virtual void save(); 29 29 30 30 MultiType& value() { return this->_value; }; … … 52 52 void removeSaveable(Saveable* saveable); 53 53 54 virtual void load( const MultiType& value);55 virtual const MultiType&save();54 virtual void load(); 55 virtual void save(); 56 56 57 57 protected: -
branches/qt_gui/src/lib/gui/qt_gui/gui_video.cc
r7555 r7598 28 28 29 29 #include <QtGui/QLayout> 30 #include " sdlincl.h"30 #include "globals.h" 31 31 #include "debug.h" 32 32 … … 39 39 */ 40 40 GuiVideo::GuiVideo(OrxGui::Gui* gui) 41 : Element("Video", gui), QGroupBox()41 : Element(CONFIG_SECTION_VIDEO, gui), QGroupBox() 42 42 { 43 43 QGridLayout* layout = new QGridLayout(this); 44 44 45 45 { 46 QtGuiCheckBox* fullscreen = new QtGuiCheckBox( "FullScreen", this);46 QtGuiCheckBox* fullscreen = new QtGuiCheckBox(CONFIG_NAME_FULLSCREEN, this); 47 47 //fullscreen->setName(); 48 48 layout->addWidget(fullscreen, 0, 0); 49 49 50 QtGuiCheckBox* wireframe = new QtGuiCheckBox( "Wireframe mode", this);50 QtGuiCheckBox* wireframe = new QtGuiCheckBox(CONFIG_NAME_WIREFRAME, this); 51 51 layout->addWidget(wireframe, 1, 0); 52 52 … … 61 61 62 62 63 QGroupBox* advanced = new QGroupBox("advanced"); 64 { 65 QGridLayout* advLayout = new QGridLayout(advanced); //!< Advanced Layout 66 { 67 QtGuiCheckBox* shadows = new QtGuiCheckBox("Shadows", this); //!< CheckBox for shadows 68 advLayout->addWidget(shadows, 0,0); 69 QtGuiCheckBox* fog = new QtGuiCheckBox("Fog", this); //!< CheckBox for fog. 70 advLayout->addWidget(fog, 1,0); 71 QtGuiCheckBox* reflections = new QtGuiCheckBox("reflections", this); //!< CheckBox for reflections 72 advLayout->addWidget(reflections, 2, 0); 73 QtGuiCheckBox* textures = new QtGuiCheckBox("textures", this); //!< CheckBox for textures 74 advLayout->addWidget(textures, 3, 0); 75 /* 76 Menu* textureDetail; //!< Menu for the Texture-Detail. 77 Label* modelDetailLabel; //!< Label for model-detail. 78 Menu* modelDetail; //!< model-detail. 79 CheckBox* particles; //!< If the Particles should be enabled 80 Label* antiAliasingLabel; //!< Label for the anti-aliasing mode. 81 Menu* antiAliasing; //!< Menu for the Antialiasing-mode. 82 Label* filterMethodLabel; //!< Label for filtering-Method. 83 Menu* filterMethod; //!< Menu for filtering Method. 84 Button* closeButton; //!< A Button to close the Advanced-settingsWindow. 85 */ 86 } 87 } 63 QGroupBox* advanced = new GuiAdvancedVideo(gui); 64 88 65 89 66 layout->addWidget(advanced, 0, 2, 4, 1); … … 146 123 } 147 124 125 126 127 GuiAdvancedVideo::GuiAdvancedVideo(OrxGui::Gui* gui) 128 : Element(CONFIG_SECTION_VIDEO_ADVANCED ,gui) 129 { 130 { 131 QGridLayout* advLayout = new QGridLayout(this); //!< Advanced Layout 132 { 133 QtGuiCheckBox* shadows = new QtGuiCheckBox(CONFIG_NAME_SHADOWS, this); //!< CheckBox for shadows 134 advLayout->addWidget(shadows, 0,0); 135 QtGuiCheckBox* fog = new QtGuiCheckBox(CONFIG_NAME_FOG, this); //!< CheckBox for fog. 136 advLayout->addWidget(fog, 1,0); 137 QtGuiCheckBox* reflections = new QtGuiCheckBox(CONFIG_NAME_REFLECTIONS, this); //!< CheckBox for reflections 138 advLayout->addWidget(reflections, 2, 0); 139 QtGuiCheckBox* textures = new QtGuiCheckBox(CONFIG_NAME_TEXTURES, this); //!< CheckBox for textures 140 advLayout->addWidget(textures, 3, 0); 141 /* 142 Menu* textureDetail; //!< Menu for the Texture-Detail. 143 Label* modelDetailLabel; //!< Label for model-detail. 144 Menu* modelDetail; //!< model-detail. 145 CheckBox* particles; //!< If the Particles should be enabled 146 Label* antiAliasingLabel; //!< Label for the anti-aliasing mode. 147 Menu* antiAliasing; //!< Menu for the Antialiasing-mode. 148 Label* filterMethodLabel; //!< Label for filtering-Method. 149 Menu* filterMethod; //!< Menu for filtering Method. 150 Button* closeButton; //!< A Button to close the Advanced-settingsWindow. 151 */ 152 } 153 } 154 } 155 156 GuiAdvancedVideo::~GuiAdvancedVideo() 157 { 158 } 159 148 160 } -
branches/qt_gui/src/lib/gui/qt_gui/gui_video.h
r7549 r7598 23 23 void getResolutions(std::vector<QString>& resolutionList); 24 24 }; 25 26 class GuiAdvancedVideo : public OrxGui::Element, public QGroupBox 27 { 28 public: 29 GuiAdvancedVideo(OrxGui::Gui* gui); 30 virtual ~GuiAdvancedVideo(); 31 }; 25 32 } 26 33 -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc
r7594 r7598 73 73 this->mainWindow->show(); 74 74 75 this->loadAll(); 75 76 this->exec(); 77 76 78 } 77 79 … … 82 84 83 85 void QtGui::startGui() 84 {} 86 { 87 } 85 88 86 89 void QtGui::stopGui() -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc
r7585 r7598 18 18 #include "qt_gui_elements.h" 19 19 20 21 20 namespace OrxGui 22 21 { … … 30 29 } 31 30 32 void QtGuiCheckBox::load( const MultiType& value)31 void QtGuiCheckBox::load() 33 32 { 34 this->setTristate(value.getBool()); 35 this->value() = value; 33 Saveable::load(); 34 if (this->value().getBool()) 35 this->setCheckState(Qt::Checked); 36 else 37 this->setCheckState(Qt::Unchecked); 36 38 } 37 39 38 40 39 41 40 const MultiType&QtGuiCheckBox::save()42 void QtGuiCheckBox::save() 41 43 { 42 return this->value();43 44 } 44 45 … … 69 70 } 70 71 71 void QtGuiComboBox::load( const MultiType& value)72 void QtGuiComboBox::load() 72 73 { 73 this->value() = value;74 74 //TODO 75 75 } 76 76 77 const MultiType&QtGuiComboBox::save()77 void QtGuiComboBox::save() 78 78 { 79 return this->value();80 79 } 81 80 … … 89 88 90 89 91 void QtGuiInputLine::load( const MultiType& value)90 void QtGuiInputLine::load() 92 91 { 93 this->setText(value.getString().c_str()); 94 this->value() = value; 92 this->setText(this->value().getString().c_str()); 95 93 } 96 94 97 95 98 96 99 const MultiType&QtGuiInputLine::save()97 void QtGuiInputLine::save() 100 98 { 101 return this->value();102 99 } 103 100 -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.h
r7585 r7598 33 33 virtual ~QtGuiCheckBox() {}; 34 34 35 virtual void load( const MultiType& value);36 virtual const MultiType&save();35 virtual void load(); 36 virtual void save(); 37 37 38 38 public slots: … … 66 66 QtGuiComboBox(const std::string& name, SaveableGroup* group); 67 67 68 virtual void load( const MultiType& value);69 virtual const MultiType&save();68 virtual void load(); 69 virtual void save(); 70 70 }; 71 71 … … 77 77 QtGuiInputLine(const std::string& name, SaveableGroup* group); 78 78 79 virtual void load( const MultiType& value);80 virtual const MultiType&save();79 virtual void load(); 80 virtual void save(); 81 81 }; 82 82
Note: See TracChangeset
for help on using the changeset viewer.