From 7e1a38e7d9546f293b2e6aace052cbd1e758c03a Mon Sep 17 00:00:00 2001 From: jef Date: Fri, 12 Nov 2010 13:01:32 +0000 Subject: [PATCH] save last used selection tool git-svn-id: http://svn.osgeo.org/qgis/trunk@14555 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/app/qgisapp.cpp | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 1807c5f76231..8284834c6af3 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -1713,7 +1713,31 @@ void QgisApp::createToolBars() menu->addAction( mActionSelectPolygon ); menu->addAction( mActionSelectFreehand ); menu->addAction( mActionSelectRadius ); - bt->setDefaultAction( mActionSelect ); + + QSettings settings; + switch( settings.value( "/UI/selectTool", 0 ).toInt() ) + { + default: + case 0: + bt->setDefaultAction( mActionSelect ); + break; + + case 1: + bt->setDefaultAction( mActionSelectRectangle ); + break; + + case 2: + bt->setDefaultAction( mActionSelectPolygon ); + break; + + case 3: + bt->setDefaultAction( mActionSelectFreehand ); + break; + + case 4: + bt->setDefaultAction( mActionSelectRadius ); + break; + } mAttributesToolBar->addWidget( bt ); connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) ); @@ -2528,7 +2552,7 @@ void QgisApp::about() whatsNew += "
  • " + tr( "Experimental WFS-T support. Additionally ported wfs to network manager." ) + "
  • "; whatsNew += "
  • " + tr( "Georeferencer has had many tidy ups and improvements." ) + "
  • "; whatsNew += "
  • " + tr( "Support for long int in attribute dialog and editor." ) + "
  • "; - whatsNew += "
  • " + tr( "The QGIS Mapserver project has been incorporated into the main SVN repository and packages are being made available. QGIS Mapserver allows you to serve your QGIS project files via the OGC WMS protocol." ) + " " + tr("Read More." ) + "
  • "; + whatsNew += "
  • " + tr( "The QGIS Mapserver project has been incorporated into the main SVN repository and packages are being made available. QGIS Mapserver allows you to serve your QGIS project files via the OGC WMS protocol." ) + " " + tr( "Read More." ) + "
  • "; whatsNew += "
  • " + tr( "Select and measure toolbar flyouts and submenus." ) + "
  • "; whatsNew += "
  • " + tr( "Support has been added for non-spatial tables (currently OGR, delimited text and PostgreSQL providers). These tables can be used for field lookups or just generally browsed and edited using the table view." ) + "
  • "; whatsNew += "
  • " + tr( "Added search string support for feature ids ($id) and various other search related improvements." ) + "
  • "; @@ -6964,5 +6988,17 @@ void QgisApp::toolButtonActionTriggered( QAction *action ) if( !bt ) return; + QSettings settings; + if( action == mActionSelect ) + settings.setValue( "/UI/selectTool", 0 ); + else if( action == mActionSelectRectangle ) + settings.setValue( "/UI/selectTool", 1 ); + else if( action == mActionSelectPolygon ) + settings.setValue( "/UI/selectTool", 2 ); + else if( action == mActionSelectFreehand ) + settings.setValue( "/UI/selectTool", 3 ); + else if( action == mActionSelectRadius ) + settings.setValue( "/UI/selectTool", 4 ); + bt->setDefaultAction( action ); }