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