Skip to content

Commit

Permalink
Merge pull request #2808 from m-kuhn/proclogtitle
Browse files Browse the repository at this point in the history
[processing] always translate debug messages tab title (fix #14287)
  • Loading branch information
alexbruy committed Feb 18, 2016
2 parents d8a5e0f + bcd3d92 commit f36214c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion python/plugins/processing/core/ProcessingLog.py
Expand Up @@ -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

Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/GetScriptsAndModels.py
Expand Up @@ -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)

Expand Down

0 comments on commit f36214c

Please sign in to comment.