Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/gajim_themes_window.py')
-rw-r--r--src/gajim_themes_window.py62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py
index 0543f00ff..409caba7c 100644
--- a/src/gajim_themes_window.py
+++ b/src/gajim_themes_window.py
@@ -35,7 +35,7 @@ class GajimThemesWindow:
self.xml = gtkgui_helpers.get_glade('gajim_themes_window.glade')
self.window = self.xml.get_widget('gajim_themes_window')
self.window.set_transient_for(gajim.interface.roster.window)
-
+
self.options = ['account', 'group', 'contact', 'banner']
self.options_combobox = self.xml.get_widget('options_combobox')
self.textcolor_checkbutton = self.xml.get_widget('textcolor_checkbutton')
@@ -69,17 +69,17 @@ class GajimThemesWindow:
self.select_active_theme()
self.current_option = self.options[0]
self.set_theme_options(self.current_theme, self.current_option)
-
+
self.xml.signal_autoconnect(self)
self.window.connect('delete-event', self.on_themese_window_delete_event)
- self.themes_tree.get_selection().connect('changed',
+ self.themes_tree.get_selection().connect('changed',
self.selection_changed)
self.window.show_all()
-
+
def on_themese_window_delete_event(self, widget, event):
self.window.hide()
return True # do NOT destroy the window
-
+
def on_close_button_clicked(self, widget):
if 'preferences' in gajim.interface.instances:
gajim.interface.instances['preferences'].update_theme_list()
@@ -138,7 +138,7 @@ class GajimThemesWindow:
self.xml.get_widget('remove_button').set_sensitive(False)
self.theme_options_vbox.set_sensitive(False)
self.theme_options_table.set_sensitive(False)
- else:
+ else:
self.xml.get_widget('remove_button').set_sensitive(True)
self.theme_options_vbox.set_sensitive(True)
self.theme_options_table.set_sensitive(True)
@@ -159,7 +159,7 @@ class GajimThemesWindow:
self.xml.get_widget('remove_button').set_sensitive(False)
self.theme_options_vbox.set_sensitive(False)
self.theme_options_table.set_sensitive(False)
- else:
+ else:
self.xml.get_widget('remove_button').set_sensitive(True)
self.theme_options_vbox.set_sensitive(True)
self.theme_options_table.set_sensitive(True)
@@ -194,7 +194,7 @@ class GajimThemesWindow:
self.xml.get_widget('remove_button').set_sensitive(False)
gajim.config.del_per('themes', self.current_theme)
model.remove(iter_)
-
+
def set_theme_options(self, theme, option = 'account'):
self.no_update = True
self.options_combobox.set_active(self.options.index(option))
@@ -215,7 +215,7 @@ class GajimThemesWindow:
state = False
self.background_checkbutton.set_active(state)
self.background_colorbutton.set_sensitive(state)
-
+
# get the font name before we set widgets and it will not be overriden
font_name = gajim.config.get_per('themes', theme, option + 'font')
font_attrs = gajim.config.get_per('themes', theme, option + 'fontattrs')
@@ -235,32 +235,32 @@ class GajimThemesWindow:
color = gajim.config.get_per('themes', theme, 'state_' + chatstate + \
'_color')
self.colorbuttons[chatstate].set_color(gtk.gdk.color_parse(color))
-
+
def on_textcolor_checkbutton_toggled(self, widget):
state = widget.get_active()
self.text_colorbutton.set_sensitive(state)
- self._set_color(state, self.text_colorbutton,
+ self._set_color(state, self.text_colorbutton,
'textcolor')
-
+
def on_background_checkbutton_toggled(self, widget):
state = widget.get_active()
self.background_colorbutton.set_sensitive(state)
- self._set_color(state, self.background_colorbutton,
+ self._set_color(state, self.background_colorbutton,
'bgcolor')
-
+
def on_textfont_checkbutton_toggled(self, widget):
self.text_fontbutton.set_sensitive(widget.get_active())
self._set_font()
-
+
def on_text_colorbutton_color_set(self, widget):
self._set_color(True, widget, 'textcolor')
-
+
def on_background_colorbutton_color_set(self, widget):
self._set_color(True, widget, 'bgcolor')
-
+
def on_text_fontbutton_font_set(self, widget):
self._set_font()
-
+
def on_options_combobox_changed(self, widget):
index = self.options_combobox.get_active()
if index == -1:
@@ -268,15 +268,15 @@ class GajimThemesWindow:
self.current_option = self.options[index]
self.set_theme_options(self.current_theme,
self.current_option)
-
+
def on_bold_togglebutton_toggled(self, widget):
if not self.no_update:
self._set_font()
-
+
def on_italic_togglebutton_toggled(self, widget):
if not self.no_update:
self._set_font()
-
+
def _set_color(self, state, widget, option):
''' set color value in prefs and update the UI '''
if state:
@@ -287,7 +287,7 @@ class GajimThemesWindow:
begin_option = ''
if not option.startswith('state'):
begin_option = self.current_option
- gajim.config.set_per('themes', self.current_theme,
+ gajim.config.set_per('themes', self.current_theme,
begin_option + option, color_string)
# use faster functions for this
if self.current_option == 'banner':
@@ -298,7 +298,7 @@ class GajimThemesWindow:
return
gajim.interface.roster.change_roster_style(self.current_option)
gajim.interface.save_config()
-
+
def _set_font(self):
''' set font value in prefs and update the UI '''
state = self.textfont_checkbutton.get_active()
@@ -306,10 +306,10 @@ class GajimThemesWindow:
font_string = self.text_fontbutton.get_font_name()
else:
font_string = ''
- gajim.config.set_per('themes', self.current_theme,
+ gajim.config.set_per('themes', self.current_theme,
self.current_option + 'font', font_string)
font_attrs = self._get_font_attrs()
- gajim.config.set_per('themes', self.current_theme,
+ gajim.config.set_per('themes', self.current_theme,
self.current_option + 'fontattrs', font_attrs)
# use faster functions for this
if self.current_option == 'banner':
@@ -318,14 +318,14 @@ class GajimThemesWindow:
return
gajim.interface.roster.change_roster_style(self.current_option)
gajim.interface.save_config()
-
+
def _toggle_font_widgets(self, font_props):
''' toggle font buttons with the bool values of font_props tuple'''
self.bold_togglebutton.set_active(font_props[0])
self.italic_togglebutton.set_active(font_props[1])
-
+
def _get_font_description(self):
- ''' return a FontDescription from togglebuttons
+ ''' return a FontDescription from togglebuttons
states'''
fd = pango.FontDescription()
if self.bold_togglebutton.get_active():
@@ -333,7 +333,7 @@ class GajimThemesWindow:
if self.italic_togglebutton.get_active():
fd.set_style(pango.STYLE_ITALIC)
return fd
-
+
def _set_font_widgets(self, font_attrs):
''' set the correct toggle state of font style buttons by
a font string of type 'BI' '''
@@ -344,7 +344,7 @@ class GajimThemesWindow:
if font_attrs.find('I') != -1:
font_props[1] = True
self._toggle_font_widgets(font_props)
-
+
def _get_font_attrs(self):
''' get a string with letters of font attribures: 'BI' '''
attrs = ''
@@ -353,7 +353,7 @@ class GajimThemesWindow:
if self.italic_togglebutton.get_active():
attrs += 'I'
return attrs
-
+
def _get_font_props(self, font_name):
''' get tuple of font properties: Weight, Style '''