Skip to content
Snippets Groups Projects
Commit e2aec8ed authored by stefan's avatar stefan
Browse files

SceneWin ContextMenu added Modifier for MultipleSelection

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2045 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 9d9a49e7
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ void export_SceneWin() ...@@ -71,6 +71,7 @@ void export_SceneWin()
.value("NOT_HIDDEN", NOT_HIDDEN) .value("NOT_HIDDEN", NOT_HIDDEN)
.value("NOT_SCENE", NOT_SCENE) .value("NOT_SCENE", NOT_SCENE)
.value("SINGLE", SINGLE) .value("SINGLE", SINGLE)
.value("MULTI", MULTI)
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
.value("MAP", MAP) .value("MAP", MAP)
#endif #endif
......
...@@ -12,7 +12,8 @@ class AlignmentContextMenu(QtCore.QObject): ...@@ -12,7 +12,8 @@ class AlignmentContextMenu(QtCore.QObject):
self.action = QtGui.QAction("Align", self) self.action = QtGui.QAction("Align", self)
QtCore.QObject.connect(self.action,QtCore.SIGNAL("triggered()"), self.Align) QtCore.QObject.connect(self.action,QtCore.SIGNAL("triggered()"), self.Align)
context_menu.AddAction(self.action, gui.ContextActionType.ENTITY) print gui.ContextActionType.ENTITY | gui.ContextActionType.MULTI
context_menu.AddAction(self.action, gui.ContextActionType.ENTITY | gui.ContextActionType.MULTI)
except FileNotFound: except FileNotFound:
return return
......
...@@ -124,9 +124,11 @@ void ContextMenu::ShowMenu(const QPoint& pos) ...@@ -124,9 +124,11 @@ void ContextMenu::ShowMenu(const QPoint& pos)
ContextActionTypes flags; ContextActionTypes flags;
flags = ~flags; flags = ~flags;
int cnt = 0;
if(indexes.size()>0){ if(indexes.size()>0){
for(int i = 0; i < indexes.size(); i++){ for(int i = 0; i < indexes.size(); i++){
if(indexes[i].column()==0){ if(indexes[i].column()==0){
cnt++;
GfxSceneNode* gfx_scene_node = qobject_cast<GfxSceneNode*>(model_->GetItem(indexes[i])); GfxSceneNode* gfx_scene_node = qobject_cast<GfxSceneNode*>(model_->GetItem(indexes[i]));
if(gfx_scene_node){ if(gfx_scene_node){
gfx::GfxNodeP gfx_node = gfx_scene_node->GetGfxNode(); gfx::GfxNodeP gfx_node = gfx_scene_node->GetGfxNode();
...@@ -164,6 +166,12 @@ void ContextMenu::ShowMenu(const QPoint& pos) ...@@ -164,6 +166,12 @@ void ContextMenu::ShowMenu(const QPoint& pos)
} }
} }
if(cnt==1){
flags &= ~MULTI;
}
else{
flags &= ~SINGLE;
}
QMenu* menu = new QMenu(); QMenu* menu = new QMenu();
QMapIterator<QAction*, ContextActionTypes> i(actions_); QMapIterator<QAction*, ContextActionTypes> i(actions_);
flags ^= NOT_VISIBLE; flags ^= NOT_VISIBLE;
......
...@@ -42,9 +42,10 @@ enum ContextActionType ...@@ -42,9 +42,10 @@ enum ContextActionType
NOT_VISIBLE=0x10, NOT_VISIBLE=0x10,
NOT_HIDDEN=0x20, NOT_HIDDEN=0x20,
NOT_SCENE=0x40, NOT_SCENE=0x40,
SINGLE=0x80 SINGLE=0x80,
MULTI=0x100
#if OST_IMG_ENABLED #if OST_IMG_ENABLED
,MAP=0x100 ,MAP=0x200
#endif #endif
}; };
Q_DECLARE_FLAGS(ContextActionTypes, ContextActionType) Q_DECLARE_FLAGS(ContextActionTypes, ContextActionType)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment