GObject.* -> GLib.*
This commit is contained in:
		
							parent
							
								
									8c7ee7a12b
								
							
						
					
					
						commit
						fd0ff877a3
					
				
					 22 changed files with 215 additions and 215 deletions
				
			
		| 
						 | 
					@ -25,7 +25,7 @@
 | 
				
			||||||
# FIXME: think if we need caching command list. it may be wrong if there will
 | 
					# FIXME: think if we need caching command list. it may be wrong if there will
 | 
				
			||||||
# be entities that often change the list, it may be slow to fetch it every time
 | 
					# be entities that often change the list, it may be slow to fetch it every time
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import nbxmpp
 | 
					import nbxmpp
 | 
				
			||||||
| 
						 | 
					@ -555,14 +555,14 @@ class CommandWindow:
 | 
				
			||||||
            return True     # important to keep callback be called back!
 | 
					            return True     # important to keep callback be called back!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # 12 times per second (80 miliseconds)
 | 
					        # 12 times per second (80 miliseconds)
 | 
				
			||||||
        self.pulse_id = GObject.timeout_add(80, callback)
 | 
					        self.pulse_id = GLib.timeout_add(80, callback)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def remove_pulsing(self):
 | 
					    def remove_pulsing(self):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Stop pulsing, useful when especially when removing widget
 | 
					        Stop pulsing, useful when especially when removing widget
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        if self.pulse_id:
 | 
					        if self.pulse_id:
 | 
				
			||||||
            GObject.source_remove(self.pulse_id)
 | 
					            GLib.source_remove(self.pulse_id)
 | 
				
			||||||
        self.pulse_id = None
 | 
					        self.pulse_id = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# handling xml stanzas
 | 
					# handling xml stanzas
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,7 +25,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
import gtkgui_helpers
 | 
					import gtkgui_helpers
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from common import gajim
 | 
					from common import gajim
 | 
				
			||||||
from common import helpers
 | 
					from common import helpers
 | 
				
			||||||
| 
						 | 
					@ -51,12 +51,12 @@ def rate_limit(rate):
 | 
				
			||||||
        timeout = [None]
 | 
					        timeout = [None]
 | 
				
			||||||
        def f(*args, **kwargs):
 | 
					        def f(*args, **kwargs):
 | 
				
			||||||
            if timeout[0] is not None:
 | 
					            if timeout[0] is not None:
 | 
				
			||||||
                GObject.source_remove(timeout[0])
 | 
					                GLib.source_remove(timeout[0])
 | 
				
			||||||
                timeout[0] = None
 | 
					                timeout[0] = None
 | 
				
			||||||
            def timeout_func():
 | 
					            def timeout_func():
 | 
				
			||||||
                func(*args, **kwargs)
 | 
					                func(*args, **kwargs)
 | 
				
			||||||
                timeout[0] = None
 | 
					                timeout[0] = None
 | 
				
			||||||
            timeout[0] = GObject.timeout_add(int(1000.0 / rate), timeout_func)
 | 
					            timeout[0] = GLib.timeout_add(int(1000.0 / rate), timeout_func)
 | 
				
			||||||
        return f
 | 
					        return f
 | 
				
			||||||
    return decorator
 | 
					    return decorator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ class CellRendererImage(Gtk.CellRendererPixbuf):
 | 
				
			||||||
        if model:
 | 
					        if model:
 | 
				
			||||||
            model.foreach(self.func, (image, tree))
 | 
					            model.foreach(self.func, (image, tree))
 | 
				
			||||||
        if self.redraw:
 | 
					        if self.redraw:
 | 
				
			||||||
            GObject.timeout_add(iter_.get_delay_time(),
 | 
					            GLib.timeout_add(iter_.get_delay_time(),
 | 
				
			||||||
                self.animation_timeout, tree, image)
 | 
					                self.animation_timeout, tree, image)
 | 
				
			||||||
        elif image in self.iters:
 | 
					        elif image in self.iters:
 | 
				
			||||||
            del self.iters[image]
 | 
					            del self.iters[image]
 | 
				
			||||||
| 
						 | 
					@ -95,8 +95,8 @@ class CellRendererImage(Gtk.CellRendererPixbuf):
 | 
				
			||||||
                timeval.tv_sec = GLib.get_current_time()
 | 
					                timeval.tv_sec = GLib.get_current_time()
 | 
				
			||||||
                iter_ = animation.get_iter(timeval)
 | 
					                iter_ = animation.get_iter(timeval)
 | 
				
			||||||
                self.iters[self.image] = iter_
 | 
					                self.iters[self.image] = iter_
 | 
				
			||||||
                GObject.timeout_add(iter_.get_delay_time(),
 | 
					                GLib.timeout_add(iter_.get_delay_time(), self.animation_timeout,
 | 
				
			||||||
                    self.animation_timeout, widget, self.image)
 | 
					                    widget, self.image)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            pix = self.iters[self.image].get_pixbuf()
 | 
					            pix = self.iters[self.image].get_pixbuf()
 | 
				
			||||||
        elif self.image.get_storage_type() == Gtk.ImageType.PIXBUF:
 | 
					        elif self.image.get_storage_type() == Gtk.ImageType.PIXBUF:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,7 @@ from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import gtkgui_helpers
 | 
					import gtkgui_helpers
 | 
				
			||||||
import gui_menu_builder
 | 
					import gui_menu_builder
 | 
				
			||||||
import message_control
 | 
					import message_control
 | 
				
			||||||
| 
						 | 
					@ -1286,7 +1287,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
 | 
				
			||||||
        visible_rect = textview.get_visible_rect()
 | 
					        visible_rect = textview.get_visible_rect()
 | 
				
			||||||
        # scroll only if expected end is not visible
 | 
					        # scroll only if expected end is not visible
 | 
				
			||||||
        if end_rect.y >= (visible_rect.y + visible_rect.height + diff_y):
 | 
					        if end_rect.y >= (visible_rect.y + visible_rect.height + diff_y):
 | 
				
			||||||
            self.scroll_to_end_id = GObject.idle_add(self.scroll_to_end_iter,
 | 
					            self.scroll_to_end_id = GLib.idle_add(self.scroll_to_end_iter,
 | 
				
			||||||
                    textview)
 | 
					                    textview)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def scroll_to_end_iter(self, textview):
 | 
					    def scroll_to_end_iter(self, textview):
 | 
				
			||||||
| 
						 | 
					@ -1482,7 +1483,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        # make the last message visible, when changing to "full view"
 | 
					        # make the last message visible, when changing to "full view"
 | 
				
			||||||
        if not state:
 | 
					        if not state:
 | 
				
			||||||
            GObject.idle_add(self.conv_textview.scroll_to_end_iter)
 | 
					            GLib.idle_add(self.conv_textview.scroll_to_end_iter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        widget.set_no_show_all(state)
 | 
					        widget.set_no_show_all(state)
 | 
				
			||||||
        if state:
 | 
					        if state:
 | 
				
			||||||
| 
						 | 
					@ -2048,8 +2049,8 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
        if avatar_w > scaled_buf_w or avatar_h > scaled_buf_h:
 | 
					        if avatar_w > scaled_buf_w or avatar_h > scaled_buf_h:
 | 
				
			||||||
            # wait for 0.5 sec in case we leave earlier
 | 
					            # wait for 0.5 sec in case we leave earlier
 | 
				
			||||||
            if self.show_bigger_avatar_timeout_id is not None:
 | 
					            if self.show_bigger_avatar_timeout_id is not None:
 | 
				
			||||||
                GObject.source_remove(self.show_bigger_avatar_timeout_id)
 | 
					                GLib.source_remove(self.show_bigger_avatar_timeout_id)
 | 
				
			||||||
            self.show_bigger_avatar_timeout_id = GObject.timeout_add(500,
 | 
					            self.show_bigger_avatar_timeout_id = GLib.timeout_add(500,
 | 
				
			||||||
                    self.show_bigger_avatar, widget)
 | 
					                    self.show_bigger_avatar, widget)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_avatar_eventbox_leave_notify_event(self, widget, event):
 | 
					    def on_avatar_eventbox_leave_notify_event(self, widget, event):
 | 
				
			||||||
| 
						 | 
					@ -2058,7 +2059,7 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        # did we add a timeout? if yes remove it
 | 
					        # did we add a timeout? if yes remove it
 | 
				
			||||||
        if self.show_bigger_avatar_timeout_id is not None:
 | 
					        if self.show_bigger_avatar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.show_bigger_avatar_timeout_id)
 | 
					            GLib.source_remove(self.show_bigger_avatar_timeout_id)
 | 
				
			||||||
            self.show_bigger_avatar_timeout_id = None
 | 
					            self.show_bigger_avatar_timeout_id = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_avatar_eventbox_button_press_event(self, widget, event):
 | 
					    def on_avatar_eventbox_button_press_event(self, widget, event):
 | 
				
			||||||
