Commit Graph

999 Commits

Author SHA1 Message Date
Sam Parkinson
cbf325d994 Extend API for activities notifications
Add a new method, called notify_user, to the base
Activity class.

This method can be used by activity developers to
send notifications to the new notification front
end. ie.,

    self.notify_user('New High Score!',
                     'Your score is over 8999')
2014-03-28 12:20:51 -04:00
Daniel Narvaez
f92f0efe06 Fix pep8 2014-03-24 09:43:20 +00:00
Sebastian Silva
2a7d4da38a Implementation of pixbufs for use with X11 window icons. 2014-03-23 22:23:02 -05:00
James Michael DuPont
a082cf1cca better debugging 2014-03-19 18:36:20 -05:00
gauravp94
cf45a7a732 Add verbosity to the activity tests 2014-03-17 00:25:24 +05:30
gauravp94
d4b2e87276 port optparse to argparse in bundlebuilder.py 2014-03-11 02:06:35 +05:30
Gonzalo Odiard
7678540056 Remove c implementation of mime methods
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-03-08 15:34:23 +01:00
Gonzalo Odiard
b02ade879a Implement mime.get_mime_parents using python
This is the only method pending implemented in c,
then we can remove seven files previously used.

Add a test for a corner case untested previously

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-03-08 15:34:23 +01:00
Gonzalo Odiard
faa0d42084 Use Gio.content_type_guess to identify mime type - Fixes #4715
Replace the use of a custom implentation in SugarExt

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-03-08 15:34:23 +01:00
Gonzalo Odiard
e762fa938c Add accelerator to PaletteMenuItem - Fixes #4716
With the port to Gtk3, we lost the display of the keybord shortcut
available in MenuItem.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-31 18:56:42 -03:00
Gonzalo Odiard
53a148f88c Restore suspend catch the wrong exception
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-31 12:30:43 -03:00
Gonzalo Odiard
62b60fa1e1 Inhibit suspend while a activity is shared
In some network environments, suspend/reume can make loose
messages and break collaboration. This patch inhibit suspend
when collaboration start. The implementation can be used by activities
or Sugar to inhibit suspend/resume when needed.

More information in http://dev.laptop.org/ticket/10363

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2014-01-31 11:08:41 -03:00
Gonzalo Odiard
cf7a5905fd Remove unused code
Fixes pyflakes error

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-31 01:48:32 +01:00
Gonzalo Odiard
30b67cc3d1 Webkit1 compatibility: send 404 error if the file don't exists
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-30 12:08:55 -03:00
Sam Parkinson
8c8c913cb2 Fixes #1929, update toolbar examples in activity doc strings 2014-01-27 11:15:28 +11:00
Martin Abente Lahaye
6c64a7d020 Revert "Keep updated CellRendererInvoker self.path updated - Fixes #4717"
This reverts commit 353e05a086.
2014-01-23 00:57:27 -03:00
Gonzalo Odiard
353e05a086 Keep updated CellRendererInvoker self.path updated - Fixes #4717
Since CellRendererInvoker can set the path at None if a mouse event
is out of the area of the renderer, can break the use of touch,
if happen after the mouse movement. This patch set the path,
in the point_in_cell_renderer test, for the positive case,
solving the issue.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-17 17:41:46 -03:00
Manuel Quiñones
5802d67ee1 Icon: deprecate icon_size
pixel_size should be always used now.

Change SMALL_ICON_SIZE to cover the other sizes at settings.ini.

