Explanation:
There was inconsistency between docs and the code.
- Docs said it returns -1 on timeout
- Code returned Gtk.Response.OK on timeout
Effect of this commit:
- Code returns -1 on timeout
Learners have to use tab to finish editing, followed by clicking the
activity icon to dismiss the dialog. A slow work flow and inconsistent
with journal list view. The enter key is ignored.
Add an activate signal handler to save the title. Force the focus to
move by calling hide and show.
Signed-off-by: James Cameron <quozl@laptop.org>
Some activities suffer from performance penalties once the number of
icons backed by SVGs exceeds 50.
Double the cache sizes.
Tested on OLPC XO-1, the weakest known system on which Sugar is used.
When an activity deletes the window associated with the canvas, save may
fail because Gdk.cairo_create is given an argument of None. Activity
continues to run without a window.
Reproduced with Chat activity and pressing Stop.
Avoid exception by returning None from get_preview when there is no
window.
- fix method name,
- return translated voices,
- low impact; method not yet used in any of the most frequently used
activities,
- old method name retained for compatibility just in case, but
deprecate.
Bundle versions are often described as being decimal floats e.g. 1.2,
but they also accept more than one dot, and a suffix after a dash,
e.g. 1.2.3-peru
Debian project and Ubuntu often use ~ for modified sources to comply
with distribution policy (~dfsg), or developer builds.
The dist_source target for setup.py does not work with
a version suffix like ~dfsg, requiring a manual step to rename the
file.
Adjust the regular expression to accept the ~ form.
When the datastore process begins on Fedora 26, the import of mime.py
causes a version warning to the system journal.
```
Jun 09 10:28:01 localhost-live org.laptop.sugar.DataStore[2197]: /usr/lib/python2.7/site-packages/sugar3/mime.py:29: PyGIWarning: GdkPixbuf was imported without specifying a version first. Use gi.require_version('GdkPixbuf', '2.0') before import to ensure that the right version gets loaded.
Jun 09 10:28:01 localhost-live org.laptop.sugar.DataStore[2197]: from gi.repository import GdkPixbuf
```
Accidental finding on #4989.
When an activity is to stop, and the save-as setting is enabled, and the
journal entry has not been named, show an alert asking for a name, with
keyboard focus in the name entry with the name selected.
Return key commits the save with the name as shown.
Escape key cancels the alert and the stop.
While the alert is shown, the activity stop button(s) will be
insensitive.
As a side-effect, when an entry is resumed, switching to the journal
will show a clone entry with the same name. When the activity is
stopped, the clone entry will be removed or renamed. Forced power down
and reboot will show the clone entry.
https://wiki.sugarlabs.org/go/Features/Save-As
Signed-off-by: James Cameron <quozl@laptop.org>
Track the stop buttons for the activity, so that they can be set
insensitive or not in a later patch.
Our API allows for more than one stop button, though the use of more
than one is very rare.
- add a comment to explain the causes of keep failure,
- rename the keep failure response callback to fit convention,
- fix typo and whitespace nearby.
Every time an activity maintainer uses the `python setup.py genpot`
command the resulting po/Activity.pot file has changes caused by random
ordering of filesystem inodes.
This makes the output unpredictable.
Sort the list of source files.
The constants must be documented, because otherwise they are hidden
from the generated online documentation.
[changes arising from review comments and flake8 compliance]
Signed-off-by: James Cameron <quozl@laptop.org>