Changeset 7555 in orxonox.OLD for branches/qt_gui/src/lib/gui/gui_saveable.cc
- Timestamp:
- May 7, 2006, 2:25:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/gui/gui_saveable.cc
r7549 r7555 17 17 18 18 #include "gui_saveable.h" 19 #include "gui.h" 19 20 20 21 namespace OrxGui … … 24 25 * standard constructor 25 26 */ 26 Saveable::Saveable (const std::string& optionName )27 Saveable::Saveable (const std::string& optionName, SaveableGroup* group) 27 28 : BaseObject(optionName) 28 29 { 29 30 this->bSaveable = false; 31 32 this->group = group; 33 this->group->addSaveable(this); 30 34 31 35 } … … 37 41 Saveable::~Saveable () 38 42 { 43 this->group->removeSaveable(this); 39 44 // delete what has to be deleted here 40 45 } … … 49 54 50 55 SaveableGroup::SaveableGroup(const std::string& groupName, OrxGui::Gui* gui) 51 : Saveable(groupName)56 : BaseObject(groupName) 52 57 { 58 assert (gui != NULL); 59 this->gui = gui; 53 60 61 this->gui->addSaveableGroup(this); 62 //this->mainWidget = NULL; 54 63 } 55 56 64 57 65 … … 59 67 SaveableGroup::~SaveableGroup() 60 68 { 61 std::vector<SaveableGroup*>::iterator delGroup = std::find(saveableGroups.begin(), saveableGroups.end(), this); 62 63 if (delGroup != saveableGroups.end() ) 64 saveableGroups.erase(delGroup); 69 this->gui->removeSaveableGroup(this); 65 70 } 66 71 72 73 /** 74 * @brief Adds a Saveable to the List. 75 * @param saveable the saveable to add. 76 */ 77 void SaveableGroup::addSaveable(Saveable* saveable) 78 { 79 if (std::find(this->saveables.begin(), this->saveables.end(), saveable) == this->saveables.end()) 80 this->saveables.push_back(saveable); 81 } 82 83 /** 84 * @brief Removes a Saveable from the List. 85 * @param saveable the saveable to remove. 86 */ 87 void SaveableGroup::removeSaveable(Saveable* saveable) 88 { 89 std::vector<Saveable*>::iterator delSav = std::find(this->saveables.begin(), this->saveables.end(), saveable); 90 if (delSav != this->saveables.end()) 91 this->saveables.erase(delSav); 92 } 93 94 95 /** 96 * @brief load the value onto the Group. 97 * @param value the Value to load. 98 */ 67 99 void SaveableGroup::load(const MultiType& value) 68 100 {} 69 101 102 /** 103 * @brief save the value from the Group 104 * @returns nothing. 105 */ 70 106 const MultiType& SaveableGroup::save() 71 107 {} … … 73 109 74 110 75 std::vector<SaveableGroup*> SaveableGroup::saveableGroups;76 77 void SaveableGroup::makingElementSaveable()78 {79 SaveableGroup::saveableGroups.push_back(this);80 }81 82 83 111 84 112 }
Note: See TracChangeset
for help on using the changeset viewer.