Skip to content
Permalink
Browse files

gdaltools batch operations: only update progress when there are input…

… files to process
  • Loading branch information
etiennesky committed Jan 28, 2014
1 parent 921510d commit 2dabba45306904c71b93bfc4a1e66fd65228df95
Showing with 7 additions and 6 deletions.
  1. +7 −6 python/plugins/GdalTools/tools/widgetBatchBase.py
@@ -74,17 +74,18 @@ def onRun( self ):
self.batchRun()

def batchRun(self):
self.base.enableRun( False )
self.base.setCursor( Qt.WaitCursor )

inDir = self.getInputFileName()
self.inFiles = Utils.getRasterFiles( self.getInputFileName(), self.isRecursiveScanEnabled() )
if len(self.inFiles) == 0:
QMessageBox.warning( self, self.tr( "Warning" ), self.tr( "No input files to process." ) )
return

self.inFiles = Utils.getRasterFiles( inDir, self.isRecursiveScanEnabled() )
self.outFiles = []

for f in self.inFiles:
self.outFiles.append( self.getBatchOutputFileName( f ) )

self.base.enableRun( False )
self.base.setCursor( Qt.WaitCursor )

self.errors = []
self.batchIndex = 0
self.batchTotal = len( self.inFiles )

0 comments on commit 2dabba4

Please sign in to comment.