Commit Graph
100 Commits
Author SHA1 Message Date
James Cameron 5b9f36db06 translate.sugarlabs.org synchronisation {uk} 2019-12-30 16:44:49 +11:00
James Cameron 88adb38a42 Fix RuntimeError: could not create signal for _closing
On Ubuntu 20.04 with GTK 3.24.13, importing sugar3.activity.activity
fails with RuntimeError: could not create signal for _closing, preceeded
by an assertion is_valid_signal_name failed.

Cause is upstream 89f955d ("gsignal: Canonicalise signal names at
installation time ") which requires application signal names to not
start with a hyphen or underscore.

Remove the prefix from our signal name.  The signal remains reserved and
private to the Activity class.
2019-12-27 20:23:34 +11:00
James Cameron aca045bde2 Reduce width of exception handler for linfo file
ParsingError is only expected during read.
2019-12-27 14:15:39 +11:00
James Cameron 2018c930ad Fix sugar-install-bundle
Traceback (most recent call last):
  File "/usr/bin/sugar-install-bundle", line 21, in <module>
    bundle = ActivityBundle(name)
  File "/usr/lib/python3.7/dist-packages/sugar3/bundle/activitybundle.py", line 118, in __init__
    info_file = self.get_file('activity/activity.info')
  File "/usr/lib/python3.7/dist-packages/sugar3/bundle/bundle.py", line 126, in get_file
    f = six.StringIO(data)
TypeError: initial_value must be str or None, not bytes

Fix by always reading bundle and metadata as Bytes, and converting to
String before passing to ConfigParser.

Did not fix ContentBundle, as it has been unused for some time, and was
only kept for use with OLPC XO and Python 2.
2019-12-27 14:10:28 +11:00
James Cameron 15caa5478d Demote speech module utterance logging 2019-09-11 14:58:09 +10:00
James Cameron bfa70f39e2 Trim LINGUAS
Regression in 86289bd ("Remove empty locale files").

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/431

Reported-by: Chihurumnaya Ibiam <[email protected]>
Tested-by: James Cameron <[email protected]>  # Ubuntu 18.04
2019-09-11 05:32:48 +10:00
James Cameron 86289bd58a Remove empty locale files
Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/429
2019-09-10 09:07:09 +10:00
James Cameron 2b56fabed1 Release Sugar 0.116 unstable
* fix previews.
2019-09-05 10:29:23 +10:00
James Cameron c911c6cb30 Port to Python 3 - preview metadata is bytes
Preview metadata in 0.114 and earlier was returned by datastore client
as a dbus.ByteArray.

Regression introduced by aa8a5e7 ("Port from Python 2 to six").

Traceback (most recent call last):
  File "/usr/lib/python3.7/dist-packages/jarabe/journal/expandedentry.py", line 378, in _create_preview
    pixbuf = get_preview_pixbuf(metadata.get('preview', ''))
  File "/usr/lib/python3.7/dist-packages/sugar3/graphics/objectchooser.py", line 85, in get_preview_pixbuf
    preview_data = base64.b64decode(preview_data)
  File "/usr/lib/python3.7/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (237) cannot be 1 more than a multiple of 4

Related to
https://github.com/sugarlabs/sugar-datastore/issues/16
2019-09-04 07:38:52 +10:00
James Cameron a7d8b9fdf6 Release Sugar 0.115 unstable 2019-08-31 13:54:47 +10:00
James Cameron 90c2539135 Fix unnecessary whitespace in warning
Regression introduced by 3b28597 ("flake8 fixes").

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/424
2019-08-28 17:28:37 +10:00
James Cameron 381c9b1b61 Fix install TypeError
Activity install target used by downstream activity packaging did fail
with;

Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    bundlebuilder.start()
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 633, in start
    globals()['cmd_' + options.command](config, options)
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 513, in cmd_install
    options.install_desktop_file)
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 290, in install
    for f in self.get_files_in_git():
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 209, in get_files_in_git
    stdout.strip('\n').split('\n')]
TypeError: a bytes-like object is required, not 'str'

Workaround was to hide .git directory.

Cause was subprocess pipe returning a bytes-like object in Python 3.

