[Sugar-devel] [sugarlabs/sugar-toolkit-gtk3] Save As Popup (#327)
Tony Anderson
tony_anderson at usa.net
Mon May 1 22:55:47 EDT 2017
Thanks for this testing. You are showing some serious ambiguity in the
core implementation of activity.py
A return of True from can_close should end processing except write_file.
Aside from user 'ctrl' + q or quit, the activity could be closed as a
result of the end of the Sugar session by shutdown or logout or by
shutdown of the system because of lower battery power.
As I recall, activity developers should assume the object changes made
in write_file will be saved.
For the quiz activity, I have had to set a flag in can_close because the
information needed by write_file is not available until the quiz
responses are complete.
This no-ops the write_file calls until after can_close has been called.
Tony
On 05/02/2017 09:27 AM, James Cameron wrote:
>
> Also in 97c7836
> <https://github.com/sugarlabs/sugar-toolkit-gtk3/commit/97c783614e81f7bc75e86fac4248f4cbba4f81ff>
> when |save-as| is enabled,
>
> * there is no busy cursor during close; this is a regression, which
> you can fix by making the cursor busy again when the alert button
> 'Save' is pressed,
> * the |_closing| signal is emitted early, which causes a
> |save_title| in widgets.py to run, but is that necessary?
> * the activity |can_close| is called only once, yet the learner can
> continue to interact with the activity (which I've just tested
> again) and may invalidate |can_close|; this is a regression on the
> meaning of |can_close|, which you can fix by either making the
> alert modal (which would be unfortunate), or calling |can_close|
> again sometime later.
>
> For your testing, among the activities that implement |can_close| are
> Browse, Chat, Develop, FractionBounce, GetBooks, ImageViewer, Jukebox,
> Maze, Physics, Read, and TurtleBlocks.
>
> I'm having trouble following the new logic path in |close|; it seem
> convoluted to call |_alert_confirmation| only for that method to find
> out that the title has been changed, then set a flag |_pre_naming|
> which is tested again later in |close|.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/327#issuecomment-298475116>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAULkunUw5MCo_otLoA5iNCjZpPb_1Dtks5r1oZvgaJpZM4JEg63>.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20170502/70cb6e11/attachment.html>
More information about the Sugar-devel
mailing list