Adds a transformation to keep backwards compatibility for some
time. This will be removed in the future.
2014-01-13 22:58:58 -03:00
Ignacio Rodriguez
1ced93e14b pep8 fixes for 'Add menu width chars' 2014-01-08 11:51:10 -02:00
Ignacio Rodriguez
463101b19d Add menu width chars to sugar3 2014-01-08 11:35:16 -02:00
Daniel Narvaez
71b42a2da0 Fix chaining up to the parent 2014-01-03 17:38:46 +00:00
Daniel Narvaez
acff63467d Fix pyflakes errors 2014-01-03 14:55:03 +00:00
Sai Vineet
29738c9087 Add Activity Testing API and check command to setup.py
./setup.py check now invokes tests in tests/ directory. tests directory should
have integration(UI tests) and unit(unit tests) sub directories, but it isn't
necessary to have any dir. of the above.
2014-01-03 14:33:58 +00:00
Emil Dudev
c0319389e8 Touch UI: esc fullscreen
This patch moves sugar3.graphics.Window key-press-event handling.
It will now be after any other event handling from deived classes.
Fixes #475
2014-01-01 22:01:45 -02:00
Emil Dudev
d918e7afff Remove GConf completely
Removes sugar-gconf from SugarExt
Removes gconf-2 dependency
2014-01-01 23:32:57 +02:00
Emil Dudev
db2ba3e579 GConf to GSettings port 2013-12-27 17:39:02 +00: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
Gonzalo Odiard
dee29c0e75 Be able to click in a tooltip - Fixes #991
This issue was reported many times, when new users see a tooltip
try to click, and are confused when there are no action.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-12-18 22:49:21 +01:00
Gonzalo Odiard
f52b4e1a96 Make webactivity compatible with webkit1
If a env variable SUGAR_USE_WEBKIT1 exists,
uses a different module to start the activity using a local webserver,
borrowed from wikipedia activity.
When use webkit1 the web inspector is not enabled, because do not work.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-12-13 10:56:21 -03:00
Gonzalo Odiard
c47b842fb9 Fix mistake in the last commit
Error detected by the tests.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-12-02 17:46:18 -03:00
Gonzalo Odiard
b8074549f6 Fix cloning activity in sugar - SL #4608
Probably this code was not included in the initial port from gtk2 to
gtk3, because is only used by Sugar, but now we need it.

I changed the way the parameter dist_name is used,
then a complementary patch in sugar is needed

Fixes #4608

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-11-29 16:14:07 -03: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
Manuel Quiñones
1baebb2051 Merge branch 'gir' of https://github.com/dnarvaez/sugar-toolkit-gtk3 into dnarvaez-gir 2013-11-20 10:57:06 -03:00
Diego Naula
ddd566c847 Fixes #3665: add is_fullscreen() method to Window class
Signed-off-by: Diego Naula <dnaula1997@gmail.com>
2013-11-19 22:38:14 -06:00
Ezequiel Pereira
f13a14a2b3 Add journal filter for .xo bundles
Fix #1712
2013-11-19 01:00:00 +01:00
Daniel Narvaez
28423249f6 Make gir files depend on their library
Otherwise with parallel builds we might try to build gir files
before the library causing an error. This happened once in the
buildbot.

Fix #4606
2013-11-17 18:50:07 +01: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 Narvaez
cf392735a0 Ensure logs path exists when initializing logs
Otherwise, for example, if we start datastore alone
like we do in the tests, we try to create logs without
the directory and traceback.
2013-10-07 23:31:49 +02:00
Daniel Narvaez
6d6469ee12 Remove now unused method 2013-09-15 16:34:03 +02:00
Daniel Narvaez
fd831931ad Remove duplicated code
And deprecate duplicated function.
2013-09-11 18:12:54 +02:00
Daniel Narvaez
a1b6b129aa Make the debug script profile aware 2013-09-11 17:33:27 +02:00
Daniel Narvaez
fe192be798 Add a SUGAR_HOME environment variable
We should really use XDG directories but that will be a bit
more complicated and require migration scripts. This is a
short time solution to "expose" the dot sugar directory in
sugar-build.
2013-09-11 16:36:31 +02:00
Daniel Narvaez
e908aeb8ca Remove unused imports 2013-09-11 16:34:48 +02:00
Daniel Narvaez
d12a1d5131 Fix translations domains to point to new toolkit 2013-09-11 16:02:47 +02:00
Daniel Narvaez
b83ddaefaf Revert "Fix translations domains to point to new toolkit"
This reverts commit abe0de3ef8.
2013-09-11 15:59:34 +02:00
Daniel Narvaez
abe0de3ef8 Fix translations domains to point to new toolkit 2013-09-11 15:27:46 +02:00
Daniel Narvaez
9717e5954b Fix translations in non standard prefix
This drops a lot of code at the same time. The code in
__init__ was:

* Using a SUGAR_PREFIX environment variable that is not
defined anywhere
* Hardcoding prefix to /usr
* Setting up the sugar-base domain which doesn't exist anymore

