Skip to content

Commit

Permalink
select and measure toolbar flyouts and submenus (followup #2938)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14101 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 17, 2010
1 parent 8f46f35 commit 6211960
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
70 changes: 43 additions & 27 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ void QgisApp::createActions()
mActionZoomOut->setStatusTip( tr( "Zoom Out" ) );
connect( mActionZoomOut, SIGNAL( triggered() ), this, SLOT( zoomOut() ) );

mActionSelect = new QAction( getThemeIcon( "mActionSelect.png" ), tr( "Select Features" ), this );
mActionSelect = new QAction( getThemeIcon( "mActionSelect.png" ), tr( "Select Features" ) , this );
shortcuts->registerAction( mActionSelect );
mActionSelect->setStatusTip( tr( "Select Features" ) );
connect( mActionSelect, SIGNAL( triggered() ), this, SLOT( select() ) );
Expand Down Expand Up @@ -1460,17 +1460,22 @@ void QgisApp::createMenus()
mViewMenu->addAction( mActionZoomIn );
mViewMenu->addAction( mActionZoomOut );
mActionViewSeparator1 = mViewMenu->addSeparator();
mViewMenu->addAction( mActionSelect );
mViewMenu->addAction( mActionSelectRectangle );
mViewMenu->addAction( mActionSelectPolygon );
mViewMenu->addAction( mActionSelectFreehand );
mViewMenu->addAction( mActionSelectRadius );
mViewMenu->addAction( mActionDeselectAll );
mActionViewSeparator2 = mViewMenu->addSeparator();

QMenu *menu = mViewMenu->addMenu( tr( "Select" ) );
menu->addAction( mActionSelect );
menu->addAction( mActionSelectRectangle );
menu->addAction( mActionSelectPolygon );
menu->addAction( mActionSelectFreehand );
menu->addAction( mActionSelectRadius );
menu->addAction( mActionDeselectAll );

mViewMenu->addAction( mActionIdentify );
mViewMenu->addAction( mActionMeasure );
mViewMenu->addAction( mActionMeasureArea );
mViewMenu->addAction( mActionMeasureAngle );

menu = mViewMenu->addMenu( tr( "Measure" ) );
menu->addAction( mActionMeasure );
menu->addAction( mActionMeasureArea );
menu->addAction( mActionMeasureAngle );

mActionViewSeparator3 = mViewMenu->addSeparator();

mViewMenu->addAction( mActionZoomFullExtent );
Expand Down Expand Up @@ -1697,32 +1702,43 @@ void QgisApp::createToolBars()
mMapNavToolBar->addAction( mActionDraw );
mToolbarMenu->addAction( mMapNavToolBar->toggleViewAction() );

//
// Feature Select Toolbar
mFeatureSelectToolBar = addToolBar( tr( "Select Tools" ) );
mFeatureSelectToolBar->setIconSize( myIconSize );
mFeatureSelectToolBar->setObjectName( "Select Tools" );
mFeatureSelectToolBar->addAction( mActionIdentify );
mFeatureSelectToolBar->addAction( mActionSelect );
mFeatureSelectToolBar->addAction( mActionSelectRectangle );
mFeatureSelectToolBar->addAction( mActionSelectPolygon );
mFeatureSelectToolBar->addAction( mActionSelectFreehand );
mFeatureSelectToolBar->addAction( mActionSelectRadius );
mFeatureSelectToolBar->addAction( mActionDeselectAll );

//
// Attributes Toolbar
mAttributesToolBar = addToolBar( tr( "Attributes" ) );
mAttributesToolBar->setIconSize( myIconSize );
mAttributesToolBar->setObjectName( "Attributes" );
mAttributesToolBar->addAction( mActionIdentify );

QToolButton *bt = new QToolButton( mAttributesToolBar );
QMenu *menu = new QMenu( bt );
bt->setMenu( menu );
bt->setPopupMode( QToolButton::InstantPopup );
menu->addAction( mActionSelect );
menu->addAction( mActionSelectRectangle );
menu->addAction( mActionSelectPolygon );
menu->addAction( mActionSelectFreehand );
menu->addAction( mActionSelectRadius );
bt->setDefaultAction( mActionSelect );
mAttributesToolBar->addWidget( bt );

mAttributesToolBar->addAction( mActionDeselectAll );
mAttributesToolBar->addAction( mActionOpenTable );
mAttributesToolBar->addAction( mActionMeasure );
mAttributesToolBar->addAction( mActionMeasureArea );
mAttributesToolBar->addAction( mActionMeasureAngle );

bt = new QToolButton( mAttributesToolBar );
menu = new QMenu( bt );
bt->setMenu( menu );
bt->setPopupMode( QToolButton::InstantPopup );
menu->addAction( mActionMeasure );
menu->addAction( mActionMeasureArea );
menu->addAction( mActionMeasureAngle );
bt->setDefaultAction( mActionMeasure );
mAttributesToolBar->addWidget( bt );

mAttributesToolBar->addAction( mActionMapTips );
mAttributesToolBar->addAction( mActionShowBookmarks );
mAttributesToolBar->addAction( mActionNewBookmark );
mAttributesToolBar->addAction( mActionLabeling );

// Annotation tools
QToolButton *annotationToolButton = new QToolButton();
annotationToolButton->setPopupMode( QToolButton::InstantPopup );
Expand Down
1 change: 0 additions & 1 deletion src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ class QgisApp : public QMainWindow
QToolBar *mDigitizeToolBar;
QToolBar *mAdvancedDigitizeToolBar;
QToolBar *mAttributesToolBar;
QToolBar *mFeatureSelectToolBar;
QToolBar *mPluginToolBar;
QToolBar *mHelpToolBar;

Expand Down

0 comments on commit 6211960

Please sign in to comment.