linux opens external links in browser now
This commit is contained in:
parent
80728df815
commit
5b2157d881
2 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@ from PyQt4.QtWebKit import QWebView
|
|||
class WebPage(QtWebKit.QWebPage):
|
||||
def __init__(self, parent=0, app=None):
|
||||
super(QtWebKit.QWebPage, self).__init__(parent)
|
||||
self.setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateExternalLinks)
|
||||
self.app = app
|
||||
|
||||
def javaScriptConsoleMessage(self, message, lineNumber, sourceId):
|
||||
|
@ -26,6 +27,7 @@ class WebViewCreator(QtWebKit.QWebView):
|
|||
|
||||
self.app = app
|
||||
self.is_local = local
|
||||
self.connect(self, SIGNAL("linkClicked (const QUrl&)"), self.app.controller.openQURL)
|
||||
self.setPage(WebPage(self, self.app))
|
||||
|
||||
def load_local(self, callback=None):
|
||||
|
|
|
@ -86,9 +86,16 @@ class Controller(QtCore.QObject):
|
|||
return ""
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def openURL(self, url):
|
||||
def openAuthorizationURL(self, url):
|
||||
self.app.oauth_implementation.handle_authentication(str(url))
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def openURL(self, url):
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode))
|
||||
|
||||
def openQURL(self, url):
|
||||
QtGui.QDesktopServices.openUrl(url)
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def loggedIn(self):
|
||||
self.app.authentification_succeded()
|
||||
|
|
Reference in a new issue