Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed the menu and grid in the style manager
  • Loading branch information
Arunmozhi committed Aug 6, 2012
1 parent cbd71fa commit ca726f3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Expand Up @@ -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" );
Expand Down Expand Up @@ -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 );

Expand All @@ -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();
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/ui/qgsstylev2managerdialogbase.ui
Expand Up @@ -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">
Expand Down

0 comments on commit ca726f3

Please sign in to comment.