@@ -616,11 +616,15 @@ void QgsStyleV2ManagerDialog::populateGroups()
616
616
setBold ( projectSymbols );
617
617
model->appendRow ( projectSymbols );
618
618
619
+ /* TODO
620
+ *
619
621
QStandardItem *recent = new QStandardItem( "Recently Used" );
620
622
recent->setData( "recent" );
621
623
recent->setEditable( false );
622
624
setBold( recent );
623
625
model->appendRow( recent );
626
+ *
627
+ */
624
628
625
629
QStandardItem *group = new QStandardItem ( " " ); // require empty name to get first order groups
626
630
group->setData ( " groups" );
@@ -1111,9 +1115,23 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
1111
1115
{
1112
1116
QPoint globalPos = groupTree->viewport ()->mapToGlobal ( point );
1113
1117
1118
+ QModelIndex index = groupTree->indexAt ( point );
1119
+ QgsDebugMsg ( " Now you clicked : " + index .data ().toString () );
1120
+
1114
1121
QMenu groupMenu;
1115
- groupMenu.addAction ( " Add Group" );
1116
- groupMenu.addAction ( " Remove Group" );
1122
+
1123
+ if ( index .parent ().isValid () && ( index .data ( Qt::UserRole + 1 ).toString () != " ungrouped" ) )
1124
+ {
1125
+ if ( index .parent ().data ( Qt::UserRole + 1 ).toString () == " smartgroups" )
1126
+ {
1127
+ groupMenu.addAction ( " Edit Group" );
1128
+ }
1129
+ else // it must be a group
1130
+ {
1131
+ groupMenu.addAction ( " Add Group" );
1132
+ }
1133
+ groupMenu.addAction ( " Remove Group" );
1134
+ }
1117
1135
1118
1136
QAction* selectedItem = groupMenu.exec ( globalPos );
1119
1137
@@ -1123,6 +1141,8 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
1123
1141
addGroup ();
1124
1142
else if ( selectedItem->text () == " Remove Group" )
1125
1143
removeGroup ();
1144
+ else if ( selectedItem->text () == " Edit Group" )
1145
+ editSmartgroupAction ();
1126
1146
}
1127
1147
}
1128
1148
0 commit comments