diff --git a/src/Gui/SelectionView.cpp b/src/Gui/SelectionView.cpp index f62302e57b..a9c3b59035 100644 --- a/src/Gui/SelectionView.cpp +++ b/src/Gui/SelectionView.cpp @@ -225,6 +225,18 @@ void SelectionView::treeSelect(void) Gui::Command::runCommand(Gui::Command::Gui,"Gui.runCommand(\"Std_TreeSelection\")"); } +void SelectionView::touch(void) +{ + QListWidgetItem *item = selectionView->currentItem(); + if (!item) + return; + QStringList elements = item->text().split(QString::fromLatin1(".")); + // remove possible space from object name followed by label + elements[1] = elements[1].split(QString::fromLatin1(" "))[0]; + QString cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").touch()").arg(elements[0]).arg(elements[1]); + Gui::Command::runCommand(Gui::Command::Doc,cmd.toLatin1()); +} + void SelectionView::toPython(void) { QListWidgetItem *item = selectionView->currentItem(); @@ -264,6 +276,9 @@ void SelectionView::onItemContextMenu(const QPoint& point) zoomAction->setToolTip(tr("Selects and fits this object in the 3D window")); QAction *gotoAction = menu.addAction(tr("Go to selection"),this,SLOT(treeSelect())); gotoAction->setToolTip(tr("Selects and locates this object in the tree view")); + QAction *touchAction = menu.addAction(tr("Mark to recompute"),this,SLOT(touch())); + touchAction->setIcon(QIcon::fromTheme(QString::fromLatin1("view-refresh"))); + touchAction->setToolTip(tr("Mark this object to be recomputed")); QAction *toPythonAction = menu.addAction(tr("To python console"),this,SLOT(toPython())); toPythonAction->setIcon(QIcon::fromTheme(QString::fromLatin1("applications-python"))); toPythonAction->setToolTip(tr("Reveals this object and its subelements in the python console.")); diff --git a/src/Gui/SelectionView.h b/src/Gui/SelectionView.h index 585e6eb003..0fd1304bcd 100644 --- a/src/Gui/SelectionView.h +++ b/src/Gui/SelectionView.h @@ -79,6 +79,7 @@ public Q_SLOTS: void zoom(void); void treeSelect(void); void toPython(void); + void touch(void); };