Author: asterix Date: 2008-09-26 17:22:16 +0200 (Fri, 26 Sep 2008) New Revision: 10431
Modified: trunk/data/glade/preferences_window.glade trunk/src/common/config.py trunk/src/config.py trunk/src/groupchat_control.py trunk/src/roster_window.py Log: ability to sort by status in roster and in muc separatly. Fixes #3823
Modified: trunk/data/glade/preferences_window.glade =================================================================== --- trunk/data/glade/preferences_window.glade 2008-09-26 13:03:25 UTC (rev 10430) +++ trunk/data/glade/preferences_window.glade 2008-09-26 15:22:16 UTC (rev 10431) @@ -124,19 +124,49 @@ </packing> </child> <child> - <widget class="GtkCheckButton" id="sort_by_show_checkbutton"> + <widget class="GtkHBox" id="hbox3"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">If checked, Gajim will sort contacts in roster window and groupchats by their status and not by the shown name</property> - <property name="label" translatable="yes">_Sort contacts by status</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_sort_by_show_checkbutton_toggled"/> + <property name="spacing">6</property> + <child> + <widget class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes">Sort contacts by status</property> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="sort_by_show_in_roster_checkbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">in _roster</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_sort_by_show_in_roster_checkbutton_toggled"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="sort_by_show_in_muc_checkbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">in _group chats</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_sort_by_show_in_muc_checkbutton_toggled"/> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> </widget> <packing> - <property name="expand">False</property> - <property name="fill">False</property> <property name="position">5</property> </packing> </child> @@ -220,7 +250,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">Some messages may include rich content (formatting, colors etc). If checked, Gajim will just display the raw message text.</property> - <property name="label" translatable="yes">Ignore rich content in incoming messages</property> + <property name="label" translatable="yes">_Ignore rich content in incoming messages</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -259,7 +289,8 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">1</property> - <property name="label" translatable="yes">Emoticons:</property> + <property name="label" translatable="yes">_Emoticons:</property> + <property name="use_underline">True</property> </widget> </child> </widget>
Modified: trunk/src/common/config.py =================================================================== --- trunk/src/common/config.py 2008-09-26 13:03:25 UTC (rev 10430) +++ trunk/src/common/config.py 2008-09-26 15:22:16 UTC (rev 10431) @@ -111,7 +111,8 @@ 'collapsed_rows': [ opt_str, '', _('List (space separated) of rows (accounts and groups) that are collapsed.'), True ], 'roster_theme': [ opt_str, _('default'), '', True ], 'mergeaccounts': [ opt_bool, False, '', True ], - 'sort_by_show': [ opt_bool, True, '', True ], + 'sort_by_show_in_roster': [ opt_bool, True, '', True ], + 'sort_by_show_in_muc': [ opt_bool, False, '', True ], 'enable_zeroconf': [opt_bool, False, _('Enable link-local/zeroconf messaging')], 'use_speller': [ opt_bool, False, ], 'ignore_incoming_xhtml': [ opt_bool, False, ],
Modified: trunk/src/config.py =================================================================== --- trunk/src/config.py 2008-09-26 13:03:25 UTC (rev 10430) +++ trunk/src/config.py 2008-09-26 15:22:16 UTC (rev 10431) @@ -124,8 +124,10 @@ set_active(st)
# Sort contacts by show - st = gajim.config.get('sort_by_show') - self.xml.get_widget('sort_by_show_checkbutton').set_active(st) + st = gajim.config.get('sort_by_show_in_roster') + self.xml.get_widget('sort_by_show_in_roster_checkbutton').set_active(st) + st = gajim.config.get('sort_by_show_in_muc') + self.xml.get_widget('sort_by_show_in_muc_checkbutton').set_active(st)
# emoticons emoticons_combobox = self.xml.get_widget('emoticons_combobox') @@ -529,9 +531,12 @@ w.set_sensitive(widget.get_active()) gajim.interface.save_config()
- def on_sort_by_show_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'sort_by_show') + def on_sort_by_show_in_roster_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'sort_by_show_in_roster') gajim.interface.roster.setup_and_draw_roster() + + def on_sort_by_show_in_muc_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'sort_by_show_in_muc') # Redraw connected groupchats for account in gajim.connections: if gajim.connections[account].connected:
Modified: trunk/src/groupchat_control.py =================================================================== --- trunk/src/groupchat_control.py 2008-09-26 13:03:25 UTC (rev 10430) +++ trunk/src/groupchat_control.py 2008-09-26 15:22:16 UTC (rev 10431) @@ -402,7 +402,7 @@ if not gc_contact2: return 0 if type1 == 'contact' and type2 == 'contact' and \ - gajim.config.get('sort_by_show'): + gajim.config.get('sort_by_show_in_muc'): cshow = {'online':0, 'chat': 1, 'away': 2, 'xa': 3, 'dnd': 4, 'invisible': 5, 'offline': 6, 'error': 7} show1 = cshow[gc_contact1.show]
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2008-09-26 13:03:25 UTC (rev 10430) +++ trunk/src/roster_window.py 2008-09-26 15:22:16 UTC (rev 10431) @@ -1561,10 +1561,10 @@ if not contact2: return 0 name2 = contact2.get_shown_name() - # We first compare by show if sort_by_show is True or if it's a child - # contact + # We first compare by show if sort_by_show_in_roster is True or if it's a + # child contact if type1 == 'contact' and type2 == 'contact' and \ - gajim.config.get('sort_by_show'): + gajim.config.get('sort_by_show_in_roster'): cshow = {'online':0, 'chat': 1, 'away': 2, 'xa': 3, 'dnd': 4, 'invisible': 5, 'offline': 6, 'not in roster': 7, 'error': 8} s = self.get_show(lcontact1)