Commit Graph

5431 Commits

Author SHA1 Message Date
dnarvaez
7ac2cae7c6 Merge pull request #3 from dnarvaez/unit-tests2
Initial bits of unit tests
2013-04-09 05:10:28 -07: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
5ad6c4e236 Add test for dev command 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
617c11a078 Add test for the genpot command 2013-04-09 11:36:51 +02:00
Daniel Narvaez
ac153f3cdc Add test for the build command 2013-04-09 11:36:51 +02:00
Daniel Narvaez
f66fbe4c08 Add tests for bundlebuilder 2013-04-09 11:36:51 +02:00
Daniel Narvaez
148655635f Add a make target for tests
We are running the existing test_mime.py. All the other tests which
are not unit tests but more examples of code one can run interactively
are moved to the example directory.
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
manuq
a776c72d46 Merge pull request #1 from dnarvaez/unused-imports
Remove a lot of unused imports

Acked-by: Manuel Quiñones <manuq@laptop.org>
2013-04-04 09:44:15 -07: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
b9234202ab Add testcase for Gtk.ComboBox
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-02-05 14:11:04 -03: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
5ea6472e0d Add missing dependencies
I'm not sure how it works with GNU ld, but it breaks with ld
gold and it's clearly wrong anyway.
2013-01-28 19:01:44 +01: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
5fd2dd8a98 Testsuite: set theme before running the test
Otherwise tests can't load icons before running because the icon theme
is not set.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-01-16 16:24:53 -03: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 Quiñones
83efac4c57 Add testcase for CellRendererProgress - SL #1395
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2013-01-07 13:25:30 -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
8357ccc4ea Release 0.98.3 2012-12-21 15:49:44 +01: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
Simon Schampijer
5b438e797a Release 0.98.2 2012-12-17 22:47:09 +01: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
4de6057e1b Release 0.98.1 2012-12-10 19:14:47 +01: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
Manuel Quiñones
2a6ad05bc9 RadioToolButton: draw the outline properly - SL #3936
Now the do_draw method is exactly the same as the one for ToolButton.
This considers the border that the radio button can have, which is
needed for the changes made in the theme to get back the original
style.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
2012-12-10 09:25:43 -03:00
Manuel Quiñones
7931e104f4 Add Gtk.ProgressBar testcase.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2012-12-03 12:52:32 -03:00
Manuel Quiñones
e456cf1c9e Fixup for previous commit - SL #4224
The palette can be None.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
2012-11-29 15:10:18 -03:00