From adff2660d8c3091efd45ff85c863df268415d496 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 15 Mar 2011 18:17:07 -0500 Subject: [PATCH] Notifying the user on dnd --- src/session.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/session.py b/src/session.py index 11de538..f113ae8 100644 --- a/src/session.py +++ b/src/session.py @@ -674,20 +674,21 @@ class Session(QtCore.QObject): self.historyUpdated.emit() def _update_dnd(self): - oldDnd = self._dnd - try: - assert self.state == self.LOGGEDIN_STATE, "DND requires being logged in (currently %s" % self.state - self._dnd = yield ( - self._backend[0].is_dnd, - (), - {}, - ) - except Exception, e: - _moduleLogger.exception("Reporting error to user") - self.error.emit(str(e)) - return - if oldDnd != self._dnd: - self.dndStateChange(self._dnd) + with qui_utils.notify_busy(self._errorLog, "Updating Do-Not-Disturb Status"): + oldDnd = self._dnd + try: + assert self.state == self.LOGGEDIN_STATE, "DND requires being logged in (currently %s" % self.state + self._dnd = yield ( + self._backend[0].is_dnd, + (), + {}, + ) + except Exception, e: + _moduleLogger.exception("Reporting error to user") + self.error.emit(str(e)) + return + if oldDnd != self._dnd: + self.dndStateChange(self._dnd) def _download_voicemail(self, messageId): actualPath = os.path.join(self._voicemailCachePath, "%s.mp3" % messageId) -- 1.7.9.5