Skip to content

Commit

Permalink
Uses Qt functions to determine output file name and path correctly (a…
Browse files Browse the repository at this point in the history
…ll? ftools output files should now be loaded with correct layer name). Fixes #2498.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Mar 9, 2010
1 parent bdca828 commit b8855d6
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 210 deletions.
12 changes: 1 addition & 11 deletions python/plugins/fTools/tools/doDefineProj.py
Expand Up @@ -109,14 +109,4 @@ def outProjFile(self):
self.txtProjection.clear()
self.txtProjection.insert(projString)
else:
return

#Gets map layer by layername in canvas
#Return: QgsMapLayer
def getMapLayerByName(self,myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
return layer
return
3 changes: 2 additions & 1 deletion python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -175,7 +175,8 @@ def runFinishedFromThread( self, success ):
if success:
addToTOC = QMessageBox.question( self, self.tr("Geometry"), self.tr( "Created output shapefile:\n%1\n\nWould you like to add the new layer to the TOC?" ).arg( unicode( self.shapefileName ) ), QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
if addToTOC == QMessageBox.Yes:
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))
else:
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Error writing output shapefile." ) )

Expand Down
3 changes: 2 additions & 1 deletion python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -212,7 +212,8 @@ def runFinishedFromThread( self, results ):
out_text = ""
addToTOC = QMessageBox.question( self, self.tr("Geoprocessing"), self.tr( "Created output shapefile:\n%1\n\n%2%3" ).arg( unicode( self.shapefileName ) ).arg( out_text ).arg( end_text ), QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
if addToTOC == QMessageBox.Yes:
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))

def runStatusFromThread( self, status ):
self.progressBar.setValue( status )
Expand Down

0 comments on commit b8855d6

Please sign in to comment.