def play(self): self._finished = 0 path = "%s/%s_%s_%s.html" % (self._save_dir, self._layout_id, self._region_id, self._id) self._widget.load("about:blank") if 'webpage' == str(self._type) and 'native' == str(self._render): url = self._options['uri'] self._widget.load(QUrl.fromPercentEncoding(url)) else: self._widget.load('file://' + path) self._widget.show() self._widget.raise_() self._play_timer.setInterval(int(float(self._duration) * 1000)) self._play_timer.start() self.started_signal.emit()
def __init__(self, authorize_url): """ Custom Webview widget to handle authentication of an authorisation url. authorize_url is string returned via flow_from_clientsecrets.step1_get_authorize_url object If Authorization is successful, returns an access code required for step2 of oauth flow object """ QWebView.__init__(self) self.URL = QUrl.fromPercentEncoding(str(authorize_url)) self.setUrl(self.URL) self.titleChanged.connect(self.handleTitleChange) self.load(self.URL) self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Popup)
def play(self): self.finished = 0 self.widget.show() self.widget.raise_() #---- kong ---- url = self.options['uri'] args = [ #'--kiosk', str(self.rect.left()), str(self.rect.top()), str(self.rect.width()), str(self.rect.height()), QUrl.fromPercentEncoding(url) ] #self.process.start('chromium-browser', args) self.process.start('./dist/web', args) self.stop_timer.start()
def play(self): self._finished = 0 path = "%s/%s_%s_%s.html" % ( self._save_dir, self._layout_id, self._region_id, self._id ) self._widget.load("about:blank") if 'webpage' == str(self._type) and 'native' == str(self._render): url = self._options['uri'] self._widget.load(QUrl.fromPercentEncoding(url)) else: self._widget.load('file://' + path) self._widget.show() self._widget.raise_() self._play_timer.setInterval(int(float(self._duration) * 1000)) self._play_timer.start() self.started_signal.emit()