mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Move tr out of AlgorithmProvider to subclasses
This commit is contained in:
parent
9a97a87b4d
commit
3739c3aa51
@ -27,6 +27,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
@ -146,3 +147,8 @@ class GdalAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def supportedOutputRasterLayerExtensions(self):
|
||||
return GdalUtils.getSupportedRasterExtensions()
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
context = 'GdalAlgorithmProvider'
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
@ -27,6 +27,7 @@ __copyright__ = '(C) 2014, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
@ -119,3 +120,8 @@ class Grass7AlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def canBeActivated(self):
|
||||
return not bool(Grass7Utils.checkGrass7IsInstalled())
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
context = 'Grass7AlgorithmProvider'
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
@ -28,6 +28,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.core import QgsApplication
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -128,3 +129,8 @@ class RAlgorithmProvider(AlgorithmProvider):
|
||||
ProcessingLog.LOG_ERROR,
|
||||
self.tr('Could not load R script: {0}\n{1}').format(descriptionFile, str(e)))
|
||||
return
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
context = 'RAlgorithmProvider'
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
@ -28,6 +28,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from processing.core.AlgorithmProvider import AlgorithmProvider
|
||||
from processing.core.ProcessingConfig import ProcessingConfig, Setting
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
@ -123,3 +124,8 @@ class SagaAlgorithmProvider(AlgorithmProvider):
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
context = 'SagaAlgorithmProvider'
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
@ -25,7 +25,6 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.core import (QgsProcessingProvider)
|
||||
from processing.core.ProcessingConfig import Setting, ProcessingConfig
|
||||
|
||||
@ -72,8 +71,3 @@ class AlgorithmProvider(QgsProcessingProvider):
|
||||
"""
|
||||
name = 'ACTIVATE_' + self.id().upper().replace(' ', '_')
|
||||
ProcessingConfig.removeSetting(name)
|
||||
|
||||
def tr(self, string, context=''):
|
||||
if context == '':
|
||||
context = self.__class__.__name__
|
||||
return QCoreApplication.translate(context, string)
|
||||
|
Loading…
x
Reference in New Issue
Block a user