Skip to content
Permalink
Browse files
Followup d3981b8:
now it works properly with pylupdate4
  • Loading branch information
slarosa committed Jan 17, 2013
1 parent d3981b8 commit 73b3d9cc8c77d66a58e112cce7819e514d8799aa
Showing with 10 additions and 7 deletions.
  1. +5 −4 python/console/console_output.py
  2. +5 −3 python/console/console_sci.py
@@ -277,11 +277,12 @@ def pastebin(self):
link = i.replace('<a href="',"").strip()
if link:
QApplication.clipboard().setText(link)
self.parent.callWidgetMessageBar('URL copied to clipboard.')
msgText = QCoreApplication.translate('PythonConsole', 'URL copied to clipboard.')
self.parent.callWidgetMessageBar(msgText)
except urllib2.URLError, e:
self.parent.callWidgetMessageBar('Connection error: ' + str(e.args))
msgText = QCoreApplication.translate('PythonConsole', 'Connection error: ')
self.parent.callWidgetMessageBar(msgText + str(e.args))

def widgetMessageBar(self, iface, text):
timeout = iface.messageTimeout()
msg = QCoreApplication.translate('PythonConsole', text)
self.infoBar.pushMessage(msg, QgsMessageBar.INFO, timeout)
self.infoBar.pushMessage(text, QgsMessageBar.INFO, timeout)
@@ -502,18 +502,20 @@ def runCommand(self, cmd):
if cmd in ('_save', '_clear', '_clearAll', '_pyqgis', '_api'):
if cmd == '_save':
self.writeHistoryFile()
self.parent.callWidgetMessageBar('History saved successfully.')
msgText = QCoreApplication.translate('PythonConsole', 'History saved successfully.')
elif cmd == '_clear':
self.clearHistoryFile()
self.parent.callWidgetMessageBar('History cleared successfully.')
msgText = QCoreApplication.translate('PythonConsole', 'History cleared successfully.')
elif cmd == '_clearAll':
self.history = QStringList()
self.clearHistoryFile()
self.parent.callWidgetMessageBar('Session and file history cleared successfully.')
msgText = QCoreApplication.translate('PythonConsole', 'Session and file history cleared successfully.')
elif cmd == '_pyqgis':
webbrowser.open( "http://www.qgis.org/pyqgis-cookbook/" )
elif cmd == '_api':
webbrowser.open( "http://www.qgis.org/api/" )
if msgText:
self.parent.callWidgetMessageBar(msgText)

self.displayPrompt(False)
else:

0 comments on commit 73b3d9c

Please sign in to comment.