Commit Graph

62 Commits

Author SHA1 Message Date
Manuel Quiñones
c8fa6bd694 Web activity: set activity name as the title of the window - SL #4605
At least View Source uses it.
2013-08-30 08:22:10 -03:00
Daniel Drake
147d80aa78 ActivityFactory: don't run which to check for rainbow
One less thing to do in the common activity startup path.
Also, which might not be available.
2013-07-13 11:05:41 -06:00
Daniel Narvaez
363eef5293 Fix pep8 2013-07-05 00:57:03 +02:00
surajgillespie
8c736d3870 Pass activity name to the webactivity 2013-07-05 00:53:23 +02:00
Daniel Drake
efaf9f9b2f Avoid use of uuid module
Upon import of uuid, that module uses ctypes.util to find libuuid/libc,
which involves forking a shell process which then forks and runs ldconfig.

ldconfig performs a whole bunch of disk accesses. This is a slowdown.

uuid.getnode() is also documented to be slow. Lets avoid using it in
the activity launch path; we don't need such a high degree of
randomness.

This makes activities launch 1-2 seconds faster on XO-1.
2013-07-04 11:43:54 -06:00
William Orr
8a6c935dd0 pep8'd sugar3.activity 2013-06-11 15:06:49 +02:00
Daniel Narvaez
9396b09ee4 Send bundleId and objectId to javascript
Also use the json module to generate the environemnt
dictionary string. This takes care of a None objectId
cleanly.
2013-06-10 15:46:54 +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
Daniel Narvaez
1f5e39f3a8 Cleanup environment initialization
We are not setting up a single sugar.window.environment object.
2013-06-10 15:46:54 +02:00
Daniel Narvaez
a1b73ff527 Rename HTML to web 2013-06-10 15:46:54 +02:00
Daniel Narvaez
8e381f9e2f Make the inspector toggle work reliably 2013-06-10 15:46:54 +02:00
Daniel Narvaez
28fe9b757f Use a relative path in the activities url
It's just a bit cleaner.
2013-06-10 15:46:54 +02:00
Daniel Narvaez
a30af509c2 Rework HTMLActivity to not inherit from Activity
This will make the activity use less memory and start faster.
2013-06-10 15:46:54 +02:00
Daniel Narvaez
3aadcbcbf0 Move the websocket service to the shell
It's a first step to make html activities much lighter. It also
just makes a lot more sense to have them interact directly with
the system rather than proxying through the python activity.
2013-06-10 15:46:54 +02:00
Daniel Narvaez
b276f61da1 Use javascript to setup websocket port and key 2013-06-10 15:46:54 +02:00
Daniel Narvaez
2fcac13791 Toggle the inspector on and off with ctrl-shift-i 2013-06-10 15:46:53 +02:00
Daniel Narvaez
0abae0e7d0 Use a custom scheme for app content
To get the origin right.
2013-06-10 15:46:53 +02:00
Daniel Narvaez
9f71aa864f Remove various unused bits 2013-05-05 01:44:03 +02:00
Daniel Narvaez
6c4a9b34a1 Add a get_xo_color API 2013-05-03 08:42:35 -03:00
Daniel Narvaez
671ad1ae3e Require authentication before making API calls
Otherwise anything might access the bus.

