Skip to content

Commit

Permalink
Fix processing model help saving and make script help content saving …
Browse files Browse the repository at this point in the history
…consistent with models behavior
  • Loading branch information
arnaud-morvan committed May 21, 2015
1 parent 87f2370 commit c19a4a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
15 changes: 0 additions & 15 deletions python/plugins/processing/gui/HelpEditionDialog.py
Expand Up @@ -80,21 +80,6 @@ def reject(self):

def accept(self):
self.descriptions[self.currentName] = unicode(self.text.toPlainText())
if isinstance(self.alg, ModelerAlgorithm):
self.alg.helpContent = self.descriptions
else:
if self.alg.descriptionFile is not None:
try:
with open(self.alg.descriptionFile + '.help', 'w') as f:
json.dump(self.descriptions, f)
except Exception, e:
QMessageBox.warning(self, self.tr('Error saving help file'),
self.tr('Help file could not be saved.\n'
'Check that you have permission to modify the help\n'
'file. You might not have permission if you are \n'
'editing an example model or script, since they \n'
'are stored on the installation folder'))

QDialog.accept(self)

def getHtml(self):
Expand Down
6 changes: 2 additions & 4 deletions python/plugins/processing/gui/ScriptEditorDialog.py
Expand Up @@ -168,11 +168,9 @@ def editHelp(self):

dlg = HelpEditionDialog(alg)
dlg.exec_()

# We store the description string in case there were not saved
# because there was no filename defined yet
if self.alg is None and dlg.descriptions:
if dlg.descriptions:
self.help = dlg.descriptions
self.setHasChanged(True)

def openScript(self):
if self.hasChanged:
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -226,6 +226,7 @@ def editHelp(self):
dlg = HelpEditionDialog(alg)
dlg.exec_()
if dlg.descriptions:
self.alg.helpContent = dlg.descriptions
self.hasChanged = True

def runModel(self):
Expand Down

0 comments on commit c19a4a7

Please sign in to comment.