Regression introduced by incomplete ed46c21 ("Port to six").

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/426
2019-08-28 13:36:44 +10:00
James Cameron 7b85b807b2 Fix AppStream metadata warning
* wrong pydoc module reference,

* was too verbose.
2019-08-28 13:36:11 +10:00
James Cameron 6e517aa3c7 Clean activity logs successful completion
Status zero is normal, so don't report it.

Also don't print the log_file object.

Changes log messages such as this;

Exited with status 0, pid 3765 data (<_io.TextIOWrapper name=13 mode='w'
encoding='UTF-8'>, '5312a7726254b3b0b9a15267c54600aec9db187e')

To this;

Normal successful completion, pid 3765 activity_id 5312a7726254b3b0b9a15267c54600aec9db187e
2019-08-15 16:25:57 +10:00
James Cameron ec753badbc Fix whitespace in AppStream metadata warning
Encountered on Hello World activity.
2019-08-14 16:48:06 +10:00
James Cameron a62bb885fc Port to Python 3 - use rb for message catalog file
Reported and patch proposed by Bas Hulsken.

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/425

Signed-off-by: James Cameron <[email protected]>
2019-08-12 07:49:06 +10:00
James Cameron 23e664df05 sugar3.speech - expose player pipeline
Expose the GstSpeechPlayer pipeline so that the activities may add their
own handlers.

A quick way to get the rest of the gst-plugins-espeak signals available.
2019-07-24 17:03:48 +10:00
James Cameron f5c86da271 flake8 fixes (several remain to be fixed) 2019-07-06 14:48:05 +10:00
James Cameron 12a899f374 Defer Gtk.Window.iconify
Defer iconify call to after the activity has been shown.  Remember the
iconify call was requested, and make the call just prior to entering the
main loop.

On Ubuntu 18.04 with Metacity 3.32.0 the Journal does appear over the
Home View on Sugar start on a VM with two virtual CPUs, yet the previous
fix in Metacity (074af8f) is present.  This is suggestive of a race
condition.

Tests with a minimal GTK reproducer shows order of three specific calls
is critical to success of iconify.  The ordering and results are;

* iconify, maximize, show; not iconified,

* maximize, iconify, show; not iconified,

* iconify, show, maximize; not iconified,

* maximize, show, iconify; app with focus will flicker, iconified,

* show, maximize, iconify; app with focus may flicker, iconified,

* show, iconify, maximize; app with focus may flicker, iconified,

Sugar Toolkit combined with Journal uses the "maximize, iconify, show"
ordering.  Using a Hello World activity with a call to iconify, the new
activity is not iconified.

When changed to "mazimise, show, iconify" ordering, there is no flicker
of the app in focus, and the new activity is iconified.
2019-06-05 12:33:31 +05:30
James Cameron a7735e6a97 Release Sugar 0.114 stable 2019-05-18 12:18:53 +10:00
James Cameron 4c4332c65c translate.sugarlabs.org synchronisation {mn,ru}
Thanks to khishigjargal and martenix.
2019-05-18 12:17:18 +10:00
James Cameron 5fa33b2d2c Build for either python 2 or python 3
`configure` and `autogen.sh` now accept `--with-python2` or
`--with-python3` options, with the default of python 2.

aa8a5e7 introduced building for python 3, but broke build for python 2,
requiring patching `configure.ac` prior to build.

Code was derived from rpmfusion-packager, found using a GitHub search of
`configure.ac` files for both `python2` and `python3`, and is GPLv3.

Tested on Ubuntu 18.04.

Signed-off-by: James Cameron <[email protected]>
2019-05-16 11:47:13 +05:30
James Cameron 481e0bac80 Fix collaboration call_async
Port to Python 3 via Six aa8a5e7 did introduce a regression during
activity collaboration on both sharing and joining.

Fixes https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/406
2019-04-03 16:23:20 +11:00
James Cameron 2453d13b03 Clean up activity environment variables
Ensure environment variables needed by Python activities are available
in each of the three supported scenarios;

- started from Sugar,

- started from Terminal inside Sugar,

- started by other desktop environments.

Variables always available are;

SUGAR_ACTIVITY_ROOT
SUGAR_BUNDLE_ID
SUGAR_BUNDLE_NAME
SUGAR_BUNDLE_PATH
SUGAR_BUNDLE_VERSION

