def on_feed_title_eventbox_button_press_event(self, widget, event): #FIXME: make it using special gtk2.10 widget if event.button == 1: # left click uri = self.entry.feed_uri if uri is not None: helpers.launch_browser_mailer('url', uri) return True
def on_open_menuitem_activate(self, menu, data): filepath = data["filepath"] original_filename = data["original_filename"] url = data["url"] if original_filename.startswith('location_'): helpers.launch_browser_mailer('url', url) return helpers.launch_file_manager(filepath)
def open_in_browser(self, widget): post = self.juick_post_comment_re.search(self.juick_post) url = None if post is not None: url = 'http://juick.com/%s#%s' % (post.group(1), post.group(2)) else: post = self.juick_post_re.search(self.juick_post) if post is not None: url = 'http://juick.com/%s' % post.group(1) if url is not None: helpers.launch_browser_mailer('url', url)
def on_open_link_in_browser_menuitem_activate(self, menu, data): url = data["url"] if data["encrypted"]: dialogs.ErrorDialog( _('Encrypted file'), _('You cannot open encrypted files in your ' 'browser directly. Try "Open Downloaded File ' 'in Browser" instead.'), transient_for=app.app.get_active_window()) else: helpers.launch_browser_mailer('url', url)
def hyperlink_handler(self, texttag, widget, event, iter_, kind): if event.type == Gdk.EventType.BUTTON_PRESS: begin_iter = iter_.copy() # we get the begining of the tag while not begin_iter.begins_tag(texttag): begin_iter.backward_char() end_iter = iter_.copy() # we get the end of the tag while not end_iter.ends_tag(texttag): end_iter.forward_char() # Detect XHTML-IM link word = getattr(texttag, 'href', None) if word: if word.startswith('xmpp'): kind = 'xmpp' elif word.startswith('mailto:'): kind = 'mail' elif app.interface.sth_at_sth_dot_sth_re.match(word): # it's a JID or mail kind = 'sth_at_sth' else: word = self.textview.get_buffer().get_text( begin_iter, end_iter) if event.button == 3: # right click self.make_link_menu(event, kind, word) return True else: # we launch the correct application if kind == 'xmpp': word = word[5:] if '?' in word: (jid, action) = word.split('?') if action == 'join': self.on_join_group_chat_menuitem_activate( None, jid) else: self.on_start_chat_activate(None, jid) else: self.on_start_chat_activate(None, word) else: helpers.launch_browser_mailer(kind, word)
def on_faq(self, action, param): helpers.launch_browser_mailer( 'url', 'https://dev.gajim.org/gajim/gajim/wikis/help/gajimfaq')
def on_contents(self, action, param): helpers.launch_browser_mailer( 'url', 'https://dev.gajim.org/gajim/gajim/wikis')
def show_shortcuts_webpage(self, parent=None): helpers.launch_browser_mailer( 'url', 'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts')
def on_open_link_activate(self, widget, kind, text): helpers.launch_browser_mailer(kind, text)