Skip to content

Commit

Permalink
gdaltools: move clipper dialog on top when the user ends to define a …
Browse files Browse the repository at this point in the history
…new extent (fix #7783)
  • Loading branch information
brushtyler committed May 19, 2013
1 parent 5ce6688 commit 693a1fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion python/plugins/GdalTools/tools/doClipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, iface):
self.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFileEdit)
self.connect(self.outSelector, SIGNAL("selectClicked()"), self.fillOutputFileEdit)
self.connect(self.maskSelector, SIGNAL("selectClicked()"), self.fillMaskFileEdit)
self.connect(self.extentSelector, SIGNAL("newExtentDefined()"), self.checkRun)
self.connect(self.extentSelector, SIGNAL("newExtentDefined()"), self.extentChanged)
self.connect(self.extentSelector, SIGNAL("selectionStarted()"), self.checkRun)

self.connect(self.extentModeRadio, SIGNAL("toggled(bool)"), self.switchClippingMode)
Expand Down Expand Up @@ -91,6 +91,11 @@ def checkRun(self):
enabler = not self.maskSelector.filename().isEmpty()
self.base.enableRun( enabler )

def extentChanged(self):
self.activateWindow()
self.raise_()
self.checkRun()

def onLayersChanged(self):
self.inSelector.setLayers( Utils.LayerRegistry.instance().getRasterLayers() )
self.maskSelector.setLayers( filter( lambda x: x.geometryType() == QGis.Polygon, Utils.LayerRegistry.instance().getVectorLayers() ) )
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/GdalTools/tools/extentSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ def canvasPressEvent(self, e):

def canvasReleaseEvent(self, e):
self.isEmittingPoint = False
if self.rectangle() != None:
self.emit( SIGNAL("rectangleCreated()") )
#if self.rectangle() != None:
# self.emit( SIGNAL("rectangleCreated()") )
self.emit( SIGNAL("rectangleCreated()") )

def canvasMoveEvent(self, e):
if not self.isEmittingPoint:
Expand Down

0 comments on commit 693a1fe

Please sign in to comment.