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
This commit is contained in:
brushtyler 2010-12-09 00:53:56 +00:00
parent ba1d890a07
commit ad407f511b
3 changed files with 7 additions and 1 deletions

View File

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

View File

@ -101,6 +101,10 @@ class GdalToolsBaseBatchWidget(BasePluginWidget):
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 @@ class GdalToolsBaseBatchWidget(BasePluginWidget):
self.addLayerIntoCanvas( fileInfo )
else:
notCreatedList << item
canvas.setRenderFlag( previousRenderFlag )
if notCreatedList.isEmpty():
QMessageBox.information( self, self.tr( "Finished" ), self.tr( "Operation completed." ) )

View File

@ -10,6 +10,7 @@ import GdalTools_utils as Utils
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)