The i18n module code was overcomplex because it was thought
for language packs which we don't support anymore, it was
not handling correctly locales with a country prefix, it
was hard coding the python prefix and it was not sorting
the directories as it intended too anyway.

The logic is very simple now. Use the locale directory in
the same prefix sugar-toolkit-gtk3 was installed, unless
SUGAR_LOCALEDIR is defined (for self contained bundles).
2013-09-10 22:55:11 +02:00
Walter Bender
ec5f064c10 Ensure entity value is type str
There are times when the entity value passed in for substitution
is of type unicode. This causes Rsvg to fail when processing the
SVG. This patch checks for unicode and converts it to utf-8.

Fixes #4621
2013-09-08 22:51:00 +02:00
Daniel Drake
e01837f8be Drop use of deprecated dbus.glib
When writing Python apps that will use asynchronous DBus calls and
signals, python-dbus must be initialised with the appropriate main
loop.

sugar currently does this by importing the datastore module from
sugar-toolkit-gtk3, and the datastore module uses the deprecated
and confusing dbus.glib module (which automatically and non-obviously
sets the default GLib main context as the DBus mainloop).

Eliminate the dbus.glib usage from sugar-toolkit-gtk3 as part
of the effort to make sugar initialised the DBus mainloop in a
more explicit and non-deprecated fashion.
2013-09-05 17:47:52 +02:00
Manuel Quiñones
fa7a765f4e Drop session.py
SessionManager has been moved to shell, and the other class has
nothing inside.
2013-09-02 21:38:49 +02:00
Manuel Quiñones
d45560e3c7 Web activity: quit the GTK main loop when activity is destroyed
Fixes #4603 .

In GTK activities, this is done by _ActivitySession when the activity
unregisters itself, in _complete_close method.

Making the web activity aware of session logout will be handled in
another patch for the shell, see http://bugs.sugarlabs.org/ticket/4611
2013-08-30 08:36:28 -03:00
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
Martin Abente Lahaye
ba8c435e50 Include string.h to sugar-fatattr
According to dsd's wisdom, without being
included, strerror is undeclared.

Fixes #4600 sugar crashing when copying
journal entries to documents folder.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2013-08-16 00:14:42 +02:00
Walter Bender
7d931c845e Fix annotation for xdg_mime_list_parents
There is a fatal crash in Sugar when retrieving mimetypes for some Journal
entries when contructing the icon palette (for both the Journal list view
and detail view). We isolated the problem to xdgmime.c, the call to
xdg_get_mime_parents. Dnarvaez observed that the annotation for the
return argument was missing and that the annotation for the return for
mime_list_parents was wrong. This patch fixes these annotations.

Fixes #4530
2013-08-15 23:59:33 +02: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
Manuel Quiñones
0b47dd37b1 Merge branch 'objectchooser_preview-try2' of https://github.com/godiard/sugar-toolkit-gtk3 into godiard-objectchooser_preview-try2 2013-07-08 17:17:22 -03:00
Gonzalo Odiard
3e6507af6e Add a option to the objectchooser to show the object preview
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-07-08 15:52:18 -03:00
Gonzalo Odiard
8e975bd5c9 Add a method to create a Pixbuf with the preview in the metadata
This code was moved from sugar expandedentry.py to be available to use
in other places. Some activities like Portfolio or JournalShare
have this code copied.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-07-08 15:51:27 -03:00
Daniel Drake
670fc44b1a Icon: handle image loading errors
If the icon can't be found, fall back on showing a generic icon.

Useful when activity/content bundles specify a bad icon, which is
unfortunately true for most content bundles in current existance
(because the icon field was previously unused).
2013-07-05 01:13:52 +02: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
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
Manuel Quiñones
2643a0b25c Merge branch 'at' of https://github.com/dnarvaez/sugar-toolkit-gtk3 into dnarvaez-at 2013-07-04 19:20:46 -03: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
Daniel Narvaez
6d2b97daec Fix pep8 errors
pep8 1.6.4 detects more issues
2013-07-04 19:00:57 +02:00
Daniel Drake
778b10f8d4 Allow override of user library path
This allows for override of ~/Library the same way that can be done
for ~/Activities. Useful for automated testing.
2013-07-02 17:46:33 +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 Narvaez
8fff409046 Add missing headers
Fixes distcheck
2013-06-27 16:11:23 +02:00
Daniel Narvaez
9778f1d35f Don't set AT_SPI_CLIENT
This is not necessary anymore with latest at-spi2-atk
(See commit 683739dea15d7c02c217a404d8c5d9d7af076a57)
2013-06-26 23:00:58 +02: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
Gonzalo Odiard
ad3c163023 Fix ObjectChooser backwards compatibility
The last change brak compatibility with the use in activities
without set the filter_type parameter, because None is not
a allowed value in the dbus call.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-06-24 02:14:57 -03:00
Daniel Narvaez
f54229efd2 Move setting AT_SPI_CLIENT to discover
It needs to be called as early as possible before unit tests
has a chance to import gtk.

Hopefully will fix random test failures we are seeing in buildbot.
2013-06-22 12:29:00 +02:00
Daniel Narvaez
6d319619f0 Factor out the discover logic to the test module
This avoids duplication in sugar and sugar-toolkit-gtk3
makefiles.
2013-06-22 12:28:56 +02:00
Gonzalo Odiard
da3786d2fb Add filter_type optative parameter to objectchooser
Constants are defined to select the different filter_type
values. A comment was added to document the use.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-06-20 17:42:19 -03:00
Daniel Narvaez
19bc2268d4 Log the UI tree on error
The dump method doesn't actually print anything, just
returns the tree as a string.
2013-06-19 19:20:44 +02:00
Daniel Narvaez
5bef5a82d2 Set the AT_SPI_CLIENT variable in the tests
This ensures the test itself is not recognized as a client
by the registry. I'm not sure how that happens since we are
not loading gtk, but it does. Not being a real gtk client with
a mainloop we wasn't answering dbus calls and causing the registry
to hang and fail.
2013-06-15 23:56:45 +02:00
Daniel Narvaez
4dc7b9e4a4 Don't set atspi timeout
Looking at the code I'm unconvinced this behaves as expected,
in certain cases at least. So reverting it for now to avoid
confusion.
2013-06-15 19:16:59 +02:00
Daniel Narvaez
521778636e Add a UIUnitTest class
To make it easier to write UI unit tests.
2013-06-15 19:15:32 +02:00
Daniel Narvaez
c86c582e19 Resync with the sugar-build implementation of tree.py
Development continued there for a while. Now I will remove it
and used the toolkit implementation instead.

Changes:

* Retry faster
* Handle GLib errors
* Don't always dump the tree
* Support master atspi api
2013-06-14 23:27:13 +02:00
William Orr
c736ffefcd pep8'd sugar3 2013-06-11 15:27:19 +02:00
William Orr
1252d95671 pep8'd sugar3.test 2013-06-11 15:25:07 +02:00
William Orr
69a7aa8f68 pep8'd sugar3.presence 2013-06-11 15:21:39 +02:00
William Orr
edbc8f53b3 pep8'd sugar3.graphics 2013-06-11 15:18:15 +02:00
William Orr
51f07bba81 pep8'd sugar3.dispatch 2013-06-11 15:13:19 +02:00
William Orr
220c9b68ef pep8'd sugar3.datastore 2013-06-11 15:11:58 +02:00
William Orr
9e4454a2ed pep8'd sugar3.bundle 2013-06-11 15:10:55 +02:00
William Orr
8a6c935dd0 pep8'd sugar3.activity 2013-06-11 15:06:49 +02:00
Walter Bender
3e5c37f3f8 Adding SugarExt for setting hidden attribute on FAT files
This extension is used by Sugar to set the HIDDEN attribute for
.Sugar-Metadata. By creating an extension, we avoid the need to add an
additional dependency (fatattr) to Sugar. The code is modeled after
fatattr, using an IOCTL call get and set FAT file attributes.

