Skip to content

Commit

Permalink
Rule copy and paste shortcut keys
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Sep 14, 2013
1 parent 7c9d859 commit 41ef0a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/symbology-ng/qgsrendererv2widget.cpp
Expand Up @@ -27,8 +27,10 @@ QgsRendererV2Widget::QgsRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* sty
{
contextMenu = new QMenu( "Renderer Options " );

contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mCopyAction = contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
mCopyAction->setShortcut( QKeySequence( QKeySequence::Copy ) );
mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );

contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor( ) ) );
contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology-ng/qgsrendererv2widget.h
Expand Up @@ -53,6 +53,8 @@ class GUI_EXPORT QgsRendererV2Widget : public QWidget
QgsVectorLayer* mLayer;
QgsStyleV2* mStyle;
QMenu* contextMenu;
QAction* mCopyAction;
QAction* mPasteAction;

/**Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods
and by connecting the slot contextMenuViewCategories(const QPoint&)*/
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Expand Up @@ -65,6 +65,8 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
mModel = new QgsRuleBasedRendererV2Model( mRenderer );
//new ModelTest( mModel, this ); // for model validity checking
viewRules->setModel( mModel );
viewRules->addAction( mCopyAction );
viewRules->addAction( mPasteAction );

mRefineMenu = new QMenu( tr( "Refine current rule" ), btnRefineRule );
mRefineMenu->addAction( tr( "Add scales to rule" ), this, SLOT( refineRuleScales() ) );
Expand Down

0 comments on commit 41ef0a9

Please sign in to comment.