From 66d0d97e1bb5d776d6b0df249527f31baf8362e8 Mon Sep 17 00:00:00 2001
From: Ajay Garg <ajay@activitycentral.com>
Date: Sat, 4 Feb 2012 17:27:39 +0530
Subject: [sugar-toolkit PATCH] sl#3317: Batch Operations on Journal Entries (Copy, Erase)
Organization: Sugar Labs Foundation
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
---
A new function has been added, which provides the ability to have a callback executed,
after the alert is shown.
Note that, in usual cases (that is, prior addition of this function), the alert is shown;
and the action taken only after user clicks one of the action-buttons (eg. 'OK', 'Cancel', etc.).
However, if it was needed that an alert shown, and some other work done (WITHOUT
USER CLICKING ANY ACTION-BUTTON), that would not be possible.
src/sugar/graphics/window.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
mode change 100644 => 100755 src/sugar/graphics/window.py
diff --git a/src/sugar/graphics/window.py b/src/sugar/graphics/window.py
old mode 100644
new mode 100755
index b269efc..0f5ebf6
a
|
b
|
class Window(gtk.Window): |
224 | 224 | else: |
225 | 225 | self.__vbox.reorder_child(alert, 0) |
226 | 226 | |
| 227 | def add_alert_and_callback(self, alert, callback, data): |
| 228 | self.add_alert(alert) |
| 229 | if callback is not None: |
| 230 | gobject.idle_add(callback, data) |
| 231 | |
227 | 232 | def remove_alert(self, alert): |
228 | 233 | if alert in self._alerts: |
229 | 234 | self._alerts.remove(alert) |