code added forreset color button
This commit is contained in:
parent
f17c483632
commit
7f3b895cdc
|
@ -178,7 +178,48 @@ class preferences_window:
|
||||||
self.plugin.hide_systray()
|
self.plugin.hide_systray()
|
||||||
self.plugin.send('CONFIG', None, ('GtkGui', self.plugin.config, 'GtkGui'))
|
self.plugin.send('CONFIG', None, ('GtkGui', self.plugin.config, 'GtkGui'))
|
||||||
self.plugin.roster.draw_roster()
|
self.plugin.roster.draw_roster()
|
||||||
|
|
||||||
|
def on_reset_colors_button_clicked(self, widget):
|
||||||
|
defaults = self.plugin.default_config
|
||||||
|
self.plugin.config['inmsgcolor'] = defaults['inmsgcolor']
|
||||||
|
self.plugin.config['outmsgcolor'] = defaults['outmsgcolor']
|
||||||
|
self.plugin.config['statusmsgcolor'] = defaults['statusmsgcolor']
|
||||||
|
self.plugin.config['accounttextcolor'] = defaults['accounttextcolor']
|
||||||
|
self.plugin.config['grouptextcolor'] = defaults['grouptextcolor']
|
||||||
|
self.plugin.config['usertextcolor'] = defaults['usertextcolor']
|
||||||
|
self.plugin.config['accountbgcolor'] = defaults['accountbgcolor']
|
||||||
|
self.plugin.config['groupbgcolor'] = defaults['groupbgcolor']
|
||||||
|
self.plugin.config['userbgcolor'] = defaults['userbgcolor']
|
||||||
|
self.plugin.config['accountfont'] = defaults['accountfont']
|
||||||
|
self.plugin.config['groupfont'] = defaults['groupfont']
|
||||||
|
self.plugin.config['userfont'] = defaults['userfont']
|
||||||
|
self.xml.get_widget('incoming_msg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['inmsgcolor']))
|
||||||
|
self.xml.get_widget('outgoing_msg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['outmsgcolor']))
|
||||||
|
self.xml.get_widget('status_msg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['statusmsgcolor']))
|
||||||
|
self.xml.get_widget('account_text_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['accounttextcolor']))
|
||||||
|
self.xml.get_widget('group_text_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['grouptextcolor']))
|
||||||
|
self.xml.get_widget('user_text_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['usertextcolor']))
|
||||||
|
self.xml.get_widget('account_text_bg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['accountbgcolor']))
|
||||||
|
self.xml.get_widget('group_text_bg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['groupbgcolor']))
|
||||||
|
self.xml.get_widget('user_text_bg_colorbutton').set_color(\
|
||||||
|
gtk.gdk.color_parse(defaults['userbgcolor']))
|
||||||
|
self.xml.get_widget('account_text_fontbutton').set_font_name(\
|
||||||
|
defaults['accountfont'])
|
||||||
|
self.xml.get_widget('group_text_fontbutton').set_font_name(\
|
||||||
|
defaults['groupfont'])
|
||||||
|
self.xml.get_widget('user_text_fontbutton').set_font_name(\
|
||||||
|
defaults['userfont'])
|
||||||
|
self.update_text_tags()
|
||||||
|
self.plugin.roster.draw_roster()
|
||||||
|
|
||||||
def write_cfg(self): #FIXME: (nk) instant apply
|
def write_cfg(self): #FIXME: (nk) instant apply
|
||||||
"""Save preferences in config File and apply them"""
|
"""Save preferences in config File and apply them"""
|
||||||
|
|
||||||
|
|
|
@ -3754,6 +3754,7 @@ on the server as a vCard</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="relief">GTK_RELIEF_NONE</property>
|
<property name="relief">GTK_RELIEF_NONE</property>
|
||||||
<property name="focus_on_click">False</property>
|
<property name="focus_on_click">False</property>
|
||||||
|
<signal name="clicked" handler="on_reset_colors_button_clicked" last_modification_time="Sun, 06 Mar 2005 18:40:18 GMT"/>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkAlignment" id="alignment50">
|
<widget class="GtkAlignment" id="alignment50">
|
||||||
|
|
|
@ -3246,7 +3246,7 @@ class plugin:
|
||||||
'ACC_OK', 'CONFIG', 'MYVCARD', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE', \
|
'ACC_OK', 'CONFIG', 'MYVCARD', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE', \
|
||||||
'VISUAL', 'GC_MSG', 'GC_SUBJECT', 'BAD_PASSPHRASE', \
|
'VISUAL', 'GC_MSG', 'GC_SUBJECT', 'BAD_PASSPHRASE', \
|
||||||
'GPG_SECRETE_KEYS', 'ROSTER_INFO', 'MSGSENT'])
|
'GPG_SECRETE_KEYS', 'ROSTER_INFO', 'MSGSENT'])
|
||||||
self.send('ASK_CONFIG', None, ('GtkGui', 'GtkGui', {'autopopup':1,\
|
self.default_config = {'autopopup':1,\
|
||||||
'autopopupaway':1,\
|
'autopopupaway':1,\
|
||||||
'showoffline':0,\
|
'showoffline':0,\
|
||||||
'autoaway':1,\
|
'autoaway':1,\
|
||||||
|
@ -3297,7 +3297,8 @@ class plugin:
|
||||||
'x-position': 0,\
|
'x-position': 0,\
|
||||||
'y-position': 0,\
|
'y-position': 0,\
|
||||||
'width': 150,\
|
'width': 150,\
|
||||||
'height': 400}))
|
'height': 400}
|
||||||
|
self.send('ASK_CONFIG', None, ('GtkGui', 'GtkGui', self.default_config))
|
||||||
self.config = self.wait('CONFIG')
|
self.config = self.wait('CONFIG')
|
||||||
self.send('ASK_CONFIG', None, ('GtkGui', 'accounts'))
|
self.send('ASK_CONFIG', None, ('GtkGui', 'accounts'))
|
||||||
self.accounts = self.wait('CONFIG')
|
self.accounts = self.wait('CONFIG')
|
||||||
|
|
Loading…
Reference in New Issue