Commit 99686812 authored by Sylvain Thery's avatar Sylvain Thery

add slot for selecting map from python console

parent 9a03f38e
...@@ -31,6 +31,8 @@ public: ...@@ -31,6 +31,8 @@ public:
unsigned int getCurrentOrbit(); unsigned int getCurrentOrbit();
CellSelectorGen* getSelectedSelector(unsigned int orbit) { return m_selectedSelector[orbit]; } CellSelectorGen* getSelectedSelector(unsigned int orbit) { return m_selectedSelector[orbit]; }
void setSelectedMap(const QString& mapName);
private slots: private slots:
// slots called from UI actions // slots called from UI actions
void selectedMapChanged(); void selectedMapChanged();
......
...@@ -90,6 +90,7 @@ private slots: ...@@ -90,6 +90,7 @@ private slots:
public slots: public slots:
MapHandlerGen* addMap(const QString& name, unsigned int dim); MapHandlerGen* addMap(const QString& name, unsigned int dim);
void removeMap(const QString& name); void removeMap(const QString& name);
void setSelectedMap(const QString& mapName);
MapHandlerGen* getMap(const QString& name) const; MapHandlerGen* getMap(const QString& name) const;
const MapSet& getMapSet() const { return m_maps; } const MapSet& getMapSet() const { return m_maps; }
......
...@@ -447,6 +447,17 @@ void ControlDock_MapTab::updateSelectedMapInfo() ...@@ -447,6 +447,17 @@ void ControlDock_MapTab::updateSelectedMapInfo()
b_updatingUI = false; b_updatingUI = false;
} }
void ControlDock_MapTab::setSelectedMap(const QString& mapName)
{
QList<QListWidgetItem *> lm = list_maps->findItems(mapName,Qt::MatchExactly);
if (!lm.empty())
{
lm[0]->setSelected(true);
}
}
} // namespace SCHNApps } // namespace SCHNApps
} // namespace CGoGN } // namespace CGoGN
...@@ -520,6 +520,11 @@ void SCHNApps::removeMap(const QString& name) ...@@ -520,6 +520,11 @@ void SCHNApps::removeMap(const QString& name)
} }
} }
void SCHNApps::setSelectedMap(const QString& mapName)
{
m_controlMapTab->setSelectedMap(mapName);
}
MapHandlerGen* SCHNApps::getMap(const QString& name) const MapHandlerGen* SCHNApps::getMap(const QString& name) const
{ {
if (m_maps.contains(name)) if (m_maps.contains(name))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment