Skip to content

Commit b8855d6

Browse files
author
cfarmer
committed
Uses Qt functions to determine output file name and path correctly (all? 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
1 parent bdca828 commit b8855d6

File tree

4 files changed

+204
-210
lines changed

4 files changed

+204
-210
lines changed

python/plugins/fTools/tools/doDefineProj.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,4 @@ def outProjFile(self):
109109
self.txtProjection.clear()
110110
self.txtProjection.insert(projString)
111111
else:
112-
return
113-
114-
#Gets map layer by layername in canvas
115-
#Return: QgsMapLayer
116-
def getMapLayerByName(self,myName):
117-
mc = self.iface.mapCanvas()
118-
nLayers = mc.layerCount()
119-
for l in range(nLayers):
120-
layer = mc.layer(l)
121-
if layer.name() == unicode(myName):
122-
return layer
112+
return

python/plugins/fTools/tools/doGeometry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def runFinishedFromThread( self, success ):
175175
if success:
176176
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 )
177177
if addToTOC == QMessageBox.Yes:
178-
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
178+
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
179+
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))
179180
else:
180181
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Error writing output shapefile." ) )
181182

python/plugins/fTools/tools/doGeoprocessing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def runFinishedFromThread( self, results ):
212212
out_text = ""
213213
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 )
214214
if addToTOC == QMessageBox.Yes:
215-
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
215+
if not ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) ):
216+
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Error loading output shapefile:\n%1" ).arg( unicode( self.shapefileName ) ))
216217

217218
def runStatusFromThread( self, status ):
218219
self.progressBar.setValue( status )

0 commit comments

Comments
 (0)