Skip to content

Commit

Permalink
cleaned BatchProcessingDialog code
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 20, 2012
1 parent 8cb001d commit cb07ae4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions python/plugins/sextante/admintools/PostGISExecuteSQL.py
Expand Up @@ -5,7 +5,7 @@
PostGISExecuteSQL.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya, Carterix Geomatics
Copyright : (C) 2012 by Victor Olaya and Carterix Geomatics
Email : volayaf at gmail dot com
***************************************************************************
* *
Expand All @@ -31,7 +31,6 @@
from sextante.parameters.ParameterString import ParameterString
from sextante.admintools import postgis_utils
from sextante.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
import PyQt4

class PostGISExecuteSQL(GeoAlgorithm):

Expand Down
19 changes: 7 additions & 12 deletions python/plugins/sextante/gui/BatchProcessingDialog.py
Expand Up @@ -47,22 +47,19 @@
from sextante.parameters.ParameterFixedTable import ParameterFixedTable
from sextante.gui.FixedTablePanel import FixedTablePanel
from sextante.parameters.ParameterMultipleInput import ParameterMultipleInput
import copy
from sextante.gui.BatchOutputSelectionPanel import BatchOutputSelectionPanel
from sextante.gui.AlgorithmExecutor import AlgorithmExecutor
from sextante.outputs.OutputHTML import OutputHTML
from sextante.core.SextanteResults import SextanteResults
from sextante.core.SextanteLog import SextanteLog
from sextante.core.SextanteConfig import SextanteConfig
from sextante.gui.UnthreadedAlgorithmExecutor import SilentProgress,\
UnthreadedAlgorithmExecutor
from sextante.gui.UnthreadedAlgorithmExecutor import UnthreadedAlgorithmExecutor

class BatchProcessingDialog(AlgorithmExecutionDialog):
def __init__(self, alg):
self.algs = None
self.table = QtGui.QTableWidget(None)
AlgorithmExecutionDialog.__init__(self, alg, self.table)
#self.setModal(True)
AlgorithmExecutionDialog.__init__(self, alg, self.table)
self.setWindowModality(1)
self.algEx = None
self.resize(800, 500)
Expand All @@ -87,9 +84,7 @@ def __init__(self, alg):
self.setTableContent()
self.table.horizontalHeader().setStretchLastSection(True)
self.table.verticalHeader().setVisible(False)
self.table.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
#self.progress = QtGui.QProgressBar()
#self.progress.setMaximum(100)
self.table.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.addRowButton.clicked.connect(self.addRow)
self.deleteRowButton.clicked.connect(self.deleteRow)

Expand Down Expand Up @@ -137,11 +132,9 @@ def accept(self):
return
self.algs.append(alg)

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
#self.progress.setMaximum(len(self.algs))
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.table.setEnabled(False)
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
#self.progress.setValue(0)
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
self.nextAlg(0)
else:
i=1
Expand Down Expand Up @@ -209,9 +202,11 @@ def createSummaryTable(self):
outputFile = SextanteUtils.getTempFilename("html")
f = open(outputFile, "w")
for alg in self.algs:
f.write("<hr>\n")
for out in alg.outputs:
if isinstance(out, (OutputNumber,OutputString)):
f.write("<p>" + out.description + ": " + str(out.value) + "</p>\n")
f.write("<hr>\n")
f.close()
SextanteResults.addResult(self.algs[0].name + "[summary]", outputFile)

Expand Down

0 comments on commit cb07ae4

Please sign in to comment.