There is a corresponding patch for model.py in sugar/src/jarabe/journal
2013-06-10 15:46:54 +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
3f908ef999 Deprecate and ignore the SUGAR_EMULATOR variable 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
William Orr
e649070aa2 Replaced deprecated GObject methods with GLib methods 2013-06-10 15:46:53 +02:00
William Orr
3a8760c9e4 Fixed crash in journal when mousing over activity icons 2013-06-10 15:46:53 +02:00
Simon Schampijer
ba1abd4a33 Palettes: remove comment about deprecated API
We make use of this API in the shell and in the toolkit itself
and never removed those deprecated calls. Let's leave it like
this for now and remove the comment.
2013-06-10 15:46:53 +02:00
Daniel Narvaez
55a072470f Silence pyflake 2013-05-05 01:46:13 +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
6cbc3d1a48 Improve XOColor fallback logic
We was failing if the value in gconf was None. Also parsing
the string once just to see if it's valid was pretty dumb.
2013-05-02 18:52:59 +02:00
Daniel Narvaez
680c501ad6 Add a binding for gconf_client_set_list (using strings) 2013-04-29 20:03:09 +02: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
Manuel Quiñones
7156e67aa2 Color Palette: get back horizontal padding - SL #4325
The PaletteWindow lost the horizontal padding when it started to be
used as replacement of palette menus.  So now each implementation has
to add the padding.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-04-17 17:09:45 -03: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
7cb4a1d72d Handle invalid /desktop/sugar/user/color
This is currently breaking the activity list unit test where
the profile has not been initialized. But, more in general,
it seems like we should not be crashing if our settings has
unexpected values.
2013-04-09 18:13:18 +02:00
Daniel Narvaez
6202d4d5cc Bind xdgmime in SugarExt
And use it in the sugar3.mime modules. This allows
to get rid of the pygtk generated sugarbase module,
along with the wrapping code.

Also add more cases to test_time to make sure
everything is still working.
2013-04-09 11:36:51 +02:00
Daniel Narvaez
e6397cf2db Some initial infrastructure for UI tests
The uitree module exposes the at-spi tree. We can use it to do
functional tests of the UI, by checking if the expected
widgets exists, clicking them etc.

A simple example of how this can be used is in the test, which
runs a window and check that it has the expected button.
2013-04-09 11:36:51 +02:00
Daniel Narvaez
65560b0b94 Add a SUGAR_ACTIVITIES_PATH environment variable
Useful for tests but perhaps for other stuff too.
2013-04-09 11:36:51 +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
Manuel Quiñones
a3cda7c49f Revert "icon.py: move all imports to the top"
We have circular imports if we do this.

