Changeset 7f1b51 for src/UIElements
- Timestamp:
- Sep 15, 2014, 3:05:28 PM (11 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, Candidate_v1.7.0, Candidate_v1.7.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:
- 7e1a88
- Parents:
- b73545 (diff), 8859b5 (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:
-
- 2 added
- 45 edited
-
CommandLineUI/CommandLineDialog.cpp (modified) (1 diff)
-
CommandLineUI/CommandLineDialog.hpp (modified) (1 diff)
-
CommandLineUI/CommandLineUIFactory.cpp (modified) (1 diff)
-
CommandLineUI/CommandLineUIFactory.hpp (modified) (1 diff)
-
Dialog.cpp (modified) (2 diffs)
-
Dialog.hpp (modified) (1 diff)
-
Makefile.am (modified) (2 diffs)
-
Menu/Menu.cpp (modified) (1 diff)
-
Menu/Menu.hpp (modified) (1 diff)
-
Menu/Qt4/QMenu_tooltip.hpp (added)
-
Menu/Qt4/QtMenu.hpp (modified) (3 diffs)
-
Qt4/QtDialog.cpp (modified) (1 diff)
-
Qt4/QtDialog.hpp (modified) (1 diff)
-
Qt4/QtMainWindow.cpp (modified) (1 diff)
-
Qt4/QtUIFactory.cpp (modified) (1 diff)
-
Qt4/QtUIFactory.hpp (modified) (1 diff)
-
Qt4/Query/AtomsQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/DoublesQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/ElementsQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/FileQtQuery.cpp (modified) (5 diffs)
-
Qt4/Query/FilesQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/IntsQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/MoleculesQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/QtQuery.hpp (modified) (1 diff)
-
Qt4/Query/QtQueryList.hpp (modified) (1 diff)
-
Qt4/Query/StringsQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/UnsignedIntsQtQuery.cpp (modified) (1 diff)
-
Qt4/Query/VectorsQtQuery.cpp (modified) (1 diff)
-
TextUI/TextDialog.cpp (modified) (1 diff)
-
TextUI/TextDialog.hpp (modified) (1 diff)
-
TextUI/TextUIFactory.cpp (modified) (1 diff)
-
TextUI/TextUIFactory.hpp (modified) (1 diff)
-
UIFactory.hpp (modified) (1 diff)
-
Views/Qt4/Plotting/QSeisPlot.cpp (modified) (1 diff)
-
Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp (modified) (3 diffs)
-
Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp (modified) (2 diffs)
-
Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp (modified) (2 diffs)
-
Views/Qt4/Qt3D/GLMoleculeObject_shape.cpp (modified) (1 diff)
-
Views/Qt4/Qt3D/GLWorldScene.cpp (modified) (4 diffs)
-
Views/Qt4/Qt3D/GLWorldScene.hpp (modified) (3 diffs)
-
Views/Qt4/Qt3D/GLWorldView.cpp (modified) (2 diffs)
-
Views/Qt4/Qt3D/GLWorldView.hpp (modified) (1 diff)
-
Views/Qt4/QtHomologyList.cpp (modified) (4 diffs)
-
Views/Qt4/QtMoleculeList.cpp (modified) (1 diff)
-
Views/Qt4/QtToolBar.cpp (modified) (2 diffs)
-
Views/Qt4/QtToolBar.hpp (modified) (2 diffs)
-
Views/Qt4/QtToolBar_QtFavoriteActions.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/CommandLineDialog.cpp
rb73545 r7f1b51 42 42 43 43 44 CommandLineDialog::CommandLineDialog() 44 CommandLineDialog::CommandLineDialog(const std::string &_title) : 45 Dialog(_title) 45 46 { 46 47 } -
src/UIElements/CommandLineUI/CommandLineDialog.hpp
rb73545 r7f1b51 30 30 { 31 31 public: 32 CommandLineDialog( );32 CommandLineDialog(const std::string &_title); 33 33 virtual ~CommandLineDialog(); 34 34 -
src/UIElements/CommandLineUI/CommandLineUIFactory.cpp
rb73545 r7f1b51 52 52 53 53 54 Dialog* CommandLineUIFactory::makeDialog( ) {55 return new CommandLineDialog( );54 Dialog* CommandLineUIFactory::makeDialog(const std::string &_title) { 55 return new CommandLineDialog(_title); 56 56 } 57 57 -
src/UIElements/CommandLineUI/CommandLineUIFactory.hpp
rb73545 r7f1b51 48 48 virtual ~CommandLineUIFactory(); 49 49 50 virtual Dialog* makeDialog( );50 virtual Dialog* makeDialog(const std::string &_title); 51 51 virtual MainWindow* makeMainWindow(); 52 52 -
src/UIElements/Dialog.cpp
rb73545 r7f1b51 50 50 using namespace std; 51 51 52 Dialog::Dialog( )52 Dialog::Dialog(const std::string &_title) 53 53 { 54 54 } … … 120 120 121 121 bool Dialog::hasQueries(){ 122 return queries.size(); 122 list<Query*>::iterator iter; 123 size_t nonemptyQueries = 0; 124 for(iter=queries.begin(); iter!=queries.end(); iter++) { 125 // count all queries that not EmptyQuery 126 if (dynamic_cast<Dialog::EmptyQuery *>(*iter) == NULL) 127 ++nonemptyQueries; 128 } 129 return nonemptyQueries != 0; 123 130 } 124 131 -
src/UIElements/Dialog.hpp
rb73545 r7f1b51 153 153 { 154 154 public: 155 Dialog( );155 Dialog(const std::string &_title); 156 156 virtual ~Dialog(); 157 157 -
src/UIElements/Makefile.am
rb73545 r7f1b51 179 179 UIElements/Views/Qt4/QtTimeLine.cpp \ 180 180 UIElements/Views/Qt4/QtToolBar.cpp \ 181 UIElements/Views/Qt4/QtToolBar_QtFavoriteActions.cpp \ 181 182 UIElements/Views/Qt4/Qt3D/GLWorldView.cpp \ 182 183 UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp \ … … 192 193 UIElements/Qt4/QtMainWindow.hpp \ 193 194 UIElements/Qt4/Query/QtQuery.hpp \ 195 UIElements/Menu/Qt4/QMenu_tooltip.hpp \ 194 196 UIElements/Menu/Qt4/QtMenuPipe.hpp \ 195 197 UIElements/Views/Qt4/QDebugStream.hpp \ -
src/UIElements/Menu/Menu.cpp
rb73545 r7f1b51 130 130 if (MenuName == name) { 131 131 const std::string &ActionName = *iter; 132 Menu::addAction(ActionName); 132 const std::string &ActionDescription = CurrentTrait.getDescription(); 133 Menu::addAction(ActionName, ActionDescription); 133 134 } 134 135 } 135 136 } 136 137 137 void Menu::addAction(const std::string &ActionName )138 void Menu::addAction(const std::string &ActionName, const std::string &ActionDescription) 138 139 { 139 140 LastItem = ActionItem; 140 addActionItem(ActionName, Action Name);141 addActionItem(ActionName, ActionDescription); 141 142 } 142 143 -
src/UIElements/Menu/Menu.hpp
rb73545 r7f1b51 61 61 62 62 protected: 63 // Unique name of the menu for identification.63 //!> Unique name of the menu for identification. 64 64 const std::string name; 65 65 66 // populater function that adds all menu items 66 /** populater function that adds all menu items. 67 * 68 */ 67 69 void populate(); 70 71 /** Populater function for all Actions in this menu. 72 * 73 */ 68 74 void populateActions(); 69 75 70 76 private: 71 void addAction(const std::string &ActionName); 77 /** Adds an action to this menu. 78 * 79 * @param ActionName name of action 80 * @param ActionDescription of the action (e.g. for tooltips) 81 */ 82 void addAction(const std::string &ActionName, const std::string &ActionDescription); 83 84 /** Adds a separator (e.g. horizontal line) to menu. 85 * 86 */ 72 87 void addSeparator(); 88 89 /** Adds a submenu to this menu. 90 * 91 * @param MenuName name of submenu 92 * @param MenuPosition position in sequence of items of submenu 93 */ 73 94 void addSubmenu(const std::string &MenuName, const int MenuPosition); 95 96 /** Checks whether an item named \a token exists in this menu. 97 * 98 * @param token name of action of submenu 99 * @return true - item exists, false - item does not exist in this menu 100 */ 74 101 bool isPresent(const std::string &token); 75 102 103 //!> enumeration of all valid item types 76 104 enum ItemType {ActionItem, MenuItem, SeparatorItem, NoItem}; 77 105 78 int TopPosition; // current position to add 79 enum ItemType LastItem; // check whether separator followed separator 80 std::set <std::string> DuplicatesList; // is used to check for duplicates 106 //!> current position to add 107 int TopPosition; 108 //!> check whether separator followed separator 109 enum ItemType LastItem; 110 //!> is used to check for duplicates 111 std::set <std::string> DuplicatesList; 81 112 }; 82 113 -
src/UIElements/Menu/Qt4/QtMenu.hpp
rb73545 r7f1b51 16 16 17 17 #include <Qt/qaction.h> 18 19 #include "Menu/Qt4/QMenu_tooltip.hpp" 18 20 19 21 #include <iostream> … … 103 105 virtual void addActionItem(const std::string &token, const std::string &description) 104 106 { 105 QAction *action = MenuInstance->addAction(QString(getNameWithAccelerator(description).c_str())); 107 QAction *action = MenuInstance->addAction(QString(getNameWithAccelerator(token).c_str())); 108 action->setToolTip(QString(description.c_str())); 109 action->setWhatsThis(QString(description.c_str())); 106 110 QtMenuPipe *pipe = new QtMenuPipe(token,action); 107 111 QObject::connect(action, SIGNAL(triggered()),pipe,SLOT(called())); … … 116 120 virtual void addSubmenuItem(const std::string &token, const std::string &description) 117 121 { 118 QMenu *Menu = MenuInstance->addMenu(QString(token.c_str())); 119 QtMenu<QMenu> *NewMenu = new QtMenu<QMenu>(Menu, token); 122 QMenu_tooltip *Menu = new QMenu_tooltip(QString(token.c_str())); 123 MenuInstance->addMenu(Menu); 124 QtMenu<QMenu_tooltip> *NewMenu = new QtMenu<QMenu_tooltip>(Menu, token); 120 125 NewMenu->init(); 121 126 } -
src/UIElements/Qt4/QtDialog.cpp
rb73545 r7f1b51 45 45 using namespace std; 46 46 47 QtDialog::QtDialog() : 48 QDialog(0) 49 { 47 QtDialog::QtDialog(const std::string &_title) : 48 QDialog(0), 49 Dialog(_title) 50 { 51 setWindowTitle(QString(_title.c_str())); 50 52 // creating and filling of the Dialog window 51 53 mainLayout = new QVBoxLayout(); -
src/UIElements/Qt4/QtDialog.hpp
rb73545 r7f1b51 30 30 Q_OBJECT 31 31 public: 32 QtDialog( );32 QtDialog(const std::string &_title); 33 33 virtual ~QtDialog(); 34 34 -
src/UIElements/Qt4/QtMainWindow.cpp
rb73545 r7f1b51 116 116 toolbar = new QtToolBar(this); 117 117 glWorldView->addToolBarActions(toolbar); 118 toolbar->addFavoriteActionItems(20); 118 119 addToolBar(toolbar); 119 120 -
src/UIElements/Qt4/QtUIFactory.cpp
rb73545 r7f1b51 67 67 } 68 68 69 Dialog* QtUIFactory::makeDialog( ) {70 return new QtDialog( );69 Dialog* QtUIFactory::makeDialog(const std::string &_title) { 70 return new QtDialog(_title); 71 71 } 72 72 -
src/UIElements/Qt4/QtUIFactory.hpp
rb73545 r7f1b51 26 26 virtual ~QtUIFactory(); 27 27 28 virtual Dialog* makeDialog( );28 virtual Dialog* makeDialog(const std::string &_title); 29 29 virtual MainWindow* makeMainWindow(); 30 30 -
src/UIElements/Qt4/Query/AtomsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<const atom *>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new AtomQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/DoublesQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<double>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new DoubleQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/ElementsQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<const element *>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new ElementQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/FileQtQuery.cpp
rb73545 r7f1b51 45 45 #include "UIElements/Qt4/Query/QtQuery.hpp" 46 46 47 #include <algorithm> 48 #include <boost/filesystem.hpp> 49 50 #include "Parameters/Validators/getFlatListFromHierarchyOfValidators.hpp" 51 #include "Parameters/Validators/Validator.hpp" 52 #include "Parameters/Validators/Specific/FilePresentValidator.hpp" 53 #include "Parameters/Validators/Specific/FileSuffixValidator.hpp" 54 #include "Parameters/Validators/Specific/ParserFileValidator.hpp" 47 55 #include "Parser/ParserTypes.hpp" 48 56 #include "Parser/FormatParserStorage.hpp" … … 51 59 QtQuery<boost::filesystem::path>(_param, _title, _description), 52 60 parent(_parent), 53 dialog(_dialog) 61 dialog(_dialog), 62 mustBePresent(false) 54 63 { 55 64 filenameLineEdit = new QLineEdit(); … … 57 66 filenameLineEdit->setReadOnly(true); 58 67 59 filenameLabel = new QLabel(QString( "Input file:"));68 filenameLabel = new QLabel(QString(_title.c_str())); 60 69 filenameLabel->setBuddy(filenameLineEdit); 61 70 filenameLabel->setToolTip(QString(getDescription().c_str())); … … 71 80 72 81 QObject::connect(filedialogButton,SIGNAL(clicked()),this,SLOT(showFileDialog())); 82 83 // fill list of suffixes 84 const Validator<boost::filesystem::path> &validator = 85 _param.getValidator(); 86 typedef std::vector<std::pair<const Validator<boost::filesystem::path> *, bool> > validators_t; 87 const validators_t validators = 88 getFlatListFromHierarchyOfValidators<boost::filesystem::path>(validator); 89 for (validators_t::const_iterator iter = validators.begin(); 90 iter != validators.end(); ++iter) { 91 const Validator< boost::filesystem::path > ¤tvalidator = *iter->first; 92 if (dynamic_cast<const FileSuffixValidator * const>(¤tvalidator) != NULL) 93 suffixes.push_back(dynamic_cast<const FileSuffixValidator &>(currentvalidator).getSuffix()); 94 if (dynamic_cast<const ParserFileValidator * const>(¤tvalidator) != NULL) { 95 const std::vector<std::string> moresuffixes = 96 dynamic_cast<const ParserFileValidator &>(currentvalidator).getSuffixes(); 97 suffixes.insert(suffixes.end(), moresuffixes.begin(), moresuffixes.end()); 98 } 99 if (dynamic_cast<const FilePresentValidator * const>(¤tvalidator) != NULL) 100 mustBePresent = iter->second; 101 } 102 std::sort(suffixes.begin(), suffixes.end()); 73 103 } 74 104 … … 93 123 // gather all possible suffixes 94 124 QStringList filters; 95 std::stringstream parsersuffixes; 96 parsersuffixes << std::string("Config files ("); 97 for (ParserTypes t = ParserTypes_begin; t < ParserTypes_end; ++t){ 98 if (t != ParserTypes_begin) 99 parsersuffixes << std::string(" "); 100 parsersuffixes << std::string("*.") << 101 FormatParserStorage::getInstance().getSuffixFromType(t); 125 std::stringstream filter_string; 126 if (!suffixes.empty()) { 127 filter_string << "Valid files ("; 128 for (std::vector<std::string>::const_iterator iter = suffixes.begin(); 129 iter != suffixes.end(); ++iter) 130 filter_string << (iter == suffixes.begin() ? "*." : " *.") << *iter << " "; 131 filter_string << ")"; 132 filters << tr(filter_string.str().c_str()); 102 133 } 103 parsersuffixes << std::string(")");104 filters << tr(parsersuffixes.str().c_str());105 filters << tr("Data files (*.dat)");106 134 filters << tr("Any files (*)"); 107 135 theFileDialog->setNameFilters(filters); -
src/UIElements/Qt4/Query/FilesQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<boost::filesystem::path>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new FileQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/IntsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<int>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new IntQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<const molecule *>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new MoleculeQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/QtQuery.hpp
rb73545 r7f1b51 211 211 QFileDialog *theFileDialog; 212 212 Dialog *dialog; 213 std::vector<std::string> suffixes; 214 bool mustBePresent; 213 215 }; 214 216 -
src/UIElements/Qt4/Query/QtQueryList.hpp
rb73545 r7f1b51 107 107 { 108 108 public: 109 ListQuerySubDialog(QtQueryListUntyped *_parent) : parent(_parent), sub(NULL){} 109 ListQuerySubDialog(QtQueryListUntyped *_parent, const std::string &_title) : 110 Dialog(_title), 111 parent(_parent), 112 sub(NULL) 113 {} 110 114 virtual void update() 111 115 { -
src/UIElements/Qt4/Query/StringsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<std::string>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new StringQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/UnsignedIntsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<unsigned int>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new UnsignedIntQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/VectorsQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<Vector>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new VectorQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery); -
src/UIElements/TextUI/TextDialog.cpp
rb73545 r7f1b51 41 41 42 42 43 TextDialog::TextDialog() 43 TextDialog::TextDialog(const std::string &_title) : 44 Dialog(_title) 44 45 { 45 46 } -
src/UIElements/TextUI/TextDialog.hpp
rb73545 r7f1b51 28 28 { 29 29 public: 30 TextDialog( );30 TextDialog(const std::string &_title); 31 31 virtual ~TextDialog(); 32 32 -
src/UIElements/TextUI/TextUIFactory.cpp
rb73545 r7f1b51 46 46 47 47 48 Dialog* TextUIFactory::makeDialog( ) {49 return new TextDialog( );48 Dialog* TextUIFactory::makeDialog(const std::string &_title) { 49 return new TextDialog(_title); 50 50 } 51 51 -
src/UIElements/TextUI/TextUIFactory.hpp
rb73545 r7f1b51 24 24 virtual ~TextUIFactory(); 25 25 26 virtual Dialog* makeDialog( );26 virtual Dialog* makeDialog(const std::string &_title); 27 27 virtual MainWindow* makeMainWindow(); 28 28 -
src/UIElements/UIFactory.hpp
rb73545 r7f1b51 56 56 * Again the type is determined upon factory creation. 57 57 */ 58 virtual Dialog* makeDialog( )=0;58 virtual Dialog* makeDialog(const std::string &_title)=0; 59 59 60 60 protected: -
src/UIElements/Views/Qt4/Plotting/QSeisPlot.cpp
rb73545 r7f1b51 43 43 ASSERT(m_plottype != NULL, 44 44 "QSeisPlot::QSeisPlot() - could not find desired plottype by name "+type.toStdString()+"."); 45 std::cout << "Type is " << type.toStdString() << ", " << m_plottype << std::endl;45 // std::cout << "Type is " << type.toStdString() << ", " << m_plottype << std::endl; 46 46 47 47 //label axes -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
rb73545 r7f1b51 69 69 } 70 70 World::getInstance().signOn(this, World::SelectionChanged); 71 WorldTime::getInstance().signOn(this, WorldTime::TimeChanged);72 71 73 72 // set the object's id … … 89 88 } 90 89 World::getInstance().signOff(this, World::SelectionChanged); 91 WorldTime::getInstance().signOff(this, WorldTime::TimeChanged);92 90 } 93 91 … … 230 228 break; 231 229 } 232 } else {233 // notification from world234 #ifdef LOG_OBSERVER235 observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(static_cast<Observer *>(this))236 << " received notification from Worldtime for channel "237 << notification->getChannelNo() << ".";238 #endif239 switch (notification->getChannelNo()) {240 case WorldTime::TimeChanged:241 resetPosition();242 emit changed();243 break;244 default:245 break;246 }247 230 } 248 231 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp
rb73545 r7f1b51 22 22 #include "types.hpp" 23 23 24 class GLWorldScene; 25 24 26 class GLMoleculeObject_atom : public GLMoleculeObject, public Observer 25 27 { … … 42 44 void indexChanged(GLMoleculeObject_atom *ob, int oldId, int newId); 43 45 44 public: 46 private: 47 //!> grant GLWorldScene acess to reset functions 48 friend class GLWorldScene; 49 45 50 void resetPosition(); 46 51 -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp
rb73545 r7f1b51 23 23 class atom; 24 24 25 class GLWorldScene; 26 25 27 class GLMoleculeObject_bond : public GLMoleculeObject, public Observer 26 28 { … … 41 43 42 44 private: 45 //!> grant WorldScene access to reset functions 46 friend class GLWorldScene; 47 43 48 /** Recalculates the position of the cylinder representing the bond. 44 49 * -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_shape.cpp
rb73545 r7f1b51 80 80 std::vector<Vector> points = shape.getHomogeneousPointsOnSurface(NumPointsonSurface); 81 81 82 // Fill the points into a tesselate-able container.83 TesselPointSTLList Corners;84 for (size_t i=0;i<points.size();++i){85 TesselPoint *Walker = new TesselPoint;86 Walker->setPosition(points[i]);87 Walker->setName(toString(i));88 Walker->setNr(i);89 Corners.push_back(Walker);90 }91 92 // Tesselate the points.93 Tesselation *T = new Tesselation;94 PointCloudAdaptor<TesselPointSTLList> cloud(&Corners, "TesselPointSTLList");95 (*T)(cloud, minradius);96 97 // Fill the points into a Qt geometry.98 82 QGeometryData geo; 99 LinkedCell_deprecated LinkedList(cloud, minradius); 100 std::vector<Vector> normals; 101 normals.resize(points.size(), zeroVec); 102 for(size_t i=0;i<points.size();++i){ 103 // add data to the primitive 104 geo.appendVertex(QVector3D(points[i][0], points[i][1], points[i][2])); 105 if (ShapeFactory::getInstance().isSimpleShape(shape.getType())) 106 normals[i] = shape.getNormal(points[i]); 107 else 108 normals[i] = T->getNormal(points[i], &LinkedList); 109 geo.appendNormal(QVector3D(normals[i][0], normals[i][1], normals[i][2])); 110 geo.appendColor(QColor(1, 1, 1, 1)); 111 geo.appendTexCoord(QVector2D(0, 0)); 112 } 113 114 // Fill the tesselated triangles into the geometry. 115 for (TriangleMap::const_iterator runner = T->TrianglesOnBoundary.begin(); runner != T->TrianglesOnBoundary.end(); runner++) { 116 int v[3]; 117 for (size_t i=0; i<3; ++i) 118 v[i] = runner->second->endpoints[i]->node->getNr(); 119 120 // Sort the vertices so the triangle is clockwise (relative to the normal vector). 121 Vector cross = points[v[1]] - points[v[0]]; 122 cross.VectorProduct(points[v[2]] - points[v[0]]); 123 if (cross.ScalarProduct(normals[v[0]] + normals[v[1]] + normals[v[2]]) > 0) 124 geo.appendIndices(v[0], v[1], v[2]); 125 else 126 geo.appendIndices(v[0], v[2], v[1]); 83 // we need at least three points for tesselation 84 if (points.size() >= 3) { 85 // Fill the points into a tesselate-able container. 86 TesselPointSTLList Corners; 87 for (size_t i=0;i<points.size();++i){ 88 TesselPoint *Walker = new TesselPoint; 89 Walker->setPosition(points[i]); 90 Walker->setName(toString(i)); 91 Walker->setNr(i); 92 Corners.push_back(Walker); 93 } 94 95 // Tesselate the points. 96 Tesselation T; 97 PointCloudAdaptor<TesselPointSTLList> cloud(&Corners, "TesselPointSTLList"); 98 T(cloud, minradius); 99 100 // Fill the points into a Qt geometry. 101 LinkedCell_deprecated LinkedList(cloud, minradius); 102 std::vector<Vector> normals; 103 normals.resize(points.size(), zeroVec); 104 for(size_t i=0;i<points.size();++i){ 105 // add data to the primitive 106 geo.appendVertex(QVector3D(points[i][0], points[i][1], points[i][2])); 107 if (ShapeFactory::getInstance().isSimpleShape(shape.getType())) 108 normals[i] = shape.getNormal(points[i]); 109 else 110 normals[i] = T.getNormal(points[i], &LinkedList); 111 geo.appendNormal(QVector3D(normals[i][0], normals[i][1], normals[i][2])); 112 geo.appendColor(QColor(1, 1, 1, 1)); 113 geo.appendTexCoord(QVector2D(0, 0)); 114 } 115 116 // Fill the tesselated triangles into the geometry. 117 for (TriangleMap::const_iterator runner = T.TrianglesOnBoundary.begin(); runner != T.TrianglesOnBoundary.end(); runner++) { 118 int v[3]; 119 for (size_t i=0; i<3; ++i) 120 v[i] = runner->second->endpoints[i]->node->getNr(); 121 122 // Sort the vertices so the triangle is clockwise (relative to the normal vector). 123 Vector cross = points[v[1]] - points[v[0]]; 124 cross.VectorProduct(points[v[2]] - points[v[0]]); 125 if (cross.ScalarProduct(normals[v[0]] + normals[v[1]] + normals[v[2]]) > 0) 126 geo.appendIndices(v[0], v[1], v[2]); 127 else 128 geo.appendIndices(v[0], v[2], v[1]); 129 } 127 130 } 128 131 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rb73545 r7f1b51 94 94 } 95 95 96 connect(this, SIGNAL(updated()), this, SLOT(update())); 97 96 98 setSelectionMode(SelectAtom); 97 99 … … 110 112 void GLWorldScene::init() 111 113 { 112 const std::vector<molecule*> &molecules = World::getInstance().getAllMolecules(); 113 114 if (molecules.size() > 0) { 115 for (std::vector<molecule*>::const_iterator Runner = molecules.begin(); 116 Runner != molecules.end(); 117 Runner++) { 118 119 for (molecule::const_iterator atomiter = (*Runner)->begin(); 120 atomiter != (*Runner)->end(); 121 ++atomiter) { 122 // create atom objects in scene 114 const std::vector<atom*> &atoms = World::getInstance().getAllAtoms(); 115 116 if (atoms.size() > 0) { 117 for (std::vector<atom*>::const_iterator atomiter = atoms.begin(); 118 atomiter != atoms.end(); 119 atomiter++) { 120 // create atom objects in scene 121 atomInserted((*atomiter)->getId()); 122 123 // create bond objects in scene 124 const BondList &bondlist = (*atomiter)->getListOfBonds(); 125 for (BondList::const_iterator bonditer = bondlist.begin(); 126 bonditer != bondlist.end(); 127 ++bonditer) { 128 const bond::ptr _bond = *bonditer; 129 const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ? 130 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; 131 bondInserted(_bond, side); 132 } 133 } 134 } 135 } 136 137 /** Update the WorldScene with molecules and atoms from World. 138 * 139 * This function should be called after e.g. WorldTime::TimeChanged was 140 * received or after another molecule has been loaded. 141 * 142 */ 143 void GLWorldScene::update() 144 { 145 const std::vector<atom*> &atoms = World::getInstance().getAllAtoms(); 146 147 if (atoms.size() > 0) { 148 for (std::vector<atom*>::const_iterator atomiter = atoms.begin(); 149 atomiter != atoms.end(); 150 atomiter++) { 151 // check whether atom already exists 152 const atomId_t atomid = (*atomiter)->getId(); 153 const bool atom_present = AtomsinSceneMap.count(atomid); 154 if (!atom_present) 123 155 atomInserted((*atomiter)->getId()); 124 125 // create bond objects in scene 126 const BondList &bondlist = (*atomiter)->getListOfBonds(); 127 for (BondList::const_iterator bonditer = bondlist.begin(); 128 bonditer != bondlist.end(); 129 ++bonditer) { 130 const bond::ptr _bond = *bonditer; 131 const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ? 132 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; 156 else 157 AtomsinSceneMap[atomid]->resetPosition(); 158 159 160 // create bond objects in scene 161 const BondList &bondlist = (*atomiter)->getListOfBonds(); 162 for (BondList::const_iterator bonditer = bondlist.begin(); 163 bonditer != bondlist.end(); 164 ++bonditer) { 165 const bond::ptr _bond = *bonditer; 166 const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ? 167 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; 168 bool bond_present = false; 169 const BondIds ids = getBondIds(_bond,side); 170 if (atom_present) { 171 // check whether bond is not present already 172 bond_present = BondsinSceneMap.count(ids); 173 } 174 if (!bond_present) 133 175 bondInserted(_bond, side); 176 else { 177 BondsinSceneMap[ids]->resetPosition(); 178 BondsinSceneMap[ids]->resetWidth(); 134 179 } 135 180 } … … 246 291 } 247 292 248 /** Adds a bond to the scene. 249 * 250 * @param _bond bond to add 251 * @param side which side of the bond (left or right) 252 */ 253 void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond side) 254 { 255 LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+"."); 256 //LOG(4, "INFO: Currently present bonds " << BondsinSceneMap << "."); 257 293 /** Helper function to get bond ids in the correct order for BondNodeMap. 294 * 295 * \return pair of ids in correct order. 296 */ 297 GLWorldScene::BondIds GLWorldScene::getBondIds( 298 const bond::ptr _bond, 299 const enum GLMoleculeObject_bond::SideOfBond _side) const 300 { 258 301 BondIds ids; 259 switch ( side) {302 switch (_side) { 260 303 case GLMoleculeObject_bond::left: 261 304 ids = std::make_pair(_bond->leftatom->getId(), _bond->rightatom->getId()); … … 265 308 break; 266 309 } 267 #ifndef NDEBUG 310 return ids; 311 } 312 313 /** Adds a bond to the scene. 314 * 315 * @param _bond bond to add 316 * @param side which side of the bond (left or right) 317 */ 318 void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond _side) 319 { 320 LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+"."); 321 //LOG(4, "INFO: Currently present bonds " << BondsinSceneMap << "."); 322 323 const BondIds ids = getBondIds(_bond, _side); 268 324 BondNodeMap::iterator iter = BondsinSceneMap.find(ids); 269 ASSERT(iter == BondsinSceneMap.end(), 270 "GLWorldScene::bondAdded() - same left-sided bond "+toString(*_bond)+" added again."); 271 #endif 272 GLMoleculeObject_bond * bondObject = 273 new GLMoleculeObject_bond(meshCylinder, this, _bond, side); 274 connect ( 275 bondObject, SIGNAL(BondRemoved(const atomId_t, const atomId_t)), 276 this, SLOT(bondRemoved(const atomId_t, const atomId_t))); 277 connect (bondObject, SIGNAL(changed()), this, SIGNAL(changed())); 278 BondsinSceneMap.insert( make_pair(ids, bondObject) ); 279 // BondIdsinSceneMap.insert( Leftids ); 325 if (iter == BondsinSceneMap.end()) { 326 GLMoleculeObject_bond * bondObject = 327 new GLMoleculeObject_bond(meshCylinder, this, _bond, _side); 328 connect ( 329 bondObject, SIGNAL(BondRemoved(const atomId_t, const atomId_t)), 330 this, SLOT(bondRemoved(const atomId_t, const atomId_t))); 331 connect (bondObject, SIGNAL(changed()), this, SIGNAL(changed())); 332 BondsinSceneMap.insert( make_pair(ids, bondObject) ); 333 // BondIdsinSceneMap.insert( Leftids ); 334 } else { 335 iter->second->resetPosition(); 336 iter->second->resetWidth(); 337 } 280 338 emit changeOccured(); 281 339 } -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rb73545 r7f1b51 68 68 signals: 69 69 void changed(); 70 void updated(); 70 71 void changeOccured(); 71 72 void pressed(); … … 90 91 void addShape(); 91 92 void removeShape(); 93 void update(); 92 94 93 95 public: … … 100 102 typedef std::pair< atomId_t, atomId_t> BondIds; 101 103 friend std::ostream &operator<<(std::ostream &ost, const BondIds &t); 104 105 BondIds getBondIds( 106 const bond::ptr _bond, 107 const enum GLMoleculeObject_bond::SideOfBond side) const; 102 108 103 109 typedef std::map< atomId_t, GLMoleculeObject_atom* > AtomNodeMap; -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
rb73545 r7f1b51 82 82 connect(this, SIGNAL(ShapeAdded()), worldscene, SLOT(addShape())); 83 83 connect(this, SIGNAL(ShapeRemoved()), worldscene, SLOT(removeShape())); 84 connect(this, SIGNAL(TimeChanged()), worldscene, SIGNAL(updated())); 84 85 connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled())); 85 86 connect(worldscene, SIGNAL(changed()), this, SIGNAL(changed())); … … 393 394 #endif 394 395 emit changed(); 396 emit TimeChanged(); 395 397 break; 396 398 } -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
rb73545 r7f1b51 57 57 signals: 58 58 void changed(); 59 void TimeChanged(); 59 60 void atomInserted(const atomicNumber_t _id); 60 61 void atomRemoved(const atomicNumber_t _id); -
src/UIElements/Views/Qt4/QtHomologyList.cpp
rb73545 r7f1b51 41 41 #include <QtGui/QTreeWidget> 42 42 #include <QtGui/QTabWidget> 43 #include<Qt/qsplitter.h> 43 #include <Qt/qsplitter.h> 44 #include <Qt/qboxlayout.h> 44 45 45 46 #include "CodePatterns/MemDebug.hpp" … … 73 74 potentialregistry_enabled(false) 74 75 { 76 QVBoxLayout* layout = new QVBoxLayout(this); 75 77 QSplitter *splitter = new QSplitter (Qt::Horizontal, this ); 78 layout->addWidget(splitter); 79 80 // tree widget 76 81 treewidget = new QTreeWidget (splitter); 82 treewidget->setSelectionMode( QTreeWidget::SingleSelection ); 83 treewidget->setColumnCount(COLUMNCOUNT); 84 QStringList header; 85 for(int i=0; i<COLUMNCOUNT;++i) 86 header << COLUMNNAMES[i]; 87 treewidget->setHeaderLabels(header); 77 88 splitter->addWidget(treewidget); 78 89 90 // plot widget 79 91 #ifdef HAVE_QWT 80 92 widget = new QSeisPlotPage ("energy", splitter); … … 84 96 #endif 85 97 splitter->addWidget(widget); 86 // splitter->setStretchFactor(10, 1);87 88 treewidget->setSelectionMode( QTreeWidget::SingleSelection );89 90 treewidget->setColumnCount(COLUMNCOUNT);91 QStringList header;92 for(int i=0; i<COLUMNCOUNT;++i)93 header << COLUMNNAMES[i];94 treewidget->setHeaderLabels(header);95 98 96 99 dirty = true; … … 198 201 const EmpiricalPotential &potential = dynamic_cast<const EmpiricalPotential &>(**potiter); 199 202 const std::string potentialname = potential.getName(); 203 const FunctionModel::filter_t filter = potential.getSpecificFilter(); 200 204 Coordinator::ptr coordinator = potential.getCoordinator(); 201 205 // then we need to sample the potential 202 206 xvalues.clear(); 203 207 for (TrainingData::InputVector_t::const_iterator inputiter = inputs.begin(); 204 inputiter != inputs.end(); ++inputiter) 205 xvalues.push_back((*coordinator)(*inputiter)); 206 207 // We need to sort the xvalues (and yvalues also) 208 inputiter != inputs.end(); ++inputiter) { 209 const FunctionModel::list_of_arguments_t specificargs = filter(*inputiter); 210 double average = 0.; 211 for (FunctionModel::list_of_arguments_t::const_iterator argiter = specificargs.begin(); 212 argiter != specificargs.end(); ++argiter) { 213 const FunctionModel::arguments_t args = *argiter; 214 average += (*coordinator)(args); 215 } 216 if (specificargs.size() > 1) { 217 const size_t index = xvalues.size(); 218 xvalues.push_back(average/(double)specificargs.size()); 219 yvalues[index] *= 1./(double)specificargs.size(); 220 } 221 } 222 223 // We need to sort the xvalues (and associated yvalues also) 208 224 std::vector<double>::const_iterator xiter = xvalues.begin(); 209 225 std::vector<double>::const_iterator yiter = yvalues.begin(); -
src/UIElements/Views/Qt4/QtMoleculeList.cpp
rb73545 r7f1b51 128 128 formula.push_back((*iter)->getFormula()); 129 129 groupItem = new QTreeWidgetItem(this); 130 groupItem->setText(0, QString( (*iter)->getName().c_str()));131 groupItem->setText(1, QString::number( (*iter)->getAtomCount()));132 groupItem->setText(2, QString( (*iter)->getFormula().toString().c_str()));130 groupItem->setText(0, QString("default")); 131 groupItem->setText(1, QString::number(0)); 132 groupItem->setText(2, QString("")); 133 133 groupItem->setText(3, "0"); 134 134 groupItem->setData(0, Qt::UserRole, QVariant(-1)); -
src/UIElements/Views/Qt4/QtToolBar.cpp
rb73545 r7f1b51 44 44 QToolBar(_parent) 45 45 { 46 addActionItem("undo", "undo ", "edit-undo");47 addActionItem("redo", "redo ", "edit-redo");46 addActionItem("undo", "undo the last Action", "edit-undo"); 47 addActionItem("redo", "redo the last Action", "edit-redo"); 48 48 } 49 49 … … 57 57 { 58 58 QAction *action = addAction(QString(description.c_str())); 59 action->setIcon(QIcon::fromTheme(QString(icon_name.c_str()))); 59 action->setIcon(FavActions.getIcon(token, icon_name)); 60 action->setToolTip(QString(description.c_str())); 60 61 QtMenuPipe *pipe = new QtMenuPipe(token,action); 61 62 QObject::connect(action, SIGNAL(triggered()),pipe,SLOT(called())); 62 63 plumbing.push_back(pipe); 64 present_actions.insert( token ); 63 65 } 66 67 void QtToolBar::addFavoriteActionItems(const unsigned int _max) 68 { 69 // separate favorite actions 70 addSeparator(); 71 FavActions.addToolBarActions(*this, _max); 72 } 73 -
src/UIElements/Views/Qt4/QtToolBar.hpp
rb73545 r7f1b51 20 20 #include "Menu/Qt4/QtMenuPipe.hpp" 21 21 22 #include <map> 23 #include <set> 24 #include <string> 25 26 #include "CodePatterns/Observer/Observer.hpp" 27 22 28 23 29 class QtToolBar : public QToolBar … … 28 34 virtual ~QtToolBar(); 29 35 36 /** Adds an action named \a token to the toolbar. 37 * 38 * @param token token of Action 39 * @param description description to appear as tooltip 40 * @param icon_name name of icon 41 */ 42 void addActionItem(const std::string &token, const std::string &description, const std::string &icon_name); 43 44 /** Function to add a set of favorite actions. 45 * 46 * @param _max maximum number of actions to add 47 */ 48 void addFavoriteActionItems(const unsigned int _max); 49 50 //!> typedef for a set of action tokens 51 typedef std::set<std::string> present_actions_t; 52 53 /** Getter for current set of present action on this toolbar. 54 * 55 * @return set of action tokens 56 */ 57 const present_actions_t & getPresentActions() const 58 { return present_actions; } 59 30 60 private: 31 61 std::list<QtMenuPipe*> plumbing; 32 62 33 void addActionItem(const std::string &token, const std::string &description, const std::string &icon_name); 63 /** This class knows about all Actions being called and stores their frequency. 64 * 65 * This is used to know about the topmost used Actions and creating placeholder 66 * toolbar icons for these on program launch. 67 * 68 */ 69 class QtFavoriteActions : public Observer 70 { 71 public: 72 QtFavoriteActions(); 73 ~QtFavoriteActions(); 34 74 75 void addToolBarActions( 76 QtToolBar &_toolbar, 77 const unsigned int _max) const; 78 79 void update(Observable *publisher); 80 void subjectKilled(Observable *publisher); 81 void recieveNotification(Observable *publisher, Notification_ptr notification); 82 83 QIcon getIcon( 84 const std::string &_token, 85 const std::string &_icon_name 86 ) const; 87 88 private: 89 QIcon createIconPlaceholder( 90 const std::string &_token 91 ) const; 92 93 private: 94 //!> typedef for the action counts 95 typedef std::map<std::string, unsigned int> ActionCounts_t; 96 //!> map counts how often each action has been called 97 ActionCounts_t ActionCounts; 98 //!> sign in to ActionQueue? 99 bool ActionQueue_observing; 100 }; 101 102 //!> instance dealing with favorite action icons 103 QtFavoriteActions FavActions; 104 105 //!> set of already present action icons 106 present_actions_t present_actions; 35 107 }; 36 108
Note:
See TracChangeset
for help on using the changeset viewer.
