Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Followup d3981b8:
now it works properly with pylupdate4
  • Loading branch information
slarosa committed Jan 17, 2013
1 parent d3981b8 commit 73b3d9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions python/console/console_output.py
Expand Up @@ -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)
8 changes: 5 additions & 3 deletions python/console/console_sci.py
Expand Up @@ -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:
Expand Down

0 comments on commit 73b3d9c

Please sign in to comment.