Skip to content
Permalink
Browse files

Uses Qt functions to determine output file name and path correctly (a…

…ll? ftools output files should now be loaded with correct layer name). Fixes #2498.

git-svn-id: http://svn.osgeo.org/qgis/trunk@13034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Mar 9, 2010
1 parent 1f0d1af commit fae4a08a8c15a166800cf4eb04616442d2879d9c
@@ -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
@@ -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." ) )

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

0 comments on commit fae4a08

Please sign in to comment.
You can’t perform that action at this time.