diff --git a/data/glade/roster_window.glade b/data/glade/roster_window.glade
index 625a713..d6b4c64 100644
|
a
|
b
|
|
| 215 | 215 | </widget> |
| 216 | 216 | </child> |
| 217 | 217 | <child> |
| | 218 | <widget class="GtkCheckMenuItem" id="show_only_active_contacts"> |
| | 219 | <property name="visible">True</property> |
| | 220 | <property name="label" translatable="yes">_Show Only Active Contacts</property> |
| | 221 | <property name="use_underline">True</property> |
| | 222 | <property name="active">False</property> |
| | 223 | <signal name="activate" handler="on_show_only_active_contacts_activate"/> |
| | 224 | <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/> |
| | 225 | </widget> |
| | 226 | </child> |
| | 227 | |
| | 228 | <child> |
| 218 | 229 | <widget class="GtkCheckMenuItem" id="show_transports_menuitem"> |
| 219 | 230 | <property name="visible">True</property> |
| 220 | 231 | <property name="label" translatable="yes">Show Trans_ports</property> |
diff --git a/src/common/config.py b/src/common/config.py
index 7f51d40..2e75d80 100644
|
a
|
b
|
|
| 58 | 58 | 'use_notif_daemon': [ opt_bool, True , _('Use D-Bus and Notification-Daemon to show notifications') ], |
| 59 | 59 | 'ignore_unknown_contacts': [ opt_bool, False ], |
| 60 | 60 | 'showoffline': [ opt_bool, False ], |
| | 61 | 'show_only_chat_and_online': [ opt_bool, False ], |
| 61 | 62 | 'show_transports_group': [ opt_bool, True ], |
| 62 | 63 | 'autoaway': [ opt_bool, True ], |
| 63 | 64 | 'autoawaytime': [ opt_int, 5, _('Time in minutes, after which your status changes to away.') ], |
diff --git a/src/common/contacts.py b/src/common/contacts.py
index 524b076..8714c81 100644
|
a
|
b
|
|
| 70 | 70 | return self.contact_name |
| 71 | 71 | return self.jid.split('@')[0] |
| 72 | 72 | |
| 73 | | def is_hidden_from_roster(self): |
| | 73 | def is_hidden_from_roster(self, show_only_chat_and_online=False): |
| 74 | 74 | '''if contact should not be visible in roster''' |
| | 75 | if show_only_chat_and_online and (self.show not in ('chat', 'online')): |
| | 76 | return True |
| 75 | 77 | # XEP-0162: http://www.xmpp.org/extensions/xep-0162.html |
| 76 | 78 | if self.is_transport(): |
| 77 | 79 | return False |
diff --git a/src/roster_window.py b/src/roster_window.py
index 35f9e82..e0b7cee 100644
|
a
|
b
|
|
| 260 | 260 | If add_children is True, we also add all children, even if they were not |
| 261 | 261 | already drawn''' |
| 262 | 262 | showOffline = gajim.config.get('showoffline') |
| | 263 | showOnlyChatAndOnline = gajim.config.get('show_only_chat_and_online') |
| 263 | 264 | model = self.tree.get_model() |
| 264 | | contact = gajim.contacts.get_first_contact_from_jid(account, jid) |
| | 265 | contact = gajim.contacts.get_contact_with_highest_priority(account, jid) |
| 265 | 266 | nb_events = gajim.events.get_nb_roster_events(account, contact.jid) |
| 266 | 267 | # count events from all resources |
| 267 | 268 | for contact_ in gajim.contacts.get_contacts(account, jid): |
| … |
… |
|
| 286 | 287 | return |
| 287 | 288 | |
| 288 | 289 | # XEP-0162 |
| 289 | | hide = contact.is_hidden_from_roster() |
| | 290 | hide = contact.is_hidden_from_roster(showOnlyChatAndOnline) |
| 290 | 291 | if hide and contact.sub != 'from': |
| 291 | 292 | return |
| 292 | 293 | observer = contact.is_observer() |
| … |
… |
|
| 4520 | 4521 | gajim.config.set('showoffline', not gajim.config.get('showoffline')) |
| 4521 | 4522 | self.draw_roster() |
| 4522 | 4523 | |
| | 4524 | |
| | 4525 | def on_show_only_active_contacts_activate(self, widget): |
| | 4526 | gajim.config.set('show_only_chat_and_online', not gajim.config.get('show_only_chat_and_online')) |
| | 4527 | self.draw_roster() |
| | 4528 | |
| 4523 | 4529 | def set_renderer_color(self, renderer, style, set_background = True): |
| 4524 | 4530 | '''set style for treeview cell, using PRELIGHT system color''' |
| 4525 | 4531 | if set_background: |