From 604387c5fd841323b2aa41aaafc812db17975a57 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 11 Apr 2010 10:22:12 -0300 Subject: [PATCH] Refresh action is disabled when getting new messages. --- mitterlib/ui/ui_pygtk.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 9314229..dbdbc79 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -369,6 +369,12 @@ class Interface(object): def _refresh(self, widget=None): """Request a refresh. *widget* is the widget that called this function (we basically ignore it.)""" + + # disable the refresh from the menu, so we don't get duplicate + # results. + refresh = self._action_group.get_action('Refresh'); + refresh.set_property('sensitive', False) + if self._refresh_id: # "De-queue" the next refresh _log.debug('Dequeuing next refresh') @@ -806,6 +812,10 @@ class Interface(object): self._update_statusbar(_('Auto-update disabled')) if self._statusicon: self._statusicon.set_from_pixbuf(self._images['icon-error']) + + # re-enable the refresh from the menu + refresh = self._action_group.get_action('Refresh') + refresh.set_property('sensitive', True) return ### replies callback @@ -835,6 +845,9 @@ class Interface(object): interval * 60 * 1000, self._refresh, None) + # re-enable the refresh action + refresh = self._action_group.get_action('Refresh') + refresh.set_property('sensitive', True) return ### image download function