Skip to content
Permalink
Browse files

fixed the menu and grid in the style manager

  • Loading branch information
tecoholic committed Aug 6, 2012
1 parent cbd71fa commit ca726f3051cbdfec6afd38e4509d7d9dd02c83f7
Showing with 31 additions and 2 deletions.
  1. +22 −2 src/gui/symbology-ng/qgsstylev2managerdialog.cpp
  2. +9 −0 src/ui/qgsstylev2managerdialogbase.ui
@@ -616,11 +616,15 @@ void QgsStyleV2ManagerDialog::populateGroups()
setBold( projectSymbols );
model->appendRow( projectSymbols );

/* TODO
*
QStandardItem *recent = new QStandardItem( "Recently Used" );
recent->setData( "recent" );
recent->setEditable( false );
setBold( recent );
model->appendRow( recent );
*
*/

QStandardItem *group = new QStandardItem( "" ); //require empty name to get first order groups
group->setData( "groups" );
@@ -1111,9 +1115,23 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
{
QPoint globalPos = groupTree->viewport()->mapToGlobal( point );

QModelIndex index = groupTree->indexAt( point );
QgsDebugMsg( "Now you clicked : " + index.data().toString() );

QMenu groupMenu;
groupMenu.addAction( "Add Group" );
groupMenu.addAction( "Remove Group" );

if ( index.parent().isValid() && ( index.data( Qt::UserRole + 1 ).toString() != "ungrouped" ) )
{
if ( index.parent().data( Qt::UserRole + 1 ).toString() == "smartgroups" )
{
groupMenu.addAction( "Edit Group" );
}
else // it must be a group
{
groupMenu.addAction( "Add Group" );
}
groupMenu.addAction( "Remove Group" );
}

QAction* selectedItem = groupMenu.exec( globalPos );

@@ -1123,6 +1141,8 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
addGroup();
else if ( selectedItem->text() == "Remove Group" )
removeGroup();
else if ( selectedItem->text() == "Edit Group" )
editSmartgroupAction();
}
}

@@ -207,9 +207,18 @@
<property name="spacing">
<number>5</number>
</property>
<property name="gridSize">
<size>
<width>75</width>
<height>83</height>
</size>
</property>
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">

0 comments on commit ca726f3

Please sign in to comment.
You can’t perform that action at this time.