Commit Graph

135 Commits

Author SHA1 Message Date
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
Utkarsh Tiwari
ba6993d705 Save As - show a save-as alert on stop
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>
2017-06-01 13:30:27 +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
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
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
György Balló
281e56c442 Allow to disable installing .desktop files 2017-04-22 08:29:58 +10: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
Eduard Sanou
05a18a2dc6
[PATCH] Sort translation files
Sort translation files when generating the .desktop file to output
reproducible results.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848633

Reviewed-by: James Cameron <quozl@laptop.org>
2017-01-02 02:25:29 -03: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
Sebastian Silva
4f3f32fd5a Assign icon to window regardless of environment.
Makes Sugar Activities more standard.
2016-07-27 01:52:05 -05:00
Sam Parkinson
2f9ae6ef51
Bundlebuilder: relabel repository url as bugtracker
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.
2016-07-16 07:55:57 +10:00
Sam Parkinson
9b5ed7e80c
Bundlebuilder: Translate AppData files 2016-07-15 09:16:18 +10:00
Sam Parkinson
6d337718d1
Bundlebuilder: Generate AppStream AppData files
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.
2016-07-15 08:19:05 +10:00
Sam Parkinson
7779c74f44
Bundlebuilder: Use installed icon path in .desktop file
Previously, the bundle builder referenced the icon path in the
source directory - which was obviously not installed in the package.
2016-07-14 16:20:22 +10:00
Sam Parkinson
c288d54ab8
Bundlebuilder: submodules can have "/.git" as a file
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.
2016-07-14 16:16:25 +10:00
Sam Parkinson
6c5bef2f78
Merge branch 'show-icons' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 2016-07-08 22:15:55 +10:00
Sam Parkinson
da65b6db55
Merge branch 'git-submodules-bundlebuilder-try2' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 2016-06-18 13:54:40 +10:00
Sam Parkinson
6079d7ff70
Show icons in buttons
Gtk 3.20 recently changed the default setting so that buttons hide
their icons.  This is regression in terms of the Sugar HIG.
2016-06-18 13:29:56 +10:00
Sam Parkinson
535ece85c3
Generate .desktop files for activities during install
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.
2016-06-07 13:29:36 +10:00
Sebastian Silva
966c65082e Allow running GTK3 Sugar Activities in HTML5 2016-06-04 22:32:05 -05:00
James Cameron
6f2550cde0 Ignore empty translated summary 2016-05-23 14:02:45 +10:00
Sam Parkinson
ea3b673f51 Merge branch 'master' of https://github.com/icarito/sugar-toolkit-gtk3 2016-04-27 21:39:12 +10:00
Sebastian Silva
2f2b2d20d8 Allow to run activities without Sugar shell.
- 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!
2016-04-21 03:10:30 -05:00
Sam Parkinson
bde85bc7e8 Merge branch 'activityhandle-docs2' of https://github.com/ndefilippis/sugar-toolkit-gtk3 2016-04-21 07:36:18 +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
Sam Parkinson
0a50431b98 Handle git submodules in bundlebuilder
Git submodules are only listed by their root directory in the
output of "git ls-files".  Therefore, we must handle this case
so that the files from the module are included in the install
and dist_xo commands.

To reproduce the issue, you could do something like the following:

    cd pippy
    git clone https://github.com/samdroid-apps/collabwrapper
    git add collabwrapper
    python setup.py install  # or just osbuild run
2016-01-05 21:05:11 +11:00
radicalonion
28053c83b1 Improve docs for sugar3.activity.activityhandle 2016-01-02 23:48:17 -05:00
Gonzalo Odiard
1bd8349b84 Deprecate create_jobject parameter on activity.py - Fixes #3450
As the ticket describe, create a object in the Journal
is no longer optional. The change do not break activities,
because the optional parameter is not removed, just ignored.
2015-10-05 00:41:21 -03:00
Gonzalo Odiard
7c804354a0 Improve documentation on activity module 2015-08-25 16:25:55 -03:00
Gonzalo Odiard
100a6b56b6 Check if parameter 'options' is None in cmd_dist_xo
When is used to clone a activity from sugar,
the options parameter is set to None.
The other uses of no_fail have False as default value
but this case was missing.
The effect of this error is that a .xo is not created in the Journal,
when the user select 'Duplicate' in the View Source window.
2015-08-05 17:13:17 -03:00
Gonzalo Odiard
04d8f596bc Add get_bundle method to activity.py
When a programmer need open one activity from other [1]
usually need display in the user interface information about the activity
to open, like the name or the icon.
This method allow get this information, previously only available on jarabe.