This reverts commit 355ca09a8c.
2013-03-20 12:34:13 -03:00
Manuel Quiñones
355ca09a8c icon.py: move all imports to the top
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2013-03-20 12:24:21 -03:00
Simon Schampijer
b3048112d6 Palette: handle the case where setting the transient window does fail, SL #4221
The expected parent window did likely change, for example
this can happen when we switch the Home Views while a Palette
of a canvas icon is popping up (SL #4221). In that case
send the 'popdown' signal so that for example the hovering
state feedback can be cleared.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2013-03-14 16:14:55 +01: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
Simon Schampijer
63b8e87b1a ToggleToolbutton: do hide the tooltip when clicked or touched
This is the same behaviour as for the RadioToolButton and the
ToolButton. See 5a1b380dd6 where
we did the same for the RadioToolbutton.

Updated the toolbuttons.py test to be able to test that code
path.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2013-02-15 15:41:03 +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
Daniel Narvaez
7ba72c4c61 Remove duplicated library flags
They are already provided by the pc files.
2013-01-28 18:41:54 +01:00
Manuel Quiñones
d32523655c Fix subtoolbars height - SL #4019
Remove the vertical padding from the box that contain the toolbar, and
change the order of drawings in the container widget so that the
outline looks right.  This has been tested with screenshots, see the
gif animation attached to the ticket.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2013-01-23 10:48:06 -03:00
Simon Schampijer
4199c0596b Notebook: fix type in doc string 2013-01-22 10:48:44 +01:00
Simon Schampijer
56da4d8e0c Animation: Remove non-descriptive doc string 2013-01-22 10:47:16 +01:00
Simon Schampijer
d77c6f563d Remove halfish done incomplete docstring 2013-01-22 10:45:35 +01:00
Daniel Narvaez
2bbeba2446 Logger: add cleanup function
Factored out from the sugar shell code

Acked-by: Simon Schampijer <simon@laptop.org>
2013-01-22 10:18:26 +01:00
Manuel Quiñones
ee0e15b95d Fixup for previous commit, 693eaab9 - SL #4384
Forgot this change from my reviewers.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-01-17 14:28:52 -03:00
Manuel Quiñones
693eaab975 New ProgressIcon widget - SL #4384
A new icon widget useful to display progress.  It is compatible with
sugar3.graphics.icon.Icon .  The progress is represented filling the
icon.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2013-01-17 14:23:30 -03:00
Carlos Garnacho
3596e8c6cb palettemenuwidget: Ensure the widget is realized before popping it up, SL #4388
Otherwise the internal state is messed up, GTK+ grabs may be held on
unrealized widgets.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
2013-01-17 18:17:43 +01:00
Manuel Quiñones
e36513f925 Adapt to icon changes - SL #3569
- In IconEntry: dialog-cancel -> entry-cancel

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2013-01-15 10:34:00 -03:00
Manuel Kaufmann
b729680568 Truncate labels on Palettes SL #4164
This was lost when PaletteMenuItem was added in
2d0ac2a952 of sugar source code.

That class does not handle the text_maxlen argument (default to 60). I
used this argument to set the Gtk.Label's size:
label.set_max_width_chars and use MIDDLE for its EllipSizeMode as
sugar3.graphics.palette.Palette does for its title and subtitle.

With these settings, the title of the palette and its items share the
same behaviour and are rendered with the same width.

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2013-01-03 13:37:11 -03:00
Simon Schampijer
3859ff0022 WidgetInvoker: do not handle the clicked signal when there is no user interaction, part of SL #4307
There are cases where there is no user interaction but we do
receive a clicked signal: in the clipboard we do have
GtkRadioToolButton which are derived from the GtkToggleToolButton [1].

The 'clicked' signal is emitted when the 'active' property
changes [2]. We use the 'active' property to indicate the
current active clipping. In the Invoker we do check now
if the event originated a user interaction or if it was
generated due to a for example a property change.

[1] http://developer.gnome.org/gtk3/3.4/GtkToggleToolButton.html
[2] http://developer.gnome.org/gtk3/3.4/GtkToggleToolButton.html#GtkToggleToolButton--active

Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-12-20 14:40:28 +01:00
Manuel Quiñones
1dd2aec650 get_mime_description, use Gio from dynamic bindings - SL #4323 #4307
'import gio' was importing static gobject, and mixing static and
dynamic bindings provoked a crash.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-18 13:44:06 -03:00
Manuel Kaufmann
0788e546f6 TrayViewport: handle the case of the widget not yet allocated in the size-allocate callback - SL #4279
In the callback, the allocation can be 1x1 if it is yet unknown [1].
This is the case of trays that start hidden by default, like the one
in Browse activity.

[1] http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-size-allocate

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-17 18:37:09 -03: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
Manuel Quiñones
0231969bba PaletteWindowWidget: set border width to make outer space in the container - SL #4295
In the palette reimplamentation, commit 48ad255a, set_border_width was
removed.  Add it again to the corresponding widget, and get the value
from the theme.  Previously the value was given by:
self.get_style().xthickness .  Now we can use the widget border.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-15 10:23:10 -03:00
Carlos Garnacho
a22d4ee50d keygrabber: Handle XI2 key events, part of SL #3895
XInput2 events are coerced by active grabs on the alt-tab handling
code in sugar shell, even if the keygrabber itself does core events.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-14 13:39:14 +01:00
Manuel Quiñones
8a9d10cda7 ColorToolButton, ToggleToolButton: do the drawing in the correct order - SL #4303
1. if the palette is up, draw the black background
2. draw the button itself
3. if the palette is up, draw the grey outline

Exactly as the ToolButton does.  Otherwise the outline is not visible.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-11 09:47:21 -03:00
Simon Schampijer
f5fee8a144 Popdown the palette if an item in the content box gets activated, SL #4191 and SL #4253
The Palette is popped down when an item is activated. We can
listen on the 'button-release-event' on that widget. We make
sure the widget is of type PaletteMenuItem. This is similar
to what the GtkMenu is doing, see gtk_menu_shell_button_release [1].

[1] http://git.gnome.org/browse/gtk+/tree/gtk/gtkmenushell.c#n915

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-12-10 18:35:45 +01:00
Simon Schampijer
e49f621110 TrayIcon: get the black background and outline for palette popup - SL #4089
Do the same as in ToolButton, update do_draw method to do the drawing
in the code.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
2012-12-10 14:34:17 -03:00