Variables also available when started from Sugar are;

SUGAR_ACTIVITIES_HIDDEN
SUGAR_APISOCKET_KEY
SUGAR_APISOCKET_PORT
SUGAR_GROUP_LABELS
SUGAR_HOME
SUGAR_MIME_DEFAULTS
SUGAR_PROFILE
SUGAR_SCALING
SUGAR_VERSION

Variables also available when started from Terminal are;

SUGAR_TERMINAL_VERSION

Other changes;

- use os.makedirs in place of distutils.dir_util.mkpath,

- avoid redundant setting of SUGAR_BUNDLE_PATH,

- do not set SUGAR_BUNDLE_ID unnecessarily,

- add explanatory comment,

Tested on Ubuntu 18.04.

Signed-off-by: James Cameron <[email protected]>
2019-03-28 15:29:02 +11:00
James Cameron 359dbf2c45 Add distributed source to .gitignore
File is generated by "make dist" or "make distclean".
2019-03-28 15:29:02 +11:00
James Cameron b6e314bbe5 Add flake8 suppression 2019-03-13 15:01:07 +11:00
James Cameron 830e7c50fb Release Sugar 0.113 unstable 2019-03-13 15:00:25 +11:00
James Cameron 0aaeca48b6 translate.sugarlabs.org synchronisation {ach,da,fy,he,is,lt,nl,pt,pt_BR,sq}
Thanks to numerous translators.
2019-03-13 14:59:33 +11:00
James Cameron 78309a2b8e Update POT file
No string changes.

Line number changes only.
2019-03-13 14:52:21 +11:00
James Cameron 6345da8e07 docs - move get_activity_root description
When it was moved from the class to the module, the full description did
not move with it.
2019-01-31 08:07:03 +11:00
James Cameron 39b7e606df get_profile() - handle new OpenSSH DSA key format
OpenSSH changed the format of the DSA key, and this broke Sugar
connection to Jabber.

Fixes https://github.com/sugarlabs/sugar/issues/814

Fixes http://bugs.sugarlabs.org/ticket/4992
2019-01-01 16:04:54 +11:00
James Cameron 87fcfb62e4 Fedora 18 backport - GLib does not have unix_signal_add 2018-12-26 12:26:12 +11:00
James Cameron 85fc4680e9 Fedora 18 backport - GObject.ParamFlags does not have READWRITE 2018-12-26 12:26:06 +11:00
James Cameron 13fc98e193 Review: Port from GObject to GLib
Fix a typo in 13a2282.
2018-07-31 17:58:37 +10:00
James Cameron 84a7286986 Review: Port from GObject to GLib
Fix new flake8 issues introduced by cb0d6e2.
2018-07-26 13:11:27 +10:00
James Cameron 6730d129cd Handle SIGINT from Ctrl+C in shell
Used when testing from the shell prompt using sugar-activity{,3}.
When Ctrl+C is pressed, close the activity.

May be used by other processes to request a clean activity stop, but
with save-as enabled may require user input.
2018-07-04 08:51:40 +05:30
James Cameron e32aea6a4f sugar3/bundle - activity metadata standard rewording
Move definition of bundle identifier from Wiki.
2018-06-28 12:28:59 +10:00
James Cameron 58224cb15d Fix traceback when an icon name matches a GNOME theme icon
When an icon file name matches a GNOME theme icon;

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/sugar3/graphics/icon.py", line 214, in _get_attach_points
    cp.readfp(config_file)
  File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.

Caused by reading a .png file as if it were config file, in turn
because the icon was expected by the toolkit to be .svg file type.

Regression introduced by f796638.

Fixes https://github.com/sugarlabs/activity-abacus/issues/16
2018-05-24 08:46:58 +05:30
James Cameron 30139a3a9e sugar3.speech - remove GConf compatibility support 2018-03-26 14:35:28 +11:00
James CameronandRahul Bothra cc2357c787 Add warnings for missing activity metadata
- report a warning if either activity_version, icon, or license are
  missing,

- fix typo in missing bundle_id exception message.

Fixes #378

