[QGIS Commit] r14555 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Nov 12 08:01:32 EST 2010


Author: jef
Date: 2010-11-12 05:01:32 -0800 (Fri, 12 Nov 2010)
New Revision: 14555

Modified:
   trunk/qgis/src/app/qgisapp.cpp
Log:
save last used selection tool

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-11-12 12:19:00 UTC (rev 14554)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-11-12 13:01:32 UTC (rev 14555)
@@ -1713,7 +1713,31 @@
   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 @@
     whatsNew +=  "<li>" + tr( "Experimental WFS-T support. Additionally ported wfs to network manager." ) + "</li>";
     whatsNew +=  "<li>" + tr( "Georeferencer has had many tidy ups and improvements." ) + "</li>";
     whatsNew +=  "<li>" + tr( "Support for long int in attribute dialog and editor." ) + "</li>";
-    whatsNew +=  "<li>" + 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." ) + " <a href=\"http://linfiniti.com/2010/08/qgis-mapserver-a-wms-server-for-the-masses/\">" + tr("Read More." ) + "</a></li>";
+    whatsNew +=  "<li>" + 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." ) + " <a href=\"http://linfiniti.com/2010/08/qgis-mapserver-a-wms-server-for-the-masses/\">" + tr( "Read More." ) + "</a></li>";
     whatsNew +=  "<li>" + tr( "Select and measure toolbar flyouts and submenus." ) + "</li>";
     whatsNew +=  "<li>" + 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." ) + "</li>";
     whatsNew +=  "<li>" + tr( "Added search string support for feature ids ($id) and various other search related improvements." ) + "</li>";
@@ -6964,5 +6988,17 @@
   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 );
 }



More information about the QGIS-commit mailing list