Skip to content
Permalink
Browse files
added clear history button
fixed buf in outputs (missing open variable)
fixed bug when using table-like params dialog

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@176 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed May 9, 2012
1 parent 45f5618 commit 16708cd54f6990257e6cec27235d0f58b351e53f
@@ -81,6 +81,11 @@ def getRecentAlgorithms():
return SextanteLog.recentAlgs


@staticmethod
def clearLog():
os.unlink(SextanteLog.logFilename())
SextanteLog.startLogging()



class LogEntry():
@@ -1,14 +1,13 @@
v.surf.bspline
v.surf.bspline
Vector (v.*)
ParameterVector|input|input|-1|False
ParameterVector|sparse|sparse|-1|False
ParameterVector|input|input|0|False
ParameterNumber|sie|sie|None|None|4
ParameterNumber|sin|sin|None|None|4
ParameterNumber|layer|layer|None|None|1
ParameterSelection|method|method|bilinear;bicubic
ParameterNumber|lambda_i|lambda_i|None|None|1
ParameterNumber|lambda_i|lambda_i|None|None|0.01
ParameterTableField|column|column|input
ParameterBoolean|-c|-c|True
ParameterBoolean|-e|-e|True
OutputVector|output|output
ParameterBoolean|-c|-c|False
ParameterBoolean|-e|-e|False
OutputRaster|raster|raster
@@ -32,12 +32,16 @@ def setupUi(self):
self.text.setReadOnly(True)
self.closeButton = QtGui.QPushButton()
self.closeButton.setText("Close")
self.clearButton = QtGui.QPushButton()
self.clearButton.setText("Clear history")
self.horizontalLayout= QtGui.QHBoxLayout()
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.addStretch(1000)
self.horizontalLayout.addWidget(self.clearButton)
self.horizontalLayout.addWidget(self.closeButton)
QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), self.closeWindow)
QObject.connect(self.clearButton, QtCore.SIGNAL("clicked()"), self.clearLog)
self.verticalLayout.addLayout(self.horizontalLayout)
self.setWindowTitle("History")
self.setLayout(self.verticalLayout)
@@ -47,8 +51,12 @@ def setupUi(self):
def closeWindow(self):
self.close()

def clearLog(self):
SextanteLog.clearLog()
self.fillTree()

def fillTree(self):
self.tree.clear()
elements = SextanteLog.getLogEntries()
for category in elements.keys():
groupItem = QtGui.QTreeWidgetItem()
@@ -95,7 +95,8 @@ def setParamValues(self):
if output.hidden:
continue
output.value = self.paramTable.valueItems[output.name].getValue()
output.open = self.paramTable.checkBoxes[output.name].isChecked()
if not SextanteConfig.getSetting(SextanteConfig.TABLE_LIKE_PARAM_PANEL):
output.open = self.paramTable.checkBoxes[output.name].isChecked()

return True

@@ -2,17 +2,17 @@

class Output(object):

def __init__(self, name="", description=""):
def __init__(self, name="", description="", hidden=False):
self.name = name
self.description = description
self.value = None
# a hidden output will not be shown to the user, who will not be able to select where to store it
# Use this to generate outputs that are modified version of inputs (like a selection in a vector layer)
# In the case of layers, hidden outputs are not loaded into QGIS after the algorithm is executed.
# Other outputs not representing layers or tables should always be hidden.
self.hidden = False
self.hidden = hidden
#this value indicates whether the output has to be opened after being produced by the algorithm or not
self.open = False
self.open = True

def __str__(self):
return self.name + " <" + self.__module__.split(".")[-1] +">"
@@ -2,12 +2,6 @@

class OutputRaster(Output):

def __init__(self, name="", description="", hidden=False):
self.name = name
self.description = description
self.value = None
self.hidden = hidden

def getFileFilter(self, alg):
exts = alg.provider.getSupportedOutputRasterLayerExtensions()
for i in range(len(exts)):
@@ -2,12 +2,6 @@

class OutputVector(Output):

def __init__(self, name="", description="", hidden=False):
self.name = name
self.description = description
self.value = None
self.hidden = hidden

def getFileFilter(self,alg):
exts = alg.provider.getSupportedOutputVectorLayerExtensions()
for i in range(len(exts)):
@@ -69,18 +69,19 @@ def createConsoleOutput():
RUtils.consoleResults = []
RUtils.allConsoleResults = []
add = False
lines = open(RUtils.getConsoleOutputFilename())
for line in lines:
line = line.strip("\n").strip(" ")
if line.startswith(">"):
line = line[1:].strip(" ")
if line in RUtils.verboseCommands:
add = True
else:
add = False
elif add:
RUtils.consoleResults.append("<p>" + line + "</p>\n");
RUtils.allConsoleResults.append(line);
if os.path.exists(RUtils.getConsoleOutputFilename()):
lines = open(RUtils.getConsoleOutputFilename())
for line in lines:
line = line.strip("\n").strip(" ")
if line.startswith(">"):
line = line[1:].strip(" ")
if line in RUtils.verboseCommands:
add = True
else:
add = False
elif add:
RUtils.consoleResults.append("<p>" + line + "</p>\n");
RUtils.allConsoleResults.append(line);


@staticmethod

0 comments on commit 16708cd

Please sign in to comment.