Co-authored-by: Rahul Bothra <[email protected]>
2018-02-15 14:52:55 +11:00
James Cameron 7e216a04d5 Adjust metadata reference 2018-02-13 12:55:30 +11:00
James Cameron 5876bc4a00 TitleEntry - clear selection
When editing stops, clear the selection.
2018-01-15 17:03:49 +11:00
James Cameron 1cf9ba8190 TitleEntry - rename callbacks, use arguments 2018-01-15 17:03:49 +11:00
James Cameron aaea86066d Icon - increase LRU cache sizes
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.
2018-01-06 15:01:00 +11:00
James Cameron a77ae5fb57 Activity.get_preview fails for no window in canvas
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.
2018-01-02 14:15:15 +11:00
James Cameron e13c4fefab Fix bundlebuilder genpot test
Lurking copy and paste error.
2018-01-02 14:14:46 +11:00
James Cameron ab7e9a8247 Fix service_name deprecated whitespace 2017-12-11 13:47:07 +11:00
James Cameron 9b687cab3f translate.sugarlabs.org synchronisation
- consequence of POT changes
2017-12-11 13:46:29 +11:00
James Cameron 2dc3f76775 translate.sugarlabs.org synchronisation {en,zh_TW,am,id,es,de} 2017-12-11 13:44:48 +11:00
James Cameron ef28adcce6 translate.sugarlabs.org synchronisation {fy,it} 2017-11-02 16:22:46 +11:00
James Cameron cf07b687a1 Update POT file
Method used was;

xgettext --join-existing --language=Python --keyword=_ --add-comments=TRANS: --output po/sugar-toolkit-gtk3.pot $(sort po/POTFILES.in)
2017-10-16 19:02:28 +11:00
James Cameron 9722cfab1e wip; sugar3.speech - espeak-ng does not have default voice 2017-10-10 14:34:53 +11:00
James Cameron 7c2a2ba94a Fix sugar3.speech.SpeechManager get all translated voices
- 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.
2017-10-06 12:39:05 +11:00
James Cameron f0b479f068 Release Sugar 0.112 stable 2017-10-06 12:39:05 +11:00
James Cameron 04a1ff181f Fix Python GI API version warning in Wikipedia
The Wikipedia activity imports from sugar3.graphics.icon without any
other use of GTK+, causing a version warning.
2017-10-03 13:30:25 +11:00
James Cameron 45cc6502dd translate.sugarlabs.org synchronisation {zh_CN} 2017-09-13 15:01:23 +10:00
James Cameron 4e4f1fbbcb Release Sugar 0.111 unstable 2017-09-09 11:54:31 +10:00
James Cameron e2ea171cfb Sort list of po files 2017-09-09 11:51:57 +10:00
James Cameron 1875a30075 Fix Python GI API warnings for web activities 2017-08-01 09:40:16 +10:00
James Cameron f3f22ad124 Remove message, best voice for LANG 2017-08-01 09:39:52 +10:00
James Cameron dd512c9c29 Fix common typo, occured should be occurred 2017-08-01 09:39:02 +10:00
James Cameron 5750773dda Documentation - rewrite activity section
- rewrite of activity section, bundle section, graphics.alert, and
  graphics.window.
2017-07-19 17:31:09 +10:00
James Cameron 4652b7ca2a Bundlebuilder - update documentation 2017-07-19 17:30:44 +10:00
James Cameron 72a34528f2 Bundlebuilder - accept repository for AppStream metadata
AppStream metadata generator was looking for key repository_url, but
Wiki and common usage has adopted repository.
2017-07-19 17:29:35 +10:00
James Cameron ae62708a7f Documentation - small typos 2017-07-19 17:29:09 +10:00
James Cameron 351143a857 Documentation - introduction
- update the copyright date,

