Skip to content

Commit

Permalink
[processing] fixed bug when editing help of example models
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Sep 2, 2013
1 parent e44c57c commit 91b9c11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 14 additions & 6 deletions python/plugins/processing/gui/HelpEditionDialog.py
Expand Up @@ -27,7 +27,7 @@
import pickle
from PyQt4.QtCore import *
from PyQt4.QtGui import *

from qgis.core import *
from processing.ui.ui_DlgHelpEdition import Ui_DlgHelpEdition

class HelpEditionDialog(QDialog, Ui_DlgHelpEdition):
Expand All @@ -38,8 +38,9 @@ class HelpEditionDialog(QDialog, Ui_DlgHelpEdition):

def __init__(self, alg):
QDialog.__init__(self)
self.setupUi(self)


self.setupUi(self)

self.alg = alg
self.descriptions = {}
if self.alg.descriptionFile is not None:
Expand All @@ -62,9 +63,16 @@ def reject(self):
def accept(self):
self.descriptions[self.currentName] = unicode(self.text.toPlainText())
if self.alg.descriptionFile is not None:
f = open(self.alg.descriptionFile + ".help", "wb")
pickle.dump(self.descriptions, f)
f.close()
try:
f = open(self.alg.descriptionFile + ".help", "wb")
pickle.dump(self.descriptions, f)
f.close()
except Exception, e:
QMessageBox.warning(self, "Error saving help file",
"Help file could not be saved."
"\nCheck that you have permission to modify the help file.\n"
"You might not have permission if you are editing an example\n"
"model or script, since they are stored on the installation folder")
QDialog.accept(self)

def getHtml(self):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -36,7 +36,6 @@
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.gui.AlgorithmClassification import AlgorithmDecorator
#from processing.gui.ProcessingToolbox import ProcessingToolbox
from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog
from processing.modeler.ModelerAlgorithm import ModelerAlgorithm
from processing.modeler.ModelerParametersDialog import ModelerParametersDialog
Expand Down

0 comments on commit 91b9c11

Please sign in to comment.