Skip to content

Commit aee3b44

Browse files
committed
[processing] remove not needed trAction method
1 parent 862b113 commit aee3b44

9 files changed

+15
-19
lines changed

python/plugins/processing/gui/ProcessingToolbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def addProviderActions(self, provider):
180180
menu = QMenu(provider.name(), self)
181181
for action in actions:
182182
action.setData(self)
183-
act = QAction(action.i18n_name, menu)
183+
act = QAction(action.name, menu)
184184
act.triggered.connect(action.execute)
185185
menu.addAction(act)
186186
toolbarButton.setMenu(menu)

python/plugins/processing/gui/ToolboxAction.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,3 @@ def tr(self, string, context=''):
4242
if context == '':
4343
context = self.__class__.__name__
4444
return QCoreApplication.translate(context, string)
45-
46-
def trAction(self, string, context=''):
47-
if context == '':
48-
context = self.__class__.__name__
49-
return string, QCoreApplication.translate(context, string)

python/plugins/processing/modeler/AddModelFromFileAction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
class AddModelFromFileAction(ToolboxAction):
4343

4444
def __init__(self):
45-
self.name, self.i18n_name = self.trAction('Add model from file')
46-
self.group, self.i18n_group = self.trAction('Tools')
45+
self.name = self.tr('Add model from file')
46+
self.group = self.tr('Tools')
4747

4848
def getIcon(self):
4949
return QgsApplication.getThemeIcon("/processingModel.svg")

python/plugins/processing/modeler/CreateNewModelAction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
class CreateNewModelAction(ToolboxAction):
3939

4040
def __init__(self):
41-
self.name, self.i18n_name = self.trAction('Create new model')
42-
self.group, self.i18n_group = self.trAction('Tools')
41+
self.name = self.tr('Create new model')
42+
self.group = self.tr('Tools')
4343

4444
def getIcon(self):
4545
return QgsApplication.getThemeIcon("/processingModel.svg")

python/plugins/processing/modeler/ModelerDialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ class TreeActionItem(QTreeWidgetItem):
805805
def __init__(self, action):
806806
QTreeWidgetItem.__init__(self)
807807
self.action = action
808-
self.setText(0, action.i18n_name)
808+
self.setText(0, action.name)
809809
self.setIcon(0, action.getIcon())
810810
self.setData(0, ModelerDialog.NAME_ROLE, action.name)
811811

python/plugins/processing/script/AddScriptFromFileAction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
class AddScriptFromFileAction(ToolboxAction):
4545

4646
def __init__(self):
47-
self.name, self.i18n_name = self.trAction('Add script from file')
48-
self.group, self.i18n_group = self.trAction('Tools')
47+
self.name = self.tr('Add script from file')
48+
self.group = self.tr('Tools')
4949

5050
def getIcon(self):
5151
return QgsApplication.getThemeIcon("/processingScript.svg")

python/plugins/processing/script/CreateNewScriptAction.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737

3838

3939
class CreateNewScriptAction(ToolboxAction):
40-
def __init__(self, actionName):
41-
self.name, self.i18n_name = self.trAction(actionName)
42-
self.group, self.i18n_group = self.trAction('Tools')
40+
41+
def __init__(self):
42+
self.name = self.tr('Create new script')
43+
self.group = self.tr('Tools')
4344

4445
def getIcon(self):
4546
return QgsApplication.getThemeIcon("/processingScript.svg")

python/plugins/processing/script/CreateScriptCollectionPluginAction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def unload(self):
7575
class CreateScriptCollectionPluginAction(ToolboxAction):
7676

7777
def __init__(self):
78-
self.name, self.i18n_name = self.trAction("Create script collection plugin")
79-
self.group, self.i18n_group = self.trAction("Tools")
78+
self.name = self.tr("Create script collection plugin")
79+
self.group = self.tr("Tools")
8080

8181
def getIcon(self):
8282
return QgsApplication.getThemeIcon("/processingScript.svg")

python/plugins/processing/script/ScriptAlgorithmProvider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self):
5050
super().__init__()
5151
self.algs = []
5252
self.folder_algorithms = []
53-
self.actions = [CreateNewScriptAction('Create new script'),
53+
self.actions = [CreateNewScriptAction(),
5454
AddScriptFromFileAction(),
5555
CreateScriptCollectionPluginAction()]
5656
self.contextMenuActions = [EditScriptAction(),

0 commit comments

Comments
 (0)