Changeset 3c9ac3 for src/UIElements
- Timestamp:
- Jul 12, 2017, 7:12:47 PM (7 years ago)
- Branches:
- Action_Thermostats, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- 9a1e099
- Parents:
- 4c6f0d
- git-author:
- Frederik Heber <frederik.heber@…> (07/12/17 14:34:42)
- git-committer:
- Frederik Heber <frederik.heber@…> (07/12/17 19:12:47)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtGeometryList.cpp
r4c6f0d r3c9ac3 54 54 QtGeometryList::QtGeometryList(QWidget * _parent) : 55 55 QTreeWidget (_parent), 56 Observer("QtGeometryList") 56 Observer("QtGeometryList"), 57 geometryregistry_enabled(false) 57 58 { 58 59 setColumnCount(COLUMNCOUNT); … … 73 74 GeometryRegistry::getInstance().signOn(this, GeometryRegistry::GeometryInserted); 74 75 GeometryRegistry::getInstance().signOn(this, GeometryRegistry::GeometryRemoved); 76 geometryregistry_enabled = true; 75 77 76 78 QCoreApplication::instance()->installEventFilter(this); … … 79 81 QtGeometryList::~QtGeometryList() 80 82 { 81 GeometryRegistry::getInstance().signOff(this); 82 GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryInserted); 83 GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryRemoved); 83 if (geometryregistry_enabled) { 84 GeometryRegistry::getInstance().signOff(this); 85 GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryInserted); 86 GeometryRegistry::getInstance().signOff(this, GeometryRegistry::GeometryRemoved); 87 } 88 } 89 90 void QtGeometryList::subjectKilled(Observable *publisher) 91 { 92 // as a new instance should always already be present ... just sign on 93 if (static_cast<GeometryRegistry *>(publisher) == GeometryRegistry::getPointer()) { 94 geometryregistry_enabled = false; 95 } 84 96 } 85 97 … … 133 145 refill(NULL);*/ 134 146 QTreeWidget::paintEvent(event); 135 }136 137 void QtGeometryList::subjectKilled(Observable *publisher) {138 147 } 139 148 -
src/UIElements/Views/Qt4/QtGeometryList.hpp
r4c6f0d r3c9ac3 48 48 49 49 private: 50 //!> flag to indicate that we are signed on to GeometryRegistry 51 bool geometryregistry_enabled; 50 52 51 53 mutable boost::recursive_mutex refill_mutex; -
src/UIElements/Views/Qt4/QtHomologyList.cpp
r4c6f0d r3c9ac3 78 78 QWidget(_parent), 79 79 Observer("QtHomologyList"), 80 homologycontainer_enabled(false), 80 81 potentialregistry_enabled(false) 81 82 { … … 118 119 HomologyContainer &homologies = World::getInstance().getHomologies(); 119 120 homologies.signOn(this); 121 homologycontainer_enabled = true; 120 122 PotentialRegistry::getInstance().signOn(this); 121 123 potentialregistry_enabled = true; … … 144 146 145 147 146 HomologyContainer &homologies = World::getInstance().getHomologies(); 147 homologies.signOff(this); 148 if (homologycontainer_enabled) { 149 HomologyContainer &homologies = World::getInstance().getHomologies(); 150 homologies.signOff(this); 151 } 148 152 if (potentialregistry_enabled) 149 153 PotentialRegistry::getInstance().signOff(this); … … 304 308 if (static_cast<PotentialRegistry *>(publisher) == PotentialRegistry::getPointer()) { 305 309 potentialregistry_enabled = false; 306 } else {307 // its HomologyContainer310 } else if (static_cast<HomologyContainer *>(publisher) == &World::getInstance().getHomologies()) { 311 homologycontainer_enabled = false; 308 312 } 309 313 } -
src/UIElements/Views/Qt4/QtHomologyList.hpp
r4c6f0d r3c9ac3 55 55 //!> flag to indicate that we got an update 56 56 bool dirty; 57 //!> flag to indicate whether we are subscribed to HomologyContainer 58 bool homologycontainer_enabled; 57 59 //!> flag to indicate whether we are subscribed to PotentialRegistry 58 60 bool potentialregistry_enabled; -
src/UIElements/Views/Qt4/QtShapeList.cpp
r4c6f0d r3c9ac3 55 55 QtShapeList::QtShapeList(QWidget * _parent) : 56 56 QTreeWidget (_parent), 57 Observer("QtShapeList") 57 Observer("QtShapeList"), 58 shaperegistry_enabled(false) 58 59 { 59 60 setColumnCount(COLUMNCOUNT); … … 73 74 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeRemoved); 74 75 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::SelectionChanged); 76 shaperegistry_enabled = true; 75 77 76 78 connect(this,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected())); … … 79 81 QtShapeList::~QtShapeList() 80 82 { 81 ShapeRegistry::getInstance().signOff(this); 82 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeInserted); 83 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeRemoved); 84 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::SelectionChanged); 83 if (shaperegistry_enabled) { 84 ShapeRegistry::getInstance().signOff(this); 85 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeInserted); 86 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeRemoved); 87 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::SelectionChanged); 88 } 85 89 } 86 90 … … 148 152 } 149 153 150 void QtShapeList::subjectKilled(Observable *publisher) { 154 void QtShapeList::subjectKilled(Observable *publisher) 155 { 156 // as a new instance should always already be present ... just sign on 157 if (static_cast<ShapeRegistry *>(publisher) == ShapeRegistry::getPointer()) { 158 shaperegistry_enabled = false; 159 } 151 160 } 152 153 161 154 162 void QtShapeList::rowSelected() -
src/UIElements/Views/Qt4/QtShapeList.hpp
r4c6f0d r3c9ac3 54 54 std::vector<bool> shapeSelection; //!< needed to determine when a selection changes 55 55 56 //!> flag to indicate whether we are signed on 57 bool shaperegistry_enabled; 58 56 59 mutable boost::recursive_mutex refill_mutex; 57 60 };
Note:
See TracChangeset
for help on using the changeset viewer.