Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FreeCAD
FreeCAD
Commits
f9da20f0
Commit
f9da20f0
authored
Dec 20, 2012
by
jriegel
Browse files
fix of #917
parent
2d35c343
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Gui/TaskView/TaskWatcher.cpp
View file @
f9da20f0
...
...
@@ -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"
src/Gui/TaskView/TaskWatcher.h
View file @
f9da20f0
...
...
@@ -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
...
...
src/Mod/PartDesign/Gui/Workbench.cpp
View file @
f9da20f0
...
...
@@ -140,7 +140,7 @@ void Workbench::activated()
"Part_Box"
,
"Part_Cylinder"
,
0
};
Watcher
.
push_back
(
new
Gui
::
TaskView
::
TaskWatcherCommandsEmpty
Doc
(
Watcher
.
push_back
(
new
Gui
::
TaskView
::
TaskWatcherCommandsEmpty
Selection
(
Empty
,
"Create Geometry"
,
"Part_Box"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment