Exemplo n.º 1
0
    def __init__(self, session):
        """constructor
        """
        BaseTable.__init__(self, 4, 2)
        self.session = session

        langs = list_dicts()

        self.spell_lang = self.session.config.get_or_set("spell_lang", "en")
        self.lang_menu = gtk.combo_box_new_text()
        self.lang_menu.connect("changed", self._on_lang_combo_change)

        index = 0
        for lang in langs:
            self.lang_menu.append_text(lang)
            if lang == self.spell_lang:
                self.lang_menu.set_active(index)
            index += 1

        self.append_markup('<b>'+_('Main window:')+'</b>')
        self.append_check(_('Show user panel'),
            'session.config.b_show_userpanel')
        self.append_markup('<b>'+_('Conversation window:')+'</b>')
        self.session.config.get_or_set('b_avatar_on_left', False)
        self.session.config.get_or_set('b_toolbar_small', False)
        self.session.config.get_or_set('b_conversation_tabs', True)
        self.append_check(_('Tabbed Conversations'),
                'session.config.b_conversation_tabs')
        self.session.config.get_or_set('b_show_avatar_in_taskbar', True)
        self.append_check(_('Start minimized/iconified'), 'session.config.b_conv_minimized')
        self.append_check(_('Show emoticons'), 'session.config.b_show_emoticons')
        self.append_check(_('Show conversation header'),
            'session.config.b_show_header')
        self.append_check(_('Show conversation side panel'),
            'session.config.b_show_info')
        self.append_check(_('Show conversation toolbar'),
            'session.config.b_show_toolbar')
        self.append_check(_('Small conversation toolbar'),
            'session.config.b_toolbar_small')
        self.append_check(_('Avatar on conversation left side'),
            'session.config.b_avatar_on_left')
        self.append_check(_('Allow auto scroll in conversation'),
            'session.config.b_allow_auto_scroll')
        self.append_check(_('Enable spell check if available (requires %s)') % 'python-gtkspell',
            'session.config.b_enable_spell_check')
        self.attach(self.lang_menu, 2, 3, 12, 13) 
        self.append_check(_('Show avatars in taskbar instead of status icons'), 
            'session.config.b_show_avatar_in_taskbar')

        self.append_range(_('Contact list avatar size'),
            'session.config.i_avatar_size', 18, 64)
        self.append_range(_('Conversation avatar size'),
            'session.config.i_conv_avatar_size', 18, 128)
        
        self.session.config.subscribe(self._on_spell_change,
            'b_enable_spell_check')
        
        self.show_all()
Exemplo n.º 2
0
    def __init__(self, session):
        """constructor
        """
        BaseTable.__init__(self, 17, 1)
        self.set_border_width(5)
        self.session = session

        #language option

        langs = list_dicts()

        self.spell_lang = self.session.config.get_or_set("spell_lang", "en")
        self.lang_menu = gtk.combo_box_new_text()
        self.lang_menu.connect("changed", self._on_lang_combo_change)

        index = 0
        for lang in langs:
            self.lang_menu.append_text(lang)
            if lang == self.spell_lang:
                self.lang_menu.set_active(index)
            index += 1

        cb_check_spelling = self.create_check(
            _('Enable spell check if available (requires %s)') % 'python-gtkspell',
            'session.config.b_enable_spell_check')

        h_lang_box = gtk.HBox()
        h_lang_box.pack_start(cb_check_spelling)
        h_lang_box.pack_start(self.lang_menu)

        # override text color option

        cb_override_text_color = self.create_check(_('Override incoming text color'),
            'session.config.b_override_text_color')
        self.session.config.subscribe(self._on_cb_override_text_color_toggled,
            'b_override_text_color')

        def on_color_selected(cb):
            col = cb.get_color()
            col_e3 = e3.base.Color(col.red, col.green, col.blue)
            self.set_attr('session.config.override_text_color', '#'+col_e3.to_hex())

        self.b_text_color = gtk.ColorButton(color=gtk.gdk.color_parse(
                            self.get_attr('session.config.override_text_color')))
        self.b_text_color.set_use_alpha(False)
        self.b_text_color.connect('color-set', on_color_selected)
        h_color_box = gtk.HBox()
        h_color_box.pack_start(cb_override_text_color)
        h_color_box.pack_start(self.b_text_color)

        # preference list

        self.session.config.get_or_set('i_tab_position', 0)
        self.tab_pos_cb = self.create_combo_with_label(_('Tab position'),
            self.get_tab_positions, 'session.config.i_tab_position',range(4))

        self.session.config.get_or_set('b_avatar_on_left', False)
        self.session.config.get_or_set('b_toolbar_small', False)
        self.session.config.get_or_set('b_conversation_tabs', True)
        self.session.config.get_or_set('b_conv_tab_popup', False)
        self.append_check(_('Tabbed Conversations'),
                'session.config.b_conversation_tabs')
        self.append_row(self.tab_pos_cb)
        self.session.config.get_or_set('b_show_avatar_in_taskbar', True)
        self.append_check(_('Start minimized/iconified'), 'session.config.b_conv_minimized')
        self.append_check(_('Show emoticons'), 'session.config.b_show_emoticons')
        self.append_check(_('Show conversation header'),
            'session.config.b_show_header')
        self.append_check(_('Show conversation side panel'),
            'session.config.b_show_info')
        self.append_check(_('Show conversation toolbar'),
            'session.config.b_show_toolbar')
        self.append_check(_('Show tabs popup menu'),
            'session.config.b_conv_tab_popup')
        # small-toolbar sensitivity depends on conversation toolbar visibility
        self.cb_small_toolbar = self.create_check(_('Small conversation toolbar'),
            'session.config.b_toolbar_small')
        self.session.config.subscribe(self._on_cb_show_toolbar_changed,
            'b_show_toolbar')
        self.append_row(self.cb_small_toolbar)

        # Avatar-on-left sensitivity depends on side panel visibility
        self.cb_avatar_left = self.create_check(_('Avatar on conversation left side'),
            'session.config.b_avatar_on_left')
        self.session.config.subscribe(self._on_cb_side_panel_changed,
            'b_show_info')
        self.append_row(self.cb_avatar_left)
        self.append_check(_('Allow auto scroll in conversation'),
            'session.config.b_allow_auto_scroll')
        self.append_row(h_lang_box)
        self.append_check(_('Show avatars in taskbar instead of status icons'),
            'session.config.b_show_avatar_in_taskbar')

        self.append_row(h_color_box)
        #update ColorButton sensitive
        self._on_cb_override_text_color_toggled(
                self.session.config.get_or_set('b_override_text_color', False))

        self.append_range(_('Conversation avatar size'),
            'session.config.i_conv_avatar_size', 18, 128)

        self.session.config.subscribe(self._on_spell_change,
            'b_enable_spell_check')

        self.session.config.subscribe(self._on_conversation_tabs_change,
            'b_conversation_tabs')

        #update tab_pos combo sensitivity
        self._on_conversation_tabs_change(self.session.config.get_or_set('b_conversation_tabs', True))
        #update spell lang combo sensitivity
        self._on_spell_change(self.session.config.get_or_set('b_enable_spell_check', False))
        #update side-panel dependent options sensitivity
        self._on_cb_side_panel_changed(self.session.config.get_or_set('b_show_info', True))
        #update small-toolbar sensitivity
        self._on_cb_show_toolbar_changed(self.session.config.get_or_set('b_show_toolbar', True))

        self.show_all()
Exemplo n.º 3
0
    def __init__(self, session):
        """constructor
        """
        BaseTable.__init__(self, 17, 2)
        self.set_border_width(5)
        self.session = session

        langs = list_dicts()

        self.spell_lang = self.session.config.get_or_set("spell_lang", "en")
        self.lang_menu = gtk.combo_box_new_text()
        self.lang_menu.connect("changed", self._on_lang_combo_change)

        index = 0
        for lang in langs:
            self.lang_menu.append_text(lang)
            if lang == self.spell_lang:
                self.lang_menu.set_active(index)
            index += 1

        self.session.config.get_or_set('i_tab_position', 0)
        self.tab_pos_cb = self.create_combo_with_label(_('Tab position'), self.get_tab_positions,
                'session.config.i_tab_position',range(4))

        self.append_markup('<b>'+_('Main window:')+'</b>')
        self.append_check(_('Show user panel'),
            'session.config.b_show_userpanel')
        self.append_markup('<b>'+_('Conversation window:')+'</b>')
        self.session.config.get_or_set('b_avatar_on_left', False)
        self.session.config.get_or_set('b_toolbar_small', False)
        self.session.config.get_or_set('b_conversation_tabs', True)
        self.append_check(_('Tabbed Conversations'),
                'session.config.b_conversation_tabs')
        self.append_row(self.tab_pos_cb)
        self.session.config.get_or_set('b_show_avatar_in_taskbar', True)
        self.append_check(_('Start minimized/iconified'), 'session.config.b_conv_minimized')
        self.append_check(_('Show emoticons'), 'session.config.b_show_emoticons')
        self.append_check(_('Show conversation header'),
            'session.config.b_show_header')
        self.append_check(_('Show conversation side panel'),
            'session.config.b_show_info')
        self.append_check(_('Show conversation toolbar'),
            'session.config.b_show_toolbar')
        # small-toolbar sensitivity depends on conversation toolbar visibility
        self.cb_small_toolbar = self.create_check(_('Small conversation toolbar'), 
            'session.config.b_toolbar_small')
        self.session.config.subscribe(self._on_cb_show_toolbar_changed,
            'b_show_toolbar')
        self.append_row(self.cb_small_toolbar)

        # Avatar-on-left sensitivity depends on side panel visibility
        self.cb_avatar_left = self.create_check(_('Avatar on conversation left side'), 
            'session.config.b_avatar_on_left')
        self.session.config.subscribe(self._on_cb_side_panel_changed,
            'b_show_info')
        self.append_row(self.cb_avatar_left)
        self.append_check(_('Allow auto scroll in conversation'),
            'session.config.b_allow_auto_scroll')
        self.append_check(_('Enable spell check if available (requires %s)') % 'python-gtkspell',
            'session.config.b_enable_spell_check')
        self.attach(self.lang_menu, 2, 3, 13, 14)
        self.append_check(_('Show avatars in taskbar instead of status icons'), 
            'session.config.b_show_avatar_in_taskbar')

        self.append_range(_('Contact list avatar size'),
            'session.config.i_avatar_size', 18, 64)
        self.append_range(_('Conversation avatar size'),
            'session.config.i_conv_avatar_size', 18, 128)
        
        self.session.config.subscribe(self._on_spell_change,
            'b_enable_spell_check')

        self.session.config.subscribe(self._on_conversation_tabs_change,
            'b_conversation_tabs')

        #update tab_pos combo sensitivity
        self._on_conversation_tabs_change(self.session.config.get_or_set('b_conversation_tabs', True))
        #update spell lang combo sensitivity
        self._on_spell_change(self.session.config.get_or_set('b_enable_spell_check', False))
        #update side-panel dependent options sensitivity
        self._on_cb_side_panel_changed(self.session.config.get_or_set('b_show_info', True))
        #update small-toolbar sensitivity
        self._on_cb_show_toolbar_changed(self.session.config.get_or_set('b_show_toolbar', True))

        self.show_all()
Exemplo n.º 4
0
    def __init__(self, session):
        """constructor
        """
        BaseTable.__init__(self, 17, 2)
        self.set_border_width(5)
        self.session = session

        langs = list_dicts()

        self.spell_lang = self.session.config.get_or_set("spell_lang", "en")
        self.lang_menu = gtk.combo_box_new_text()
        self.lang_menu.connect("changed", self._on_lang_combo_change)

        index = 0
        for lang in langs:
            self.lang_menu.append_text(lang)
            if lang == self.spell_lang:
                self.lang_menu.set_active(index)
            index += 1

        self.session.config.get_or_set('i_tab_position', 0)
        self.tab_pos_cb = self.create_combo_with_label(
            _('Tab position'), self.get_tab_positions,
            'session.config.i_tab_position', range(4))

        self.append_markup('<b>' + _('Main window:') + '</b>')
        self.append_check(_('Show user panel'),
                          'session.config.b_show_userpanel')
        self.append_markup('<b>' + _('Conversation window:') + '</b>')
        self.session.config.get_or_set('b_avatar_on_left', False)
        self.session.config.get_or_set('b_toolbar_small', False)
        self.session.config.get_or_set('b_conversation_tabs', True)
        self.append_check(_('Tabbed Conversations'),
                          'session.config.b_conversation_tabs')
        self.append_row(self.tab_pos_cb)
        self.session.config.get_or_set('b_show_avatar_in_taskbar', True)
        self.append_check(_('Start minimized/iconified'),
                          'session.config.b_conv_minimized')
        self.append_check(_('Show emoticons'),
                          'session.config.b_show_emoticons')
        self.append_check(_('Show conversation header'),
                          'session.config.b_show_header')
        self.append_check(_('Show conversation side panel'),
                          'session.config.b_show_info')
        self.append_check(_('Show conversation toolbar'),
                          'session.config.b_show_toolbar')
        # small-toolbar sensitivity depends on conversation toolbar visibility
        self.cb_small_toolbar = self.create_check(
            _('Small conversation toolbar'), 'session.config.b_toolbar_small')
        self.session.config.subscribe(self._on_cb_show_toolbar_changed,
                                      'b_show_toolbar')
        self.append_row(self.cb_small_toolbar)

        # Avatar-on-left sensitivity depends on side panel visibility
        self.cb_avatar_left = self.create_check(
            _('Avatar on conversation left side'),
            'session.config.b_avatar_on_left')
        self.session.config.subscribe(self._on_cb_side_panel_changed,
                                      'b_show_info')
        self.append_row(self.cb_avatar_left)
        self.append_check(_('Allow auto scroll in conversation'),
                          'session.config.b_allow_auto_scroll')
        self.append_check(
            _('Enable spell check if available (requires %s)') %
            'python-gtkspell', 'session.config.b_enable_spell_check')
        self.attach(self.lang_menu, 2, 3, 13, 14)
        self.append_check(_('Show avatars in taskbar instead of status icons'),
                          'session.config.b_show_avatar_in_taskbar')

        self.append_range(_('Contact list avatar size'),
                          'session.config.i_avatar_size', 18, 64)
        self.append_range(_('Conversation avatar size'),
                          'session.config.i_conv_avatar_size', 18, 128)

        self.session.config.subscribe(self._on_spell_change,
                                      'b_enable_spell_check')

        self.session.config.subscribe(self._on_conversation_tabs_change,
                                      'b_conversation_tabs')

        #update tab_pos combo sensitivity
        self._on_conversation_tabs_change(
            self.session.config.get_or_set('b_conversation_tabs', True))
        #update spell lang combo sensitivity
        self._on_spell_change(
            self.session.config.get_or_set('b_enable_spell_check', False))
        #update side-panel dependent options sensitivity
        self._on_cb_side_panel_changed(
            self.session.config.get_or_set('b_show_info', True))
        #update small-toolbar sensitivity
        self._on_cb_show_toolbar_changed(
            self.session.config.get_or_set('b_show_toolbar', True))

        self.show_all()
Exemplo n.º 5
0
 def get_spell_langs(self):
     return sorted(set(list_dicts()))