Skip to content

Commit

Permalink
[processing] remove not needed trAction method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Feb 5, 2018
1 parent 862b113 commit aee3b44
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -180,7 +180,7 @@ def addProviderActions(self, provider):
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)
Expand Down
5 changes: 0 additions & 5 deletions python/plugins/processing/gui/ToolboxAction.py
Expand Up @@ -42,8 +42,3 @@ def tr(self, string, context=''):
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)
4 changes: 2 additions & 2 deletions python/plugins/processing/modeler/AddModelFromFileAction.py
Expand Up @@ -42,8 +42,8 @@
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")
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/modeler/CreateNewModelAction.py
Expand Up @@ -38,8 +38,8 @@
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")
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/script/AddScriptFromFileAction.py
Expand Up @@ -44,8 +44,8 @@
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")
Expand Down
7 changes: 4 additions & 3 deletions python/plugins/processing/script/CreateNewScriptAction.py
Expand Up @@ -37,9 +37,10 @@


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")
Expand Down
Expand Up @@ -75,8 +75,8 @@ def unload(self):
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")
Expand Down
Expand Up @@ -50,7 +50,7 @@ def __init__(self):
super().__init__()
self.algs = []
self.folder_algorithms = []
self.actions = [CreateNewScriptAction('Create new script'),
self.actions = [CreateNewScriptAction(),
AddScriptFromFileAction(),
CreateScriptCollectionPluginAction()]
self.contextMenuActions = [EditScriptAction(),
Expand Down

0 comments on commit aee3b44

Please sign in to comment.