Skip to content
Permalink
Browse files

Merge pull request #2808 from m-kuhn/proclogtitle

[processing] always translate debug messages tab title (fix #14287)
  • Loading branch information
alexbruy committed Feb 18, 2016
2 parents d8a5e0f + bcd3d92 commit f36214c56759d5716ab92e0d0cb24ce7256a5bae
@@ -83,7 +83,7 @@ def addToLog(msgtype, msg):
msgtypes = {ProcessingLog.LOG_ERROR: QgsMessageLog.CRITICAL,
ProcessingLog.LOG_INFO: QgsMessageLog.INFO,
ProcessingLog.LOG_WARNING: QgsMessageLog.WARNING, }
QgsMessageLog.logMessage(msg, "Processing", msgtypes[msgtype])
QgsMessageLog.logMessage(msg, ProcessingLog.tr("Processing"), msgtypes[msgtype])
except:
pass

@@ -137,6 +137,12 @@ def saveLog(fileName):
for entry in v:
f.write('%s|%s|%s\n' % (k, entry.date, entry.text))

@staticmethod
def tr(string, context=''):
if context == '':
context = 'ProcessingLog'
return QCoreApplication.translate(context, string)


class LogEntry:

@@ -152,7 +152,7 @@ def popupError(self, error=None, url=None):
widget = iface.messageBar().createMessage(self.tr('Connection problem', disambiguation),
self.tr('Could not connect to scripts/models repository', disambiguation))
if error and url:
QgsMessageLog.logMessage(self.tr(u"Network error code: {} on URL: {}").format(error, url), u"Processing", QgsMessageLog.CRITICAL)
QgsMessageLog.logMessage(self.tr(u"Network error code: {} on URL: {}").format(error, url), self.tr(u"Processing"), QgsMessageLog.CRITICAL)
button = QPushButton(QCoreApplication.translate("Python", "View message log"), pressed=show_message_log)
widget.layout().addWidget(button)

0 comments on commit f36214c

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