[Sugar-devel] [sugar-toolkit PATCH] sl#3317: Batch Operations on Journal Entries (Copy, Erase)

Sascha Silbe silbe at activitycentral.com
Mon Feb 6 08:56:25 EST 2012


Excerpts from Ajay Garg's message of 2012-02-05 21:47:47 +0100:


The patch summary (subject line) doesn't describe what this patch does,
only in what context it is useful.

Also, please note that sugar-toolkit (GTK2) is in maintenance mode; API
changes need to be targeted at sugar-toolkit-gtk3. For changes that are
required by the sugar package (which is still based on sugar-toolkit),
we may make an exemption and backport them to sugar-toolkit, but they
need to get landed in sugar-toolkit-gtk3 first.


> 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.

I don't grok your description and I don't see a use case, given that all
you do...

[src/sugar/graphics/window.py]
> @@ -224,6 +224,11 @@ class Window(gtk.Window):
>              else:
>                  self.__vbox.reorder_child(alert, 0)
>  
> +    def add_alert_and_callback(self, alert, callback, data):
> +        self.add_alert(alert)
> +        if callback is not None:
> +            gobject.idle_add(callback, data)

... is to add an optional gobject.idle_add() invocation with parameters
passed in by the caller. Why don't you simply do that on the caller
side?

We can't account for everything some caller might want to do after
executing this method, that would litter the code with special cases and
make it incomprehensible. There needs to be some real value gained from
doing it as part of the API.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120206/e6e16235/attachment.pgp>


More information about the Sugar-devel mailing list