Skip to content
Permalink
Browse files

[processing] Fix some message box titles

  • Loading branch information
nyalldawson committed Feb 21, 2018
1 parent f8c3f39 commit 277e06ec28588bb5645c2b14173763a1504d0405
@@ -42,7 +42,7 @@
class AddModelFromFileAction(ToolboxAction):

def __init__(self):
self.name = self.tr('Add model from file')
self.name = self.tr('Add Model From File…')
self.group = self.tr('Tools')

def getIcon(self):
@@ -38,7 +38,7 @@
class CreateNewModelAction(ToolboxAction):

def __init__(self):
self.name = self.tr('Create new model')
self.name = self.tr('Create New Model…')
self.group = self.tr('Tools')

def getIcon(self):
@@ -34,15 +34,15 @@
class DeleteModelAction(ContextAction):

def __init__(self):
self.name = self.tr('Delete model', 'DeleteModelAction')
self.name = self.tr('Delete Model…', 'DeleteModelAction')

def isEnabled(self):
return isinstance(self.itemData, QgsProcessingModelAlgorithm)

def execute(self):
reply = QMessageBox.question(
None,
self.tr('Confirmation', 'DeleteModelAction'),
self.tr('Delete Model', 'DeleteModelAction'),
self.tr('Are you sure you want to delete this model?', 'DeleteModelAction'),
QMessageBox.Yes | QMessageBox.No,
QMessageBox.No)
@@ -33,7 +33,7 @@
class EditModelAction(ContextAction):

def __init__(self):
self.name = self.tr('Edit model', 'EditModelAction')
self.name = self.tr('Edit Model…', 'EditModelAction')

def isEnabled(self):
return isinstance(self.itemData, QgsProcessingModelAlgorithm)
@@ -35,14 +35,14 @@
class DeletePreconfiguredAlgorithmAction(ContextAction):

def __init__(self):
self.name = self.tr('Delete preconfigured algorithm', 'DeletePreconfiguredAlgorithmAction')
self.name = self.tr('Delete Preconfigured Algorithm…', 'DeletePreconfiguredAlgorithmAction')

def isEnabled(self):
return isinstance(self.itemData, PreconfiguredAlgorithm)

def execute(self):
reply = QMessageBox.question(None,
self.tr('Confirmation', 'DeletePreconfiguredAlgorithmAction'),
self.tr('Delete Algorithm', 'DeletePreconfiguredAlgorithmAction'),
self.tr('Are you sure you want to delete this algorithm?',
'DeletePreconfiguredAlgorithmAction'),
QMessageBox.Yes | QMessageBox.No,
@@ -27,15 +27,14 @@
__revision__ = '$Format:%H$'

from processing.gui.ContextAction import ContextAction
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.preconfigured.PreconfiguredAlgorithmDialog import PreconfiguredAlgorithmDialog
from processing.preconfigured.PreconfiguredAlgorithm import PreconfiguredAlgorithm


class NewPreconfiguredAlgorithmAction(ContextAction):

def __init__(self):
self.name = self.tr('Create preconfigured algorithm', 'NewPreconfiguredAlgorithmAction')
self.name = self.tr('Create Preconfigured Algorithm…', 'NewPreconfiguredAlgorithmAction')

def isEnabled(self):
return (isinstance(self.itemData, GeoAlgorithm) and
@@ -40,7 +40,7 @@
class AddScriptFromFileAction(ToolboxAction):

def __init__(self):
self.name = self.tr("Add script from file")
self.name = self.tr("Add Script From File…")
self.group = self.tr("Tools")

def execute(self):
@@ -37,7 +37,7 @@
class CreateNewScriptAction(ToolboxAction):

def __init__(self):
self.name = self.tr("Create new script")
self.name = self.tr("Create New Script…")
self.group = self.tr("Tools")

def execute(self):
@@ -39,14 +39,14 @@
class DeleteScriptAction(ContextAction):

def __init__(self):
self.name = self.tr("Delete script")
self.name = self.tr("Delete Script…")

def isEnabled(self):
return isinstance(self.itemData, QgsProcessingAlgorithm) and self.itemData.provider().id() == "script"

def execute(self):
reply = QMessageBox.question(None,
self.tr("Confirmation"),
self.tr("Delete Script"),
self.tr("Are you sure you want to delete this script?"),
QMessageBox.Yes | QMessageBox.No,
QMessageBox.No)
@@ -56,7 +56,7 @@ def execute(self):
os.remove(filePath)
QgsApplication.processingRegistry().providerById("script").refreshAlgorithms()
else:
QgsMessageBox.warning(None,
self.tr("File not found"),
self.tr("Can not find corresponding script file.")
)
QMessageBox.warning(None,
self.tr("Delete Script"),
self.tr("Can not find corresponding script file.")
)
@@ -29,6 +29,7 @@

from qgis.core import QgsProcessingAlgorithm
from qgis.utils import iface
from qgis.PyQt.QtWidgets import QMessageBox

from processing.gui.ContextAction import ContextAction

@@ -39,7 +40,7 @@
class EditScriptAction(ContextAction):

def __init__(self):
self.name = self.tr("Edit script")
self.name = self.tr("Edit Script…")

def isEnabled(self):
return isinstance(self.itemData, QgsProcessingAlgorithm) and self.itemData.provider().id() == "script"
@@ -50,7 +51,7 @@ def execute(self):
dlg = ScriptEditorDialog(filePath, iface.mainWindow())
dlg.show()
else:
QgsMessageBox.warning(None,
self.tr("File not found"),
self.tr("Can not find corresponding script file.")
)
QMessageBox.warning(None,
self.tr("Edit Script"),
self.tr("Can not find corresponding script file.")
)

0 comments on commit 277e06e

Please sign in to comment.
You can’t perform that action at this time.