Note: This will not work if the user moves to another html page.  They
will not have a port/key passed in the query string of the URL, so
they won't be able to connect.
2013-05-03 08:40:44 -03:00
Daniel Narvaez
ff5612caee Add API to close an html activity
We are exposing it using a websocket server. The port of the server
is passed in the search string of the file:// url.
2013-05-03 08:40:24 -03:00
Daniel Narvaez
d4019684a3 Add exec script to build pure html activities
An hello world activity using the script
http://git.sugarlabs.org/hello-world/mainline/trees/html
2013-04-23 16:05:20 +02:00
Daniel Narvaez
c5f30a9fbe Support out of source directory builds
It works similarly to automake. The current working directory
is used as build directory.
2013-04-09 11:36:49 +02:00
Daniel Narvaez
07d593fe52 Rework the install to use git files
Instead of installing everything except a few ignored files. This
is consistent with the other packagers.
2013-04-09 11:36:04 +02:00
Daniel Narvaez
9db81af598 Remove a few unused keywords 2013-04-05 17:05:42 +02: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
Simon Schampijer
dcbdcd77fe i18n get_locale_path: handle the case when the default locale is not set, SL #4450
If the default locale is not set (see SL #4450 for a use case), get_locale_path
does now return None so that the sugar-activity script can handle that case
cleanly.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Daniel Drake <dsd@laptop.org>
2013-03-08 10:29:17 +01:00
Manuel Quiñones
a7e0e5ae57 Make the size of the preview image a public constant
Instead of hardcoding it.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-02-04 11:51:03 -03:00
Manuel Kaufmann
7b8fa5e406 Activity title entry: auto-select text when tap/click in the entry, SL #4036
When the user taps/clicks in the activity title entry, the text
is selected automatically to change the whole title of the activity
easily.

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-11-28 11:48:18 +01:00
Simon Schampijer
6064fb30cc Add support for locking Palettes, SL #4008
This adds a property that indicates that a Palette should
behave in a locking manner. The behaviour is the same
as with the secondary Toolbars: when you hover over the invoking
widget the Palette will popdown and react to mouse movements,
leaving the invoker area or the Palette itself will popdown
the Palette again. When you click the invoking widget
the Palette will be locked. You have to unlock it again
to pop it down.

This patch makes the DescriptionButton and the Colorbutton
work.

If the DescriptionButton or the Colorbutton are placed in
the primary toolbar they will share the locked state with
the secondary toolbars. Only one can be locked at a time.

When a secondary toolbar is unlocked we do force that the
open Palettes are closed. Having a locking Palette in
a subtoolbar will also work (Activity Toolbar case or
ColorButton case in a few examples). There is no state
sharing implemented here at the moment, but so far we
do only have cases with one lockable Palette in a
subtoolbar.

This will also fix the case where we want to use the
OSK to edit the description of the activity SL #3887.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-11-21 20:21:46 +01:00
Manuel Quiñones
ac3b0a3a14 Update style of Description palette - SL #4167
We can now use the PaletteMenuBox.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-11-10 11:30:30 +01:00
Simon Schampijer
2834344b98 DescriptionButton, ShareButton: set the toggle_palette option to True
Setting this option will popup the Palette on left click or tap
and popdown the Palette if it is up. This functionality has been
added with c4165967d5e05607db8b3e0969b516da87855431.

The ShareButton, which derrives from the RadioMenuButton, had the
desired behavior already overriding the on_clicked method, we
do this now in the invoker.

The DescriptionButton did only handle the popup part so far, with
this change the Palette will also popdown when the button is clicked
and the Palette is up.

Since both are Toolbuttons we have to set the hide_tooltip_on_click
property to False otherwise the popdown part would not function, see
1a8f89226b for more info.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-11-06 15:21:35 +01:00
Simon Schampijer
063e40d77d ActivityButton: set the toggle_palette option to True
Setting this option will popup the Palette on left click or tap
and popdown the Palette if it is up. This functionality has been
added with c4165967d5e05607db8b3e0969b516da87855431.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-10-23 11:29:02 +02:00
Gonzalo Odiard
2a15fbc0f2 Add in the metadata info about every startup time
Signed-off-by: Walter Bender <walter.bender@gmail.com>
Tested-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-10-05 09:17:04 -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
Daniel Narvaez
4cc6967c8d Reimplement the wm module in C
The wm module in sugar-toolkit-gtk3 has been reimplemented
in C and made available through introspection. The same was
hard to achieve directly using the Gdk API.

We can drop wm.py and the wrapper around gdk_property_change.

Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-09-06 18:14:46 +02:00
Simon Schampijer
030ab202c8 Bundlebuilder: don't fail to package if git is not installed, OLPC #11341
When git is installed, it will return non-zero if it gets asked to list
the files in a non-git-repository. The subprocess.Popen instantiation is
successful in this case and the returncode attribute will contain the
error code from git. The current code handles this fine and does fall
back to our own source file listing facility.

If git isn't installed, however, trying to instantiate subprocess.Popen
will fail with OSError. We need to catch this and fall back to our own
source file listing facility like we do for the non-repository case.

Signed-off-by: Simon Schampijer <simon at laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-08-23 14:28:56 +02:00
Simon Schampijer
6330204e91 Move the translation initialisation to an earlier stage, SL #3654
Must be done early, some activities set translations globally. Remove
the support for the langpackdir.

Signed-off-by: Simon Schampijer <simon@laptop.org>
2012-06-05 23:45:26 +02:00
Simon Schampijer
433c6391ec Activity Toolbar Description input field wrap text, SL #3586
Signed-off-by: Gary C. Martin <garycmartin@googlemail.com
Acked-by: Simon Schampijer <simon@laptop.org>
2012-06-01 19:32:51 +02:00
Simon Schampijer
ab643a1076 Display spinner cursor when saving after closing the activity, OLPC #11691
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Daniel Drake <dsd@laptop.org>
Tested-by: Manuel Quiñones <manuq@laptop.org>
2012-05-30 11:56:34 +02:00
Simon Schampijer
3c39375d9b Use json as included in Python SL #3142
We use json as included in Python. This will make Sugar dependent on
Python 2.6 and Python 2.7 to have the highest JSON performance.

Signed-off-by: Simon Schampijer <simon@laptop.org>
2012-03-22 18:46:48 +01:00
Simon Schampijer
afcb2fcea9 Port get_preview method to cairo
Previously we were using a GdkPixmap [1] created with the get_snapshot [2]
method of the Gtk.Widget. GTK 3 encourages to use cairo surfaces
now instead.

The ported mothod does create a cairo surface similar to that of the canvas'
window and draws on that. Then we create a cairo image surface with
the desired preview size and scale the canvas surface on that.

Several people have been involved in this work: Gonzalo Odiard,
Manuel Quiñones and Benjamin Berg.

[1] http://developer.gnome.org/gdk/stable/gdk-Bitmaps-and-Pixmaps.html#GdkPixmap
[2] http://developer.gnome.org/gtk/stable/GtkWidget.html#gtk-widget-get-snapshot
2012-03-14 17:37:23 +01:00
Simon Schampijer
ef2c624b5a s/Descriptions/Description fixup of d9e1a72fcd
Spotted by Chris Leonard: we use Description in all the other
places.
2012-02-09 19:05:57 +01:00
Simon Schampijer
bb02ef0ead Remove the Naming Alert
With the new 'Write to Journal anytime' feature it is possible
to write a description within an activity. Hopefully this leads
to more usage of the Journal for reflection by the learner. The
hinting nature ('you have not named your session yet') of the
Naming Alert has not been replaced, though.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Reviewed-by: Manuel Quiñones <manuq@laptop.org>
2012-02-02 18:30:03 +01:00
Simon Schampijer
d9e1a72fcd Add DescriptionEntry to the activity sub-toolbar
This is the implementation of the 'Write to Journal anytime'
feature [1].

The patch itself adds a DescriptionItem to the activity
sub-toolbar to make editing a Journal entry description
from within the activity possible. The code has the same
error handling as the TitleEntry.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Signed-off-by: Walter Bender <walter.bender@gmail.com>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Reviewed-by: Manuel Quiñones <manuq@laptop.org>

[1] http://wiki.sugarlabs.org/go/Features/Write_to_journal_anytime
2012-02-02 18:22:17 +01:00
Simon Schampijer
b5de7ef332 Remove support for the old deprecated toolbar
- removed deprecated imports from the activity module, use the
  widgets module instead
- removed the ActivityToolbox class
- removed the Stop button from the ActivityToolbar
- removed set_toolbar/get_toolbar API from the window module

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:36:37 +01:00
Simon Schampijer
aae6082b14 Bundlebuilder: remove deprecated bundle_name argument
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:33:03 +01:00
Simon Schampijer
70cee44717 Activity: remove deprecated _shared_activity member
Use the get_shared_activity method 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:31:52 +01:00
Simon Schampijer
a8342ecf8c Finally remove the keep button completely
see 0082e10f8e for
the complete reasoning.

e022aa8e4a already made the button
invisible, keeping it only for backwards compatibility.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-By: Sascha Silbe <silbe@activitycentral.com>
Acked-by: Daniel Drake <dsd@laptop.org>
2012-01-24 12:20:52 +01:00
Gonzalo Odiard
24af358275 Set the sugar theme name in gsettings according the scale
We need set the theme in gsettings according the scale in
the SUGAR_SCLING environment variable.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2011-12-20 19:19:26 +01:00