Skip to content
Permalink
Browse files
Managed the render flag in batch tools to avoid waste of time loading…
… many layers, to fix #3254

git-svn-id: http://svn.osgeo.org/qgis/trunk@14875 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Dec 9, 2010
1 parent ba1d890 commit ad407f511bc52e6cd9168d52d6162b7e25fd8d5e
Showing with 7 additions and 1 deletion.
  1. +1 −1 python/plugins/GdalTools/__init__.py
  2. +5 −0 python/plugins/GdalTools/tools/widgetBatchBase.py
  3. +1 −0 python/plugins/GdalTools/tools/widgetPluginBase.py
@@ -22,7 +22,7 @@ def name():
def description():
return "Integrate gdal tools into qgis"
def version():
return "Version 1.2.17"
return "Version 1.2.18"
def qgisMinimumVersion():
return "1.0"
def classFactory(iface):
@@ -101,6 +101,10 @@ def batchFinished( self ):
msg = QString( "Processing of the following files ended with error: <br><br>" ).append( self.errors.join( "<br><br>" ) )
QErrorMessage( self ).showMessage( msg )

# load layers managing the render flag to avoid waste of time
canvas = self.iface.mapCanvas()
previousRenderFlag = canvas.renderFlag()
canvas.setRenderFlag( False )
notCreatedList = QStringList()
for item in self.outFiles:
fileInfo = QFileInfo( item )
@@ -109,6 +113,7 @@ def batchFinished( self ):
self.addLayerIntoCanvas( fileInfo )
else:
notCreatedList << item
canvas.setRenderFlag( previousRenderFlag )

if notCreatedList.isEmpty():
QMessageBox.information( self, self.tr( "Finished" ), self.tr( "Operation completed." ) )
@@ -10,6 +10,7 @@
class GdalToolsBasePluginWidget:

def __init__(self, iface, commandName, helpFileBaseName = None, parent = None):
self.iface = iface
self.base = BaseDialog(parent, iface, self, self.windowTitle(), commandName)
self.connect(self.base, SIGNAL("processError(QProcess::ProcessError)"), self.onError)
self.connect(self.base, SIGNAL("processFinished(int, QProcess::ExitStatus)"), self.onFinished)

0 comments on commit ad407f5

Please sign in to comment.