opening the browser
This commit is contained in:
parent
80bf6388c9
commit
a1dc9d4923
2 changed files with 14 additions and 2 deletions
|
@ -34,5 +34,5 @@ class WebViewCreator(QtGui.QWidget):
|
||||||
|
|
||||||
|
|
||||||
def load_finished(self, ok):
|
def load_finished(self, ok):
|
||||||
self.view.page().mainFrame().evaluateJavaScript("OS_TYPE = 'linux';")
|
self.view.page().mainFrame().evaluateJavaScript("var OS_TYPE = 'linux';")
|
||||||
self.delegate.load_finished(ok)
|
self.delegate.load_finished(ok)
|
||||||
|
|
|
@ -10,6 +10,7 @@ class Tentia:
|
||||||
self.controller = Controller()
|
self.controller = Controller()
|
||||||
self.console = Console()
|
self.console = Console()
|
||||||
|
|
||||||
|
self.setup_url_handler()
|
||||||
self.setup_windows()
|
self.setup_windows()
|
||||||
self.preferences.show()
|
self.preferences.show()
|
||||||
self.app.exec_()
|
self.app.exec_()
|
||||||
|
@ -28,11 +29,16 @@ class Tentia:
|
||||||
def resources_uri(self):
|
def resources_uri(self):
|
||||||
return "file://localhost" + os.path.abspath(os.path.join(self.resources_path(), "WebKit"))
|
return "file://localhost" + os.path.abspath(os.path.join(self.resources_path(), "WebKit"))
|
||||||
|
|
||||||
|
|
||||||
def login_with_entity(self, entity):
|
def login_with_entity(self, entity):
|
||||||
self.controller.setStringForKey(entity, "entity")
|
self.controller.setStringForKey(entity, "entity")
|
||||||
self.oauth_implementation = Windows.Oauth(self)
|
self.oauth_implementation = Windows.Oauth(self)
|
||||||
|
|
||||||
|
def setup_url_handler(self):
|
||||||
|
QtGui.QDesktopServices.setUrlHandler("tentia://", self.reciveURI)
|
||||||
|
|
||||||
|
def reciveURI(uri):
|
||||||
|
print uri
|
||||||
|
|
||||||
|
|
||||||
class Controller(QtCore.QObject):
|
class Controller(QtCore.QObject):
|
||||||
|
|
||||||
|
@ -65,6 +71,12 @@ class Controller(QtCore.QObject):
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@QtCore.pyqtSlot(str)
|
||||||
|
def openURL(self, url):
|
||||||
|
print url
|
||||||
|
print QtCore.QUrl(url)
|
||||||
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl(url));
|
||||||
|
|
||||||
|
|
||||||
class Console(QtCore.QObject):
|
class Console(QtCore.QObject):
|
||||||
|
|
||||||
|
|
Reference in a new issue