Skip to content

Commit a6de659

Browse files
author
brushtyler
committed
remove the clipping rectangle closing clipper, to fix #3664
git-svn-id: http://svn.osgeo.org/qgis/trunk@15562 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 855601c commit a6de659

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

python/plugins/GdalTools/tools/dialogBase.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ def __init__(self, parent, iface, pluginBase, pluginName, pluginCommand):
6666
self.arguments = QStringList()
6767

6868
def reject(self):
69+
if self.process.state() != QProcess.NotRunning:
70+
ret = QMessageBox.warning(self, self.tr( "Warning" ), self.tr( "The command is still running. \nDo you want terminate it anyway?" ), QMessageBox.Yes | QMessageBox.No)
71+
if ret == QMessageBox.No:
72+
return
73+
74+
self.disconnect(self.process, SIGNAL("error(QProcess::ProcessError)"), self.processError)
75+
self.disconnect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished)
76+
6977
self.emit( SIGNAL("closeClicked()") )
7078

7179
def accept(self):
@@ -129,16 +137,6 @@ def stop(self):
129137

130138
# called on closing the dialog, stop the process if it's running
131139
def onClosing(self):
132-
if self.process.state() != QProcess.NotRunning:
133-
ret = QMessageBox.warning(self, self.tr( "Warning" ), self.tr( "The command is still running. \nDo you want terminate it anyway?" ), QMessageBox.Yes | QMessageBox.No)
134-
if ret == QMessageBox.No:
135-
return
136-
137-
self.disconnect(self.process, SIGNAL("error(QProcess::ProcessError)"), self.processError)
138-
self.disconnect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished)
139-
#self.process.kill()
140-
#print "Debug: " + self.command + " terminated by user"
141-
142140
self.stop()
143141
QDialog.reject(self)
144142

python/plugins/GdalTools/tools/extentSelector.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,21 @@ def setCanvas(self, canvas):
3232
self.connect(self.tool, SIGNAL("deactivated()"), self.pause)
3333

3434
def stop(self):
35+
if not self.isStarted:
36+
return
3537
self.isStarted = False
3638
self.btnEnable.setVisible(False)
3739
self.tool.reset()
3840
self.canvas.unsetMapTool(self.tool)
39-
self.canvas.setMapTool(self.previousMapTool)
41+
if self.previousMapTool != self.tool:
42+
self.canvas.setMapTool(self.previousMapTool)
4043
#self.coordsChanged()
4144
self.emit( SIGNAL( "selectionStopped()" ) )
4245

4346
def start(self):
44-
self.previousMapTool = self.canvas.mapTool()
47+
prevMapTool = self.canvas.mapTool()
48+
if prevMapTool != self.tool:
49+
self.previousMapTool = prevMapTool
4550
self.canvas.setMapTool(self.tool)
4651
self.isStarted = True
4752
self.btnEnable.setVisible(False)

0 commit comments

Comments
 (0)