From 2203e6aa52041ec9225d06d0541d533a2e542bf6 Mon Sep 17 00:00:00 2001 From: souliane Date: Thu, 16 Apr 2015 17:17:28 +0200 Subject: [PATCH] quick_frontend, primitivus: fixes a couple of issues: - chat: notification was raising an error when you just entered the room and self.nick is None - quick_widget: deleting a widget was modifying a dict while looping on it + unselect widget when it's being deleted --- INSTALL | 1 + frontends/src/primitivus/chat.py | 2 +- frontends/src/quick_frontend/quick_contact_list.py | 3 +++ frontends/src/quick_frontend/quick_widgets.py | 8 +++++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 053ec646..34b902bf 100644 --- a/INSTALL +++ b/INSTALL @@ -41,6 +41,7 @@ media_dir=~/sat/media/destination/path ### end sat.conf ### Of course, replace ~/sat/media/destination/path with the actual path you want to use. +Check the wiki for more information about this configuration file: http://wiki.goffi.org/wiki/Configuration/en You should now be able to launch sat: - to launch the backend, enter diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index 588896cf..94779791 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -365,7 +365,7 @@ class Chat(PrimitivusWidget, QuickChat): if not self.host.x_notify.hasFocus(): if self.type == C.CHAT_ONE2ONE: self.host.x_notify.sendNotification(_("Primitivus: %s is talking to you") % from_jid) - elif self.nick.lower() in msg.lower(): + elif self.nick is not None and self.nick.lower() in msg.lower(): self.host.x_notify.sendNotification(_("Primitivus: %(user)s mentioned you in room '%(room)s'") % {'user': from_jid, 'room': self.target}) # MENU EVENTS # diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index 063d2f47..b05e2010 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -249,6 +249,9 @@ class QuickContactList(QuickWidget): self._cache.clear() self._groups.clear() self._specials.clear() + self._special_extras.clear() + self._roster.clear() + self._alerts.clear() self.update() def setContact(self, entity, groups=None, attributes=None, in_roster=False): diff --git a/frontends/src/quick_frontend/quick_widgets.py b/frontends/src/quick_frontend/quick_widgets.py index d5721d2d..0b563599 100644 --- a/frontends/src/quick_frontend/quick_widgets.py +++ b/frontends/src/quick_frontend/quick_widgets.py @@ -232,9 +232,12 @@ class QuickWidgetsManager(object): widget_to_delete.onDelete() for widget_map in self._widgets.itervalues(): + to_delete = set() for hash_, widget in widget_map.iteritems(): if widget_to_delete is widget: - del widget_map[hash_] + to_delete.add(hash_) + for hash_ in to_delete: + del widget_map[hash_] class QuickWidget(object): @@ -308,3 +311,6 @@ class QuickWidget(object): def onDelete(self): """Called when a widget is deleted""" log.debug(u"deleting widget {}".format(self)) # Must be implemented by frontends + if self.host.selected_widget == self: + self.host.selected_widget = None +