def set_title(self, title): """ Go upwards to the main window's tab widget and set this tab's title """ if title is None: title = "[NO TITLE]" mainwin().tab_widget.setTabText(mainwin().tab_widget.indexOf(self), title[:40])
def set_title(self, title): """ Go upwards to the main window's tab widget and set this tab's title """ if title is None: title = "[NO TITLE]" mainwin().tab_widget.setTabText( mainwin().tab_widget.indexOf(self), title[:40])
def notify(text): """ Pushes a notification to the main window's notifier label Blueish, big fonts, transparent, in the center of the window; always transient """ if not text: return label = mainwin().tooltip label.push_text(text) label.adjustSize() label.move(mainwin().width() // 2 - label.width() // 2, mainwin().height() // 2 - label.height() // 2) label.show()
def on_link_click(qurl): """ Callback for connection. Reads the 'paste' attribute to know if a middle click requested to open on a new tab. BRW01 BRW12 VID01 CB03 """ # required for 'open in new tab if not in this instance' qurl = do_redirect(qurl) # BRW12 # 'play' and 'save' should only happen from inside the webkit and # if the user started the action; handle here, not in 'navigate' if 'play' in self.attr: print("PLAYING") GLOBAL_VID_PLAY.play(qurl) # VID01 self.attr.clear('play') return if 'save' in self.attr: clipboard(qurl) # CB02 self.attr.clear('save') return instance = extract_instance(qurl.toString()) target_prefix = get_options()['sites'][instance]['prefix'] # if the prefixes don't match, we're requesting a new instance # TAB04 TAB05 if 'paste' in self.attr or self.attr.prefix != target_prefix: mainwin().add_tab(qurl, scripting=('open_scripted' in self.attr)) self.attr.clear('paste') else: self.navigate(qurl) # BRW01 if 'open_scripted' in self.attr: self.attr.clear('open_scripted')