Skip to content

Commit

Permalink
gdaltools batch operations: only update progress when there are input…
Browse files Browse the repository at this point in the history
… files to process
  • Loading branch information
etiennesky committed Jan 28, 2014
1 parent 921510d commit 2dabba4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/plugins/GdalTools/tools/widgetBatchBase.py
Expand Up @@ -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 )
Expand Down

0 comments on commit 2dabba4

Please sign in to comment.