Skip to content

Commit

Permalink
remove the clipping rectangle closing clipper, to fix #3664
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15562 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Mar 22, 2011
1 parent 44fc315 commit 96d2ec5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
18 changes: 8 additions & 10 deletions python/plugins/GdalTools/tools/dialogBase.py
Expand Up @@ -66,6 +66,14 @@ def __init__(self, parent, iface, pluginBase, pluginName, pluginCommand):
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):
Expand Down Expand Up @@ -129,16 +137,6 @@ def stop(self):

# 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)

Expand Down
9 changes: 7 additions & 2 deletions python/plugins/GdalTools/tools/extentSelector.py
Expand Up @@ -32,16 +32,21 @@ def setCanvas(self, canvas):
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)
Expand Down

0 comments on commit 96d2ec5

Please sign in to comment.