def on_show_menuitem_activate(self, widget, show): # we all add some fake (we cannot select those nor have them as show) # but this helps to align with roster's status_combobox index positions l = ['online', 'chat', 'away', 'xa', 'dnd', 'invisible', 'SEPARATOR', 'CHANGE_STATUS_MSG_MENUITEM', 'SEPARATOR', 'offline'] index = l.index(show) if not helpers.statuses_unified(): app.interface.roster.status_combobox.set_active(index + 2) return current = app.interface.roster.status_combobox.get_active() if index != current: app.interface.roster.status_combobox.set_active(index)
def update(self): if not app.connections: self.hide() return self.show() show = get_global_show() uf_show = get_uf_show(show) self._current_show_icon.set_from_icon_name(get_icon_name(show), Gtk.IconSize.MENU) if statuses_unified(): self._current_show_icon.set_tooltip_text(_('Status: %s') % uf_show) if not self._compact: self._current_show_label.set_text(uf_show) else: show_label = _('%s (desynced)') % uf_show self._current_show_icon.set_tooltip_text( _('Status: %s') % show_label) if not self._compact: self._current_show_label.set_text(show_label) self._change_status_message.set_sensitive(show != 'offline')