Commit f9da20f0 authored by jriegel's avatar jriegel
Browse files

fix of #917

parent 2d35c343
......@@ -143,5 +143,30 @@ bool TaskWatcherCommandsEmptyDoc::shouldShow()
return doc && doc->countObjects() == 0;
}
//**************************************************************************
//**************************************************************************
// TaskWatcherCommandsEmptySelection
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskWatcherCommandsEmptySelection::TaskWatcherCommandsEmptySelection(const char* commands[],
const char* name,
const char* pixmap )
: TaskWatcherCommands(0,commands,name,pixmap)
{
}
TaskWatcherCommandsEmptySelection::~TaskWatcherCommandsEmptySelection()
{
}
//==== implementer ===========================================================================
//==== calls from the TaskView ===============================================================
bool TaskWatcherCommandsEmptySelection::shouldShow()
{
return (App::GetApplication().getActiveDocument() && Gui::Selection().size() == 0);
}
#include "moc_TaskWatcher.cpp"
......@@ -97,6 +97,23 @@ public:
};
// --------------------------------------------------------------------------
/// Special watcher class for showing commands when there is nothing selected
class GuiExport TaskWatcherCommandsEmptySelection : public TaskWatcherCommands
{
Q_OBJECT
public:
TaskWatcherCommandsEmptySelection(const char* commands[], const char* name, const char* pixmap);
~TaskWatcherCommandsEmptySelection();
public:
/// is called wenn the document or the Selection changes.
virtual bool shouldShow(void);
};
} //namespace TaskView
......
......@@ -140,7 +140,7 @@ void Workbench::activated()
"Part_Box",
"Part_Cylinder",
0};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptyDoc(
Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptySelection(
Empty,
"Create Geometry",
"Part_Box"
......
Supports Markdown
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