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 5408fe1..2d06ca3 100644
|
a
|
b
|
|
| 63 | 63 | 'use_notif_daemon': [ opt_bool, True , _('Use D-Bus and Notification-Daemon to show notifications') ], |
| 64 | 64 | 'ignore_unknown_contacts': [ opt_bool, False ], |
| 65 | 65 | 'showoffline': [ opt_bool, False ], |
| | 66 | 'show_only_chat_and_online': [ opt_bool, False ], |
| 66 | 67 | 'show_transports_group': [ opt_bool, True ], |
| 67 | 68 | 'autoaway': [ opt_bool, True ], |
| 68 | 69 | '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 23a798a..d78d4a8 100644
|
a
|
b
|
|
| 75 | 75 | return self.contact_name |
| 76 | 76 | return self.jid.split('@')[0] |
| 77 | 77 | |
| 78 | | def is_hidden_from_roster(self): |
| | 78 | def is_hidden_from_roster(self, show_only_chat_and_online=False): |
| 79 | 79 | '''if contact should not be visible in roster''' |
| | 80 | if show_only_chat_and_online and (self.show not in ('chat', 'online')): |
| | 81 | return True |
| 80 | 82 | # XEP-0162: http://www.xmpp.org/extensions/xep-0162.html |
| 81 | 83 | if self.is_transport(): |
| 82 | 84 | return False |
diff --git a/src/roster_window.py b/src/roster_window.py
index ae3f40e..204786b 100644
|
a
|
b
|
|
| 265 | 265 | If add_children is True, we also add all children, even if they were not |
| 266 | 266 | already drawn''' |
| 267 | 267 | showOffline = gajim.config.get('showoffline') |
| | 268 | showOnlyChatAndOnline = gajim.config.get('show_only_chat_and_online') |
| 268 | 269 | model = self.tree.get_model() |
| 269 | | contact = gajim.contacts.get_first_contact_from_jid(account, jid) |
| | 270 | contact = gajim.contacts.get_contact_with_highest_priority(account, jid) |
| 270 | 271 | nb_events = gajim.events.get_nb_roster_events(account, contact.jid) |
| 271 | 272 | # count events from all resources |
| 272 | 273 | for contact_ in gajim.contacts.get_contacts(account, jid): |
| … |
… |
|
| 291 | 292 | return |
| 292 | 293 | |
| 293 | 294 | # XEP-0162 |
| 294 | | hide = contact.is_hidden_from_roster() |
| | 295 | hide = contact.is_hidden_from_roster(showOnlyChatAndOnline) |
| 295 | 296 | if hide and contact.sub != 'from': |
| 296 | 297 | return |
| 297 | 298 | observer = contact.is_observer() |
| … |
… |
|
| 4542 | 4543 | gajim.config.set('showoffline', not gajim.config.get('showoffline')) |
| 4543 | 4544 | self.draw_roster() |
| 4544 | 4545 | |
| | 4546 | |
| | 4547 | def on_show_only_active_contacts_activate(self, widget): |
| | 4548 | gajim.config.set('show_only_chat_and_online', not gajim.config.get('show_only_chat_and_online')) |
| | 4549 | self.draw_roster() |
| | 4550 | |
| 4545 | 4551 | def set_renderer_color(self, renderer, style, set_background = True): |
| 4546 | 4552 | '''set style for treeview cell, using PRELIGHT system color''' |
| 4547 | 4553 | if set_background: |
| … |
… |
|
| 5280 | 5286 | self.xml.get_widget('show_transports_menuitem').set_active( |
| 5281 | 5287 | show_transports_group) |
| 5282 | 5288 | |
| | 5289 | showOnlyChatAndOnline = gajim.config.get('show_only_chat_and_online') |
| | 5290 | self.xml.get_widget('show_only_active_contacts').set_active( |
| | 5291 | showOnlyChatAndOnline) |
| | 5292 | |
| 5283 | 5293 | # columns |
| 5284 | 5294 | |
| 5285 | 5295 | # this col has 3 cells: |