Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add delete keyboard action for rules
  • Loading branch information
NathanW2 committed Sep 14, 2013
1 parent 41ef0a9 commit c02c28b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsrendererv2widget.cpp
Expand Up @@ -32,6 +32,7 @@ QgsRendererV2Widget::QgsRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* sty
mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );

contextMenu->addSeparator();
contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor( ) ) );
contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
contextMenu->addAction( tr( "Change output unit" ), this, SLOT( changeSymbolUnit() ) );
Expand Down
6 changes: 6 additions & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Expand Up @@ -65,6 +65,11 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
mModel = new QgsRuleBasedRendererV2Model( mRenderer );
//new ModelTest( mModel, this ); // for model validity checking
viewRules->setModel( mModel );

mDeleteAction = new QAction( tr( "Remove Rule"), this );
mDeleteAction->setShortcut( QKeySequence( QKeySequence::Delete ) );

viewRules->addAction( mDeleteAction );
viewRules->addAction( mCopyAction );
viewRules->addAction( mPasteAction );

Expand All @@ -89,6 +94,7 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
connect( btnAddRule, SIGNAL( clicked() ), this, SLOT( addRule() ) );
connect( btnEditRule, SIGNAL( clicked() ), this, SLOT( editRule() ) );
connect( btnRemoveRule, SIGNAL( clicked() ), this, SLOT( removeRule() ) );
connect( mDeleteAction, SIGNAL( triggered() ), this, SLOT( removeRule() ) );
connect( btnCountFeatures, SIGNAL( clicked() ), this, SLOT( countFeatures() ) );

connect( btnRenderingOrder, SIGNAL( clicked() ), this, SLOT( setRenderingOrder() ) );
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.h
Expand Up @@ -142,6 +142,7 @@ class GUI_EXPORT QgsRuleBasedRendererV2Widget : public QgsRendererV2Widget, priv
QgsRuleBasedRendererV2Model* mModel;

QMenu* mRefineMenu;
QAction* mDeleteAction;

protected slots:
void copy();
Expand Down

0 comments on commit c02c28b

Please sign in to comment.