remove U it is not needed nor works; remove it also from glade, remove crazy hboxing and use fill and other similar properties

This commit is contained in:
Nikos Kouremenos 2005-11-02 16:34:35 +00:00
parent f7a1f8fa64
commit 9554d2c8f5
2 changed files with 135 additions and 220 deletions

View File

@ -40,7 +40,7 @@ class GajimThemesWindow:
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'gajim_themes_window', APP)
self.window = self.xml.get_widget('gajim_themes_window')
self.options = ['account', 'group', 'contact', 'banner', 'lastmessage']
self.options = ['account', 'group', 'contact', 'banner']
self.options_combobox = self.xml.get_widget('options_combobox')
self.textcolor_checkbutton = self.xml.get_widget('textcolor_checkbutton')
self.background_checkbutton = self.xml.get_widget('background_checkbutton')
@ -50,7 +50,6 @@ class GajimThemesWindow:
self.text_fontbutton = self.xml.get_widget('text_fontbutton')
self.bold_togglebutton = self.xml.get_widget('bold_togglebutton')
self.italic_togglebutton = self.xml.get_widget('italic_togglebutton')
self.underline_togglebutton = self.xml.get_widget('underline_togglebutton')
self.themes_tree = self.xml.get_widget('themes_treeview')
self.theme_options_vbox = self.xml.get_widget('theme_options_vbox')
model = gtk.ListStore(str)
@ -151,7 +150,8 @@ class GajimThemesWindow:
return
if self.current_theme == gajim.config.get('roster_theme'):
dialogs.ErrorDialog(
_('You cannot delete your current theme')).get_response()
_('You cannot delete your current theme'),
_('Please first choose another for your current theme')).get_response()
return
self.theme_options_vbox.set_sensitive(False)
gajim.config.del_per('themes', self.current_theme)
@ -233,9 +233,6 @@ class GajimThemesWindow:
def on_italic_togglebutton_toggled(self, widget):
self._set_font()
def on_underline_togglebutton_toggled(self, widget):
self._set_font()
def _set_color(self, state, widget, option):
''' set color value in prefs and update the UI '''
if state:
@ -279,7 +276,6 @@ class GajimThemesWindow:
''' 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])
self.underline_togglebutton.set_active(font_props[2])
def _get_font_description(self):
''' return a FontDescription from togglebuttons
@ -293,31 +289,27 @@ class GajimThemesWindow:
def _set_font_widgets(self, font_attrs):
''' set the correct toggle state of font style buttons by
a font string of type 'BIU' '''
a font string of type 'BI' '''
font_props = [False, False, False]
if font_attrs:
if font_attrs.find('B') != -1:
font_props[0] = True
if font_attrs.find('I') != -1:
font_props[1] = True
if font_attrs.find('U') != -1:
font_props[2] = True
self._toggle_font_widgets(font_props)
def _get_font_attrs(self):
''' get a string with letters of font attribures: 'BUI' '''
''' get a string with letters of font attribures: 'BI' '''
attrs = ''
if self.bold_togglebutton.get_active():
attrs += 'B'
if self.italic_togglebutton.get_active():
attrs += 'I'
if self.underline_togglebutton.get_active():
attrs += 'U'
return attrs
def _get_font_props(self, font_name):
''' get tuple of font properties: Weight, Style, Underline '''
''' get tuple of font properties: Weight, Style '''
font_props = [False, False, False]
font_description = pango.FontDescription(font_name)
if font_description.get_weight() != pango.WEIGHT_NORMAL:

View File

@ -16257,55 +16257,11 @@ Last Message</property>
<widget class="GtkTable" id="table5">
<property name="visible">True</property>
<property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="n_columns">4</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<widget class="GtkHBox" id="hbox2981">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkHBox" id="hbox2986">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkColorButton" id="background_colorbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
<signal name="color_set" handler="on_background_colorbutton_color_set" last_modification_time="Fri, 16 Sep 2005 21:15:38 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="textcolor_checkbutton">
<property name="visible">True</property>
@ -16329,38 +16285,6 @@ Last Message</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2980">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkColorButton" id="text_colorbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
<signal name="color_set" handler="on_text_colorbutton_color_set" last_modification_time="Fri, 16 Sep 2005 21:15:45 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="background_checkbutton">
<property name="visible">True</property>
@ -16384,29 +16308,6 @@ Last Message</property>
</packing>
</child>
<child>
<widget class="GtkFontButton" id="text_fontbutton">
<property name="width_request">15</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">True</property>
<property name="use_font">False</property>
<property name="use_size">False</property>
<property name="focus_on_click">True</property>
<signal name="font_set" handler="on_text_fontbutton_font_set" last_modification_time="Fri, 16 Sep 2005 21:14:43 GMT"/>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="textfont_checkbutton">
<property name="visible">True</property>
@ -16430,112 +16331,6 @@ Last Message</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2987">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkToggleButton" id="bold_togglebutton">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Bold</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="toggled" handler="on_bold_togglebutton_toggled" last_modification_time="Fri, 16 Sep 2005 21:16:17 GMT"/>
<child>
<widget class="GtkImage" id="image28">
<property name="visible">True</property>
<property name="stock">gtk-bold</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkToggleButton" id="italic_togglebutton">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Italic</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="toggled" handler="on_italic_togglebutton_toggled" last_modification_time="Fri, 16 Sep 2005 21:16:23 GMT"/>
<child>
<widget class="GtkImage" id="image29">
<property name="visible">True</property>
<property name="stock">gtk-italic</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkToggleButton" id="underline_togglebutton">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Underline</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="toggled" handler="on_underline_togglebutton_toggled" last_modification_time="Fri, 16 Sep 2005 21:16:29 GMT"/>
<child>
<widget class="GtkImage" id="image30">
<property name="visible">True</property>
<property name="stock">gtk-underline</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label334">
<property name="visible">True</property>
@ -16549,6 +16344,7 @@ Last Message</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">bold_togglebutton</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
@ -16577,6 +16373,133 @@ Last Message</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkFontButton" id="text_fontbutton">
<property name="width_request">15</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="show_style">False</property>
<property name="show_size">True</property>
<property name="use_font">False</property>
<property name="use_size">False</property>
<property name="focus_on_click">True</property>
<signal name="font_set" handler="on_text_fontbutton_font_set" last_modification_time="Fri, 16 Sep 2005 21:14:43 GMT"/>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="text_colorbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
<signal name="color_set" handler="on_text_colorbutton_color_set" last_modification_time="Fri, 16 Sep 2005 21:15:45 GMT"/>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="background_colorbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
<signal name="color_set" handler="on_background_colorbutton_color_set" last_modification_time="Fri, 16 Sep 2005 21:15:38 GMT"/>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkToggleButton" id="bold_togglebutton">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Bold</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="toggled" handler="on_bold_togglebutton_toggled" last_modification_time="Fri, 16 Sep 2005 21:16:17 GMT"/>
<child>
<widget class="GtkImage" id="image28">
<property name="visible">True</property>
<property name="stock">gtk-bold</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkToggleButton" id="italic_togglebutton">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Italic</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="toggled" handler="on_italic_togglebutton_toggled" last_modification_time="Fri, 16 Sep 2005 21:16:23 GMT"/>
<child>
<widget class="GtkImage" id="image29">
<property name="visible">True</property>
<property name="stock">gtk-italic</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>