- 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 <f2016015@pilani.bits-pilani.ac.in>
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>
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
- 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 <hrishipatel99@gmail.com> (31176ea) and
- radicalonion <ndefilippis98@gmail.com> (db89aca).
The popdown state argument was removed in 90cec5b, as the palette
popdowns were unified. However, this is a public api. Removing
the argument caused exceptions to be raised, breaking applications.
Most uses of the state argument were for the SECONDARY state, which
is now the default behaviour.
This commit re-adds the argument with a deprecation notice.
This adds a explicit method for cleaning up the animation. Previously,
animations expected the next_frame to be called where frame=end.
That guarantee was never provided by the api. This resulted in
animations sometimes being in odd states. For example, Browse activity
had an animation that overrode the Gtk "draw" signal. If the signal
was not unbound, the animated object was mistakenly rendered after
the completion of the animation, obstructing the user's view.
This api is explicit and allows cleaner code in the animation
implementation. The clean up code goes in do_stop rather than in a
conditional of next_frame.
Many activities already have the repository url pointing to their GitHub
page - which also serves as a bug tracker for many of the projects. The
repository url is not part of the spec, but the bug tracker url is.
This commit adds the 1st pass generator for these files. It also adds
documentation about the required fields in the "activity.info"
file, as AppStream requires more metadata than most activities currently
include.
When created via "git submodules add", a submodules may have the
"/.git" path be a file rather than a directory. The bundlebuilder
previously thought that all submodules had "/.git" as a directory.
The unversioned import results in the following log noise:
/usr/lib/python2.7/site-packages/sugar3/graphics/window.py:26: PyGIWarning: GdkX11 was imported without specifying a version first. Use gi.require_version('GdkX11', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GdkX11
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.
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.
Previously there was the concept of having 2 popdowns for a palette.
The first popdown showed the of tooltip the palette, and the 2nd
showed the content of the palette. However, this was confusing
to new users, and made users wait for little reason.
This commit removes the 2nd popdown. An example of this is when you
mouse over an icon to invoke the palette. Previously, it showed
the tooltip, then made you wait, then showed the content of the
palette. With this patch, the whole palette is shown at the
first popdown, making a snappy UX.
Steps to reproduce:
1. Long press on home view favorite icon (an event icon)
Expected: Palette invoker where finger is
Actuall: Palette invokes in top left corner
This is because the long press controller emits coords relative
to the widget's window, and EventIcons sometimes have their own
windows. We can't change the long press controller, as it is a
public api. But we fix this by translating the coords to the
root window coords in the CursorInvoker. Using root coords is
consistent with the right click handleing in the cursor invoker.
Steps to reproduce:
1. Long press activity icon on homeview
Expcected: Palette invokes, icon not activated
Actual: Palette invokes, icon also activated, activity launched
This was because the "activate" signal was emitted before the
palette invoker got it's signal, meaning the palette invoker couldn't
scilence the event.
Steps to reproduce:
1. Long press activity icon on homeview
Expcected: Palette invokes, icon not activated
Actual: Palette invokes, icon also activated, activity launched
This was because the "activate" signal was emitted before the
palette invoker got it's signal, meaning the palette invoker couldn't
scilence the event.
This will allow .desktops for all of the activities to be
packaged. In the future, we could ship a special launcher script
so that the user can choose the jobject to run, but for now
we just open the activity using the command specified in the
activity.info file.
If the user has a "random" telepathy connection manager
installed and running on the system (eg. telepathy idle being
active if they are chatting on irc with GNOME's Polari), activities
will crash on startup.
Steps to reproduce the crash:
1. Run Polari (eg. via the Terminal activity)
2. Join an irc channel in Polari (eg. #sugar on freenode)
3. Try to open an activity from the home view
- notice that opening any sugar3 activity will crash
Currently, the ToolInvoker code passes the button child in such a
way that the WidgetInvoker queues only the child's draw. In previous
Gtk+ versions, this magically resulted in redrawing the parent as well.
However, Gtk+ 3.20 is probably trying to save power and not randomly
redraw widgets. To fix this, we must queue the redraw of the widget
that we want to redraw explicitly.
- Handle lack of GSettings gracefully.
- Still requires sugar-datastore.
- Supports avoiding X11 docks/panels.
- Provides icons for Activity windows.
Try it outside Sugar. Go to an Activity directory and run 'sugar-activity'.
Tested it with Terminal, Finance, Write, Browse, Memorize under XFCE4.
Tested in Gnome under OLPC-OS.
Also works from Sugar Terminal Activity.
Does not affect regular Sugar operation.
This is patch v.2 -
Addresses most concerns:
- Removed commented code, sorry.
- Changed code to use profile.get_nickname and get_color where possible.
Couldn't the launcher just pass this info?
Maybe the launcher could set the activity root as well?
- It is intended to be usable from the command line also.
Should put sugar version in the environment
- It is intended to work even without Sugar Shell installed.
Why don't we always set the icon?
- On XO it might use some memory. I was concerned to degrade
performance.
Also, imports should be at the top of the file?
- Also a concern about performance on XO.
This way it is only loaded in this use case.
Maybe it is insignificant -moved as requested.
It would be nice if the changes to the POT for sugar-toolkit-gtk3
could be incorporated in this pull request, please.
- There were no changes to POT files as part of this patch. Maybe
it is worth translating low level command line tools, not sure.
Suggest packaged activities might also provide .desktop files.
- Intriguing but not sure within scope of this patch. You mean generate
a .desktop file automatically as an option? Sounds nice!
Suggest sugar-activity might also accept path to unpacked bundle.
- Implemented!