<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Thanks for this testing. You are
showing some serious ambiguity in the core implementation of
activity.py<br>
<br>
A return of True from can_close should end processing except
write_file. <br>
<br>
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. <br>
<br>
As I recall, activity developers should assume the object changes
made in write_file will be saved. <br>
<br>
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.<br>
This no-ops the write_file calls until after can_close has been
called.<br>
<br>
Tony<br>
<br>
On 05/02/2017 09:27 AM, James Cameron wrote:<br>
</div>
<blockquote
cite="mid:sugarlabs%2Fsugar-toolkit-gtk3%2Fpull%2F327%2Fc298475116@github.com"
type="cite">
<p>Also in <a moz-do-not-send="true"
href="https://github.com/sugarlabs/sugar-toolkit-gtk3/commit/97c783614e81f7bc75e86fac4248f4cbba4f81ff"
class="commit-link"><tt>97c7836</tt></a> when <code>save-as</code>
is enabled,</p>
<ul>
<li>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,</li>
<li>the <code>_closing</code> signal is emitted early, which
causes a <code>save_title</code> in widgets.py to run, but is
that necessary?</li>
<li>the activity <code>can_close</code> is called only once,
yet the learner can continue to interact with the activity
(which I've just tested again) and may invalidate <code>can_close</code>;
this is a regression on the meaning of <code>can_close</code>,
which you can fix by either making the alert modal (which
would be unfortunate), or calling <code>can_close</code>
again sometime later.</li>
</ul>
<p>For your testing, among the activities that implement <code>can_close</code>
are Browse, Chat, Develop, FractionBounce, GetBooks,
ImageViewer, Jukebox, Maze, Physics, Read, and TurtleBlocks.</p>
<p>I'm having trouble following the new logic path in <code>close</code>;
it seem convoluted to call <code>_alert_confirmation</code>
only for that method to find out that the title has been
changed, then set a flag <code>_pre_naming</code> which is
tested again later in <code>close</code>.</p>
<p
style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>
You are receiving this because you were mentioned.<br>
Reply to this email directly, <a moz-do-not-send="true"
href="https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/327#issuecomment-298475116">view
it on GitHub</a>, or <a moz-do-not-send="true"
href="https://github.com/notifications/unsubscribe-auth/AAULkunUw5MCo_otLoA5iNCjZpPb_1Dtks5r1oZvgaJpZM4JEg63">mute
the thread</a>.<img moz-do-not-send="true" alt=""
src="https://github.com/notifications/beacon/AAULkpVgnbLXi3QDMF8uYC8yojQsARFEks5r1oZvgaJpZM4JEg63.gif"
height="1" width="1"></p>
<div itemscope="" itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope=""
itemtype="http://schema.org/ViewAction">
<link itemprop="url"
href="https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/327#issuecomment-298475116">
<meta itemprop="name" content="View Pull Request">
</div>
<meta itemprop="description" content="View this Pull Request on
GitHub">
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/sugarlabs/sugar-toolkit-gtk3","title":"sugarlabs/sugar-toolkit-gtk3","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/sugarlabs/sugar-toolkit-gtk3"}},"updates":{"snippets":[{"icon":"PERSON","message":"@quozl in #327: Also in 97c783614e81f7bc75e86fac4248f4cbba4f81ff when `save-as` is enabled,\r\n- 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,\r\n- the `_closing` signal is emitted early, which causes a `save_title` in
widgets.py to run, but is that necessary?\r\n- 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.\r\n\r\nFor your testing, among the activities that implement `can_close` are Browse, Chat, Develop, FractionBounce, GetBooks, ImageViewer, Jukebox, Maze, Physics, Read, and TurtleBlocks.\r\n\r\nI'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`.\r\n\r\n\r\n\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/327#issuecomment-298475116"}}}</script>
</blockquote>
<br>
</body>
</html>