Skip to content

Commit 73b3d9c

Browse files
committedJan 17, 2013
Followup d3981b8:
now it works properly with pylupdate4
1 parent d3981b8 commit 73b3d9c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed
 

‎python/console/console_output.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,12 @@ def pastebin(self):
277277
link = i.replace('<a href="',"").strip()
278278
if link:
279279
QApplication.clipboard().setText(link)
280-
self.parent.callWidgetMessageBar('URL copied to clipboard.')
280+
msgText = QCoreApplication.translate('PythonConsole', 'URL copied to clipboard.')
281+
self.parent.callWidgetMessageBar(msgText)
281282
except urllib2.URLError, e:
282-
self.parent.callWidgetMessageBar('Connection error: ' + str(e.args))
283+
msgText = QCoreApplication.translate('PythonConsole', 'Connection error: ')
284+
self.parent.callWidgetMessageBar(msgText + str(e.args))
283285

284286
def widgetMessageBar(self, iface, text):
285287
timeout = iface.messageTimeout()
286-
msg = QCoreApplication.translate('PythonConsole', text)
287-
self.infoBar.pushMessage(msg, QgsMessageBar.INFO, timeout)
288+
self.infoBar.pushMessage(text, QgsMessageBar.INFO, timeout)

‎python/console/console_sci.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,18 +502,20 @@ def runCommand(self, cmd):
502502
if cmd in ('_save', '_clear', '_clearAll', '_pyqgis', '_api'):
503503
if cmd == '_save':
504504
self.writeHistoryFile()
505-
self.parent.callWidgetMessageBar('History saved successfully.')
505+
msgText = QCoreApplication.translate('PythonConsole', 'History saved successfully.')
506506
elif cmd == '_clear':
507507
self.clearHistoryFile()
508-
self.parent.callWidgetMessageBar('History cleared successfully.')
508+
msgText = QCoreApplication.translate('PythonConsole', 'History cleared successfully.')
509509
elif cmd == '_clearAll':
510510
self.history = QStringList()
511511
self.clearHistoryFile()
512-
self.parent.callWidgetMessageBar('Session and file history cleared successfully.')
512+
msgText = QCoreApplication.translate('PythonConsole', 'Session and file history cleared successfully.')
513513
elif cmd == '_pyqgis':
514514
webbrowser.open( "http://www.qgis.org/pyqgis-cookbook/" )
515515
elif cmd == '_api':
516516
webbrowser.open( "http://www.qgis.org/api/" )
517+
if msgText:
518+
self.parent.callWidgetMessageBar(msgText)
517519

518520
self.displayPrompt(False)
519521
else:

0 commit comments

Comments
 (0)
Please sign in to comment.