Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-10-19 14:15:43 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-10-19 14:15:43 (GMT)
commit60c746ce5a773ffc0695ce106160ea2b5e3457a1 (patch)
treed3f4ba3c7f6d1746a38dc573620dc1480b2f7830 /lib
parent099d279d7e8c7af312129810349bba36fa08d576 (diff)
Add support to be able to remove an alert which is not the top
one on the queue
Diffstat (limited to 'lib')
-rw-r--r--lib/sugar/graphics/window.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sugar/graphics/window.py b/lib/sugar/graphics/window.py
index e55199f..b21de1c 100644
--- a/lib/sugar/graphics/window.py
+++ b/lib/sugar/graphics/window.py
@@ -80,13 +80,15 @@ class Window(gtk.Window):
def remove_alert(self, alert):
if alert in self._alerts:
self._alerts.remove(alert)
- self._vbox.remove(alert)
- if len(self._alerts) >= 1:
- self._vbox.pack_start(self._alerts[0], False)
- if self.toolbox is not None:
- self._vbox.reorder_child(self._alerts[0], 1)
- else:
- self._vbox.reorder_child(self._alert[0], 0)
+ # if the alert is the visible one on top of the queue
+ if alert.get_parent() is not None:
+ self._vbox.remove(alert)
+ if len(self._alerts) >= 1:
+ self._vbox.pack_start(self._alerts[0], False)
+ if self.toolbox is not None:
+ self._vbox.reorder_child(self._alerts[0], 1)
+ else:
+ self._vbox.reorder_child(self._alert[0], 0)
def __window_realize_cb(self, window):
group = gtk.Window()