Example #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
Example #2
0
def _info(type, value, tb):
	if not _exception_in_progress.acquire(False):
		# Exceptions have piled up, so we use the default exception
		# handler for such exceptions
		_excepthook_save(type, value, tb)
		return

	dialog = dialogs.HigDialog(None, gtk.MESSAGE_WARNING, gtk.BUTTONS_NONE, 
				_('A programming error has been detected'),
				_('It probably is not fatal, but should be reported '
				'to the developers nonetheless.'))
	
	#FIXME: add icon to this button
	RESPONSE_REPORT_BUG = 42
	dialog.add_buttons(gtk.STOCK_CLOSE, gtk.BUTTONS_CLOSE,
		_('_Report Bug'), RESPONSE_REPORT_BUG)
	dialog.set_default_response(RESPONSE_REPORT_BUG)
	report_button = dialog.action_area.get_children()[0] # right to left
	report_button.grab_focus()

	# Details
	textview = gtk.TextView()
	textview.set_editable(False)
	textview.modify_font(pango.FontDescription('Monospace'))
	sw = gtk.ScrolledWindow()
	sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
	sw.add(textview)
	frame = gtk.Frame()
	frame.set_shadow_type(gtk.SHADOW_IN)
	frame.add(sw)
	frame.set_border_width(6)
	textbuffer = textview.get_buffer()
	trace = StringIO()
	traceback.print_exception(type, value, tb, None, trace)
	textbuffer.set_text(trace.getvalue())
	textview.set_size_request(
		gtk.gdk.screen_width() / 3,
		gtk.gdk.screen_height() / 4)
	expander = gtk.Expander(_('Details'))
	expander.add(frame)
	dialog.vbox.add(expander)

	dialog.set_resizable(True)
	# on expand the details the dialog remains centered on screen
	dialog.set_position(gtk.WIN_POS_CENTER_ALWAYS)

	dialog.show_all()

	close_clicked = False
	while not close_clicked:
		resp = dialog.run()
		if resp == RESPONSE_REPORT_BUG:
			url = 'http://trac.gajim.org/wiki/WikiStart#howto_report_ticket'
			helpers.launch_browser_mailer('url', url)
		else:
			close_clicked = True
	
	dialog.destroy()

	_exception_in_progress.release()
Example #3
0
	def on_feed_title_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 html_hyperlink_handler(self, texttag, widget, event, iter_, kind, href):
		if event.type == gtk.gdk.BUTTON_PRESS:
			if event.button == 3: # right click
				self.make_link_menu(event, kind, href)
				return True
			else:
				# we launch the correct application
				helpers.launch_browser_mailer(kind, href)
Example #5
0
 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)
Example #6
0
 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)
Example #7
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=self.chat_control.parent_win.window)
     else:
         helpers.launch_browser_mailer('url', url)
Example #8
0
 def open_in_browser(self, widget):
     post = self.pointim_post_comment_re.search(self.pointim_post)
     url = None
     if post is not None:
         url = 'https://point.im/%s#%s' % (post.group(1), post.group(2))
     else:
         post = self.pointim_post_re.search(self.pointim_post)
         if post is not None:
             url = 'https://point.im/%s' % post.group(1)
     if url is not None:
         helpers.launch_browser_mailer('url', url)
Example #9
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=self.chat_control.parent_win.window)
     else:
         helpers.launch_browser_mailer('url', url)
Example #10
0
	def hyperlink_handler(self, texttag, widget, event, iter, kind):
		if event.type == gtk.gdk.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()
			word = self.get_buffer().get_text(begin_iter, end_iter).decode('utf-8')
			if event.button == 3: # right click
				self.make_link_menu(event, kind, word)
			else:
				# we launch the correct application
				helpers.launch_browser_mailer(kind, word)
Example #11
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 gajim.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)
Example #12
0
    def hyperlink_handler(self, texttag, widget, event, iter_, kind):
        if event.type == gtk.gdk.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 gajim.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).decode('utf-8')

            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_open_link_activate(self, widget, kind, text):
		helpers.launch_browser_mailer(kind, text)
Example #14
0
def show_shortcuts_webpage(self, parent=None):
    helpers.launch_browser_mailer(
        'url',
        'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts')
Example #15
0
 def on_open_link_activate(self, widget, kind, text):
     helpers.launch_browser_mailer(kind, text)
Example #16
0
	def on_dialog_response(dialog, response):
		if response == RESPONSE_REPORT_BUG:
			url = 'http://trac.gajim.org/wiki/HowToCreateATicket'
			helpers.launch_browser_mailer('url', url)
		else:
			dialog.destroy()
Example #17
0
 def on_button_press_event(self, eb, event, url):
     if event.button == 1:  # left click
         # Open URL in browser
         helpers.launch_browser_mailer('url', url)
Example #18
0
 def on_button_press_event(self, eb, event, url):
     # left click
     if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
         helpers.launch_browser_mailer('url', url)
Example #19
0
 def on_button_press_event(self, eb, event, url):
     # left click
     if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
         helpers.launch_browser_mailer('url', url)
	def visit_url_from_menuitem(self, widget, link):
		'''basically it filters out the widget instance'''
		helpers.launch_browser_mailer('url', link)