Commit Graph

27 Commits

Author SHA1 Message Date
Gonzalo Odiard
a43b972d1b Don't break activity startup if .info have 'class' instead of 'exec'
When we ported sugar to Gtk3 we removed the support of the fields
exec and service_name due they were deprecated for a long time [1].
But this is still a problem in deployments, and we already added
compatibility for the service_name field.
Here [3] there is a long thred were we discussed this issue.

[1] ae85dd62d4
[2] 32f97b48c3
[3] http://lists.sugarlabs.org/archive/sugar-devel/2013-October/045404.html
2015-04-06 08:51:39 -03:00
Gonzalo Odiard
3c4ac98baf Fix import of exception from ConfigParser
In the commit f0927c364c
the ParsingError is not properly imported.
2014-12-05 13:06:27 -03:00
Gonzalo Odiard
f0927c364c Don't break if translation can't be parsed
If the .linfo file can't be parsed, use the untranslated name/summary,
but don't  break activity load.
2014-11-25 13:09:22 -03:00
Gonzalo Odiard
2456465d79 Enable collaboration by default on activities
When we implemented read max_participants from activity.info [1]
we changed the default value of max_participants, from 0 to 1.
Before, was responsability of the activities set max_participants == 1,
when the activity not implemented collaboration.
This change make the default backwards compatible.

[1] d0cca91fe8
2014-06-18 14:06:10 -04: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
Daniel Narvaez
01ed63ee4b Fixes for pep8 1.5 2014-03-29 19:25:34 +00:00
James Michael DuPont
a082cf1cca better debugging 2014-03-19 18:36:20 -05:00
Gonzalo Odiard
93437ddedf Add get_show_launcher() in bundles other than activitybundle
This is needed now by Sugar, after (sugar commit)
f4638b5f481478e96195d55aa38c90fd33db9aee

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-12-26 15:59:19 -03:00
akskumarnot
81b388c554 Use proper formatting syntax, fixes #2170 2013-12-26 15:57:33 +01:00
Sam
f43d5f8d24 Fixes #4634, issue where spaces in bundle ids crashed sugar 2013-12-25 21:19:04 +11:00
Walter Bender
cd5292881e Add single_instance field to activity bundle
This field can be used by activities that need to be restricted to a
single open instance. Usage is:

single_instance = yes

jarabe/model/shell.py has been modified look for this field in a
separate patch to Sugar.

Together these two patches constitute the implementation of Sugar
feature Launch Limits [1]

[1] http://wiki.sugarlabs.org/go/Features/Launch_Limits
2013-11-21 13:39:43 -05:00
Gonzalo Odiard
32f97b48c3 Workaround to enable start of activities still using service_name
While we deprecated service_name a long time ago, still there are activities
using it, and is a source of frequent problems.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-10-30 23:02:11 -03:00
Daniel Drake
f46ac7ba6a ContentBundle cleanups
Share get_installation_time() between all bundle types so that it works
with content bundles.

Add get_tags() stub, this is called by Sugar.

Remove unused fields: l10n, category, subcategory, etc.

We remove support for running OLPC's content bundle indexer.
This is assumed to go away now that Sugar will support content bundles
as first-class objects.

Some minor behavioural fixes and cleanups.

This now implements http://wiki.sugarlabs.org/go/Content_bundles
and when care is taken to include all the fields required by old
Sugar versions, there is no change in compatibility of existing or
new content bundles.

Required for http://wiki.sugarlabs.org/go/Features/Content_support
2013-07-05 01:13:52 +02:00
Daniel Narvaez
6d2b97daec Fix pep8 errors
pep8 1.6.4 detects more issues
2013-07-04 19:00:57 +02:00
Daniel Drake
be91f84a4b Avoid auto-import of bundle helpers (#4527)
The new bundle helpers were being auto-loaded with sugar3.bundle due
to their placement in __init__.py. This was causing Gi to be imported,
breaking GTK2 activity launches.

Move the helpers to a dedicated module.
2013-06-29 09:17:26 -06:00
Daniel Drake
12476caa12 Improve bundle API for bundleregistry changes
The bundle API is a bit confusing and inconsistent. Fix up the
ActivityBundle and ContentBundle classes to be more consistent and to
work with the ongoing improvements being made in bundleregistry.
2013-06-24 22:47:13 +02:00
Daniel Drake
f4c1bd152a Add bundle instantiation helpers
Add some helper functions for use by upcoming changes in the Sugar shell.
2013-06-24 22:47:13 +02:00
William Orr
9e4454a2ed pep8'd sugar3.bundle 2013-06-11 15:10:55 +02:00
Gonzalo Odiard
58bab9cf6a Do not use the translated summary to get the value from gettext in the bundle builder
This patch is a rebased push from pull request #31

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-06-10 15:46:54 +02:00
Walter Bender
b4c0b2258f Use gettext algorithm to determine locale for activity.linfo
When activity bundles are loaded, the activity name and summary are
pulled from an activity.linfo file that is associated with
locale. However, sometimes locale, which uses $LANG has been
superceded by $LANGUAGE as set in
extensions/cpsection/languages/model.py. This patch uses the same
algorithm as gettext.py to find activity.linfo

This problem is seen on the .AU systems which use en_AU for locale and
en_GB for LANGUAGE.
2013-04-15 08:42:42 -04:00
Daniel Narvaez
db448c4eea Remove a lot of unused imports
Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com>
2013-04-03 22:01:55 +02:00
Manuel Quiñones
b6152b023a ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276
In the Journal, CellRendererActivityIcon is calling its do_render
method after the temporal file is removed.  This is because we wrap
the icon path in a TempFilePath to control its deletion, but as we
don't maintain any reference to it, its __del__ method deletes the
temporal file.

Note that returning the path directly has one disadventage: the
temporal file is left in /tmp .

As a comment in the get_icon method of ActivityBundle say, ideally we
should return the icon data.  But that implies a major change in the
Journal model and views, and in the CellRendererIcon class.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-17 18:23:10 -03:00
Gonzalo Odiard
3a30d3f84e Add management of summary property to the activity.info file
This summary is translatable as the Activity name and will be displayed
in the Activity list in the Home View.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-09-25 15:01:37 +02:00
Simon Schampijer
ae85dd62d4 ActivityBundle: clean from deprecated code
- removed deprecated mime type 'application/vnd.olpc-x-sugar'
- activity.info file: removed deprecated field 'service_name' use 'bundle_id' instead
- activity.info file: removed deprecated field 'class' use 'exec' instead

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Daniel Drake <dsd@laptop.org>
2012-01-24 12:24:12 +01:00
Simon Schampijer
89ef6304a1 Fix broken imports
8f1a821d68 only changed imports starting with
"import", but not those using "from ... import ...".

[replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
2011-11-15 17:51:23 +01:00
Simon Schampijer
8f1a821d68 Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
2011-11-14 19:17:32 +01:00
Simon Schampijer
000ed75cbe Rename the module to sugar3
The old gtk-2 based module will be present in
the 0.94 branch in the sugar-toolkit.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
2011-11-14 18:17:18 +01:00