[1] http://wiki.sugarlabs.org/go/Features/Start_activity_from_another_activity
2015-07-03 15:03:27 -03:00
Martin Abente Lahaye
e8553c13a1 Add skip-install-mime option to bundlebuilder
Historically, distro packagers have been using bunblebuilder, via
"setup.py install", to populate packages directories and files.

The install procedure uses ActivityBundle.install_mime_type to install
custom mime types, by creating symlinks and updating the system mime
types database via the update-mime-database tool.

When ActivityBundle.install_mime_type is executed during packages
creation, the symlinks end-up broken in the final package and the use
of update-mime-database populates the final packages with a new copy
of the database files which could clash with the system copy.

This patch adds a new option, called --skip-install-mime to "setup.py
install" to skip the execution of ActivityBundle.install_mime_type and
avoid the issues mentioned above.

Activity packagers should use this new option. The creation of symlinks
and the execution of update-mime-database should be done in post install
packaging steps.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2015-05-28 16:30:04 -04:00
Gonzalo Odiard
bbdebce0d4 Simplify routine used to get the list of files from git
This change remove duplicated code
2015-05-15 20:37:21 +10:00
Gonzalo Odiard
34b0e17e95 Add screenshots to ignored dirs in bundlebuilder
After add the directory to the IGNORE_DIRS array,
we need make the standard procedure to get the list off files
for the bundle, get_files_in_git honor the configured ignored
files and dirs. That was not a problem until now,
because that files was already not added to git,
but in the case of the screenshots, are included in git,
but we don't want include them in our bundles.
2015-05-15 20:37:21 +10:00
Sam Parkinson
a56282991f Add ability to launch a bundle
This commit adds the `launch_bundle` function in `sugar3.activity.
activity` which accesses the same function in the shell is over dbus.
This is means the shell process launches the bundle.  Activities
should not launch child processes as per the Rainbow security model
[1].

[1]  http://wiki.laptop.org/go/Rainbow
2015-05-12 16:11:49 -03:00
Gonzalo Odiard
026146a081 Pep8 fixes 2015-04-17 08:05:58 +10:00
Gonzalo Odiard
954be953ca Remove new line chars when create linfo files
If a translator add a '\n' char in the summary translation
ConfigParser can't parse the linfo file.
Remove them when the file is created and show a message to warning
to the developer.
2015-04-17 08:05:58 +10:00
Martin Abente Lahaye
06c3f01998 Revert "Add ability to launch a bundle"
This reverts commit 8fcb0b48d3.
2015-04-12 10:11:59 -04:00
Manuel Quiñones
8fcb0b48d3 Add ability to launch a bundle
FIXME, to be written.
2015-04-12 20:02:11 +10:00
Sam Parkinson
712682a3b0 BundleBuilder: Don't crash on malformed translation files
The BundleBuilder currently crashes on a malformed translation file.  This is
good for humans (makes them fix their issues) but crashes bots who need it
compiled and don't care about that single translation file.

This patch adds a --no-fail option which stops the builder from crashing
2014-11-22 02:40:59 -03:00
Sam Parkinson
f48c3247f6 Merge branch 'godiard-bundlebuilder_gitls' 2014-10-18 19:31:08 +11:00
Gonzalo Odiard
e50a90c243 Bundlebuilder check if activity files are in git
git version 1.9.3, in a activity directory created inside sugar-build/activities
return a empty string when the command "git ls-files" is executed,
and no repository is configured.
We need verify that condition, and process a file list from the filesystem.
2014-10-13 23:01:29 -03:00
Martin Abente Lahaye
98a29ae12c Save spent time on activities
Use set_active and save events to keep track of the time,
in seconds, that the activity is on the main screen. The
time is calculated and stored each time an activity is
open/resumed and closed. Therefore, each activity entry
will have an array of seconds for each time it was used.

This makes a 1 to 1 relationship between the spent and
lauch times. In orders words, we can reflect not only the
"when", but also the " for how long".

Even though this time does not necessarily represents the
real time the user "used" the activity, it is a low-cost
approach for reflecting time.

This is a long requested featured from deployments that have
been using statistics tools on journal metadata, and this
patch is already being used by OLPC-AU.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2014-10-02 13:24:59 -04:00
Sam Parkinson
6e81c67622 Remove a double / in webkit1 activity's request's filenames 2014-06-13 09:43:50 -03:00
Gonzalo Odiard
568e0254d7 Pep8 fix 2014-05-05 09:26:37 -03:00
Walter Bender
d0cca91fe8 Assign max_participants in activity.info
As part of an effort to "honor" max_participants, this patch supports setting
max_participants in activity.info, thus making it available in the bundle.

By default, if it is not set in the bundle, the previous behavior persists.

In support of this change, a cache of Activity bundles is
maintained. The goal is to eliminate unnecessary calls to the file
system.
2014-05-02 10:41:12 -03:00