- add an introduction to the documentation.
2017-07-19 17:27:23 +10:00
James Cameron 73df533b06 README - add build and install 2017-07-19 12:38:43 +10:00
James Cameron 002349f290 NormalizedVersion - accept ~ as version separator
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.
2017-07-17 17:39:31 +10:00
James Cameron 2f3c47ffb0 translate.sugarlabs.org synchronisation 2017-07-17 17:37:52 +10:00
James Cameron 2265623933 Fix Python GI API version warning in datastore
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.
2017-06-10 12:26:38 +10:00
James Cameron 12de9f0412 Remove noisy output from sugar-activity 2017-06-10 08:42:02 +10:00
James Cameron 3a574ae778 Save As - add busy cursor methods
Add methods for use by activity for showing and removing a busy cursor.
2017-06-01 13:19:09 +10:00
James Cameron 6bcd664289 Save As - track stop buttons in Activity instance
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.
2017-06-01 13:18:22 +10:00
James Cameron b1d1129759 Save As - document keep failure
- add a comment to explain the causes of keep failure,

- rename the keep failure response callback to fit convention,

- fix typo and whitespace nearby.
2017-06-01 13:10:55 +10:00
James Cameron 286387b22e Save As - return copied datastore object
When a datastore object is copied, return the new object to the caller.
2017-06-01 12:57:34 +10:00
James Cameron 83697d21f9 Save As - add an optional Gtk.Entry to Alert
An Alert may have a Gtk.Entry, which is placed between the title and the
buttons.  It is for when text is to be input during the alert.
2017-06-01 12:50:29 +10:00
James Cameron 926a262306 Save As - add profile.get_save_as
Add a method for reading the save-as setting.
2017-06-01 12:49:10 +10:00
James Cameron 7d5abe2684 Predictable POT file ordering
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.
2017-06-01 08:09:53 +10:00
James Cameron c26c902dc7 Remove Python GI API version warnings
- reported in Clock-19 testing.
2017-05-30 14:10:30 +10:00
James Cameron 2c3d1d0707 Specify library version prior to import
- web activities caused two warnings every time they were started,

- warnings cost disk write wait time.
2017-05-19 14:22:28 +10:00
James Cameron 495eed8737 Prepend instead of append to path
When an activity is launched, an import should first search the activity
bundle source rather than /usr/bin

Fixes the need to change activity sources every time a system package
conflicts with an import.

May impact any activity that relies on a system package being in search
path before the bundle source.  Forty activities were tested, and none
relied on this.
2017-03-27 19:07:37 +11:00
James Cameron a6e62a52b6 Fix screen resize race
When an external monitor is connected or disconnected, about 25% of the
time an activity does not resize correctly; a size-changed signal occurs
but the workarea geometry has not changed.

Underlying problem is an update race in get_monitor_workarea, so the fix
is to call get_monitor_geometry for obtaining the width and height.

Can be reproduced easily without an external monitor by switching
display panel resolution repeatedly;

    xrandr --output eDP1 --mode 1024x768
    xrandr --output eDP1 --mode 1366x768

Part of a fix for https://bugs.sugarlabs.org/ticket/4968
2017-01-02 04:38:37 -03:00
James Cameron 99130b0263 Write documentation for sugar3.power 2017-01-02 02:48:48 -03:00
James Cameron a71a011496 Fix documentation typo, SPCAING 2017-01-02 15:22:51 +11:00
James Cameron c92d0009df Write documentation for sugar3.graphics.ToolButton
- add two examples,

- document critical properties as keyword arguments in the class init,

- ensure documentation is consistent between RadioToolButton and
  ToolButton, (as some of the text is similar),

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs

- follow How To Guide
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs/How_To_Write

Derived from work by

- Hrishi <[email protected]> (31176ea) and

- radicalonion <[email protected]> (db89aca).
2016-12-12 15:51:49 +11:00
James Cameron ee93ad3bef Further gi.require_version calls
Activity logs have continued to report GObject Introspection version
warnings.
2016-11-09 13:32:49 +11:00
James Cameron 4b6d8751b3 sugar-activity: typo 2016-10-08 11:06:57 +11:00
James Cameron 4ad2b99ebc Add missing popwindow to POTFILES.in 2016-07-15 12:55:37 +10:00
James Cameron 1f93659c95 Avoid private member access to Bundle
ActivityBundle was making reference to _path private in Bundle, change
to use get_path public method.
2016-07-15 12:55:26 +10:00
James Cameron 7950e4c124 Missing 0.190.0.2 version change
7722015bf9 did not add change to doc/conf.py as 513452503e did.
2016-07-15 12:49:20 +10:00
James Cameron 433d06b025 avoid uncommanded palettes
Problem #1, buddy menu appears on Sugar startup on physical hardware, or
when mouse is centre of display.

Problem #2, Terminal toolbar steals keyboard focus, when mouse is left
in home view search box at activity start time.

Regressions were introduced in the port from Gtk2 to Gtk3.

Cause is enter-notify-events that arrive because cursor is already
present in widgets as they are realised and mapped.

Fix is to capture cursor position when the widget is being created, and
ignore enter-notify-event if the same position is seen.
2016-07-08 12:42:57 +10:00
James Cameron 65fa711e53 refactor pointer position get
Move common code into a function, and cache Gdk.Device client pointer.
2016-07-08 12:40:04 +10:00
James Cameron 552c7da884 remove surplus message
The log message "PaletteWindowWidget popup get_visible True" is not
useful, and is removed.  It can be made to occur in Terminal by repeated
right-click on any of the first three toolbar button.
2016-07-08 11:53:37 +10:00
James Cameron 6f2550cde0 Ignore empty translated summary 2016-05-23 14:02:45 +10:00
James Cameron 8d4298ee9e Remove Rainbow, avoid race in creating directories
Sugar depended on Rainbow for clearing the activity instance/ and tmp/
directories.  But Rainbow is no longer used downstream.

- remove support for Rainbow,

- avoid race when creating directories; don't check they exist before we
  create.
2016-02-15 11:41:31 +11:00
James Cameron 7ba120fe25 Fix persistent tree view palettes
A rework of the TreeViewInvoker used by the journal and activity list.

Fixes a persistent journal entry palette that reappears in journal or
home view.  https://bugs.sugarlabs.org/ticket/4918

Also fixes an over-sensitive journal icon; with the journal mostly
empty, rapidly move the mouse from the bottom of the screen into the
lowest icon and then out again.  Before this patch, the palette was
shown.  After this patch, the mouse must rest in the icon.

Changes made:

- override _ensure_palette_exists in parent class Invoker,

- remove reference to MouseSpeedDetector, it is no longer required,

- remove enter and leave events; they are for the TreeView as a whole,
  and are not required,

- properly detect that None is returned by get_path_at_pos, when the
  coordinates are outside the TreeView cells.

Not fixed:

- moving the mouse out of the journal icon invoker does not popdown the
  palette, but it does when moving the mouse out of the activity icon in
  the activity list; so this is a problem beyond the invoker,

Tested on Fedora 18 and Ubuntu 15.10.

Test cases:

- check a click will activate item,

- check a right-click will show palette,

- check a mouse hover will show palette,

- check a brief mouse passing will not show palette,

- check if mouse leaving palette will popdown.
2015-12-22 09:49:16 +11:00
James Cameron ae80df7725 Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.

Additional change missed from already merged 70bc4db.
2015-12-16 10:22:21 +11:00
James Cameron 70bc4dbe6a Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.
2015-12-15 16:44:04 +11:00
James Cameron a11639eb86 demote warning to debug for sugar_accel_group 2015-12-08 15:11:17 +11:00
James Cameron 280c74cd9e allow start on full disk
When disk is full, Sugar will not start, because the backup log
directory cannot be created.

X session logs in tmpfs show this exception:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 20, in <module>
    logger.cleanup()
  File "/usr/lib/python2.7/site-packages/sugar3/logger.py", line 113, in cleanup
    os.mkdir(backup_dir)
OSError: [Errno 28] No space left on device: '/home/user/.sugar/default/logs/1448258018'

Fix is to ignore the exception.

We've been here before!  Was previously fixed in 2010:

	https://github.com/sugarlabs/sugar/commit/4cde481
	https://bugs.sugarlabs.org/ticket/1720
	http://dev.laptop.org/ticket/9623

But new regression introduced in 2012 during reorganisation of
code by Daniel Narvaez; the exception was no longer handled:

	https://github.com/sugarlabs/sugar/commit/0e45f9d
	https://github.com/sugarlabs/sugar/commit/19db9c5

Reported-by: Nathan Riddle <[email protected]>
Tested-by: James Cameron <[email protected]>
2015-11-23 17:26:29 +11:00