mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[processing] remove not needed trAction method
This commit is contained in:
parent
862b1139fa
commit
aee3b44909
@ -180,7 +180,7 @@ class ProcessingToolbox(QgsDockWidget, WIDGET):
|
||||
menu = QMenu(provider.name(), self)
|
||||
for action in actions:
|
||||
action.setData(self)
|
||||
act = QAction(action.i18n_name, menu)
|
||||
act = QAction(action.name, menu)
|
||||
act.triggered.connect(action.execute)
|
||||
menu.addAction(act)
|
||||
toolbarButton.setMenu(menu)
|
||||
|
@ -42,8 +42,3 @@ class ToolboxAction:
|
||||
if context == '':
|
||||
context = self.__class__.__name__
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
||||
def trAction(self, string, context=''):
|
||||
if context == '':
|
||||
context = self.__class__.__name__
|
||||
return string, QCoreApplication.translate(context, string)
|
||||
|
@ -42,8 +42,8 @@ pluginPath = os.path.split(os.path.dirname(__file__))[0]
|
||||
class AddModelFromFileAction(ToolboxAction):
|
||||
|
||||
def __init__(self):
|
||||
self.name, self.i18n_name = self.trAction('Add model from file')
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
self.name = self.tr('Add model from file')
|
||||
self.group = self.tr('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
@ -38,8 +38,8 @@ pluginPath = os.path.split(os.path.dirname(__file__))[0]
|
||||
class CreateNewModelAction(ToolboxAction):
|
||||
|
||||
def __init__(self):
|
||||
self.name, self.i18n_name = self.trAction('Create new model')
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
self.name = self.tr('Create new model')
|
||||
self.group = self.tr('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QgsApplication.getThemeIcon("/processingModel.svg")
|
||||
|
@ -805,7 +805,7 @@ class TreeActionItem(QTreeWidgetItem):
|
||||
def __init__(self, action):
|
||||
QTreeWidgetItem.__init__(self)
|
||||
self.action = action
|
||||
self.setText(0, action.i18n_name)
|
||||
self.setText(0, action.name)
|
||||
self.setIcon(0, action.getIcon())
|
||||
self.setData(0, ModelerDialog.NAME_ROLE, action.name)
|
||||
|
||||
|
@ -44,8 +44,8 @@ pluginPath = os.path.split(os.path.dirname(__file__))[0]
|
||||
class AddScriptFromFileAction(ToolboxAction):
|
||||
|
||||
def __init__(self):
|
||||
self.name, self.i18n_name = self.trAction('Add script from file')
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
self.name = self.tr('Add script from file')
|
||||
self.group = self.tr('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
@ -37,9 +37,10 @@ pluginPath = os.path.split(os.path.dirname(__file__))[0]
|
||||
|
||||
|
||||
class CreateNewScriptAction(ToolboxAction):
|
||||
def __init__(self, actionName):
|
||||
self.name, self.i18n_name = self.trAction(actionName)
|
||||
self.group, self.i18n_group = self.trAction('Tools')
|
||||
|
||||
def __init__(self):
|
||||
self.name = self.tr('Create new script')
|
||||
self.group = self.tr('Tools')
|
||||
|
||||
def getIcon(self):
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
@ -75,8 +75,8 @@ class ProcessingScriptCollectionPlugin:
|
||||
class CreateScriptCollectionPluginAction(ToolboxAction):
|
||||
|
||||
def __init__(self):
|
||||
self.name, self.i18n_name = self.trAction("Create script collection plugin")
|
||||
self.group, self.i18n_group = self.trAction("Tools")
|
||||
self.name = self.tr("Create script collection plugin")
|
||||
self.group = self.tr("Tools")
|
||||
|
||||
def getIcon(self):
|
||||
return QgsApplication.getThemeIcon("/processingScript.svg")
|
||||
|
@ -50,7 +50,7 @@ class ScriptAlgorithmProvider(QgsProcessingProvider):
|
||||
super().__init__()
|
||||
self.algs = []
|
||||
self.folder_algorithms = []
|
||||
self.actions = [CreateNewScriptAction('Create new script'),
|
||||
self.actions = [CreateNewScriptAction(),
|
||||
AddScriptFromFileAction(),
|
||||
CreateScriptCollectionPluginAction()]
|
||||
self.contextMenuActions = [EditScriptAction(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user