| 
						 | 
					@ -2100,9 +2101,9 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
            self.mouse_over_in_last_30_secs = True
 | 
					            self.mouse_over_in_last_30_secs = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _schedule_activity_timers(self):
 | 
					    def _schedule_activity_timers(self):
 | 
				
			||||||
        self.possible_paused_timeout_id = GObject.timeout_add_seconds(5,
 | 
					        self.possible_paused_timeout_id = GLib.timeout_add_seconds(5,
 | 
				
			||||||
                self.check_for_possible_paused_chatstate, None)
 | 
					                self.check_for_possible_paused_chatstate, None)
 | 
				
			||||||
        self.possible_inactive_timeout_id = GObject.timeout_add_seconds(30,
 | 
					        self.possible_inactive_timeout_id = GLib.timeout_add_seconds(30,
 | 
				
			||||||
                self.check_for_possible_inactive_chatstate, None)
 | 
					                self.check_for_possible_inactive_chatstate, None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def update_ui(self):
 | 
					    def update_ui(self):
 | 
				
			||||||
| 
						 | 
					@ -2162,7 +2163,7 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
            name = i18n.direction_mark +  _(
 | 
					            name = i18n.direction_mark +  _(
 | 
				
			||||||
                '%(nickname)s from group chat %(room_name)s') % \
 | 
					                '%(nickname)s from group chat %(room_name)s') % \
 | 
				
			||||||
                {'nickname': name, 'room_name': self.room_name}
 | 
					                {'nickname': name, 'room_name': self.room_name}
 | 
				
			||||||
        name = i18n.direction_mark + GObject.markup_escape_text(name)
 | 
					        name = i18n.direction_mark + GLib.markup_escape_text(name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # We know our contacts nick, but if another contact has the same nick
 | 
					        # We know our contacts nick, but if another contact has the same nick
 | 
				
			||||||
        # in another account we need to also display the account.
 | 
					        # in another account we need to also display the account.
 | 
				
			||||||
| 
						 | 
					@ -2179,7 +2180,7 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
                if other_contact_.get_shown_name() == \
 | 
					                if other_contact_.get_shown_name() == \
 | 
				
			||||||
                self.contact.get_shown_name():
 | 
					                self.contact.get_shown_name():
 | 
				
			||||||
                    acct_info = i18n.direction_mark + ' (%s)' % \
 | 
					                    acct_info = i18n.direction_mark + ' (%s)' % \
 | 
				
			||||||
                        GObject.markup_escape_text(self.account)
 | 
					                        GLib.markup_escape_text(self.account)
 | 
				
			||||||
                    break
 | 
					                    break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        status = contact.status
 | 
					        status = contact.status
 | 
				
			||||||
| 
						 | 
					@ -2189,7 +2190,7 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
            status_reduced = helpers.reduce_chars_newlines(status, max_lines=1)
 | 
					            status_reduced = helpers.reduce_chars_newlines(status, max_lines=1)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            status_reduced = ''
 | 
					            status_reduced = ''
 | 
				
			||||||
        status_escaped = GObject.markup_escape_text(status_reduced)
 | 
					        status_escaped = GLib.markup_escape_text(status_reduced)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        font_attrs, font_attrs_small = self.get_font_attrs()
 | 
					        font_attrs, font_attrs_small = self.get_font_attrs()
 | 
				
			||||||
        st = gajim.config.get('displayed_chat_state_notifications')
 | 
					        st = gajim.config.get('displayed_chat_state_notifications')
 | 
				
			||||||
| 
						 | 
					@ -2407,8 +2408,8 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
                chatstate_to_send = 'active'
 | 
					                chatstate_to_send = 'active'
 | 
				
			||||||
                contact.our_chatstate = 'active'
 | 
					                contact.our_chatstate = 'active'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                GObject.source_remove(self.possible_paused_timeout_id)
 | 
					                GLib.source_remove(self.possible_paused_timeout_id)
 | 
				
			||||||
                GObject.source_remove(self.possible_inactive_timeout_id)
 | 
					                GLib.source_remove(self.possible_inactive_timeout_id)
 | 
				
			||||||
                self._schedule_activity_timers()
 | 
					                self._schedule_activity_timers()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def _on_sent(msg_stanza, message, encrypted, xhtml, label, old_txt):
 | 
					        def _on_sent(msg_stanza, message, encrypted, xhtml, label, old_txt):
 | 
				
			||||||
| 
						 | 
					@ -2671,7 +2672,7 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
        name = self.contact.get_shown_name()
 | 
					        name = self.contact.get_shown_name()
 | 
				
			||||||
        if self.resource:
 | 
					        if self.resource:
 | 
				
			||||||
            name += '/' + self.resource
 | 
					            name += '/' + self.resource
 | 
				
			||||||
        label_str = GObject.markup_escape_text(name)
 | 
					        label_str = GLib.markup_escape_text(name)
 | 
				
			||||||
        if num_unread: # if unread, text in the label becomes bold
 | 
					        if num_unread: # if unread, text in the label becomes bold
 | 
				
			||||||
            label_str = '<b>' + unread + label_str + '</b>'
 | 
					            label_str = '<b>' + unread + label_str + '</b>'
 | 
				
			||||||
        return (label_str, color)
 | 
					        return (label_str, color)
 | 
				
			||||||
| 
						 | 
					@ -2809,8 +2810,8 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
            self.session.control = None
 | 
					            self.session.control = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Disconnect timer callbacks
 | 
					        # Disconnect timer callbacks
 | 
				
			||||||
        GObject.source_remove(self.possible_paused_timeout_id)
 | 
					        GLib.source_remove(self.possible_paused_timeout_id)
 | 
				
			||||||
        GObject.source_remove(self.possible_inactive_timeout_id)
 | 
					        GLib.source_remove(self.possible_inactive_timeout_id)
 | 
				
			||||||
        # Remove bigger avatar window
 | 
					        # Remove bigger avatar window
 | 
				
			||||||
        if self.bigger_avatar_window:
 | 
					        if self.bigger_avatar_window:
 | 
				
			||||||
            self.bigger_avatar_window.destroy()
 | 
					            self.bigger_avatar_window.destroy()
 | 
				
			||||||
| 
						 | 
					@ -2893,8 +2894,8 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self.send_chatstate('active', self.contact)
 | 
					                self.send_chatstate('active', self.contact)
 | 
				
			||||||
            self.reset_kbd_mouse_timeout_vars()
 | 
					            self.reset_kbd_mouse_timeout_vars()
 | 
				
			||||||
            GObject.source_remove(self.possible_paused_timeout_id)
 | 
					            GLib.source_remove(self.possible_paused_timeout_id)
 | 
				
			||||||
            GObject.source_remove(self.possible_inactive_timeout_id)
 | 
					            GLib.source_remove(self.possible_inactive_timeout_id)
 | 
				
			||||||
            self._schedule_activity_timers()
 | 
					            self._schedule_activity_timers()
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.send_chatstate('inactive', self.contact)
 | 
					            self.send_chatstate('inactive', self.contact)
 | 
				
			||||||
| 
						 | 
					@ -3479,6 +3480,6 @@ class ChatControl(ChatControlBase):
 | 
				
			||||||
                        self.info_bar.set_no_show_all(True)
 | 
					                        self.info_bar.set_no_show_all(True)
 | 
				
			||||||
                        self.info_bar.hide()
 | 
					                        self.info_bar.hide()
 | 
				
			||||||
                        # show next one?
 | 
					                        # show next one?
 | 
				
			||||||
                        GObject.idle_add(self._info_bar_show_message)
 | 
					                        GLib.idle_add(self._info_bar_show_message)
 | 
				
			||||||
                    break
 | 
					                    break
 | 
				
			||||||
                i += 1
 | 
					                i += 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@ import sys
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
import copy
 | 
					import copy
 | 
				
			||||||
from common import defs
 | 
					from common import defs
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
OPT_TYPE,
 | 
					OPT_TYPE,
 | 
				
			||||||
| 
						 | 
					@ -802,7 +802,7 @@ class Config:
 | 
				
			||||||
    def _timeout_save(self):
 | 
					    def _timeout_save(self):
 | 
				
			||||||
        if self.save_timeout_id:
 | 
					        if self.save_timeout_id:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        self.save_timeout_id = GObject.timeout_add(1000, self._really_save)
 | 
					        self.save_timeout_id = GLib.timeout_add(1000, self._really_save)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self):
 | 
					    def __init__(self):
 | 
				
			||||||
        #init default values
 | 
					        #init default values
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@ import base64
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import operator
 | 
					import operator
 | 
				
			||||||
import hashlib
 | 
					import hashlib
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from time import (altzone, daylight, gmtime, localtime, mktime, strftime,
 | 
					from time import (altzone, daylight, gmtime, localtime, mktime, strftime,
 | 
				
			||||||
        time as time_time, timezone, tzname)
 | 
					        time as time_time, timezone, tzname)
 | 
				
			||||||
| 
						 | 
					@ -560,7 +560,7 @@ class ConnectionVcard:
 | 
				
			||||||
                    self.discover_ft_proxies()
 | 
					                    self.discover_ft_proxies()
 | 
				
			||||||
                gajim.nec.push_incoming_event(RosterReceivedEvent(None,
 | 
					                gajim.nec.push_incoming_event(RosterReceivedEvent(None,
 | 
				
			||||||
                    conn=self))
 | 
					                    conn=self))
 | 
				
			||||||
            GObject.timeout_add_seconds(10, self.discover_servers)
 | 
					            GLib.timeout_add_seconds(10, self.discover_servers)
 | 
				
			||||||
        elif self.awaiting_answers[id_][0] == PRIVACY_ARRIVED:
 | 
					        elif self.awaiting_answers[id_][0] == PRIVACY_ARRIVED:
 | 
				
			||||||
            if iq_obj.getType() != 'error':
 | 
					            if iq_obj.getType() != 'error':
 | 
				
			||||||
                self.privacy_rules_supported = True
 | 
					                self.privacy_rules_supported = True
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ Handles Jingle RTP sessions (XEP 0167)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from collections import deque
 | 
					from collections import deque
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
import socket
 | 
					import socket
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import nbxmpp
 | 
					import nbxmpp
 | 
				
			||||||
| 
						 | 
					@ -130,13 +130,13 @@ class JingleRTPContent(JingleContent):
 | 
				
			||||||
        events = deque(events)
 | 
					        events = deque(events)
 | 
				
			||||||
        self._dtmf_running = True
 | 
					        self._dtmf_running = True
 | 
				
			||||||
        self._start_dtmf(events.popleft())
 | 
					        self._start_dtmf(events.popleft())
 | 
				
			||||||
        GObject.timeout_add(500, self._next_dtmf, events)
 | 
					        GLib.timeout_add(500, self._next_dtmf, events)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _next_dtmf(self, events):
 | 
					    def _next_dtmf(self, events):
 | 
				
			||||||
        self._stop_dtmf()
 | 
					        self._stop_dtmf()
 | 
				
			||||||
        if events:
 | 
					        if events:
 | 
				
			||||||
            self._start_dtmf(events.popleft())
 | 
					            self._start_dtmf(events.popleft())
 | 
				
			||||||
            GObject.timeout_add(500, self._next_dtmf, events)
 | 
					            GLib.timeout_add(500, self._next_dtmf, events)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self._dtmf_running = False
 | 
					            self._dtmf_running = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ import time
 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
from gzip import GzipFile
 | 
					from gzip import GzipFile
 | 
				
			||||||
from io import BytesIO
 | 
					from io import BytesIO
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from common import exceptions
 | 
					from common import exceptions
 | 
				
			||||||
from common import gajim
 | 
					from common import gajim
 | 
				
			||||||
| 
						 | 
					@ -177,7 +177,7 @@ class Logger:
 | 
				
			||||||
    def _timeout_commit(self):
 | 
					    def _timeout_commit(self):
 | 
				
			||||||
        if self.commit_timout_id:
 | 
					        if self.commit_timout_id:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        self.commit_timout_id = GObject.timeout_add(500, self._really_commit)
 | 
					        self.commit_timout_id = GLib.timeout_add(500, self._really_commit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def simple_commit(self, sql_to_commit):
 | 
					    def simple_commit(self, sql_to_commit):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -317,7 +317,7 @@ class NsLookup(IdleCommand):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# below lines is on how to use API and assist in testing
 | 
					# below lines is on how to use API and assist in testing
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    from gi.repository import GObject
 | 
					    from gi.repository import GLib
 | 
				
			||||||
    from gi.repository import Gtk
 | 
					    from gi.repository import Gtk
 | 
				
			||||||
    from nbxmpp import idlequeue
 | 
					    from nbxmpp import idlequeue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -342,7 +342,7 @@ if __name__ == '__main__':
 | 
				
			||||||
    but.connect('clicked', clicked)
 | 
					    but.connect('clicked', clicked)
 | 
				
			||||||
    win.add(hbox)
 | 
					    win.add(hbox)
 | 
				
			||||||
    win.show_all()
 | 
					    win.show_all()
 | 
				
			||||||
    GObject.timeout_add(200, idlequeue.process)
 | 
					    GLib.timeout_add(200, idlequeue.process)
 | 
				
			||||||
    if USE_LIBASYNCNS:
 | 
					    if USE_LIBASYNCNS:
 | 
				
			||||||
        GObject.timeout_add(200, resolver.process)
 | 
					        GLib.timeout_add(200, resolver.process)
 | 
				
			||||||
    Gtk.main()
 | 
					    Gtk.main()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,7 @@ from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import os, sys
 | 
					import os, sys
 | 
				
			||||||
import common.config
 | 
					import common.config
 | 
				
			||||||
import common.sleepy
 | 
					import common.sleepy
 | 
				
			||||||
| 
						 | 
					@ -588,7 +589,7 @@ class PreferencesWindow:
 | 
				
			||||||
        gtkgui_helpers.possibly_move_window_in_current_desktop(self.window)
 | 
					        gtkgui_helpers.possibly_move_window_in_current_desktop(self.window)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_preferences_notebook_switch_page(self, widget, page, page_num):
 | 
					    def on_preferences_notebook_switch_page(self, widget, page, page_num):
 | 
				
			||||||
        GObject.idle_add(self.xml.get_object('close_button').grab_focus)
 | 
					        GLib.idle_add(self.xml.get_object('close_button').grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_preferences_window_key_press_event(self, widget, event):
 | 
					    def on_preferences_window_key_press_event(self, widget, event):
 | 
				
			||||||
        if event.keyval == Gdk.KEY_Escape:
 | 
					        if event.keyval == Gdk.KEY_Escape:
 | 
				
			||||||
| 
						 | 
					@ -1661,7 +1662,7 @@ class AccountsWindow:
 | 
				
			||||||
                status_before = gajim.connections[account].status
 | 
					                status_before = gajim.connections[account].status
 | 
				
			||||||
                gajim.interface.roster.send_status(account, 'offline',
 | 
					                gajim.interface.roster.send_status(account, 'offline',
 | 
				
			||||||
                        _('Be right back.'))
 | 
					                        _('Be right back.'))
 | 
				
			||||||
                GObject.timeout_add(500, login, account, show_before, status_before)
 | 
					                GLib.timeout_add(500, login, account, show_before, status_before)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            def on_yes(checked, account):
 | 
					            def on_yes(checked, account):
 | 
				
			||||||
                relog(account)
 | 
					                relog(account)
 | 
				
			||||||
| 
						 | 
					@ -2162,7 +2163,7 @@ class AccountsWindow:
 | 
				
			||||||
            if not widget.is_focus():
 | 
					            if not widget.is_focus():
 | 
				
			||||||
                pritext = _('Invalid Jabber ID')
 | 
					                pritext = _('Invalid Jabber ID')
 | 
				
			||||||
                dialogs.ErrorDialog(pritext, str(s))
 | 
					                dialogs.ErrorDialog(pritext, str(s))
 | 
				
			||||||
                GObject.idle_add(lambda: widget.grab_focus())
 | 
					                GLib.idle_add(lambda: widget.grab_focus())
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        jid_splited = jid.split('@', 1)
 | 
					        jid_splited = jid.split('@', 1)
 | 
				
			||||||
| 
						 | 
					@ -2172,7 +2173,7 @@ class AccountsWindow:
 | 
				
			||||||
                pritext = _('Invalid Jabber ID')
 | 
					                pritext = _('Invalid Jabber ID')
 | 
				
			||||||
                sectext = _('A Jabber ID must be in the form "user@servername".')
 | 
					                sectext = _('A Jabber ID must be in the form "user@servername".')
 | 
				
			||||||
                dialogs.ErrorDialog(pritext, sectext)
 | 
					                dialogs.ErrorDialog(pritext, sectext)
 | 
				
			||||||
                GObject.idle_add(lambda: widget.grab_focus())
 | 
					                GLib.idle_add(lambda: widget.grab_focus())
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2237,7 +2238,7 @@ class AccountsWindow:
 | 
				
			||||||
            if not widget.is_focus():
 | 
					            if not widget.is_focus():
 | 
				
			||||||
                pritext = _('Invalid Jabber ID')
 | 
					                pritext = _('Invalid Jabber ID')
 | 
				
			||||||
                dialogs.ErrorDialog(pritext, str(s))
 | 
					                dialogs.ErrorDialog(pritext, str(s))
 | 
				
			||||||
                GObject.idle_add(lambda: widget.grab_focus())
 | 
					                GLib.idle_add(lambda: widget.grab_focus())
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.option_changed('resource', resource):
 | 
					        if self.option_changed('resource', resource):
 | 
				
			||||||
| 
						 | 
					@ -2393,7 +2394,7 @@ class AccountsWindow:
 | 
				
			||||||
            if not widget.is_focus():
 | 
					            if not widget.is_focus():
 | 
				
			||||||
                dialogs.ErrorDialog(_('Invalid entry'),
 | 
					                dialogs.ErrorDialog(_('Invalid entry'),
 | 
				
			||||||
                        _('Custom port must be a port number.'))
 | 
					                        _('Custom port must be a port number.'))
 | 
				
			||||||
                GObject.idle_add(lambda: widget.grab_focus())
 | 
					                GLib.idle_add(lambda: widget.grab_focus())
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
        if self.option_changed('custom_port', custom_port):
 | 
					        if self.option_changed('custom_port', custom_port):
 | 
				
			||||||
            self.need_relogin = True
 | 
					            self.need_relogin = True
 | 
				
			||||||
| 
						 | 
					@ -3701,7 +3702,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
                self.notebook.set_current_page(5) # show creating page
 | 
					                self.notebook.set_current_page(5) # show creating page
 | 
				
			||||||
                self.back_button.hide()
 | 
					                self.back_button.hide()
 | 
				
			||||||
                self.forward_button.hide()
 | 
					                self.forward_button.hide()
 | 
				
			||||||
                self.update_progressbar_timeout_id = GObject.timeout_add(100,
 | 
					                self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
                    self.update_progressbar)
 | 
					                    self.update_progressbar)
 | 
				
			||||||
                # Get form from serveur
 | 
					                # Get form from serveur
 | 
				
			||||||
                con = connection.Connection(self.account)
 | 
					                con = connection.Connection(self.account)
 | 
				
			||||||
| 
						 | 
					@ -3743,7 +3744,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
            self.notebook.set_current_page(5) # show creating page
 | 
					            self.notebook.set_current_page(5) # show creating page
 | 
				
			||||||
            self.back_button.hide()
 | 
					            self.back_button.hide()
 | 
				
			||||||
            self.forward_button.hide()
 | 
					            self.forward_button.hide()
 | 
				
			||||||
            self.update_progressbar_timeout_id = GObject.timeout_add(100,
 | 
					            self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
                self.update_progressbar)
 | 
					                self.update_progressbar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def update_proxy_list(self):
 | 
					    def update_proxy_list(self):
 | 
				
			||||||
| 
						 | 
					@ -3779,7 +3780,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
        if obj.conn.name != self.account:
 | 
					        if obj.conn.name != self.account:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
        self.back_button.show()
 | 
					        self.back_button.show()
 | 
				
			||||||
        self.forward_button.show()
 | 
					        self.forward_button.show()
 | 
				
			||||||
        self.is_form = obj.is_form
 | 
					        self.is_form = obj.is_form
 | 
				
			||||||
| 
						 | 
					@ -3837,7 +3838,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
        if self.account not in gajim.connections:
 | 
					        if self.account not in gajim.connections:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
        del gajim.connections[self.account]
 | 
					        del gajim.connections[self.account]
 | 
				
			||||||
        if self.account in gajim.config.get_per('accounts'):
 | 
					        if self.account in gajim.config.get_per('accounts'):
 | 
				
			||||||
            gajim.config.del_per('accounts', self.account)
 | 
					            gajim.config.del_per('accounts', self.account)
 | 
				
			||||||
| 
						 | 
					@ -3863,7 +3864,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
        self.show_finish_page()
 | 
					        self.show_finish_page()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_acc_is_not_ok(self, obj):
 | 
					    def _nec_acc_is_not_ok(self, obj):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -3887,7 +3888,7 @@ class AccountCreationWizardWindow:
 | 
				
			||||||
        self.notebook.set_current_page(6) # show finish page
 | 
					        self.notebook.set_current_page(6) # show finish page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_advanced_button_clicked(self, widget):
 | 
					    def on_advanced_button_clicked(self, widget):
 | 
				
			||||||
        if 'accounts' in gajim.interface.instances:
 | 
					        if 'accounts' in gajim.interface.instances:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,7 @@ from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import tooltips
 | 
					import tooltips
 | 
				
			||||||
| 
						 | 
					@ -404,14 +405,14 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def smooth_scroll_timeout(self):
 | 
					    def smooth_scroll_timeout(self):
 | 
				
			||||||
        GObject.idle_add(self.do_smooth_scroll_timeout)
 | 
					        GLib.idle_add(self.do_smooth_scroll_timeout)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def do_smooth_scroll_timeout(self):
 | 
					    def do_smooth_scroll_timeout(self):
 | 
				
			||||||
        if not self.smooth_id:
 | 
					        if not self.smooth_id:
 | 
				
			||||||
            # we finished scrolling
 | 
					            # we finished scrolling
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        GObject.source_remove(self.smooth_id)
 | 
					        GLib.source_remove(self.smooth_id)
 | 
				
			||||||
        self.smooth_id = None
 | 
					        self.smooth_id = None
 | 
				
			||||||
        parent = self.tv.get_parent()
 | 
					        parent = self.tv.get_parent()
 | 
				
			||||||
        if parent:
 | 
					        if parent:
 | 
				
			||||||
| 
						 | 
					@ -423,7 +424,7 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
    def smooth_scroll_to_end(self):
 | 
					    def smooth_scroll_to_end(self):
 | 
				
			||||||
        if None != self.smooth_id: # already scrolling
 | 
					        if None != self.smooth_id: # already scrolling
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        self.smooth_id = GObject.timeout_add(self.SCROLL_DELAY,
 | 
					        self.smooth_id = GLib.timeout_add(self.SCROLL_DELAY,
 | 
				
			||||||
                self.smooth_scroll)
 | 
					                self.smooth_scroll)
 | 
				
			||||||
        self.smooth_scroll_timer = Timer(self.MAX_SCROLL_TIME,
 | 
					        self.smooth_scroll_timer = Timer(self.MAX_SCROLL_TIME,
 | 
				
			||||||
                self.smooth_scroll_timeout)
 | 
					                self.smooth_scroll_timeout)
 | 
				
			||||||
| 
						 | 
					@ -453,9 +454,9 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
        # scroll only if expected end is not visible
 | 
					        # scroll only if expected end is not visible
 | 
				
			||||||
        if end_rect.y >= (visible_rect.y + visible_rect.height + diff_y):
 | 
					        if end_rect.y >= (visible_rect.y + visible_rect.height + diff_y):
 | 
				
			||||||
            if use_smooth:
 | 
					            if use_smooth:
 | 
				
			||||||
                GObject.idle_add(self.smooth_scroll_to_end)
 | 
					                GLib.idle_add(self.smooth_scroll_to_end)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                GObject.idle_add(self.scroll_to_end_iter)
 | 
					                GLib.idle_add(self.scroll_to_end_iter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def scroll_to_end_iter(self):
 | 
					    def scroll_to_end_iter(self):
 | 
				
			||||||
        buffer_ = self.tv.get_buffer()
 | 
					        buffer_ = self.tv.get_buffer()
 | 
				
			||||||
| 
						 | 
					@ -467,7 +468,7 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def stop_scrolling(self):
 | 
					    def stop_scrolling(self):
 | 
				
			||||||
        if self.smooth_id:
 | 
					        if self.smooth_id:
 | 
				
			||||||
            GObject.source_remove(self.smooth_id)
 | 
					            GLib.source_remove(self.smooth_id)
 | 
				
			||||||
            self.smooth_id = None
 | 
					            self.smooth_id = None
 | 
				
			||||||
            self.smooth_scroll_timer.cancel()
 | 
					            self.smooth_scroll_timer.cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -548,7 +549,7 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self.xep0184_shown[id_] = SHOWN
 | 
					            self.xep0184_shown[id_] = SHOWN
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        GObject.timeout_add_seconds(3, show_it)
 | 
					        GLib.timeout_add_seconds(3, show_it)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        buffer_.end_user_action()
 | 
					        buffer_.end_user_action()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -647,7 +648,7 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
            if scroll:
 | 
					            if scroll:
 | 
				
			||||||
                # scroll to the end (via idle in case the scrollbar has
 | 
					                # scroll to the end (via idle in case the scrollbar has
 | 
				
			||||||
                # appeared)
 | 
					                # appeared)
 | 
				
			||||||
                GObject.idle_add(self.scroll_to_end)
 | 
					                GLib.idle_add(self.scroll_to_end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def show_xep0184_warning_tooltip(self):
 | 
					    def show_xep0184_warning_tooltip(self):
 | 
				
			||||||
        pointer = self.tv.get_pointer()
 | 
					        pointer = self.tv.get_pointer()
 | 
				
			||||||
| 
						 | 
					@ -751,13 +752,13 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
            if not xep0184_warning:
 | 
					            if not xep0184_warning:
 | 
				
			||||||
                self.xep0184_warning_tooltip.hide_tooltip()
 | 
					                self.xep0184_warning_tooltip.hide_tooltip()
 | 
				
			||||||
        if over_line and not self.line_tooltip.win:
 | 
					        if over_line and not self.line_tooltip.win:
 | 
				
			||||||
            self.line_tooltip.timeout = GObject.timeout_add(500,
 | 
					            self.line_tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                    self.show_line_tooltip)
 | 
					                    self.show_line_tooltip)
 | 
				
			||||||
            self.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
					            self.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
				
			||||||
                    Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
					                    Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
				
			||||||
            self.change_cursor = True
 | 
					            self.change_cursor = True
 | 
				
			||||||
        if xep0184_warning and not self.xep0184_warning_tooltip.win:
 | 
					        if xep0184_warning and not self.xep0184_warning_tooltip.win:
 | 
				
			||||||
            self.xep0184_warning_tooltip.timeout = GObject.timeout_add(500,
 | 
					            self.xep0184_warning_tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                    self.show_xep0184_warning_tooltip)
 | 
					                    self.show_xep0184_warning_tooltip)
 | 
				
			||||||
            self.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
					            self.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
				
			||||||
                    Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
					                    Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
				
			||||||
| 
						 | 
					@ -1384,9 +1385,9 @@ class ConversationTextview(GObject.GObject):
 | 
				
			||||||
            # we are at the end or we are sending something
 | 
					            # we are at the end or we are sending something
 | 
				
			||||||
            # scroll to the end (via idle in case the scrollbar has appeared)
 | 
					            # scroll to the end (via idle in case the scrollbar has appeared)
 | 
				
			||||||
            if gajim.config.get('use_smooth_scrolling'):
 | 
					            if gajim.config.get('use_smooth_scrolling'):
 | 
				
			||||||
                GObject.idle_add(self.smooth_scroll_to_end)
 | 
					                GLib.idle_add(self.smooth_scroll_to_end)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                GObject.idle_add(self.scroll_to_end)
 | 
					                GLib.idle_add(self.scroll_to_end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.just_cleared = False
 | 
					        self.just_cleared = False
 | 
				
			||||||
        buffer_.end_user_action()
 | 
					        buffer_.end_user_action()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,6 +33,7 @@ from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import cairo
 | 
					import cairo
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -566,7 +567,7 @@ class TimeoutDialog:
 | 
				
			||||||
    def run_timeout(self):
 | 
					    def run_timeout(self):
 | 
				
			||||||
        if self.countdown_left > 0:
 | 
					        if self.countdown_left > 0:
 | 
				
			||||||
            self.countdown()
 | 
					            self.countdown()
 | 
				
			||||||
            GObject.timeout_add_seconds(1, self.countdown)
 | 
					            GLib.timeout_add_seconds(1, self.countdown)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_timeout():
 | 
					    def on_timeout():
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -2871,7 +2872,7 @@ class PopupNotificationWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        event_type_label.set_markup(
 | 
					        event_type_label.set_markup(
 | 
				
			||||||
            '<span foreground="black" weight="bold">%s</span>' %
 | 
					            '<span foreground="black" weight="bold">%s</span>' %
 | 
				
			||||||
            GObject.markup_escape_text(title))
 | 
					            GLib.markup_escape_text(title))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # set colors [ http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html ]
 | 
					        # set colors [ http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html ]
 | 
				
			||||||
        self.window.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('black'))
 | 
					        self.window.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('black'))
 | 
				
			||||||
| 
						 | 
					@ -2904,7 +2905,7 @@ class PopupNotificationWindow:
 | 
				
			||||||
        close_button.modify_bg(Gtk.StateType.NORMAL, popup_bg_color)
 | 
					        close_button.modify_bg(Gtk.StateType.NORMAL, popup_bg_color)
 | 
				
			||||||
        eventbox.modify_bg(Gtk.StateType.NORMAL, popup_bg_color)
 | 
					        eventbox.modify_bg(Gtk.StateType.NORMAL, popup_bg_color)
 | 
				
			||||||
        event_description_label.set_markup('<span foreground="black">%s</span>' %
 | 
					        event_description_label.set_markup('<span foreground="black">%s</span>' %
 | 
				
			||||||
            GObject.markup_escape_text(text))
 | 
					            GLib.markup_escape_text(text))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # set the image
 | 
					        # set the image
 | 
				
			||||||
        image.set_from_file(path_to_image)
 | 
					        image.set_from_file(path_to_image)
 | 
				
			||||||
| 
						 | 
					@ -2924,7 +2925,7 @@ class PopupNotificationWindow:
 | 
				
			||||||
        xml.connect_signals(self)
 | 
					        xml.connect_signals(self)
 | 
				
			||||||
        self.window.show_all()
 | 
					        self.window.show_all()
 | 
				
			||||||
        if timeout > 0:
 | 
					        if timeout > 0:
 | 
				
			||||||
            GObject.timeout_add_seconds(timeout, self.on_timeout)
 | 
					            GLib.timeout_add_seconds(timeout, self.on_timeout)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_close_button_clicked(self, widget):
 | 
					    def on_close_button_clicked(self, widget):
 | 
				
			||||||
        self.adjust_height_and_move_popup_notification_windows()
 | 
					        self.adjust_height_and_move_popup_notification_windows()
 | 
				
			||||||
| 
						 | 
					@ -3122,7 +3123,7 @@ class SingleMessageWindow:
 | 
				
			||||||
                self.cancel_button.hide()
 | 
					                self.cancel_button.hide()
 | 
				
			||||||
                self.close_button.show()
 | 
					                self.close_button.show()
 | 
				
			||||||
                self.message_tv_buffer.set_text(self.message)
 | 
					                self.message_tv_buffer.set_text(self.message)
 | 
				
			||||||
                GObject.idle_add(self.set_cursor_to_end)
 | 
					                GLib.idle_add(self.set_cursor_to_end)
 | 
				
			||||||
            else: # we write a new message (not from reply)
 | 
					            else: # we write a new message (not from reply)
 | 
				
			||||||
                self.close_button.hide()
 | 
					                self.close_button.hide()
 | 
				
			||||||
                if self.to: # do we already have jid?
 | 
					                if self.to: # do we already have jid?
 | 
				
			||||||
| 
						 | 
					@ -3400,7 +3401,7 @@ class XMLConsoleWindow:
 | 
				
			||||||
        buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') \
 | 
					        buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') \
 | 
				
			||||||
            + '\n\n', type_)
 | 
					            + '\n\n', type_)
 | 
				
			||||||
        if at_the_end:
 | 
					        if at_the_end:
 | 
				
			||||||
            GObject.idle_add(self.scroll_to_end)
 | 
					            GLib.idle_add(self.scroll_to_end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_stanza_received(self, obj):
 | 
					    def _nec_stanza_received(self, obj):
 | 
				
			||||||
        if obj.conn.name != self.account:
 | 
					        if obj.conn.name != self.account:
 | 
				
			||||||
| 
						 | 
					@ -3782,8 +3783,8 @@ class ItemArchivingPreferencesWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def launch_progressbar(self):
 | 
					    def launch_progressbar(self):
 | 
				
			||||||
        self.progressbar.show()
 | 
					        self.progressbar.show()
 | 
				
			||||||
        self.update_progressbar_timeout_id = GObject.timeout_add(
 | 
					        self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
            100, self.update_progressbar)
 | 
					            self.update_progressbar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def response_arrived(self, data):
 | 
					    def response_arrived(self, data):
 | 
				
			||||||
        if self.waiting:
 | 
					        if self.waiting:
 | 
				
			||||||
| 
						 | 
					@ -4082,7 +4083,7 @@ class PrivacyListWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.privacy_lists_title_label.set_label(
 | 
					        self.privacy_lists_title_label.set_label(
 | 
				
			||||||
                _('Privacy List <b><i>%s</i></b>') % \
 | 
					                _('Privacy List <b><i>%s</i></b>') % \
 | 
				
			||||||
                GObject.markup_escape_text(self.privacy_list_name))
 | 
					                GLib.markup_escape_text(self.privacy_list_name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if len(gajim.connections) > 1:
 | 
					        if len(gajim.connections) > 1:
 | 
				
			||||||
            title = _('Privacy List for %s') % self.account
 | 
					            title = _('Privacy List for %s') % self.account
 | 
				
			||||||
| 
						 | 
					@ -4566,7 +4567,7 @@ class InvitationReceivedDialog:
 | 
				
			||||||
        sectext = sectext.replace('$Contact', contact_text)
 | 
					        sectext = sectext.replace('$Contact', contact_text)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if comment: # only if not None and not ''
 | 
					        if comment: # only if not None and not ''
 | 
				
			||||||
            comment = GObject.markup_escape_text(comment)
 | 
					            comment = GLib.markup_escape_text(comment)
 | 
				
			||||||
            comment = _('Comment: %s') % comment
 | 
					            comment = _('Comment: %s') % comment
 | 
				
			||||||
            sectext += '\n\n%s' % comment
 | 
					            sectext += '\n\n%s' % comment
 | 
				
			||||||
        sectext += '\n\n' + _('Do you want to accept the invitation?')
 | 
					        sectext += '\n\n' + _('Do you want to accept the invitation?')
 | 
				
			||||||
| 
						 | 
					@ -4605,7 +4606,7 @@ class ProgressDialog:
 | 
				
			||||||
        self.dialog.show_all()
 | 
					        self.dialog.show_all()
 | 
				
			||||||
        self.xml.connect_signals(self)
 | 
					        self.xml.connect_signals(self)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.update_progressbar_timeout_id = GObject.timeout_add(100,
 | 
					        self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
            self.update_progressbar)
 | 
					            self.update_progressbar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def update_progressbar(self):
 | 
					    def update_progressbar(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										34
									
								
								src/disco.py
									
										
									
									
									
								
							
							
						
						
									
										34
									
								
								src/disco.py
									
										
									
									
									
								
							| 
						 | 
					@ -47,7 +47,7 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import types
 | 
					import types
 | 
				
			||||||
import weakref
 | 
					import weakref
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
| 
						 | 
					@ -153,7 +153,7 @@ class CacheDictionary:
 | 
				
			||||||
        for key in list(self.cache.keys()):
 | 
					        for key in list(self.cache.keys()):
 | 
				
			||||||
            item = self.cache[key]
 | 
					            item = self.cache[key]
 | 
				
			||||||
            if item.source:
 | 
					            if item.source:
 | 
				
			||||||
                GObject.source_remove(item.source)
 | 
					                GLib.source_remove(item.source)
 | 
				
			||||||
            del self.cache[key]
 | 
					            del self.cache[key]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _expire_timeout(self, key):
 | 
					    def _expire_timeout(self, key):
 | 
				
			||||||
| 
						 | 
					@ -170,9 +170,9 @@ class CacheDictionary:
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        item = self.cache[key]
 | 
					        item = self.cache[key]
 | 
				
			||||||
        if item.source:
 | 
					        if item.source:
 | 
				
			||||||
            GObject.source_remove(item.source)
 | 
					            GLib.source_remove(item.source)
 | 
				
			||||||
        if self.lifetime:
 | 
					        if self.lifetime:
 | 
				
			||||||
            source = GObject.timeout_add_seconds(int(self.lifetime/1000), self._expire_timeout, key)
 | 
					            source = GLib.timeout_add_seconds(int(self.lifetime/1000), self._expire_timeout, key)
 | 
				
			||||||
            item.source = source
 | 
					            item.source = source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __getitem__(self, key):
 | 
					    def __getitem__(self, key):
 | 
				
			||||||
| 
						 | 
					@ -189,7 +189,7 @@ class CacheDictionary:
 | 
				
			||||||
    def __delitem__(self, key):
 | 
					    def __delitem__(self, key):
 | 
				
			||||||
        item = self.cache[key]
 | 
					        item = self.cache[key]
 | 
				
			||||||
        if item.source:
 | 
					        if item.source:
 | 
				
			||||||
            GObject.source_remove(item.source)
 | 
					            GLib.source_remove(item.source)
 | 
				
			||||||
        del self.cache[key]
 | 
					        del self.cache[key]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __contains__(self, key):
 | 
					    def __contains__(self, key):
 | 
				
			||||||
| 
						 | 
					@ -1059,7 +1059,7 @@ class AgentBrowser:
 | 
				
			||||||
        self.model.clear()
 | 
					        self.model.clear()
 | 
				
			||||||
        self._total_items = self._progress = 0
 | 
					        self._total_items = self._progress = 0
 | 
				
			||||||
        self.window.progressbar.show()
 | 
					        self.window.progressbar.show()
 | 
				
			||||||
        self._pulse_timeout = GObject.timeout_add(250, self._pulse_timeout_cb)
 | 
					        self._pulse_timeout = GLib.timeout_add(250, self._pulse_timeout_cb)
 | 
				
			||||||
        self.cache.get_items(self.jid, self.node, self._agent_items,
 | 
					        self.cache.get_items(self.jid, self.node, self._agent_items,
 | 
				
			||||||
                force=force, args=(force,))
 | 
					                force=force, args=(force,))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1098,7 +1098,7 @@ class AgentBrowser:
 | 
				
			||||||
        self.model.clear()
 | 
					        self.model.clear()
 | 
				
			||||||
        self.add_self_line()
 | 
					        self.add_self_line()
 | 
				
			||||||
        self._total_items = 0
 | 
					        self._total_items = 0
 | 
				
			||||||
        GObject.source_remove(self._pulse_timeout)
 | 
					        GLib.source_remove(self._pulse_timeout)
 | 
				
			||||||
        self.window.progressbar.hide()
 | 
					        self.window.progressbar.hide()
 | 
				
			||||||
        # The server returned an error
 | 
					        # The server returned an error
 | 
				
			||||||
        if items == 0:
 | 
					        if items == 0:
 | 
				
			||||||
| 
						 | 
					@ -1311,8 +1311,8 @@ class ToplevelAgentBrowser(AgentBrowser):
 | 
				
			||||||
            if jid and state > 0 and \
 | 
					            if jid and state > 0 and \
 | 
				
			||||||
                            (self.tooltip.timeout == 0 or self.tooltip.id != props[0]):
 | 
					                            (self.tooltip.timeout == 0 or self.tooltip.id != props[0]):
 | 
				
			||||||
                self.tooltip.id = row
 | 
					                self.tooltip.id = row
 | 
				
			||||||
                self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                self.tooltip.timeout = GLib.timeout_add(500, self._show_tooltip,
 | 
				
			||||||
                        self._show_tooltip, state)
 | 
					                    state)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_treeview_event_hide_tooltip(self, widget, event):
 | 
					    def on_treeview_event_hide_tooltip(self, widget, event):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -1586,7 +1586,7 @@ class ToplevelAgentBrowser(AgentBrowser):
 | 
				
			||||||
        #       self.expanding = False
 | 
					        #       self.expanding = False
 | 
				
			||||||
        #       return False
 | 
					        #       return False
 | 
				
			||||||
        #self.expanding = True
 | 
					        #self.expanding = True
 | 
				
			||||||
        #GObject.idle_add(expand_all)
 | 
					        #GLib.idle_add(expand_all)
 | 
				
			||||||
        self.window.services_treeview.expand_all()
 | 
					        self.window.services_treeview.expand_all()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _update_progressbar(self):
 | 
					    def _update_progressbar(self):
 | 
				
			||||||
| 
						 | 
					@ -1595,7 +1595,7 @@ class ToplevelAgentBrowser(AgentBrowser):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        # Refresh this every update
 | 
					        # Refresh this every update
 | 
				
			||||||
        if self._progressbar_sourceid:
 | 
					        if self._progressbar_sourceid:
 | 
				
			||||||
            GObject.source_remove(self._progressbar_sourceid)
 | 
					            GLib.source_remove(self._progressbar_sourceid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        fraction = 0
 | 
					        fraction = 0
 | 
				
			||||||
        if self._total_items:
 | 
					        if self._total_items:
 | 
				
			||||||
| 
						 | 
					@ -1604,12 +1604,12 @@ class ToplevelAgentBrowser(AgentBrowser):
 | 
				
			||||||
            fraction = float(self._progress) / float(self._total_items)
 | 
					            fraction = float(self._progress) / float(self._total_items)
 | 
				
			||||||
            if self._progress >= self._total_items:
 | 
					            if self._progress >= self._total_items:
 | 
				
			||||||
                # We show the progressbar for just a bit before hiding it.
 | 
					                # We show the progressbar for just a bit before hiding it.
 | 
				
			||||||
                id_ = GObject.timeout_add_seconds(2, self._hide_progressbar_cb)
 | 
					                id_ = GLib.timeout_add_seconds(2, self._hide_progressbar_cb)
 | 
				
			||||||
                self._progressbar_sourceid = id_
 | 
					                self._progressbar_sourceid = id_
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self.window.progressbar.show()
 | 
					                self.window.progressbar.show()
 | 
				
			||||||
                # Hide the progressbar if we're timing out anyways. (20 secs)
 | 
					                # Hide the progressbar if we're timing out anyways. (20 secs)
 | 
				
			||||||
                id_ = GObject.timeout_add_seconds(20, self._hide_progressbar_cb)
 | 
					                id_ = GLib.timeout_add_seconds(20, self._hide_progressbar_cb)
 | 
				
			||||||
                self._progressbar_sourceid = id_
 | 
					                self._progressbar_sourceid = id_
 | 
				
			||||||
        self.window.progressbar.set_fraction(fraction)
 | 
					        self.window.progressbar.set_fraction(fraction)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1706,7 +1706,7 @@ class ToplevelAgentBrowser(AgentBrowser):
 | 
				
			||||||
        if not cat:
 | 
					        if not cat:
 | 
				
			||||||
            cat = self._create_category(*cat_args)
 | 
					            cat = self._create_category(*cat_args)
 | 
				
			||||||
        self.model.append(cat, (jid, node, pix, descr, 1))
 | 
					        self.model.append(cat, (jid, node, pix, descr, 1))
 | 
				
			||||||
        GObject.idle_add(self._expand_all)
 | 
					        GLib.idle_add(self._expand_all)
 | 
				
			||||||
        # Grab info on the service
 | 
					        # Grab info on the service
 | 
				
			||||||
        self.cache.get_info(jid, node, self._agent_info, force=force)
 | 
					        self.cache.get_info(jid, node, self._agent_info, force=force)
 | 
				
			||||||
        self._update_progressbar()
 | 
					        self._update_progressbar()
 | 
				
			||||||
| 
						 | 
					@ -1943,7 +1943,7 @@ class MucBrowser(AgentBrowser):
 | 
				
			||||||
        view = self.window.services_treeview
 | 
					        view = self.window.services_treeview
 | 
				
			||||||
        if not view.get_realized():
 | 
					        if not view.get_realized():
 | 
				
			||||||
            # Prevent a silly warning, try again in a bit.
 | 
					            # Prevent a silly warning, try again in a bit.
 | 
				
			||||||
            self._fetch_source = GObject.timeout_add(100, self._start_info_query)
 | 
					            self._fetch_source = GLib.timeout_add(100, self._start_info_query)
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        range_ = view.get_visible_range()
 | 
					        range_ = view.get_visible_range()
 | 
				
			||||||
        if not range_:
 | 
					        if not range_:
 | 
				
			||||||
| 
						 | 
					@ -1994,7 +1994,7 @@ class MucBrowser(AgentBrowser):
 | 
				
			||||||
    def _add_item(self, jid, node, parent_node, item, force):
 | 
					    def _add_item(self, jid, node, parent_node, item, force):
 | 
				
			||||||
        self.model.append((jid, node, item.get('name', ''), -1, '', '', False))
 | 
					        self.model.append((jid, node, item.get('name', ''), -1, '', '', False))
 | 
				
			||||||
        if not self._fetch_source:
 | 
					        if not self._fetch_source:
 | 
				
			||||||
            self._fetch_source = GObject.idle_add(self._start_info_query)
 | 
					            self._fetch_source = GLib.idle_add(self._start_info_query)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _update_info(self, iter_, jid, node, identities, features, data):
 | 
					    def _update_info(self, iter_, jid, node, identities, features, data):
 | 
				
			||||||
        name = identities[0].get('name', '')
 | 
					        name = identities[0].get('name', '')
 | 
				
			||||||
| 
						 | 
					@ -2125,7 +2125,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
 | 
				
			||||||
            dunno = True
 | 
					            dunno = True
 | 
				
			||||||
            subscribed = False
 | 
					            subscribed = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        name = GObject.markup_escape_text(name)
 | 
					        name = GLib.markup_escape_text(name)
 | 
				
			||||||
        name = '<b>%s</b>' % name
 | 
					        name = '<b>%s</b>' % name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if parent_node:
 | 
					        if parent_node:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
| 
						 | 
					@ -183,8 +183,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            (file_path, file_name) = os.path.split(file_props.file_name)
 | 
					            (file_path, file_name) = os.path.split(file_props.file_name)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            file_name = file_props.name
 | 
					            file_name = file_props.name
 | 
				
			||||||
        sectext = '\t' + _('Filename: %s') % GObject.markup_escape_text(
 | 
					        sectext = '\t' + _('Filename: %s') % GLib.markup_escape_text(file_name)
 | 
				
			||||||
            file_name)
 | 
					 | 
				
			||||||
        sectext += '\n\t' + _('Size: %s') % \
 | 
					        sectext += '\n\t' + _('Size: %s') % \
 | 
				
			||||||
        helpers.convert_bytes(file_props.size)
 | 
					        helpers.convert_bytes(file_props.size)
 | 
				
			||||||
        if file_props.type_ == 'r':
 | 
					        if file_props.type_ == 'r':
 | 
				
			||||||
| 
						 | 
					@ -240,8 +239,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            file_name = os.path.basename(file_props.file_name)
 | 
					            file_name = os.path.basename(file_props.file_name)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            file_name = file_props.name
 | 
					            file_name = file_props.name
 | 
				
			||||||
        sectext = '\t' + _('Filename: %s') % GObject.markup_escape_text(
 | 
					        sectext = '\t' + _('Filename: %s') % GLib.markup_escape_text(file_name)
 | 
				
			||||||
            file_name)
 | 
					 | 
				
			||||||
        sectext += '\n\t' + _('Recipient: %s') % jid
 | 
					        sectext += '\n\t' + _('Recipient: %s') % jid
 | 
				
			||||||
        if error_msg:
 | 
					        if error_msg:
 | 
				
			||||||
            sectext += '\n\t' + _('Error message: %s') % error_msg
 | 
					            sectext += '\n\t' + _('Error message: %s') % error_msg
 | 
				
			||||||
| 
						 | 
					@ -384,7 +382,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            if os.path.exists(file_path):
 | 
					            if os.path.exists(file_path):
 | 
				
			||||||
                # check if we have write permissions
 | 
					                # check if we have write permissions
 | 
				
			||||||
                if not os.access(file_path, os.W_OK):
 | 
					                if not os.access(file_path, os.W_OK):
 | 
				
			||||||
                    file_name = GObject.markup_escape_text(os.path.basename(
 | 
					                    file_name = GLib.markup_escape_text(os.path.basename(
 | 
				
			||||||
                        file_path))
 | 
					                        file_path))
 | 
				
			||||||
                    dialogs.ErrorDialog(
 | 
					                    dialogs.ErrorDialog(
 | 
				
			||||||
                        _('Cannot overwrite existing file "%s"' % file_name),
 | 
					                        _('Cannot overwrite existing file "%s"' % file_name),
 | 
				
			||||||
| 
						 | 
					@ -448,7 +446,7 @@ class FileTransfersWindow:
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        if not file_props or not file_props.name:
 | 
					        if not file_props or not file_props.name:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        sec_text = '\t' + _('File: %s') % GObject.markup_escape_text(
 | 
					        sec_text = '\t' + _('File: %s') % GLib.markup_escape_text(
 | 
				
			||||||
            file_props.name)
 | 
					            file_props.name)
 | 
				
			||||||
        if file_props.size:
 | 
					        if file_props.size:
 | 
				
			||||||
            sec_text += '\n\t' + _('Size: %s') % \
 | 
					            sec_text += '\n\t' + _('Size: %s') % \
 | 
				
			||||||
| 
						 | 
					@ -495,7 +493,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            text += helpers.convert_bytes(received_size) + '/' + \
 | 
					            text += helpers.convert_bytes(received_size) + '/' + \
 | 
				
			||||||
                helpers.convert_bytes(full_size)
 | 
					                helpers.convert_bytes(full_size)
 | 
				
			||||||
            self.model.set(iter_, C_PROGRESS, text)
 | 
					            self.model.set(iter_, C_PROGRESS, text)
 | 
				
			||||||
            self.model.set(iter_, C_PULSE, GObject.constants.G_MAXINT)
 | 
					            self.model.set(iter_, C_PULSE, GLib.MAXINT32)
 | 
				
			||||||
        elif status == 'computing':
 | 
					        elif status == 'computing':
 | 
				
			||||||
            self.model.set(iter_, C_PULSE, 1)
 | 
					            self.model.set(iter_, C_PULSE, 1)
 | 
				
			||||||
            text = _('Checking file...') + '\n'
 | 
					            text = _('Checking file...') + '\n'
 | 
				
			||||||
| 
						 | 
					@ -506,11 +504,11 @@ class FileTransfersWindow:
 | 
				
			||||||
            self.model.set(iter_, C_PROGRESS, text)
 | 
					            self.model.set(iter_, C_PROGRESS, text)
 | 
				
			||||||
            def pulse():
 | 
					            def pulse():
 | 
				
			||||||
                p = self.model.get(iter_, C_PULSE)[0]
 | 
					                p = self.model.get(iter_, C_PULSE)[0]
 | 
				
			||||||
                if p == GObject.constants.G_MAXINT:
 | 
					                if p == GLib.MAXINT32:
 | 
				
			||||||
                    return False
 | 
					                    return False
 | 
				
			||||||
                self.model.set(iter_, C_PULSE, p + 1)
 | 
					                self.model.set(iter_, C_PULSE, p + 1)
 | 
				
			||||||
                return True
 | 
					                return True
 | 
				
			||||||
            GObject.timeout_add(100, pulse)
 | 
					            GLib.timeout_add(100, pulse)
 | 
				
			||||||
        elif status == 'hash_error':
 | 
					        elif status == 'hash_error':
 | 
				
			||||||
            text = _('File error') + '\n'
 | 
					            text = _('File error') + '\n'
 | 
				
			||||||
            received_size = int(file_props.received_len)
 | 
					            received_size = int(file_props.received_len)
 | 
				
			||||||
| 
						 | 
					@ -518,7 +516,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            text += helpers.convert_bytes(received_size) + '/' + \
 | 
					            text += helpers.convert_bytes(received_size) + '/' + \
 | 
				
			||||||
                helpers.convert_bytes(full_size)
 | 
					                helpers.convert_bytes(full_size)
 | 
				
			||||||
            self.model.set(iter_, C_PROGRESS, text)
 | 
					            self.model.set(iter_, C_PROGRESS, text)
 | 
				
			||||||
            self.model.set(iter_, C_PULSE, GObject.constants.G_MAXINT)
 | 
					            self.model.set(iter_, C_PULSE, GLib.MAXINT32)
 | 
				
			||||||
        self.model.set(iter_, C_IMAGE, self.get_icon(status))
 | 
					        self.model.set(iter_, C_IMAGE, self.get_icon(status))
 | 
				
			||||||
        path = self.model.get_path(iter_)
 | 
					        path = self.model.get_path(iter_)
 | 
				
			||||||
        self.select_func(path)
 | 
					        self.select_func(path)
 | 
				
			||||||
| 
						 | 
					@ -738,7 +736,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            file_name = os.path.split(file_props.file_name)[1]
 | 
					            file_name = os.path.split(file_props.file_name)[1]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            file_name = file_props.name
 | 
					            file_name = file_props.name
 | 
				
			||||||
        text_props = GObject.markup_escape_text(file_name) + '\n'
 | 
					        text_props = GLib.markup_escape_text(file_name) + '\n'
 | 
				
			||||||
        text_props += contact.get_shown_name()
 | 
					        text_props += contact.get_shown_name()
 | 
				
			||||||
        self.model.set(iter_, 1, text_labels, 2, text_props, C_PULSE, -1, C_SID,
 | 
					        self.model.set(iter_, 1, text_labels, 2, text_props, C_PULSE, -1, C_SID,
 | 
				
			||||||
                file_props.type_ + file_props.sid)
 | 
					                file_props.type_ + file_props.sid)
 | 
				
			||||||
| 
						 | 
					@ -774,7 +772,7 @@ class FileTransfersWindow:
 | 
				
			||||||
            if file_props is not None:
 | 
					            if file_props is not None:
 | 
				
			||||||
                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
					                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
				
			||||||
                    self.tooltip.id = row
 | 
					                    self.tooltip.id = row
 | 
				
			||||||
                    self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                    self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                        self.show_tooltip, widget)
 | 
					                        self.show_tooltip, widget)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_transfers_list_leave_notify_event(self, widget=None, event=None):
 | 
					    def on_transfers_list_leave_notify_event(self, widget=None, event=None):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
import gtkgui_helpers
 | 
					import gtkgui_helpers
 | 
				
			||||||
import gui_menu_builder
 | 
					import gui_menu_builder
 | 
				
			||||||
import message_control
 | 
					import message_control
 | 
				
			||||||
| 
						 | 
					@ -606,7 +606,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
            self.resize_from_another_muc = False
 | 
					            self.resize_from_another_muc = False
 | 
				
			||||||
        # Reset the flag when everything will be redrawn, and in particular when
 | 
					        # Reset the flag when everything will be redrawn, and in particular when
 | 
				
			||||||
        # on_treeview_size_allocate will have been called.
 | 
					        # on_treeview_size_allocate will have been called.
 | 
				
			||||||
        GObject.idle_add(reset_flag)
 | 
					        GLib.idle_add(reset_flag)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_hpaned_notify(self, pane, gparamspec):
 | 
					    def on_hpaned_notify(self, pane, gparamspec):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -795,7 +795,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.subject:
 | 
					        if self.subject:
 | 
				
			||||||
            subject = helpers.reduce_chars_newlines(self.subject, max_lines=2)
 | 
					            subject = helpers.reduce_chars_newlines(self.subject, max_lines=2)
 | 
				
			||||||
            subject = GObject.markup_escape_text(subject)
 | 
					            subject = GLib.markup_escape_text(subject)
 | 
				
			||||||
            subject_text = self.urlfinder.sub(self.make_href, subject)
 | 
					            subject_text = self.urlfinder.sub(self.make_href, subject)
 | 
				
			||||||
            subject_text = '<span %s>%s</span>' % (font_attrs_small,
 | 
					            subject_text = '<span %s>%s</span>' % (font_attrs_small,
 | 
				
			||||||
                subject_text)
 | 
					                subject_text)
 | 
				
			||||||
| 
						 | 
					@ -1348,7 +1348,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
    def got_connected(self):
 | 
					    def got_connected(self):
 | 
				
			||||||
        # Make autorejoin stop.
 | 
					        # Make autorejoin stop.
 | 
				
			||||||
        if self.autorejoin:
 | 
					        if self.autorejoin:
 | 
				
			||||||
            GObject.source_remove(self.autorejoin)
 | 
					            GLib.source_remove(self.autorejoin)
 | 
				
			||||||
        self.autorejoin = None
 | 
					        self.autorejoin = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        gajim.gc_connected[self.account][self.room_jid] = True
 | 
					        gajim.gc_connected[self.account][self.room_jid] = True
 | 
				
			||||||
| 
						 | 
					@ -1415,8 +1415,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
        if self.autorejoin is None and gajim.account_is_connected(self.account):
 | 
					        if self.autorejoin is None and gajim.account_is_connected(self.account):
 | 
				
			||||||
            ar_to = gajim.config.get('muc_autorejoin_timeout')
 | 
					            ar_to = gajim.config.get('muc_autorejoin_timeout')
 | 
				
			||||||
            if ar_to:
 | 
					            if ar_to:
 | 
				
			||||||
                self.autorejoin = GObject.timeout_add_seconds(ar_to,
 | 
					                self.autorejoin = GLib.timeout_add_seconds(ar_to, self.rejoin)
 | 
				
			||||||
                    self.rejoin)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def rejoin(self):
 | 
					    def rejoin(self):
 | 
				
			||||||
        if not self.autorejoin:
 | 
					        if not self.autorejoin:
 | 
				
			||||||
| 
						 | 
					@ -1469,7 +1468,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            image = state_images[gc_contact.show]
 | 
					            image = state_images[gc_contact.show]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        name = GObject.markup_escape_text(gc_contact.name)
 | 
					        name = GLib.markup_escape_text(gc_contact.name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Strike name if blocked
 | 
					        # Strike name if blocked
 | 
				
			||||||
        fjid = self.room_jid + '/' + nick
 | 
					        fjid = self.room_jid + '/' + nick
 | 
				
			||||||
| 
						 | 
					@ -1488,7 +1487,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
                colorstring = "#%04x%04x%04x" % (color.red, color.green,
 | 
					                colorstring = "#%04x%04x%04x" % (color.red, color.green,
 | 
				
			||||||
                    color.blue)
 | 
					                    color.blue)
 | 
				
			||||||
                name += ('\n<span size="small" style="italic" foreground="%s">'
 | 
					                name += ('\n<span size="small" style="italic" foreground="%s">'
 | 
				
			||||||
                    '%s</span>') % (colorstring, GObject.markup_escape_text(
 | 
					                    '%s</span>') % (colorstring, GLib.markup_escape_text(
 | 
				
			||||||
                    status))
 | 
					                    status))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if image.get_storage_type() == Gtk.ImageType.PIXBUF and \
 | 
					        if image.get_storage_type() == Gtk.ImageType.PIXBUF and \
 | 
				
			||||||
| 
						 | 
					@ -2671,7 +2670,7 @@ class GroupchatControl(ChatControlBase):
 | 
				
			||||||
                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
					                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
				
			||||||
                    self.tooltip.id = row
 | 
					                    self.tooltip.id = row
 | 
				
			||||||
                    nick = self.model[iter_][C_NICK]
 | 
					                    nick = self.model[iter_][C_NICK]
 | 
				
			||||||
                    self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                    self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                        self.show_tooltip, gajim.contacts.get_gc_contact(
 | 
					                        self.show_tooltip, gajim.contacts.get_gc_contact(
 | 
				
			||||||
                        account, self.room_jid, nick))
 | 
					                        account, self.room_jid, nick))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@ from subprocess import Popen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from common import i18n
 | 
					from common import i18n
 | 
				
			||||||
from common import gajim
 | 
					from common import gajim
 | 
				
			||||||
| 
						 | 
					@ -229,8 +229,8 @@ class Interface:
 | 
				
			||||||
            # we stop blocking notifications of any kind
 | 
					            # we stop blocking notifications of any kind
 | 
				
			||||||
            # this prevents from getting the roster items as 'just signed in'
 | 
					            # this prevents from getting the roster items as 'just signed in'
 | 
				
			||||||
            # contacts. 30 seconds should be enough time
 | 
					            # contacts. 30 seconds should be enough time
 | 
				
			||||||
            GObject.timeout_add_seconds(30,
 | 
					            GLib.timeout_add_seconds(30, self.unblock_signed_in_notifications,
 | 
				
			||||||
                self.unblock_signed_in_notifications, account)
 | 
					                account)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if account in self.show_vcard_when_connect and obj.show not in (
 | 
					        if account in self.show_vcard_when_connect and obj.show not in (
 | 
				
			||||||
        'offline', 'error'):
 | 
					        'offline', 'error'):
 | 
				
			||||||
| 
						 | 
					@ -370,8 +370,8 @@ class Interface:
 | 
				
			||||||
            # popup notifications for 30s
 | 
					            # popup notifications for 30s
 | 
				
			||||||
            account_jid = account + '/' + jid
 | 
					            account_jid = account + '/' + jid
 | 
				
			||||||
            gajim.block_signed_in_notifications[account_jid] = True
 | 
					            gajim.block_signed_in_notifications[account_jid] = True
 | 
				
			||||||
            GObject.timeout_add_seconds(30,
 | 
					            GLib.timeout_add_seconds(30, self.unblock_signed_in_notifications,
 | 
				
			||||||
                self.unblock_signed_in_notifications, account_jid)
 | 
					                account_jid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        highest = gajim.contacts.get_contact_with_highest_priority(account, jid)
 | 
					        highest = gajim.contacts.get_contact_with_highest_priority(account, jid)
 | 
				
			||||||
        is_highest = (highest and highest.resource == resource)
 | 
					        is_highest = (highest and highest.resource == resource)
 | 
				
			||||||
| 
						 | 
					@ -974,13 +974,13 @@ class Interface:
 | 
				
			||||||
        # then the file is not corrupt
 | 
					        # then the file is not corrupt
 | 
				
			||||||
        jid = file_props.sender
 | 
					        jid = file_props.sender
 | 
				
			||||||
        if file_props.hash_ == hash_:
 | 
					        if file_props.hash_ == hash_:
 | 
				
			||||||
            GObject.idle_add(self.popup_ft_result, account, jid, file_props)
 | 
					            GLib.idle_add(self.popup_ft_result, account, jid, file_props)
 | 
				
			||||||
            GObject.idle_add(ft_win.set_status, file_props, 'ok')
 | 
					            GLib.idle_add(ft_win.set_status, file_props, 'ok')
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            # wrong hash, we need to get the file again!
 | 
					            # wrong hash, we need to get the file again!
 | 
				
			||||||
            file_props.error = -10
 | 
					            file_props.error = -10
 | 
				
			||||||
            GObject.idle_add(self.popup_ft_result, account, jid, file_props)
 | 
					            GLib.idle_add(self.popup_ft_result, account, jid, file_props)
 | 
				
			||||||
            GObject.idle_add(ft_win.set_status, file_props, 'hash_error')
 | 
					            GLib.idle_add(ft_win.set_status, file_props, 'hash_error')
 | 
				
			||||||
        # End jingle session
 | 
					        # End jingle session
 | 
				
			||||||
        if session:
 | 
					        if session:
 | 
				
			||||||
            session.end_session()
 | 
					            session.end_session()
 | 
				
			||||||
| 
						 | 
					@ -1119,7 +1119,7 @@ class Interface:
 | 
				
			||||||
        if gajim.config.get('ask_offline_status_on_connection'):
 | 
					        if gajim.config.get('ask_offline_status_on_connection'):
 | 
				
			||||||
            # Ask offline status in 1 minute so w'are sure we got all online
 | 
					            # Ask offline status in 1 minute so w'are sure we got all online
 | 
				
			||||||
            # presences
 | 
					            # presences
 | 
				
			||||||
            GObject.timeout_add_seconds(60, self.ask_offline_status, account)
 | 
					            GLib.timeout_add_seconds(60, self.ask_offline_status, account)
 | 
				
			||||||
        if state != sleepy.STATE_UNKNOWN and connected in (2, 3):
 | 
					        if state != sleepy.STATE_UNKNOWN and connected in (2, 3):
 | 
				
			||||||
            # we go online or free for chat, so we activate auto status
 | 
					            # we go online or free for chat, so we activate auto status
 | 
				
			||||||
            gajim.sleeper_state[account] = 'online'
 | 
					            gajim.sleeper_state[account] = 'online'
 | 
				
			||||||
| 
						 | 
					@ -2189,7 +2189,7 @@ class Interface:
 | 
				
			||||||
        # For JEP-0172
 | 
					        # For JEP-0172
 | 
				
			||||||
        if added_to_roster:
 | 
					        if added_to_roster:
 | 
				
			||||||
            ctrl.user_nick = gajim.nicks[account]
 | 
					            ctrl.user_nick = gajim.nicks[account]
 | 
				
			||||||
        GObject.idle_add(mw.window.grab_focus)
 | 
					        GLib.idle_add(mw.window.grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return ctrl
 | 
					        return ctrl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2405,9 +2405,9 @@ class Interface:
 | 
				
			||||||
            # Otherwise, an exception will stop our loop
 | 
					            # Otherwise, an exception will stop our loop
 | 
				
			||||||
            timeout, in_seconds = gajim.idlequeue.PROCESS_TIMEOUT
 | 
					            timeout, in_seconds = gajim.idlequeue.PROCESS_TIMEOUT
 | 
				
			||||||
            if in_seconds:
 | 
					            if in_seconds:
 | 
				
			||||||
                GObject.timeout_add_seconds(timeout, self.process_connections)
 | 
					                GLib.timeout_add_seconds(timeout, self.process_connections)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                GObject.timeout_add(timeout, self.process_connections)
 | 
					                GLib.timeout_add(timeout, self.process_connections)
 | 
				
			||||||
            raise
 | 
					            raise
 | 
				
			||||||
        return True # renew timeout (loop for ever)
 | 
					        return True # renew timeout (loop for ever)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2620,18 +2620,18 @@ class Interface:
 | 
				
			||||||
        # get instances for windows/dialogs that will show_all()/hide()
 | 
					        # get instances for windows/dialogs that will show_all()/hide()
 | 
				
			||||||
        self.instances['file_transfers'] = dialogs.FileTransfersWindow()
 | 
					        self.instances['file_transfers'] = dialogs.FileTransfersWindow()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        GObject.timeout_add(100, self.autoconnect)
 | 
					        GLib.timeout_add(100, self.autoconnect)
 | 
				
			||||||
        timeout, in_seconds = gajim.idlequeue.PROCESS_TIMEOUT
 | 
					        timeout, in_seconds = gajim.idlequeue.PROCESS_TIMEOUT
 | 
				
			||||||
        if in_seconds:
 | 
					        if in_seconds:
 | 
				
			||||||
            GObject.timeout_add_seconds(timeout, self.process_connections)
 | 
					            GLib.timeout_add_seconds(timeout, self.process_connections)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            GObject.timeout_add(timeout, self.process_connections)
 | 
					            GLib.timeout_add(timeout, self.process_connections)
 | 
				
			||||||
        GObject.timeout_add_seconds(gajim.config.get(
 | 
					        GLib.timeout_add_seconds(gajim.config.get(
 | 
				
			||||||
                'check_idle_every_foo_seconds'), self.read_sleepy)
 | 
					                'check_idle_every_foo_seconds'), self.read_sleepy)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # when using libasyncns we need to process resolver in regular intervals
 | 
					        # when using libasyncns we need to process resolver in regular intervals
 | 
				
			||||||
        if resolver.USE_LIBASYNCNS:
 | 
					        if resolver.USE_LIBASYNCNS:
 | 
				
			||||||
            GObject.timeout_add(200, gajim.resolver.process)
 | 
					            GLib.timeout_add(200, gajim.resolver.process)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def remote_init():
 | 
					        def remote_init():
 | 
				
			||||||
            if gajim.config.get('remote_control'):
 | 
					            if gajim.config.get('remote_control'):
 | 
				
			||||||
| 
						 | 
					@ -2640,7 +2640,7 @@ class Interface:
 | 
				
			||||||
                    self.remote_ctrl = remote_control.Remote()
 | 
					                    self.remote_ctrl = remote_control.Remote()
 | 
				
			||||||
                except Exception:
 | 
					                except Exception:
 | 
				
			||||||
                    pass
 | 
					                    pass
 | 
				
			||||||
        GObject.timeout_add_seconds(5, remote_init)
 | 
					        GLib.timeout_add_seconds(5, remote_init)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self):
 | 
					    def __init__(self):
 | 
				
			||||||
        gajim.interface = self
 | 
					        gajim.interface = self
 | 
				
			||||||
| 
						 | 
					@ -2969,8 +2969,8 @@ class PassphraseRequest:
 | 
				
			||||||
        self.passphrase = passphrase
 | 
					        self.passphrase = passphrase
 | 
				
			||||||
        self.completed = True
 | 
					        self.completed = True
 | 
				
			||||||
        if passphrase is not None:
 | 
					        if passphrase is not None:
 | 
				
			||||||
            GObject.timeout_add_seconds(30,
 | 
					            GLib.timeout_add_seconds(30, gajim.interface.forget_gpg_passphrase,
 | 
				
			||||||
                gajim.interface.forget_gpg_passphrase, self.keyid)
 | 
					                self.keyid)
 | 
				
			||||||
        for (account, cb) in self.callbacks:
 | 
					        for (account, cb) in self.callbacks:
 | 
				
			||||||
            self.run_callback(account, cb)
 | 
					            self.run_callback(account, cb)
 | 
				
			||||||
        self.callbacks = []
 | 
					        self.callbacks = []
 | 
				
			||||||
| 
						 | 
					@ -3021,7 +3021,7 @@ class ThreadInterface:
 | 
				
			||||||
        def thread_function(func, func_args, callback, callback_args):
 | 
					        def thread_function(func, func_args, callback, callback_args):
 | 
				
			||||||
            output = func(*func_args)
 | 
					            output = func(*func_args)
 | 
				
			||||||
            if callback:
 | 
					            if callback:
 | 
				
			||||||
                GObject.idle_add(callback, output, *callback_args)
 | 
					                GLib.idle_add(callback, output, *callback_args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Thread(target=thread_function, args=(func, func_args, callback,
 | 
					        Thread(target=thread_function, args=(func, func_args, callback,
 | 
				
			||||||
                callback_args)).start()
 | 
					                callback_args)).start()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,6 +36,7 @@ modular.
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
| 
						 | 
					@ -895,7 +896,7 @@ class HtmlTextView(Gtk.TextView):
 | 
				
			||||||
            window = widget.get_window(Gtk.TextWindowType.TEXT)
 | 
					            window = widget.get_window(Gtk.TextWindowType.TEXT)
 | 
				
			||||||
            window.set_cursor(Gdk.Cursor.new(Gdk.CursorType.HAND2))
 | 
					            window.set_cursor(Gdk.Cursor.new(Gdk.CursorType.HAND2))
 | 
				
			||||||
            self._changed_cursor = True
 | 
					            self._changed_cursor = True
 | 
				
			||||||
            self.tooltip.timeout = GObject.timeout_add(500, self.show_tooltip,
 | 
					            self.tooltip.timeout = GLib.timeout_add(500, self.show_tooltip,
 | 
				
			||||||
                anchor_tags[0])
 | 
					                anchor_tags[0])
 | 
				
			||||||
        elif self._changed_cursor and not anchor_tags:
 | 
					        elif self._changed_cursor and not anchor_tags:
 | 
				
			||||||
            window = widget.get_window(Gtk.TextWindowType.TEXT)
 | 
					            window = widget.get_window(Gtk.TextWindowType.TEXT)
 | 
				
			||||||
| 
						 | 
					@ -1020,7 +1021,7 @@ if __name__ == '__main__':
 | 
				
			||||||
        #       if not over_line:
 | 
					        #       if not over_line:
 | 
				
			||||||
        #               line_tooltip.hide_tooltip()
 | 
					        #               line_tooltip.hide_tooltip()
 | 
				
			||||||
        #if over_line and not line_tooltip.win:
 | 
					        #if over_line and not line_tooltip.win:
 | 
				
			||||||
        #       line_tooltip.timeout = GObject.timeout_add(500,
 | 
					        #       line_tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
        #               show_line_tooltip)
 | 
					        #               show_line_tooltip)
 | 
				
			||||||
        #       htmlview.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
					        #       htmlview.tv.get_window(Gtk.TextWindowType.TEXT).set_cursor(
 | 
				
			||||||
        #               Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
					        #               Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,6 +30,7 @@
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import common
 | 
					import common
 | 
				
			||||||
| 
						 | 
					@ -276,7 +277,7 @@ class MessageWindow(object):
 | 
				
			||||||
                scrolled = True
 | 
					                scrolled = True
 | 
				
			||||||
            self.notebook.set_show_tabs(True)
 | 
					            self.notebook.set_show_tabs(True)
 | 
				
			||||||
            if scrolled:
 | 
					            if scrolled:
 | 
				
			||||||
                GObject.idle_add(conv_textview.scroll_to_end_iter)
 | 
					                GLib.idle_add(conv_textview.scroll_to_end_iter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Add notebook page and connect up to the tab's close button
 | 
					        # Add notebook page and connect up to the tab's close button
 | 
				
			||||||
        xml = gtkgui_helpers.get_gtk_builder('message_window.ui', 'chat_tab_ebox')
 | 
					        xml = gtkgui_helpers.get_gtk_builder('message_window.ui', 'chat_tab_ebox')
 | 
				
			||||||
| 
						 | 
					@ -306,7 +307,7 @@ class MessageWindow(object):
 | 
				
			||||||
        # NOTE: we do not call set_control_active(True) since we don't know
 | 
					        # NOTE: we do not call set_control_active(True) since we don't know
 | 
				
			||||||
        # whether the tab is the active one.
 | 
					        # whether the tab is the active one.
 | 
				
			||||||
        self.show_title()
 | 
					        self.show_title()
 | 
				
			||||||
        GObject.timeout_add(500, control.msg_textview.grab_focus)
 | 
					        GLib.timeout_add(500, control.msg_textview.grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_tab_eventbox_button_press_event(self, widget, event, child):
 | 
					    def on_tab_eventbox_button_press_event(self, widget, event, child):
 | 
				
			||||||
        if event.button == 3: # right click
 | 
					        if event.button == 3: # right click
 | 
				
			||||||
| 
						 | 
					@ -318,7 +319,7 @@ class MessageWindow(object):
 | 
				
			||||||
            self.remove_tab(ctrl, self.CLOSE_TAB_MIDDLE_CLICK)
 | 
					            self.remove_tab(ctrl, self.CLOSE_TAB_MIDDLE_CLICK)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            ctrl = self._widget_to_control(child)
 | 
					            ctrl = self._widget_to_control(child)
 | 
				
			||||||
            GObject.idle_add(ctrl.msg_textview.grab_focus)
 | 
					            GLib.idle_add(ctrl.msg_textview.grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _on_message_textview_mykeypress_event(self, widget, event_keyval,
 | 
					    def _on_message_textview_mykeypress_event(self, widget, event_keyval,
 | 
				
			||||||
            event_keymod):
 | 
					            event_keymod):
 | 
				
			||||||
| 
						 | 
					@ -546,7 +547,7 @@ class MessageWindow(object):
 | 
				
			||||||
        ctrl_page = self.notebook.page_num(ctrl.widget)
 | 
					        ctrl_page = self.notebook.page_num(ctrl.widget)
 | 
				
			||||||
        self.notebook.set_current_page(ctrl_page)
 | 
					        self.notebook.set_current_page(ctrl_page)
 | 
				
			||||||
        self.window.present()
 | 
					        self.window.present()
 | 
				
			||||||
        GObject.idle_add(ctrl.msg_textview.grab_focus)
 | 
					        GLib.idle_add(ctrl.msg_textview.grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def remove_tab(self, ctrl, method, reason = None, force = False):
 | 
					    def remove_tab(self, ctrl, method, reason = None, force = False):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,7 @@ from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import base64
 | 
					import base64
 | 
				
			||||||
import mimetypes
 | 
					import mimetypes
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
| 
						 | 
					@ -60,7 +61,7 @@ class ProfileWindow:
 | 
				
			||||||
        self.avatar_encoded = None
 | 
					        self.avatar_encoded = None
 | 
				
			||||||
        self.message_id = self.statusbar.push(self.context_id,
 | 
					        self.message_id = self.statusbar.push(self.context_id,
 | 
				
			||||||
            _('Retrieving profile...'))
 | 
					            _('Retrieving profile...'))
 | 
				
			||||||
        self.update_progressbar_timeout_id = GObject.timeout_add(100,
 | 
					        self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
            self.update_progressbar)
 | 
					            self.update_progressbar)
 | 
				
			||||||
        self.remove_statusbar_timeout_id = None
 | 
					        self.remove_statusbar_timeout_id = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,7 +79,7 @@ class ProfileWindow:
 | 
				
			||||||
        self.xml.get_object('ok_button').grab_focus()
 | 
					        self.xml.get_object('ok_button').grab_focus()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_information_notebook_switch_page(self, widget, page, page_num):
 | 
					    def on_information_notebook_switch_page(self, widget, page, page_num):
 | 
				
			||||||
        GObject.idle_add(self.xml.get_object('ok_button').grab_focus)
 | 
					        GLib.idle_add(self.xml.get_object('ok_button').grab_focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def update_progressbar(self):
 | 
					    def update_progressbar(self):
 | 
				
			||||||
        self.progressbar.pulse()
 | 
					        self.progressbar.pulse()
 | 
				
			||||||
| 
						 | 
					@ -90,9 +91,9 @@ class ProfileWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_profile_window_destroy(self, widget):
 | 
					    def on_profile_window_destroy(self, widget):
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
        if self.remove_statusbar_timeout_id is not None:
 | 
					        if self.remove_statusbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.remove_statusbar_timeout_id)
 | 
					            GLib.source_remove(self.remove_statusbar_timeout_id)
 | 
				
			||||||
        gajim.ged.remove_event_handler('vcard-published', ged.GUI1,
 | 
					        gajim.ged.remove_event_handler('vcard-published', ged.GUI1,
 | 
				
			||||||
            self._nec_vcard_published)
 | 
					            self._nec_vcard_published)
 | 
				
			||||||
        gajim.ged.remove_event_handler('vcard-not-published', ged.GUI1,
 | 
					        gajim.ged.remove_event_handler('vcard-not-published', ged.GUI1,
 | 
				
			||||||
| 
						 | 
					@ -237,7 +238,7 @@ class ProfileWindow:
 | 
				
			||||||
                pritext = _('Wrong date format')
 | 
					                pritext = _('Wrong date format')
 | 
				
			||||||
                dialogs.ErrorDialog(pritext, _('Format of the date must be '
 | 
					                dialogs.ErrorDialog(pritext, _('Format of the date must be '
 | 
				
			||||||
                    'YYYY-MM-DD'))
 | 
					                    'YYYY-MM-DD'))
 | 
				
			||||||
                GObject.idle_add(lambda: widget.grab_focus())
 | 
					                GLib.idle_add(lambda: widget.grab_focus())
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def set_value(self, entry_name, value):
 | 
					    def set_value(self, entry_name, value):
 | 
				
			||||||
| 
						 | 
					@ -294,9 +295,9 @@ class ProfileWindow:
 | 
				
			||||||
                self.statusbar.remove(self.context_id, self.message_id)
 | 
					                self.statusbar.remove(self.context_id, self.message_id)
 | 
				
			||||||
            self.message_id = self.statusbar.push(self.context_id,
 | 
					            self.message_id = self.statusbar.push(self.context_id,
 | 
				
			||||||
                    _('Information received'))
 | 
					                    _('Information received'))
 | 
				
			||||||
            self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
 | 
					            self.remove_statusbar_timeout_id = GLib.timeout_add_seconds(3,
 | 
				
			||||||
                self.remove_statusbar, self.message_id)
 | 
					                self.remove_statusbar, self.message_id)
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
            self.progressbar.hide()
 | 
					            self.progressbar.hide()
 | 
				
			||||||
            self.progressbar.set_fraction(0)
 | 
					            self.progressbar.set_fraction(0)
 | 
				
			||||||
            self.update_progressbar_timeout_id = None
 | 
					            self.update_progressbar_timeout_id = None
 | 
				
			||||||
| 
						 | 
					@ -386,14 +387,14 @@ class ProfileWindow:
 | 
				
			||||||
        self.message_id = self.statusbar.push(self.context_id,
 | 
					        self.message_id = self.statusbar.push(self.context_id,
 | 
				
			||||||
                _('Sending profile...'))
 | 
					                _('Sending profile...'))
 | 
				
			||||||
        self.progressbar.show()
 | 
					        self.progressbar.show()
 | 
				
			||||||
        self.update_progressbar_timeout_id = GObject.timeout_add(100,
 | 
					        self.update_progressbar_timeout_id = GLib.timeout_add(100,
 | 
				
			||||||
            self.update_progressbar)
 | 
					            self.update_progressbar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_vcard_published(self, obj):
 | 
					    def _nec_vcard_published(self, obj):
 | 
				
			||||||
        if obj.conn.name != self.account:
 | 
					        if obj.conn.name != self.account:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
            self.update_progressbar_timeout_id = None
 | 
					            self.update_progressbar_timeout_id = None
 | 
				
			||||||
        self.window.destroy()
 | 
					        self.window.destroy()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -404,10 +405,10 @@ class ProfileWindow:
 | 
				
			||||||
            self.statusbar.remove(self.context_id, self.message_id)
 | 
					            self.statusbar.remove(self.context_id, self.message_id)
 | 
				
			||||||
        self.message_id = self.statusbar.push(self.context_id,
 | 
					        self.message_id = self.statusbar.push(self.context_id,
 | 
				
			||||||
            _('Information NOT published'))
 | 
					            _('Information NOT published'))
 | 
				
			||||||
        self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
 | 
					        self.remove_statusbar_timeout_id = GLib.timeout_add_seconds(3,
 | 
				
			||||||
            self.remove_statusbar, self.message_id)
 | 
					            self.remove_statusbar, self.message_id)
 | 
				
			||||||
        if self.update_progressbar_timeout_id is not None:
 | 
					        if self.update_progressbar_timeout_id is not None:
 | 
				
			||||||
            GObject.source_remove(self.update_progressbar_timeout_id)
 | 
					            GLib.source_remove(self.update_progressbar_timeout_id)
 | 
				
			||||||
            self.progressbar.set_fraction(0)
 | 
					            self.progressbar.set_fraction(0)
 | 
				
			||||||
            self.update_progressbar_timeout_id = None
 | 
					            self.update_progressbar_timeout_id = None
 | 
				
			||||||
        dialogs.InformationDialog(_('vCard publication failed'),
 | 
					        dialogs.InformationDialog(_('vCard publication failed'),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,6 +37,7 @@ from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GdkPixbuf
 | 
					from gi.repository import GdkPixbuf
 | 
				
			||||||
from gi.repository import Pango
 | 
					from gi.repository import Pango
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GObject
 | 
				
			||||||
 | 
					from gi.repository import GLib
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
| 
						 | 
					@ -267,7 +268,7 @@ class RosterWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            it = self.model.append(None, [
 | 
					            it = self.model.append(None, [
 | 
				
			||||||
                gajim.interface.jabber_state_images['16'][show],
 | 
					                gajim.interface.jabber_state_images['16'][show],
 | 
				
			||||||
                GObject.markup_escape_text(account), 'account', our_jid,
 | 
					                GLib.markup_escape_text(account), 'account', our_jid,
 | 
				
			||||||
                account, None, None, None, None, None, tls_pixbuf] +
 | 
					                account, None, None, None, None, None, tls_pixbuf] +
 | 
				
			||||||
                [None] * self.nb_ext_renderers)
 | 
					                [None] * self.nb_ext_renderers)
 | 
				
			||||||
            self._iters[account]['account'] = it
 | 
					            self._iters[account]['account'] = it
 | 
				
			||||||
| 
						 | 
					@ -327,7 +328,7 @@ class RosterWindow:
 | 
				
			||||||
            iter_parent = self._get_account_iter(account, self.model)
 | 
					            iter_parent = self._get_account_iter(account, self.model)
 | 
				
			||||||
        iter_group = self.model.append(iter_parent,
 | 
					        iter_group = self.model.append(iter_parent,
 | 
				
			||||||
            [gajim.interface.jabber_state_images['16']['closed'],
 | 
					            [gajim.interface.jabber_state_images['16']['closed'],
 | 
				
			||||||
            GObject.markup_escape_text(group), 'group', group, account, None,
 | 
					            GLib.markup_escape_text(group), 'group', group, account, None,
 | 
				
			||||||
            None, None, None, None, None] + [None] * self.nb_ext_renderers)
 | 
					            None, None, None, None, None] + [None] * self.nb_ext_renderers)
 | 
				
			||||||
        self.draw_group(group, account)
 | 
					        self.draw_group(group, account)
 | 
				
			||||||
        self._iters[account_group]['groups'][group] = iter_group
 | 
					        self._iters[account_group]['groups'][group] = iter_group
 | 
				
			||||||
| 
						 | 
					@ -1103,7 +1104,7 @@ class RosterWindow:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        self.accounts_to_draw.append(account)
 | 
					        self.accounts_to_draw.append(account)
 | 
				
			||||||
        if len(self.accounts_to_draw) == 1:
 | 
					        if len(self.accounts_to_draw) == 1:
 | 
				
			||||||
            GObject.timeout_add(200, self._really_draw_accounts)
 | 
					            GLib.timeout_add(200, self._really_draw_accounts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _really_draw_group(self, group, account):
 | 
					    def _really_draw_group(self, group, account):
 | 
				
			||||||
        child_iter = self._get_group_iter(group, account, model=self.model)
 | 
					        child_iter = self._get_group_iter(group, account, model=self.model)
 | 
				
			||||||
| 
						 | 
					@ -1115,7 +1116,7 @@ class RosterWindow:
 | 
				
			||||||
            accounts = []
 | 
					            accounts = []
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            accounts = [account]
 | 
					            accounts = [account]
 | 
				
			||||||
        text = GObject.markup_escape_text(group)
 | 
					        text = GLib.markup_escape_text(group)
 | 
				
			||||||
        if helpers.group_is_blocked(account, group):
 | 
					        if helpers.group_is_blocked(account, group):
 | 
				
			||||||
            text = '<span strikethrough="true">%s</span>' % text
 | 
					            text = '<span strikethrough="true">%s</span>' % text
 | 
				
			||||||
        if gajim.config.get('show_contacts_number'):
 | 
					        if gajim.config.get('show_contacts_number'):
 | 
				
			||||||
| 
						 | 
					@ -1139,7 +1140,7 @@ class RosterWindow:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        self.groups_to_draw[ag] = {'group': group, 'account': account}
 | 
					        self.groups_to_draw[ag] = {'group': group, 'account': account}
 | 
				
			||||||
        if len(self.groups_to_draw) == 1:
 | 
					        if len(self.groups_to_draw) == 1:
 | 
				
			||||||
            GObject.timeout_add(200, self._really_draw_groups)
 | 
					            GLib.timeout_add(200, self._really_draw_groups)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def draw_parent_contact(self, jid, account):
 | 
					    def draw_parent_contact(self, jid, account):
 | 
				
			||||||
        child_iters = self._get_contact_iter(jid, account, model=self.model)
 | 
					        child_iters = self._get_contact_iter(jid, account, model=self.model)
 | 
				
			||||||
| 
						 | 
					@ -1173,7 +1174,7 @@ class RosterWindow:
 | 
				
			||||||
        if not child_iters:
 | 
					        if not child_iters:
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        name = GObject.markup_escape_text(contact.get_shown_name())
 | 
					        name = GLib.markup_escape_text(contact.get_shown_name())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # gets number of unread gc marked messages
 | 
					        # gets number of unread gc marked messages
 | 
				
			||||||
        if jid in gajim.interface.minimized_controls[account] and \
 | 
					        if jid in gajim.interface.minimized_controls[account] and \
 | 
				
			||||||
| 
						 | 
					@ -1226,7 +1227,7 @@ class RosterWindow:
 | 
				
			||||||
                    color.blue)
 | 
					                    color.blue)
 | 
				
			||||||
                name += '\n<span size="small" style="italic" ' \
 | 
					                name += '\n<span size="small" style="italic" ' \
 | 
				
			||||||
                    'foreground="%s">%s</span>' % (colorstring,
 | 
					                    'foreground="%s">%s</span>' % (colorstring,
 | 
				
			||||||
                    GObject.markup_escape_text(status))
 | 
					                    GLib.markup_escape_text(status))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        icon_name = helpers.get_icon_name_to_show(contact, account)
 | 
					        icon_name = helpers.get_icon_name_to_show(contact, account)
 | 
				
			||||||
        # look if another resource has awaiting events
 | 
					        # look if another resource has awaiting events
 | 
				
			||||||
| 
						 | 
					@ -1419,7 +1420,7 @@ class RosterWindow:
 | 
				
			||||||
            yield False
 | 
					            yield False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        task = _draw_all_contacts(jids, account)
 | 
					        task = _draw_all_contacts(jids, account)
 | 
				
			||||||
        GObject.idle_add(next, task)
 | 
					        GLib.idle_add(next, task)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _before_fill(self):
 | 
					    def _before_fill(self):
 | 
				
			||||||
        self.tree.freeze_child_notify()
 | 
					        self.tree.freeze_child_notify()
 | 
				
			||||||
| 
						 | 
					@ -2586,11 +2587,11 @@ class RosterWindow:
 | 
				
			||||||
        if jid in jid_list or jid == gajim.get_jid_from_account(account):
 | 
					        if jid in jid_list or jid == gajim.get_jid_from_account(account):
 | 
				
			||||||
            if not gajim.jid_is_transport(jid) and len(obj.contact_list) == 1:
 | 
					            if not gajim.jid_is_transport(jid) and len(obj.contact_list) == 1:
 | 
				
			||||||
                if obj.old_show == 0 and obj.new_show > 1:
 | 
					                if obj.old_show == 0 and obj.new_show > 1:
 | 
				
			||||||
                    GObject.timeout_add_seconds(5, self.remove_newly_added, jid,
 | 
					                    GLib.timeout_add_seconds(5, self.remove_newly_added, jid,
 | 
				
			||||||
                        account)
 | 
					                        account)
 | 
				
			||||||
                elif obj.old_show > 1 and obj.new_show == 0 and \
 | 
					                elif obj.old_show > 1 and obj.new_show == 0 and \
 | 
				
			||||||
                obj.conn.connected > 1:
 | 
					                obj.conn.connected > 1:
 | 
				
			||||||
                    GObject.timeout_add_seconds(5, self.remove_to_be_removed,
 | 
					                    GLib.timeout_add_seconds(5, self.remove_to_be_removed,
 | 
				
			||||||
                        jid, account)
 | 
					                        jid, account)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if obj.need_redraw:
 | 
					        if obj.need_redraw:
 | 
				
			||||||
| 
						 | 
					@ -2613,7 +2614,7 @@ class RosterWindow:
 | 
				
			||||||
        if obj.popup:
 | 
					        if obj.popup:
 | 
				
			||||||
            ctrl = gajim.interface.msg_win_mgr.search_control(jid, account)
 | 
					            ctrl = gajim.interface.msg_win_mgr.search_control(jid, account)
 | 
				
			||||||
            if ctrl:
 | 
					            if ctrl:
 | 
				
			||||||
                GObject.idle_add(ctrl.parent_win.set_active_tab, ctrl)
 | 
					                GLib.idle_add(ctrl.parent_win.set_active_tab, ctrl)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                ctrl = gajim.interface.new_chat(obj.contact, account)
 | 
					                ctrl = gajim.interface.new_chat(obj.contact, account)
 | 
				
			||||||
                if len(gajim.events.get_events(account, obj.jid)):
 | 
					                if len(gajim.events.get_events(account, obj.jid)):
 | 
				
			||||||
| 
						 | 
					@ -2655,7 +2656,7 @@ class RosterWindow:
 | 
				
			||||||
                            account)
 | 
					                            account)
 | 
				
			||||||
                gajim.config.set_per('accounts', account,
 | 
					                gajim.config.set_per('accounts', account,
 | 
				
			||||||
                    'opened_chat_controls', '')
 | 
					                    'opened_chat_controls', '')
 | 
				
			||||||
            GObject.idle_add(self.refilter_shown_roster_items)
 | 
					            GLib.idle_add(self.refilter_shown_roster_items)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_anonymous_auth(self, obj):
 | 
					    def _nec_anonymous_auth(self, obj):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					@ -2885,7 +2886,7 @@ class RosterWindow:
 | 
				
			||||||
                        # no connected contacts, show the ofline one
 | 
					                        # no connected contacts, show the ofline one
 | 
				
			||||||
                        connected_contacts = contacts
 | 
					                        connected_contacts = contacts
 | 
				
			||||||
                    self.tooltip.account = account
 | 
					                    self.tooltip.account = account
 | 
				
			||||||
                    self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                    self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                        self.show_tooltip, connected_contacts)
 | 
					                        self.show_tooltip, connected_contacts)
 | 
				
			||||||
            elif model[titer][C_TYPE] == 'groupchat':
 | 
					            elif model[titer][C_TYPE] == 'groupchat':
 | 
				
			||||||
                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
					                if self.tooltip.timeout == 0 or self.tooltip.id != props[0]:
 | 
				
			||||||
| 
						 | 
					@ -2894,7 +2895,7 @@ class RosterWindow:
 | 
				
			||||||
                    self.tooltip.id = row
 | 
					                    self.tooltip.id = row
 | 
				
			||||||
                    contact = gajim.contacts.get_contacts(account, jid)
 | 
					                    contact = gajim.contacts.get_contacts(account, jid)
 | 
				
			||||||
                    self.tooltip.account = account
 | 
					                    self.tooltip.account = account
 | 
				
			||||||
                    self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                    self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                        self.show_tooltip, contact)
 | 
					                        self.show_tooltip, contact)
 | 
				
			||||||
            elif model[titer][C_TYPE] == 'account':
 | 
					            elif model[titer][C_TYPE] == 'account':
 | 
				
			||||||
                # we're on an account entry in the roster
 | 
					                # we're on an account entry in the roster
 | 
				
			||||||
| 
						 | 
					@ -2903,7 +2904,7 @@ class RosterWindow:
 | 
				
			||||||
                    if account == 'all':
 | 
					                    if account == 'all':
 | 
				
			||||||
                        self.tooltip.id = row
 | 
					                        self.tooltip.id = row
 | 
				
			||||||
                        self.tooltip.account = None
 | 
					                        self.tooltip.account = None
 | 
				
			||||||
                        self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                        self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                            self.show_tooltip, [])
 | 
					                            self.show_tooltip, [])
 | 
				
			||||||
                        return
 | 
					                        return
 | 
				
			||||||
                    jid = gajim.get_jid_from_account(account)
 | 
					                    jid = gajim.get_jid_from_account(account)
 | 
				
			||||||
| 
						 | 
					@ -2957,7 +2958,7 @@ class RosterWindow:
 | 
				
			||||||
                                contacts.append(contact)
 | 
					                                contacts.append(contact)
 | 
				
			||||||
                    self.tooltip.id = row
 | 
					                    self.tooltip.id = row
 | 
				
			||||||
                    self.tooltip.account = None
 | 
					                    self.tooltip.account = None
 | 
				
			||||||
                    self.tooltip.timeout = GObject.timeout_add(500,
 | 
					                    self.tooltip.timeout = GLib.timeout_add(500,
 | 
				
			||||||
                        self.show_tooltip, contacts)
 | 
					                        self.show_tooltip, contacts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_agent_logging(self, widget, jid, state, account):
 | 
					    def on_agent_logging(self, widget, jid, state, account):
 | 
				
			||||||
| 
						 | 
					@ -3108,7 +3109,7 @@ class RosterWindow:
 | 
				
			||||||
            old_text = jid
 | 
					            old_text = jid
 | 
				
			||||||
            title = _('Rename Group')
 | 
					            title = _('Rename Group')
 | 
				
			||||||
            message = _('Enter a new name for group %s') % \
 | 
					            message = _('Enter a new name for group %s') % \
 | 
				
			||||||
                    GObject.markup_escape_text(jid)
 | 
					                GLib.markup_escape_text(jid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def on_renamed(new_text, account, row_type, jid, old_text):
 | 
					        def on_renamed(new_text, account, row_type, jid, old_text):
 | 
				
			||||||
            if 'rename' in gajim.interface.instances:
 | 
					            if 'rename' in gajim.interface.instances:
 | 
				
			||||||
| 
						 | 
					@ -4270,7 +4271,7 @@ class RosterWindow:
 | 
				
			||||||
                if self.filtering:
 | 
					                if self.filtering:
 | 
				
			||||||
                    # Prevent endless loops
 | 
					                    # Prevent endless loops
 | 
				
			||||||
                    jid = model[titer][C_JID]
 | 
					                    jid = model[titer][C_JID]
 | 
				
			||||||
                    GObject.idle_add(self.draw_contact, jid, account)
 | 
					                    GLib.idle_add(self.draw_contact, jid, account)
 | 
				
			||||||
        elif type_ == 'group':
 | 
					        elif type_ == 'group':
 | 
				
			||||||
            group = model[titer][C_JID]
 | 
					            group = model[titer][C_JID]
 | 
				
			||||||
            self._adjust_group_expand_collapse_state(group, account)
 | 
					            self._adjust_group_expand_collapse_state(group, account)
 | 
				
			||||||
| 
						 | 
					@ -4292,7 +4293,7 @@ class RosterWindow:
 | 
				
			||||||
#               if len(self._last_selected_contact):
 | 
					#               if len(self._last_selected_contact):
 | 
				
			||||||
#                       # update unselected rows
 | 
					#                       # update unselected rows
 | 
				
			||||||
#                       for (jid, account) in self._last_selected_contact:
 | 
					#                       for (jid, account) in self._last_selected_contact:
 | 
				
			||||||
#                               GObject.idle_add(self.draw_contact, jid,
 | 
					#                               GLib.idle_add(self.draw_contact, jid,
 | 
				
			||||||
#                                       account)
 | 
					#                                       account)
 | 
				
			||||||
#               self._last_selected_contact = []
 | 
					#               self._last_selected_contact = []
 | 
				
			||||||
#               if len(list_of_paths) == 0:
 | 
					#               if len(list_of_paths) == 0:
 | 
				
			||||||
| 
						 | 
					@ -4305,7 +4306,7 @@ class RosterWindow:
 | 
				
			||||||
#                       jid = row[C_JID]
 | 
					#                       jid = row[C_JID]
 | 
				
			||||||
#                       account = row[C_ACCOUNT]
 | 
					#                       account = row[C_ACCOUNT]
 | 
				
			||||||
#                       self._last_selected_contact.append((jid, account))
 | 
					#                       self._last_selected_contact.append((jid, account))
 | 
				
			||||||
#                       GObject.idle_add(self.draw_contact, jid, account, True)
 | 
					#                       GLib.idle_add(self.draw_contact, jid, account, True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_service_disco_menuitem_activate(self, widget, account):
 | 
					    def on_service_disco_menuitem_activate(self, widget, account):
 | 
				
			||||||
        server_jid = gajim.config.get_per('accounts', account, 'hostname')
 | 
					        server_jid = gajim.config.get_per('accounts', account, 'hostname')
 | 
				
			||||||
| 
						 | 
					@ -6651,7 +6652,7 @@ class RosterWindow:
 | 
				
			||||||
                    config.AccountCreationWizardWindow()
 | 
					                    config.AccountCreationWizardWindow()
 | 
				
			||||||
            # Open wizard only after roster is created, so we can make it
 | 
					            # Open wizard only after roster is created, so we can make it
 | 
				
			||||||
            # transient for the roster window
 | 
					            # transient for the roster window
 | 
				
			||||||
            GObject.idle_add(_open_wizard)
 | 
					            GLib.idle_add(_open_wizard)
 | 
				
			||||||
        if not gajim.ZEROCONF_ACC_NAME in gajim.config.get_per('accounts'):
 | 
					        if not gajim.ZEROCONF_ACC_NAME in gajim.config.get_per('accounts'):
 | 
				
			||||||
            # Create zeroconf in config file
 | 
					            # Create zeroconf in config file
 | 
				
			||||||
            from common.zeroconf import connection_zeroconf
 | 
					            from common.zeroconf import connection_zeroconf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 | 
					## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from common import gajim
 | 
					from common import gajim
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,7 @@ class SearchWindow:
 | 
				
			||||||
        self.xml.connect_signals(self)
 | 
					        self.xml.connect_signals(self)
 | 
				
			||||||
        self.window.show_all()
 | 
					        self.window.show_all()
 | 
				
			||||||
        self.request_form()
 | 
					        self.request_form()
 | 
				
			||||||
        self.pulse_id = GObject.timeout_add(80, self.pulse_callback)
 | 
					        self.pulse_id = GLib.timeout_add(80, self.pulse_callback)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.is_form = None
 | 
					        self.is_form = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ class SearchWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_search_window_destroy(self, widget):
 | 
					    def on_search_window_destroy(self, widget):
 | 
				
			||||||
        if self.pulse_id:
 | 
					        if self.pulse_id:
 | 
				
			||||||
            GObject.source_remove(self.pulse_id)
 | 
					            GLib.source_remove(self.pulse_id)
 | 
				
			||||||
        del gajim.interface.instances[self.account]['search'][self.jid]
 | 
					        del gajim.interface.instances[self.account]['search'][self.jid]
 | 
				
			||||||
        gajim.ged.remove_event_handler('search-form-received', ged.GUI1,
 | 
					        gajim.ged.remove_event_handler('search-form-received', ged.GUI1,
 | 
				
			||||||
            self._nec_search_form_received)
 | 
					            self._nec_search_form_received)
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@ class SearchWindow:
 | 
				
			||||||
        self.progressbar.show()
 | 
					        self.progressbar.show()
 | 
				
			||||||
        self.label.set_text(_('Waiting for results'))
 | 
					        self.label.set_text(_('Waiting for results'))
 | 
				
			||||||
        self.label.show()
 | 
					        self.label.show()
 | 
				
			||||||
        self.pulse_id = GObject.timeout_add(80, self.pulse_callback)
 | 
					        self.pulse_id = GLib.timeout_add(80, self.pulse_callback)
 | 
				
			||||||
        self.search_button.hide()
 | 
					        self.search_button.hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def on_add_contact_button_clicked(self, widget):
 | 
					    def on_add_contact_button_clicked(self, widget):
 | 
				
			||||||
| 
						 | 
					@ -128,7 +128,7 @@ class SearchWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_search_form_received(self, obj):
 | 
					    def _nec_search_form_received(self, obj):
 | 
				
			||||||
        if self.pulse_id:
 | 
					        if self.pulse_id:
 | 
				
			||||||
            GObject.source_remove(self.pulse_id)
 | 
					            GLib.source_remove(self.pulse_id)
 | 
				
			||||||
        self.progressbar.hide()
 | 
					        self.progressbar.hide()
 | 
				
			||||||
        self.label.hide()
 | 
					        self.label.hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@ class SearchWindow:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _nec_search_result_received(self, obj):
 | 
					    def _nec_search_result_received(self, obj):
 | 
				
			||||||
        if self.pulse_id:
 | 
					        if self.pulse_id:
 | 
				
			||||||
            GObject.source_remove(self.pulse_id)
 | 
					            GLib.source_remove(self.pulse_id)
 | 
				
			||||||
        self.progressbar.hide()
 | 
					        self.progressbar.hide()
 | 
				
			||||||
        self.label.hide()
 | 
					        self.label.hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from gi.repository import Gtk
 | 
					from gi.repository import Gtk
 | 
				
			||||||
from gi.repository import Gdk
 | 
					from gi.repository import Gdk
 | 
				
			||||||
from gi.repository import GObject
 | 
					from gi.repository import GLib
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import locale
 | 
					import locale
 | 
				
			||||||
| 
						 | 
					@ -155,7 +155,7 @@ class BaseTooltip:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def hide_tooltip(self):
 | 
					    def hide_tooltip(self):
 | 
				
			||||||
        if self.timeout > 0:
 | 
					        if self.timeout > 0:
 | 
				
			||||||
            GObject.source_remove(self.timeout)
 | 
					            GLib.source_remove(self.timeout)
 | 
				
			||||||
            self.timeout = 0
 | 
					            self.timeout = 0
 | 
				
			||||||
        if self.win:
 | 
					        if self.win:
 | 
				
			||||||
            self.win.destroy()
 | 
					            self.win.destroy()
 | 
				
			||||||
| 
						 | 
					@ -241,8 +241,8 @@ class StatusTable:
 | 
				
			||||||
            if status != '':
 | 
					            if status != '':
 | 
				
			||||||
                # reduce to 100 chars, 1 line
 | 
					                # reduce to 100 chars, 1 line
 | 
				
			||||||
                status = helpers.reduce_chars_newlines(status, 100, 1)
 | 
					                status = helpers.reduce_chars_newlines(status, 100, 1)
 | 
				
			||||||
                str_status = GObject.markup_escape_text(str_status)
 | 
					                str_status = GLib.markup_escape_text(str_status)
 | 
				
			||||||
                status = GObject.markup_escape_text(status)
 | 
					                status = GLib.markup_escape_text(status)
 | 
				
			||||||
                str_status += ' - <i>' + status + '</i>'
 | 
					                str_status += ' - <i>' + status + '</i>'
 | 
				
			||||||
        return str_status
 | 
					        return str_status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -299,7 +299,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
 | 
				
			||||||
        for acct in accounts:
 | 
					        for acct in accounts:
 | 
				
			||||||
            message = acct['message']
 | 
					            message = acct['message']
 | 
				
			||||||
            message = helpers.reduce_chars_newlines(message, 100, 1)
 | 
					            message = helpers.reduce_chars_newlines(message, 100, 1)
 | 
				
			||||||
            message = GObject.markup_escape_text(message)
 | 
					            message = GLib.markup_escape_text(message)
 | 
				
			||||||
            if acct['name'] in gajim.con_types and \
 | 
					            if acct['name'] in gajim.con_types and \
 | 
				
			||||||
                    gajim.con_types[acct['name']] in ('tls', 'ssl'):
 | 
					                    gajim.con_types[acct['name']] in ('tls', 'ssl'):
 | 
				
			||||||
                show_lock = True
 | 
					                show_lock = True
 | 
				
			||||||
| 
						 | 
					@ -307,12 +307,12 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
 | 
				
			||||||
                show_lock = False
 | 
					                show_lock = False
 | 
				
			||||||
            if message:
 | 
					            if message:
 | 
				
			||||||
                self.add_status_row(file_path, acct['show'],
 | 
					                self.add_status_row(file_path, acct['show'],
 | 
				
			||||||
                        GObject.markup_escape_text(acct['name']) + \
 | 
					                    GLib.markup_escape_text(acct['name']) + ' - ' + message,
 | 
				
			||||||
                        ' - ' + message, show_lock=show_lock, indent=False)
 | 
					                    show_lock=show_lock, indent=False)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self.add_status_row(file_path, acct['show'],
 | 
					                self.add_status_row(file_path, acct['show'],
 | 
				
			||||||
                        GObject.markup_escape_text(acct['name'])
 | 
					                    GLib.markup_escape_text(acct['name']), show_lock=show_lock,
 | 
				
			||||||
                        , show_lock=show_lock, indent=False)
 | 
					                    indent=False)
 | 
				
			||||||
            for line in acct['event_lines']:
 | 
					            for line in acct['event_lines']:
 | 
				
			||||||
                self.add_text_row('  ' + line, 1)
 | 
					                self.add_text_row('  ' + line, 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -354,8 +354,7 @@ class GCTooltip(BaseTooltip):
 | 
				
			||||||
        vcard_current_row = 1
 | 
					        vcard_current_row = 1
 | 
				
			||||||
        properties = []
 | 
					        properties = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        nick_markup = '<b>' + \
 | 
					        nick_markup = '<b>' + GLib.markup_escape_text(contact.get_shown_name())\
 | 
				
			||||||
                GObject.markup_escape_text(contact.get_shown_name()) \
 | 
					 | 
				
			||||||
            + '</b>'
 | 
					            + '</b>'
 | 
				
			||||||
        properties.append((nick_markup, None))
 | 
					        properties.append((nick_markup, None))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -364,8 +363,7 @@ class GCTooltip(BaseTooltip):
 | 
				
			||||||
            if status != '':
 | 
					            if status != '':
 | 
				
			||||||
                # escape markup entities
 | 
					                # escape markup entities
 | 
				
			||||||
                status = helpers.reduce_chars_newlines(status, 300, 5)
 | 
					                status = helpers.reduce_chars_newlines(status, 300, 5)
 | 
				
			||||||
                status = '<i>' +\
 | 
					                status = '<i>' + GLib.markup_escape_text(status) + '</i>'
 | 
				
			||||||
                        GObject.markup_escape_text(status) + '</i>'
 | 
					 | 
				
			||||||
                properties.append((status, None))
 | 
					                properties.append((status, None))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        show = helpers.get_uf_show(contact.show)
 | 
					        show = helpers.get_uf_show(contact.show)
 | 
				
			||||||
| 
						 | 
					@ -376,8 +374,8 @@ class GCTooltip(BaseTooltip):
 | 
				
			||||||
            properties.append((_('Jabber ID: '), "<b>%s</b>" % contact.jid))
 | 
					            properties.append((_('Jabber ID: '), "<b>%s</b>" % contact.jid))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if hasattr(contact, 'resource') and contact.resource.strip():
 | 
					        if hasattr(contact, 'resource') and contact.resource.strip():
 | 
				
			||||||
            properties.append((_('Resource: '),
 | 
					            properties.append((_('Resource: '), GLib.markup_escape_text(
 | 
				
			||||||
                    GObject.markup_escape_text(contact.resource)))
 | 
					                contact.resource)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if contact.affiliation != 'none':
 | 
					        if contact.affiliation != 'none':
 | 
				
			||||||
            uf_affiliation = helpers.get_uf_affiliation(contact.affiliation)
 | 
					            uf_affiliation = helpers.get_uf_affiliation(contact.affiliation)
 | 
				
			||||||
| 
						 | 
					@ -480,13 +478,12 @@ class RosterTooltip(NotificationAreaTooltip):
 | 
				
			||||||
        vcard_current_row = 1
 | 
					        vcard_current_row = 1
 | 
				
			||||||
        properties = []
 | 
					        properties = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        name_markup = '<span weight="bold">' + \
 | 
					        name_markup = '<span weight="bold">' + GLib.markup_escape_text(
 | 
				
			||||||
                GObject.markup_escape_text(prim_contact.get_shown_name())\
 | 
					            prim_contact.get_shown_name()) + '</span>'
 | 
				
			||||||
                + '</span>'
 | 
					 | 
				
			||||||
        if gajim.config.get('mergeaccounts'):
 | 
					        if gajim.config.get('mergeaccounts'):
 | 
				
			||||||
            name_markup += " <span foreground='%s'>(%s)</span>" % (
 | 
					            name_markup += " <span foreground='%s'>(%s)</span>" % (
 | 
				
			||||||
                gajim.config.get('tooltip_account_name_color'),
 | 
					                gajim.config.get('tooltip_account_name_color'),
 | 
				
			||||||
                GObject.markup_escape_text(prim_contact.account.name))
 | 
					                GLib.markup_escape_text(prim_contact.account.name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.account and helpers.jid_is_blocked(self.account,
 | 
					        if self.account and helpers.jid_is_blocked(self.account,
 | 
				
			||||||
        prim_contact.jid):
 | 
					        prim_contact.jid):
 | 
				
			||||||
| 
						 | 
					@ -586,7 +583,7 @@ class RosterTooltip(NotificationAreaTooltip):
 | 
				
			||||||
                        # status is wrapped
 | 
					                        # status is wrapped
 | 
				
			||||||
                        status = helpers.reduce_chars_newlines(status, 300, 5)
 | 
					                        status = helpers.reduce_chars_newlines(status, 300, 5)
 | 
				
			||||||
                        # escape markup entities.
 | 
					                        # escape markup entities.
 | 
				
			||||||
                        status = GObject.markup_escape_text(status)
 | 
					                        status = GLib.markup_escape_text(status)
 | 
				
			||||||
                        properties.append(('<i>%s</i>' % status, None))
 | 
					                        properties.append(('<i>%s</i>' % status, None))
 | 
				
			||||||
                properties.append((show, None))
 | 
					                properties.append((show, None))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -596,15 +593,14 @@ class RosterTooltip(NotificationAreaTooltip):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # contact has only one ressource
 | 
					        # contact has only one ressource
 | 
				
			||||||
        if num_resources == 1 and contact.resource:
 | 
					        if num_resources == 1 and contact.resource:
 | 
				
			||||||
            properties.append((_('Resource: '),
 | 
					            properties.append((_('Resource: '), GLib.markup_escape_text(
 | 
				
			||||||
                    GObject.markup_escape_text(contact.resource) +\
 | 
					                contact.resource) + ' (' + str(contact.priority) + ')'))
 | 
				
			||||||
                    ' (' + str(contact.priority) + ')'))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.account and prim_contact.sub and prim_contact.sub != 'both' and\
 | 
					        if self.account and prim_contact.sub and prim_contact.sub != 'both' and\
 | 
				
			||||||
        prim_contact.jid not in gajim.gc_connected[self.account]:
 | 
					        prim_contact.jid not in gajim.gc_connected[self.account]:
 | 
				
			||||||
            # ('both' is the normal sub so we don't show it)
 | 
					            # ('both' is the normal sub so we don't show it)
 | 
				
			||||||
            properties.append(( _('Subscription: '),
 | 
					            properties.append(( _('Subscription: '), GLib.markup_escape_text(
 | 
				
			||||||
                    GObject.markup_escape_text(helpers.get_uf_sub(prim_contact.sub))))
 | 
					                helpers.get_uf_sub(prim_contact.sub))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if prim_contact.keyID:
 | 
					        if prim_contact.keyID:
 | 
				
			||||||
            keyID = None
 | 
					            keyID = None
 | 
				
			||||||
| 
						 | 
					@ -613,8 +609,8 @@ class RosterTooltip(NotificationAreaTooltip):
 | 
				
			||||||
            elif len(prim_contact.keyID) == 16:
 | 
					            elif len(prim_contact.keyID) == 16:
 | 
				
			||||||
                keyID = prim_contact.keyID[8:]
 | 
					                keyID = prim_contact.keyID[8:]
 | 
				
			||||||
            if keyID:
 | 
					            if keyID:
 | 
				
			||||||
                properties.append((_('OpenPGP: '),
 | 
					                properties.append((_('OpenPGP: '), GLib.markup_escape_text(
 | 
				
			||||||
                        GObject.markup_escape_text(keyID)))
 | 
					                    keyID)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if contact.last_activity_time:
 | 
					        if contact.last_activity_time:
 | 
				
			||||||
            last_active = datetime(*contact.last_activity_time[:6])
 | 
					            last_active = datetime(*contact.last_activity_time[:6])
 | 
				
			||||||
| 
						 | 
					@ -730,8 +726,7 @@ class FileTransfersTooltip(BaseTooltip):
 | 
				
			||||||
            file_name = os.path.split(file_props.file_name)[1]
 | 
					            file_name = os.path.split(file_props.file_name)[1]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            file_name = file_props.name
 | 
					            file_name = file_props.name
 | 
				
			||||||
        properties.append((_('Name: '),
 | 
					        properties.append((_('Name: '), GLib.markup_escape_text(file_name)))
 | 
				
			||||||
                GObject.markup_escape_text(file_name)))
 | 
					 | 
				
			||||||
        if file_props.type_ == 'r':
 | 
					        if file_props.type_ == 'r':
 | 
				
			||||||
            type_ = _('Download')
 | 
					            type_ = _('Download')
 | 
				
			||||||
            actor = _('Sender: ')
 | 
					            actor = _('Sender: ')
 | 
				
			||||||
| 
						 | 
					@ -747,7 +742,7 @@ class FileTransfersTooltip(BaseTooltip):
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                name = receiver.split('/')[0]
 | 
					                name = receiver.split('/')[0]
 | 
				
			||||||
        properties.append((_('Type: '), type_))
 | 
					        properties.append((_('Type: '), type_))
 | 
				
			||||||
        properties.append((actor, GObject.markup_escape_text(name)))
 | 
					        properties.append((actor, GLib.markup_escape_text(name)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        transfered_len = file_props.received_len
 | 
					        transfered_len = file_props.received_len
 | 
				
			||||||
        if not transfered_len:
 | 
					        if not transfered_len:
 | 
				
			||||||
| 
						 | 
					@ -775,7 +770,7 @@ class FileTransfersTooltip(BaseTooltip):
 | 
				
			||||||
            status = _('Not started')
 | 
					            status = _('Not started')
 | 
				
			||||||
        properties.append((_('Status: '), status))
 | 
					        properties.append((_('Status: '), status))
 | 
				
			||||||
        file_desc = file_props.desc
 | 
					        file_desc = file_props.desc
 | 
				
			||||||
        properties.append((_('Description: '), GObject.markup_escape_text(
 | 
					        properties.append((_('Description: '), GLib.markup_escape_text(
 | 
				
			||||||
            file_desc)))
 | 
					            file_desc)))
 | 
				
			||||||
        while properties:
 | 
					        while properties:
 | 
				
			||||||
            property_ = properties.pop(0)
 | 
					            property_ = properties.pop(0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue