Beispiel #1
0
    def _build(self):
        SettingsDialog._build(self)

        prop = self.parent.get_property('contacts-list-font')
        on_changed_cb = lambda desc: self.parent.cl.modify_font(desc)
        btn_cl_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('contacts-list-color')
        on_changed_cb = lambda color: self.parent.cl.modify_text(gtk.STATE_NORMAL, color)
        btn_cl_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('contacts-list-bgcolor')
        on_changed_cb = lambda color: self.parent.cl.modify_base(gtk.STATE_NORMAL, color)
        btn_cl_bgcolor = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('contacts-list-header-visible-name')
        on_changed_cb = lambda visible: self.parent.cl.get_column(1).set_visible(visible)
        chk_name = GConfCheckButton(prop, on_changed_cb, 'User')

        prop = self.parent.get_property('contacts-list-header-visible-group')
        on_changed_cb = lambda visible: self.parent.cl.get_column(2).set_visible(visible)
        chk_group = GConfCheckButton(prop, on_changed_cb, 'Group')
        chk_group.set_sensitive(not settings['grouping'])

        prop = self.parent.get_property('contacts-list-header-visible-version')
        on_changed_cb = lambda visible: self.parent.cl.get_column(3).set_visible(visible)
        chk_version = GConfCheckButton(prop, on_changed_cb, 'Version')

        prop = self.parent.get_property('contacts-list-header-visible-status')
        on_changed_cb = lambda visible: self.parent.cl.get_column(4).set_visible(visible)
        chk_login = GConfCheckButton(prop, on_changed_cb, 'Login')

        prop = self.parent.get_property('contacts-list-header-visible-host')
        on_changed_cb = lambda visible: self.parent.cl.get_column(5).set_visible(visible)
        chk_host = GConfCheckButton(prop, on_changed_cb, 'Host')

        hbox = gtk.HBox(True, 10)
        hbox.show()
        hbox.pack_start(chk_name, False, False)
        hbox.pack_start(chk_group, False, False)
        hbox.pack_start(chk_version, False, False)
        hbox.pack_start(chk_login, False, False)
        hbox.pack_start(chk_host, False, False)

        self.add_page('Contacts List', [('Font', btn_cl_font), ('Color', btn_cl_color), ('Background', btn_cl_bgcolor), ('Header', hbox)])

        prop = self.parent.get_property('message-font')
        on_changed_cb = lambda desc: self.parent.txt_send.invoke('modify_font', desc)
        btn_msg_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('message-color')
        on_changed_cb = lambda color: self.parent.txt_send.invoke('modify_text', gtk.STATE_NORMAL, color)
        btn_msg_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('message-bgcolor')
        on_changed_cb = lambda color: self.parent.txt_send.invoke('modify_base', gtk.STATE_NORMAL, color)
        btn_msg_bgcolor = GConfColorButton(prop, on_changed_cb)

        self.add_page('Message Editor', [('Font', btn_msg_font), ('Color', btn_msg_color), ('Background', btn_msg_bgcolor)])
Beispiel #2
0
    def _build(self):
        SettingsDialog._build(self)

        prop = self.parent.get_property('header-font')
        on_changed_cb = lambda desc: self.parent.lbl_header.modify_font(desc)
        btn_header_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('header-color')
        on_changed_cb = lambda color: self.parent.lbl_header.modify_text(gtk.STATE_NORMAL, color)
        btn_header_color = GConfColorButton(prop, on_changed_cb)

        self.add_page('Header', [('Font', btn_header_font), ('Color', btn_header_color)])

        prop = self.parent.get_property('content-font')
        on_changed_cb = lambda desc: self.parent.txt_recv.invoke('modify_font', desc)
        btn_content_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('content-color')
        on_changed_cb = lambda color: self.parent.txt_recv.invoke('modify_text', gtk.STATE_NORMAL, color)
        btn_content_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('content-bgcolor')
        on_changed_cb = lambda color: self.parent.txt_recv.invoke('modify_base', gtk.STATE_NORMAL, color)
        btn_content_bgcolor = GConfColorButton(prop, on_changed_cb)

        self.add_page('Message', [('Font', btn_content_font), ('Color', btn_content_color), ('Background', btn_content_bgcolor)])

        prop = self.parent.get_property('link-color')
        def on_changed_cb(color):
            self.parent.txt_recv.link['foreground'] = color
            self.parent.txt_recv.recognize_url()
        btn_link_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_recv.link['background'] = color
            self.parent.txt_recv.recognize_url()
        btn_link_bgcolor = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-hover-color')
        def on_changed_cb(color):
            self.parent.txt_recv.hover['foreground'] = color
            self.parent.txt_recv.recognize_url()
        btn_hover_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-hover-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_recv.hover['background'] = color
            self.parent.txt_recv.recognize_url()
        btn_hover_bgcolor = GConfColorButton(prop, on_changed_cb)

        self.add_page('Url', [('Color', btn_link_color), ('Background', btn_link_bgcolor),
                              ('Hover Color', btn_hover_color), ('Hover Background', btn_hover_bgcolor)])
Beispiel #3
0
    def _build(self):
        SettingsDialog._build(self)

        prop = self.parent.get_property('title-from-font')
        def on_changed_cb(desc):
            self.parent.txt_log.styles['title-from']['font-desc'] = desc
            self.parent.txt_log.reload_styles()
        btn_title_from_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('title-from-color')
        def on_changed_cb(color):
            self.parent.txt_log.styles['title-from']['foreground'] = color.to_string()
            self.parent.txt_log.reload_styles()
        btn_title_from_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('title-from-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_log.styles['title-from']['paragraph-background'] = color.to_string()
            self.parent.txt_log.reload_styles()
        btn_title_from_bgcolor = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('title-to-font')
        def on_changed_cb(desc):
            self.parent.txt_log.styles['title-to']['font-desc'] = desc
            self.parent.txt_log.reload_styles()
        btn_title_to_font = GConfFontButton(prop, on_changed_cb)

        prop = self.parent.get_property('title-to-color')
        def on_changed_cb(color):
            self.parent.txt_log.styles['title-to']['foreground'] = color.to_string()
            self.parent.txt_log.reload_styles()
        btn_title_to_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('title-to-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_log.styles['title-to']['paragraph-background'] = color.to_string()
            self.parent.txt_log.reload_styles()
        btn_title_to_bgcolor = GConfColorButton(prop, on_changed_cb)

        self.add_page('From', [('Title Font', btn_title_from_font), ('Color', btn_title_from_color), ('Background', btn_title_from_bgcolor)])
        self.add_page('To', [('Title Font', btn_title_to_font), ('Color', btn_title_to_color), ('Background', btn_title_to_bgcolor)])

        prop = self.parent.get_property('link-color')
        def on_changed_cb(color):
            self.parent.txt_log.link['foreground'] = color.to_string()
            self.parent.txt_log.recognize_url()
        btn_link_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_log.link['background'] = color.to_string()
            self.parent.txt_log.recognize_url()
        btn_link_bgcolor = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-hover-color')
        def on_changed_cb(color):
            self.parent.txt_log.hover['foreground'] = color.to_string()
            self.parent.txt_log.recognize_url()
        btn_hover_color = GConfColorButton(prop, on_changed_cb)

        prop = self.parent.get_property('link-hover-bgcolor')
        def on_changed_cb(color):
            self.parent.txt_log.hover['background'] = color.to_string()
            self.parent.txt_log.recognize_url()
        btn_hover_bgcolor = GConfColorButton(prop, on_changed_cb)

        self.add_page('Url', [('Color', btn_link_color), ('Background', btn_link_bgcolor),
                              ('Hover Color', btn_hover_color), ('Hover Background', btn_hover_bgcolor)])