# HG changeset patch # User souliane # Date 1395764791 -3600 # Node ID 255e6953b2c35fec70421b7892b196cc678ab813 # Parent 6404df5305e335b3d7e0bfdbe4d300a663912666 primitivus: do not display the presence/status dialog if the profile is not connected diff -r 6404df5305e3 -r 255e6953b2c3 frontends/src/primitivus/status.py --- a/frontends/src/primitivus/status.py Tue Mar 25 14:57:38 2014 +0100 +++ b/frontends/src/primitivus/status.py Tue Mar 25 17:26:31 2014 +0100 @@ -41,12 +41,16 @@ urwid.connect_signal(self.status, 'click', self.onStatusClick) def onPresenceClick(self, sender=None): + if not self.host.bridge.isConnected(self.host.profile): + return options = [commonConst.PRESENCE[presence] for presence in commonConst.PRESENCE] list_widget = sat_widgets.GenericList(options=options, option_type=sat_widgets.ClickableText, on_click=self.onChange) decorated = sat_widgets.LabelLine(list_widget, sat_widgets.SurroundedText(_('Set your presence'))) self.host.showPopUp(decorated) def onStatusClick(self, sender=None): + if not self.host.bridge.isConnected(self.host.profile): + return pop_up_widget = sat_widgets.InputDialog(_('Set your status'), _('New status'), default_txt=self.status.get_text(), cancel_cb=lambda dummy: self.host.removePopUp, ok_cb=self.onChange) self.host.showPopUp(pop_up_widget)