Skip to content

Commit

Permalink
[processing] fixed help in models
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Nov 23, 2014
1 parent 8039895 commit 484e162
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -165,6 +165,7 @@ def getCopy(self):
newone.name = self.name
newone.group = self.group
newone.descriptionFile = self.descriptionFile
newone.helpContent = copy.deepcopy(self.helpContent)
return newone

def __init__(self):
Expand Down Expand Up @@ -473,13 +474,14 @@ def updateModelerView(self):
self.modelerdialog.repaintModel()

def help(self):
print self.helpContent
try:
return True, getHtmlFromDescriptionsDict(self, self.help())
return True, getHtmlFromDescriptionsDict(self, self.helpContent)
except:
return False, None

def todict(self):
keys = ["inputs", "group", "name", "algs"]
keys = ["inputs", "group", "name", "algs", "helpContent"]
return {k:v for k,v in self.__dict__.iteritems() if k in keys}

def toJson(self):
Expand All @@ -493,6 +495,7 @@ def todict(o):
pass
return json.dumps(self, default=todict, indent=4)


@staticmethod
def fromJson(s):
def fromdict(d):
Expand Down
Expand Up @@ -84,6 +84,7 @@ def loadFromFolder(self, folder):
alg = ModelerAlgorithm.fromFile(fullpath)
if alg.name:
alg.provider = self
alg.descriptionFile = fullpath
self.algs.append(alg)
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -215,8 +215,10 @@ def closeEvent(self, evt):
evt.accept()

def editHelp(self):
dlg = HelpEditionDialog(self.alg.getCopy())
dlg = HelpEditionDialog(self.alg)
dlg.exec_()
if dlg.descriptions:
self.hasChanged = True

def runModel(self):
if len(self.alg.algs) == 0:
Expand Down

0 comments on commit 484e162

Please sign in to comment.