Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove useless action from script editor
  • Loading branch information
ghtmtt authored and nyalldawson committed Mar 31, 2018
1 parent 61c3b48 commit deaeaa6
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions python/plugins/processing/script/ScriptEditorDialog.py
Expand Up @@ -72,8 +72,6 @@ def __init__(self, filePath=None, parent=None):
QgsApplication.getThemeIcon('/mActionFileSave.svg'))
self.actionSaveScriptAs.setIcon(
QgsApplication.getThemeIcon('/mActionFileSaveAs.svg'))
self.actionLoadFromTemplate.setIcon(
QgsApplication.getThemeIcon('/mActionOpenFromTemplate.svg'))
self.actionRunScript.setIcon(
QgsApplication.getThemeIcon('/mActionStart.svg'))
self.actionCut.setIcon(
Expand All @@ -97,7 +95,6 @@ def __init__(self, filePath=None, parent=None):
self.actionOpenScript.triggered.connect(self.openScript)
self.actionSaveScript.triggered.connect(self.save)
self.actionSaveScriptAs.triggered.connect(self.saveAs)
self.actionLoadFromTemplate.triggered.connect(self.loadFrom)
self.actionRunScript.triggered.connect(self.runAlgorithm)
self.actionCut.triggered.connect(self.editor.cut)
self.actionCopy.triggered.connect(self.editor.copy)
Expand Down Expand Up @@ -169,22 +166,6 @@ def save(self):
def saveAs(self):
self.saveScript(True)

def loadFrom(self):
if self.hasChanged:
ret = QMessageBox.warning(self,
self.tr("Load Script From Template"),
self.tr("There are unsaved changes in the script. Continue?"),
QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if ret == QMessageBox.No:
return

templatePath = os.path.join(
pluginPath, 'script', 'ScriptTemplate.py')

with codecs.open(templatePath, 'r', encoding='utf-8') as f:
templateTxt = f.read()
self.editor.setText(templateTxt)

def saveScript(self, saveAs):
newPath = None
if self.filePath is None or saveAs:
Expand Down

0 comments on commit deaeaa6

Please sign in to comment.