Changeset be374a


Ignore:
Timestamp:
Jul 17, 2012, 12:17:28 PM (13 years ago)
Author:
Michael Ankele <ankele@…>
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:
c736fe
Parents:
7772aa
git-author:
Michael Ankele <ankele@…> (06/29/12 15:25:34)
git-committer:
Michael Ankele <ankele@…> (07/17/12 12:17:28)
Message:

Fix: QtMoleculeView must not signOff after subjectKilled

Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtMoleculeView.cpp

    r7772aa rbe374a  
    4444
    4545QtMoleculeView::~QtMoleculeView()
    46 {}
     46{
     47  clearTabs();
     48}
    4749
    4850void QtMoleculeView::nameChanged(QTMoleculePage *page, std::string name){}
     
    6062}
    6163
    62 void QtMoleculeView::showAtom(const atom *_atom)
     64void QtMoleculeView::clearTabs()
    6365{
    64   curAtom = _atom;
    65 
    66   // Remove old tabs.
    6766  if (page_atom){
    68     removeTab(indexOf(page_atom));
     67    //removeTab(indexOf(page_atom));
    6968    delete(page_atom);
    7069    page_atom = NULL;
    7170  }
    7271  if (page_mol){
    73     removeTab(indexOf(page_mol));
     72    //removeTab(indexOf(page_mol));
    7473    delete(page_mol);
    7574    page_mol = NULL;
    7675  }
     76}
    7777
     78void QtMoleculeView::showAtom(const atom *_atom)
     79{
     80  // Remove old tabs.
     81  clearTabs();
     82
     83  curAtom = _atom;
    7884
    7985  // Show new tabs.
     
    8187    page_atom = new QTAtomPage(curAtom);
    8288    addTab(page_atom, "Atom");
     89    connect(page_atom, SIGNAL(atomKilled()), this, SLOT(clearTabs()));
    8390
    8491    if (curAtom->getMolecule()){
    8592      page_mol = new QTMoleculePage(curAtom->getMolecule());
    8693      addTab(page_mol, "Molecule");
     94      connect(page_mol, SIGNAL(moleculeKilled()), this, SLOT(clearTabs()));
    8795    }
    8896  }
     
    120128QTAtomPage::~QTAtomPage()
    121129{
    122   atomRef->signOff(this);
     130  if (atomRef)
     131    atomRef->signOff(this);
    123132}
    124133
     
    130139}
    131140
    132 void QTAtomPage::subjectKilled(Observable *subject){}
     141void QTAtomPage::subjectKilled(Observable *subject){
     142  atomRef = NULL;
     143  emit atomKilled();
     144}
    133145
    134146/************************ Tab for single Molecules *****************/
     
    154166
    155167QTMoleculePage::~QTMoleculePage(){
    156   mol->signOff(this);
     168  if (mol)
     169    mol->signOff(this);
    157170}
    158171
    159 void QTMoleculePage::update(Observable *subject){
     172void QTMoleculePage::update(Observable *subject){  std::cout << "tab mol update\n";
    160173}
    161174
    162 void QTMoleculePage::subjectKilled(Observable *subject){}
     175void QTMoleculePage::subjectKilled(Observable *subject){
     176  mol = NULL;
     177  emit moleculeKilled();
     178}
  • src/UIElements/Views/Qt4/QtMoleculeView.hpp

    r7772aa rbe374a  
    4242
    4343  void nameChanged(QTMoleculePage *page, std::string name);
     44  void clearTabs();
    4445
    4546private:
     
    6364  void subjectKilled(Observable *subject);
    6465
     66signals:
     67  void atomKilled();
     68
    6569private:
    6670  const atom *atomRef;
     
    8084  void subjectKilled(Observable *subject);
    8185
     86  signals:
     87    void moleculeKilled();
     88
    8289private:
    8390  const molecule *mol;
Note: See TracChangeset for help on using the changeset viewer.