コード例 #1
0
 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
コード例 #2
0
 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)
コード例 #3
0
ファイル: plugin.py プロジェクト: dreamsxin/gajim-plugins
 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)
コード例 #4
0
 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)
コード例 #5
0
    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)
コード例 #6
0
ファイル: app_actions.py プロジェクト: Hoeze/gajim
 def on_faq(self, action, param):
     helpers.launch_browser_mailer(
         'url', 'https://dev.gajim.org/gajim/gajim/wikis/help/gajimfaq')
コード例 #7
0
ファイル: app_actions.py プロジェクト: Hoeze/gajim
 def on_contents(self, action, param):
     helpers.launch_browser_mailer(
         'url', 'https://dev.gajim.org/gajim/gajim/wikis')
コード例 #8
0
ファイル: shortcuts_window.py プロジェクト: mdellweg/gajim
def show_shortcuts_webpage(self, parent=None):
    helpers.launch_browser_mailer(
        'url',
        'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts')
コード例 #9
0
 def on_open_link_activate(self, widget, kind, text):
     helpers.launch_browser_mailer(kind, text)