From 895926cddb097bcbe956291e1aad23b35d3068bd Mon Sep 17 00:00:00 2001 From: Pierre Kraemer Date: Wed, 2 Oct 2013 10:43:24 +0200 Subject: [PATCH] debug some selection problems --- SCHNApps/include/mapHandler.h | 1 + SCHNApps/include/schnapps.h | 2 ++ SCHNApps/src/controlDock_mapTab.cpp | 3 +++ SCHNApps/src/view.cpp | 3 ++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SCHNApps/include/mapHandler.h b/SCHNApps/include/mapHandler.h index 0979fb13..83ac780d 100644 --- a/SCHNApps/include/mapHandler.h +++ b/SCHNApps/include/mapHandler.h @@ -148,6 +148,7 @@ public slots: CellSelectorGen* getCellSelector(unsigned int orbit, const QString& name) const; const CellSelectorSet& getCellSelectorSet(unsigned int orbit) const { return m_cellSelectors[orbit]; } +private slots: void selectedCellsChanged(); public: diff --git a/SCHNApps/include/schnapps.h b/SCHNApps/include/schnapps.h index 9872c7db..d9f135dc 100644 --- a/SCHNApps/include/schnapps.h +++ b/SCHNApps/include/schnapps.h @@ -98,6 +98,7 @@ public slots: MapHandlerGen* getSelectedMap() const; unsigned int getCurrentOrbit() const; + void notifySelectedCellSelectorChanged(CellSelectorGen* cs) { emit(selectedCellSelectorChanged(cs)); } CellSelectorGen* getSelectedSelector(unsigned int orbit) const; /********************************************************* @@ -140,6 +141,7 @@ signals: void mapAdded(MapHandlerGen* map); void mapRemoved(MapHandlerGen* map); void selectedMapChanged(MapHandlerGen* old, MapHandlerGen* cur); + void selectedCellSelectorChanged(CellSelectorGen* cs); void pluginAvailableAdded(QString name); void pluginEnabled(Plugin* plugin); diff --git a/SCHNApps/src/controlDock_mapTab.cpp b/SCHNApps/src/controlDock_mapTab.cpp index 02e13e49..e648a58e 100644 --- a/SCHNApps/src/controlDock_mapTab.cpp +++ b/SCHNApps/src/controlDock_mapTab.cpp @@ -157,7 +157,10 @@ void ControlDock_MapTab::selectedSelectorChanged() case VOLUME: items = list_volumeSelectors->selectedItems(); break; } if(!items.empty()) + { m_selectedSelector[orbit] = m_selectedMap->getCellSelector(orbit, items[0]->text()); + m_schnapps->notifySelectedCellSelectorChanged(m_selectedSelector[orbit]); + } } } } diff --git a/SCHNApps/src/view.cpp b/SCHNApps/src/view.cpp index aa44ff49..5e7d58ff 100644 --- a/SCHNApps/src/view.cpp +++ b/SCHNApps/src/view.cpp @@ -35,6 +35,7 @@ View::View(const QString& name, SCHNApps* s, const QGLWidget* shareWidget) : m_currentCamera = m_schnapps->addCamera(); connect(m_schnapps, SIGNAL(selectedMapChanged(MapHandlerGen*,MapHandlerGen*)), this, SLOT(selectedMapChanged(MapHandlerGen*,MapHandlerGen*))); + connect(m_schnapps, SIGNAL(selectedCellSelectorChanged(CellSelectorGen*)), this, SLOT(updateGL())); } View::~View() @@ -162,7 +163,7 @@ void View::unlinkMap(MapHandlerGen* map) updateGL(); disconnect(map->getFrame(), SIGNAL(modified()), this, SLOT(updateGL())); - disconnect(map, SIGNAL(selectedCellsChanged()), this, SLOT(updateGL())); + disconnect(map, SIGNAL(selectedCellsChanged(CellSelectorGen*)), this, SLOT(updateGL())); if(map == m_schnapps->getSelectedMap()) setManipulatedFrame(NULL); -- GitLab