[QGIS Commit] r15562 - trunk/qgis/python/plugins/GdalTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Mar 22 12:45:30 EDT 2011


Author: brushtyler
Date: 2011-03-22 09:45:30 -0700 (Tue, 22 Mar 2011)
New Revision: 15562

Modified:
   trunk/qgis/python/plugins/GdalTools/tools/dialogBase.py
   trunk/qgis/python/plugins/GdalTools/tools/extentSelector.py
Log:
remove the clipping rectangle closing clipper, to fix #3664


Modified: trunk/qgis/python/plugins/GdalTools/tools/dialogBase.py
===================================================================
--- trunk/qgis/python/plugins/GdalTools/tools/dialogBase.py	2011-03-22 15:39:10 UTC (rev 15561)
+++ trunk/qgis/python/plugins/GdalTools/tools/dialogBase.py	2011-03-22 16:45:30 UTC (rev 15562)
@@ -66,6 +66,14 @@
       self.arguments = QStringList()
 
   def reject(self):
+      if self.process.state() != QProcess.NotRunning:
+        ret = QMessageBox.warning(self, self.tr( "Warning" ), self.tr( "The command is still running. \nDo you want terminate it anyway?" ), QMessageBox.Yes | QMessageBox.No)
+        if ret == QMessageBox.No:
+          return
+
+        self.disconnect(self.process, SIGNAL("error(QProcess::ProcessError)"), self.processError)
+        self.disconnect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished)
+
       self.emit( SIGNAL("closeClicked()") )
 
   def accept(self):
@@ -129,16 +137,6 @@
 
   # called on closing the dialog, stop the process if it's running
   def onClosing(self):
-      if self.process.state() != QProcess.NotRunning:
-        ret = QMessageBox.warning(self, self.tr( "Warning" ), self.tr( "The command is still running. \nDo you want terminate it anyway?" ), QMessageBox.Yes | QMessageBox.No)
-        if ret == QMessageBox.No:
-          return
-
-        self.disconnect(self.process, SIGNAL("error(QProcess::ProcessError)"), self.processError)
-        self.disconnect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished)
-        #self.process.kill()
-        #print "Debug: " + self.command + " terminated by user"
-
       self.stop()
       QDialog.reject(self)
 

Modified: trunk/qgis/python/plugins/GdalTools/tools/extentSelector.py
===================================================================
--- trunk/qgis/python/plugins/GdalTools/tools/extentSelector.py	2011-03-22 15:39:10 UTC (rev 15561)
+++ trunk/qgis/python/plugins/GdalTools/tools/extentSelector.py	2011-03-22 16:45:30 UTC (rev 15562)
@@ -32,16 +32,21 @@
       self.connect(self.tool, SIGNAL("deactivated()"), self.pause)
 
   def stop(self):
+      if not self.isStarted:
+        return
       self.isStarted = False
       self.btnEnable.setVisible(False)
       self.tool.reset()
       self.canvas.unsetMapTool(self.tool)
-      self.canvas.setMapTool(self.previousMapTool)
+      if self.previousMapTool != self.tool:
+        self.canvas.setMapTool(self.previousMapTool)
       #self.coordsChanged()
       self.emit( SIGNAL( "selectionStopped()" ) )
 
   def start(self):
-      self.previousMapTool = self.canvas.mapTool()
+      prevMapTool = self.canvas.mapTool()
+      if prevMapTool != self.tool:
+      	self.previousMapTool = prevMapTool
       self.canvas.setMapTool(self.tool)
       self.isStarted = True
       self.btnEnable.setVisible(False)



More information about the QGIS-commit mailing list