Skip to content
Permalink
Browse files

[processing] remove not needed trAction method

  • Loading branch information
alexbruy committed Feb 5, 2018
1 parent 862b113 commit aee3b44909544fa7b9a5de36e25d3546a5917284
@@ -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)
@@ -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)
@@ -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")
@@ -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")
@@ -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 @@
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 @@


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 @@ 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")
@@ -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(),

0 comments on commit aee3b44

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