Changeset 589112 for src/UIElements
- Timestamp:
- Dec 5, 2010, 12:18:31 AM (14 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 6e06bd
- Parents:
- 5d4b73 (diff), a01144 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/UIElements
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/CommandLineParser_validate.cpp
r5d4b73 r589112 19 19 20 20 #include "Helpers/MemDebug.hpp" 21 22 #include <boost/version.hpp> 21 23 22 24 #include <iostream> … … 41 43 if (values.size() != 1) { 42 44 std::cerr << "Not one vector but " << values.size() << " given " << std::endl; 45 #if BOOST_VERSION < 104200 43 46 throw boost::program_options::validation_error("Unequal to one vector given"); 47 #else 48 throw boost::program_options::validation_error( 49 boost::program_options::validation_error::invalid_option_value, 50 std::string("value"), 51 std::string("VectorValue") 52 ); 53 #endif 44 54 } 45 55 std::string argument(values.at(0)); … … 59 69 if (components.size() != 3) { 60 70 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl; 71 #if BOOST_VERSION < 104200 61 72 throw boost::program_options::validation_error("Specified vector does not have three components"); 73 #else 74 throw boost::program_options::validation_error( 75 boost::program_options::validation_error::invalid_option_value, 76 std::string("value"), 77 std::string("VectorValue") 78 ); 79 #endif 62 80 } 63 81 VV.x = boost::lexical_cast<double>(components.at(0)); … … 75 93 if (values.size() != 1) { 76 94 std::cerr << "Not one vector but " << values.size() << " given " << std::endl; 95 #if BOOST_VERSION < 104200 77 96 throw boost::program_options::validation_error("Unequal to one vector given"); 97 #else 98 throw boost::program_options::validation_error( 99 boost::program_options::validation_error::invalid_option_value, 100 std::string("value"), 101 std::string("BoxValue") 102 ); 103 #endif 78 104 } 79 105 std::string argument(values.at(0)); … … 93 119 if (components.size() != 6) { 94 120 std::cerr << "Specified vector does not have three components but " << components.size() << std::endl; 121 #if BOOST_VERSION < 104200 95 122 throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components"); 123 #else 124 throw boost::program_options::validation_error( 125 boost::program_options::validation_error::invalid_option_value, 126 std::string("value"), 127 std::string("BoxValue") 128 ); 129 #endif 96 130 } 97 131 BV.xx = boost::lexical_cast<double>(components.at(0)); … … 120 154 if (values.size() != 1) { 121 155 std::cerr << "Not one file but " << values.size() << " given " << std::endl; 156 #if BOOST_VERSION < 104200 122 157 throw boost::program_options::validation_error("Unequal to one file given"); 158 #else 159 if (values.size() == 0) { 160 throw boost::program_options::validation_error( 161 boost::program_options::validation_error::at_least_one_value_required, 162 std::string("value"), 163 std::string("boost::filesystem::path") 164 ); 165 } else { 166 throw boost::program_options::validation_error( 167 boost::program_options::validation_error::multiple_values_not_allowed, 168 std::string("value"), 169 std::string("boost::filesystem::path") 170 ); 171 } 172 #endif 123 173 } 124 174 filename = values.at(0); -
src/UIElements/Makefile.am
r5d4b73 r589112 5 5 AM_LDFLAGS = -ldl 6 6 AM_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} 7 7 AM_CPPFLAGS = ${BOOST_CPPFLAGS} 8 8 9 VIEWSOURCE = \ 9 10 Views/View.cpp \ … … 227 228 QTUI_DEFS = 228 229 230 GUI_LIBS = 229 231 230 232 … … 233 235 libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 234 236 libMolecuilderQtUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/ 235 libMolecuilderUI_ LIBS = \237 libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LIBS = \ 236 238 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 237 libMolecuilderQtUI_ LIBS = \239 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LIBS = \ 238 240 Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la 241 242 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LIBADD = ${QT_LIB_GUI} -lQtOpenGL ${GLU_LIBS} ${QT_LDADD} 239 243 240 244 nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER} … … 302 306 303 307 304 MOSTLYCLEANFILES = unity.cpp 308 MOSTLYCLEANFILES = unity.cpp allmocs.moc.cpp -
src/UIElements/Menu/Menu.cpp
r5d4b73 r589112 41 41 */ 42 42 Menu::~Menu() 43 {} 43 { 44 DuplicatesList.clear(); 45 } 44 46 45 47 /** Initialiser for class Menu. … … 65 67 CompleteFlag = true; 66 68 PossibleMissingFlag = false; 67 for(MenuDescription::const_iterator iter = menudescriptions.getBeginIter();68 iter != menudescriptions.getEndIter();69 for(MenuDescription::const_iterator iter = MenuDescription::getInstance().getBeginIter(); 70 iter != MenuDescription::getInstance().getEndIter(); 69 71 ++iter) { 70 72 // skip when already present … … 137 139 ASSERT (!isPresent(MenuName), 138 140 "Menu::addSubmenu() - trying to add menu "+MenuName+" with already present token!"); 139 addSubmenuItem(MenuName, menudescriptions.getDescription(MenuName));141 addSubmenuItem(MenuName, MenuDescription::getInstance().getDescription(MenuName)); 140 142 DuplicatesList.insert(MenuName); 141 143 LastItem = MenuItem; -
src/UIElements/Menu/Menu.hpp
r5d4b73 r589112 72 72 73 73 int TopPosition; // current position to add 74 MenuDescription menudescriptions; // contains the menu tree and description to each item75 74 enum ItemType LastItem; // check whether separator followed separator 76 75 std::set <std::string> DuplicatesList; // is used to check for duplicates -
src/UIElements/Menu/MenuDescription.cpp
r5d4b73 r589112 13 13 */ 14 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 21 15 22 #include <iostream> 16 23 #include <map> 17 24 #include <string> 18 25 19 #include "Actions/ActionRegistry.hpp"26 //#include "Actions/ActionRegistry.hpp" 20 27 #include "Menu/MenuDescription.hpp" 28 29 #include "Patterns/Singleton_impl.hpp" 30 31 MenuDescription::TextMap *MenuDescription::MenuDescriptionsMap = NULL; 32 MenuDescription::IterableMap *MenuDescription::MenuPositionMap = NULL; 33 MenuDescription::TextMap *MenuDescription::MenuNameMap = NULL; 34 21 35 22 36 /** Constructor of class MenuDescription. … … 25 39 MenuDescription::MenuDescription() 26 40 { 41 // allocate maps 42 MenuDescriptionsMap = new TextMap(); 43 MenuPositionMap = new IterableMap(); 44 MenuNameMap = new TextMap(); 45 27 46 // put each menu into its place, "" means top level 28 MenuPositionMap ["analysis"] = TopPosition("tools",1);29 MenuPositionMap ["atom"] = TopPosition("edit",1);30 MenuPositionMap ["command"] = TopPosition("",3);31 MenuPositionMap ["edit"] = TopPosition("",2);32 MenuPositionMap ["fragmentation"] = TopPosition("tools",3);33 MenuPositionMap ["molecule"] = TopPosition("edit",2);34 MenuPositionMap ["parser"] = TopPosition("edit",3);35 MenuPositionMap ["selection"] = TopPosition("edit",4);36 MenuPositionMap ["tesselation"] = TopPosition("tools",2);37 MenuPositionMap ["tools"] = TopPosition("",4);38 MenuPositionMap ["world"] = TopPosition("",1);47 MenuPositionMap->insert(std::make_pair("analysis",TopPosition("tools",1))); 48 MenuPositionMap->insert(std::make_pair("atom",TopPosition("edit",1))); 49 MenuPositionMap->insert(std::make_pair("command",TopPosition("",3))); 50 MenuPositionMap->insert(std::make_pair("edit",TopPosition("",2))); 51 MenuPositionMap->insert(std::make_pair("fragmentation",TopPosition("tools",3))); 52 MenuPositionMap->insert(std::make_pair("molecule",TopPosition("edit",2))); 53 MenuPositionMap->insert(std::make_pair("parser",TopPosition("edit",3))); 54 MenuPositionMap->insert(std::make_pair("selection",TopPosition("edit",4))); 55 MenuPositionMap->insert(std::make_pair("tesselation",TopPosition("tools",2))); 56 MenuPositionMap->insert(std::make_pair("tools",TopPosition("",4))); 57 MenuPositionMap->insert(std::make_pair("world",TopPosition("",1))); 39 58 40 59 // put menu description into each menu category 41 MenuDescriptionsMap ["analysis"] = "Analysis (pair correlation, volume)";42 MenuDescriptionsMap ["atom"] = "Edit atoms";43 MenuDescriptionsMap ["command"] = "Configuration";44 MenuDescriptionsMap ["edit"] = "Edit";45 MenuDescriptionsMap ["fragmentation"] = "Fragmentation";46 MenuDescriptionsMap ["molecule"] = "Parse files into system";47 MenuDescriptionsMap ["parser"] = "Edit molecules (load, parse, save)";48 MenuDescriptionsMap ["selection"] = "Select atoms/molecules";49 MenuDescriptionsMap ["tesselation"] = "Tesselate molecules";50 MenuDescriptionsMap ["tools"] = "Various tools";51 MenuDescriptionsMap ["world"] = "Edit world";60 MenuDescriptionsMap->insert(std::make_pair("analysis","Analysis (pair correlation, volume)")); 61 MenuDescriptionsMap->insert(std::make_pair("atom","Edit atoms")); 62 MenuDescriptionsMap->insert(std::make_pair("command","Configuration")); 63 MenuDescriptionsMap->insert(std::make_pair("edit","Edit")); 64 MenuDescriptionsMap->insert(std::make_pair("fragmentation","Fragmentation")); 65 MenuDescriptionsMap->insert(std::make_pair("molecule","Parse files into system")); 66 MenuDescriptionsMap->insert(std::make_pair("parser","Edit molecules (load, parse, save)")); 67 MenuDescriptionsMap->insert(std::make_pair("selection","Select atoms/molecules")); 68 MenuDescriptionsMap->insert(std::make_pair("tesselation","Tesselate molecules")); 69 MenuDescriptionsMap->insert(std::make_pair("tools","Various tools")); 70 MenuDescriptionsMap->insert(std::make_pair("world","Edit world")); 52 71 53 72 // put menu name into each menu category 54 MenuNameMap ["analysis"] = "Analysis";55 MenuNameMap ["atom"] = "Atoms";56 MenuNameMap ["command"] = "Configuration";57 MenuNameMap ["edit"] = "Edit";58 MenuNameMap ["fragmentation"] = "Fragmentation";59 MenuNameMap ["molecule"] = "Molecules";60 MenuNameMap ["parser"] = "Input/Output";61 MenuNameMap ["selection"] = "Selection";62 MenuNameMap ["tesselation"] = "Tesselation";63 MenuNameMap ["tools"] = "Tools";64 MenuNameMap ["world"] = "Globals";73 MenuNameMap->insert(std::make_pair("analysis","Analysis")); 74 MenuNameMap->insert(std::make_pair("atom","Atoms")); 75 MenuNameMap->insert(std::make_pair("command","Configuration")); 76 MenuNameMap->insert(std::make_pair("edit","Edit")); 77 MenuNameMap->insert(std::make_pair("fragmentation","Fragmentation")); 78 MenuNameMap->insert(std::make_pair("molecule","Molecules")); 79 MenuNameMap->insert(std::make_pair("parser","Input/Output")); 80 MenuNameMap->insert(std::make_pair("selection","Selection")); 81 MenuNameMap->insert(std::make_pair("tesselation","Tesselation")); 82 MenuNameMap->insert(std::make_pair("tools","Tools")); 83 MenuNameMap->insert(std::make_pair("world","Globals")); 65 84 } 66 85 … … 69 88 */ 70 89 MenuDescription::~MenuDescription() 71 {} 90 { 91 std::cout << "MenuDescription: clearing maps ... " << std::endl; 92 for (IterableMap::iterator iter = MenuPositionMap->begin(); !MenuPositionMap->empty(); iter = MenuPositionMap->begin()) 93 MenuPositionMap->erase(iter); 94 delete MenuNameMap; 95 delete MenuDescriptionsMap; 96 delete MenuPositionMap; 97 } 72 98 73 99 /** Getter for MenuDescriptionsMap. … … 77 103 const std::string MenuDescription::getDescription(const std::string &token) const 78 104 { 79 if (MenuDescriptionsMap .find(token) != MenuDescriptionsMap.end())80 return MenuDescriptionsMap .find(token)->second;105 if (MenuDescriptionsMap->find(token) != MenuDescriptionsMap->end()) 106 return MenuDescriptionsMap->find(token)->second; 81 107 else 82 108 return std::string(); 83 109 } 84 110 85 /** Getter for MenuNameMap .111 /** Getter for MenuNameMap-> 86 112 * \param token name of menu 87 113 * \return description string of the menu or empty … … 89 115 const std::string MenuDescription::getName(const std::string &token) const 90 116 { 91 if (MenuNameMap .find(token) != MenuNameMap.end())92 return MenuNameMap .find(token)->second;117 if (MenuNameMap->find(token) != MenuNameMap->end()) 118 return MenuNameMap->find(token)->second; 93 119 else 94 120 return std::string(); 95 121 } 96 122 97 / ** Constructs a multimap of all menus running over all actions belonging to it.98 * \return multimap with which actions belongs to which menu.99 */100 std::multimap <std::string, std::string> MenuDescription::getMenuItemsMap() const101 {102 std::multimap <std::string, std::string> result;103 104 ActionRegistry &AR = ActionRegistry::getInstance();105 for (ActionRegistry::const_iterator iter = AR.getBeginIter();iter != AR.getEndIter();++iter) {106 std::cout << "Inserting " << (iter->second)->getName() << " into menu " << (iter->second)->Traits.getMenuName() << std::endl;107 result.insert( std::pair<std::string, std::string> ((iter->second)->Traits.getMenuName(), (iter->second)->getName()));108 }109 // TODO: MenuPosition is not yet realized.110 return result;111 }123 ///** Constructs a multimap of all menus running over all actions belonging to it. 124 // * \return multimap with which actions belongs to which menu. 125 // */ 126 //std::multimap <std::string, std::string> MenuDescription::getMenuItemsMap() const 127 //{ 128 // std::multimap <std::string, std::string> result; 129 // 130 // ActionRegistry &AR = ActionRegistry::getInstance(); 131 // for (ActionRegistry::const_iterator iter = AR.getBeginIter();iter != AR.getEndIter();++iter) { 132 // std::cout << "Inserting " << (iter->second)->getName() << " into menu " << (iter->second)->Traits.getMenuName() << std::endl; 133 // result.insert( std::pair<std::string, std::string> ((iter->second)->Traits.getMenuName(), (iter->second)->getName())); 134 // } 135 // // TODO: MenuPosition is not yet realized. 136 // return result; 137 //} 112 138 113 139 /** Forward iterator from beginning of list of descriptions. … … 116 142 MenuDescription::iterator MenuDescription::getBeginIter() 117 143 { 118 return MenuPositionMap .begin();144 return MenuPositionMap->begin(); 119 145 } 120 146 … … 124 150 MenuDescription::iterator MenuDescription::getEndIter() 125 151 { 126 return MenuPositionMap .end();152 return MenuPositionMap->end(); 127 153 } 128 154 … … 132 158 MenuDescription::const_iterator MenuDescription::getBeginIter() const 133 159 { 134 return MenuPositionMap .begin();160 return MenuPositionMap->begin(); 135 161 } 136 162 … … 140 166 MenuDescription::const_iterator MenuDescription::getEndIter() const 141 167 { 142 return MenuPositionMap .end();168 return MenuPositionMap->end(); 143 169 } 144 170 145 171 CONSTRUCT_SINGLETON(MenuDescription) -
src/UIElements/Menu/MenuDescription.hpp
r5d4b73 r589112 13 13 #include <string> 14 14 15 #include "Patterns/Singleton.hpp" 16 15 17 class MenuDescriptionTest; 16 18 … … 18 20 * 19 21 */ 20 class MenuDescription 22 class MenuDescription : public Singleton<MenuDescription> 21 23 { 22 24 friend class MenuDescriptionTest; 25 friend class Singleton<MenuDescription>; 23 26 public: 24 MenuDescription();25 ~MenuDescription();26 27 27 typedef std::pair<std::string , int> TopPosition;28 typedef std::map<std::string , TopPosition> IterableMap;28 typedef std::pair<std::string const, int const> TopPosition; 29 typedef std::map<std::string const, TopPosition const> IterableMap; 29 30 typedef IterableMap::iterator iterator; 30 31 typedef IterableMap::const_iterator const_iterator ; 31 typedef std::map<std::string , std::string> TextMap;32 typedef std::map<std::string const, std::string const> TextMap; 32 33 33 34 // getter for description … … 35 36 const std::string getName(const std::string &token) const; 36 37 37 std::multimap <std::string, std::string> getMenuItemsMap() const;38 //std::multimap <std::string, std::string> getMenuItemsMap() const; 38 39 39 40 // iterators … … 44 45 45 46 private: 46 TextMap MenuDescriptionsMap; 47 IterableMap MenuPositionMap; 48 TextMap MenuNameMap; 49 std::multimap <std::string, std::string> MenuItemMap; 47 MenuDescription(); 48 ~MenuDescription(); 49 50 static TextMap *MenuDescriptionsMap; 51 static IterableMap *MenuPositionMap; 52 static TextMap *MenuNameMap; 50 53 }; 51 54 -
src/UIElements/Menu/MenuInterface.cpp
r5d4b73 r589112 10 10 #include <config.h> 11 11 #endif 12 13 #include "Helpers/MemDebug.hpp" 12 14 13 15 #include "Menu/MenuInterface.hpp" -
src/UIElements/Menu/TextMenu/ActionMenuItem.hpp
r5d4b73 r589112 23 23 public: 24 24 ActionMenuItem(char,const std::string &,TxMenu* const,const std::string &); 25 virtual~ActionMenuItem();25 ~ActionMenuItem(); 26 26 27 27 virtual void doTrigger(); -
src/UIElements/Menu/TextMenu/DisplayMenuItem.hpp
r5d4b73 r589112 28 28 DisplayMenuItem(TxMenu* const _menu, StringView *_view, const std::string &_title, 29 29 char _spacer=STD_MENU_TITLE_SPACER, int _length=STD_MENU_LENGTH); 30 virtual~DisplayMenuItem();30 ~DisplayMenuItem(); 31 31 32 32 virtual void doTrigger(); -
src/UIElements/Menu/TextMenu/SeparatorMenuItem.hpp
r5d4b73 r589112 25 25 SeparatorMenuItem(TxMenu* const ); 26 26 SeparatorMenuItem(TxMenu* const ,char,int); 27 virtual~SeparatorMenuItem();27 ~SeparatorMenuItem(); 28 28 29 29 virtual void doTrigger(); -
src/UIElements/Menu/TextMenu/SubMenuItem.hpp
r5d4b73 r589112 12 12 public: 13 13 SubMenuItem(char _trigger,const std::string &_description,TxMenu* const _parent, TxMenu* const _instance); 14 virtual~SubMenuItem();14 ~SubMenuItem(); 15 15 16 16 virtual void doTrigger(); -
src/UIElements/Menu/TextMenu/TextMenu.hpp
r5d4b73 r589112 60 60 * 61 61 */ 62 virtual~TextMenu()62 ~TextMenu() 63 63 { 64 ShortcutMap.clear(); 64 65 if (deleteMenu) 65 66 delete MenuInstance; 67 for (typename SubmenuList::iterator iter = Submenus.begin(); !Submenus.empty(); iter = Submenus.begin()) { 68 delete(*iter); 69 Submenus.erase(iter); 70 } 66 71 } 67 72 … … 102 107 MenuShortcutMap ShortcutMap; 103 108 109 typedef std::list< TextMenu<T> *> SubmenuList; 110 SubmenuList Submenus; 111 104 112 /** Adds an ActionItem by simply creating a new one. 105 113 * \param &token token of Action (token in ActionRegistry) … … 128 136 { 129 137 TextMenu<TxMenu> *NewMenu = new TextMenu<TxMenu>(outputter, token); 138 Submenus.push_back(NewMenu); 130 139 new SubMenuItem(getSuitableShortForm(description), description, MenuInstance, NewMenu->getMenuInstance()); 131 140 NewMenu->reserveShortcut('q',"leave"+token); -
src/UIElements/Menu/TextMenu/TxMenu.cpp
r5d4b73 r589112 52 52 TxMenu::~TxMenu() 53 53 { 54 for(std::list<MenuItem*>::iterator it=items.begin(); it != items.end(); it++)54 for(std::list<MenuItem*>::iterator it=items.begin(); !items.empty(); it=items.begin()) { 55 55 delete (*it); 56 items.erase(it); 57 } 56 58 } 57 59 -
src/UIElements/Menu/TextMenu/TxMenu.hpp
r5d4b73 r589112 39 39 40 40 TxMenu(std::ostream& _outputter, const std::string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH); 41 virtual~TxMenu();41 ~TxMenu(); 42 42 43 43 void addItem(MenuItem*); -
src/UIElements/TextUI/TextWindow.cpp
r5d4b73 r589112 86 86 TextWindow::~TextWindow() 87 87 { 88 for (std::list<Action *>::iterator iter = returnFromActions.begin(); !returnFromActions.empty(); ++iter) 88 for (std::list<Action *>::iterator iter = returnFromActions.begin(); 89 !returnFromActions.empty(); 90 iter = returnFromActions.begin()) { 89 91 delete (*iter); 90 returnFromActions.clear(); 92 returnFromActions.erase(iter); 93 } 91 94 delete moleculeView; 92 95 delete statusIndicator; -
src/UIElements/UIFactory.cpp
r5d4b73 r589112 34 34 35 35 UIFactory::~UIFactory() 36 {} 36 { 37 // clear out factories map to allow boost::shared_ptr to do their work (i.e. to release mem) 38 // this is necessary as factories is a static object 39 factories.clear(); 40 } 37 41 38 42 void UIFactory::makeUserInterface(std::string type) {
Note:
See TracChangeset
for help on using the changeset viewer.