Commit 6c1458d9 authored by Jan Möbius's avatar Jan Möbius

Context Menus when no object has been clicked

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3019 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b5906b28
......@@ -58,7 +58,7 @@
* type an object has, get the dataType from it.
*/
enum DataType {
/// Empty Objects (Should not be used)
/// None of the other Objects
DATA_NONE = 0 ,
/// Items used for Grouping
DATA_GROUP = 1 ,
......
......@@ -140,8 +140,21 @@ void CoreWidget::updatePopupMenu(const QPoint& _point) {
}
}
} else {
contextMenu_->removeAction(typeEntry);
contextMenu_->removeAction(entrySeparator);
emit updateContextMenu(-1);
// Add real context Menus first
for ( uint i = 0 ; i < contextMenus_.size(); ++i ) {
if ( contextMenus_[i].contextType == DATA_NONE ) {
contextMenu_->addMenu( contextMenus_[i].menu );
topLevelAdded++;
}
}
if ( topLevelAdded == 0 ) {
contextMenu_->removeAction(typeEntry);
contextMenu_->removeAction(entrySeparator);
}
}
if ( contextSelectionMenu_->isEmpty() )
......
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