1135 Commits (b6e314bbe58d11b223a8b152b1240649aa203dce)

Author SHA1 Message Date
James Cameron c26c902dc7 Remove Python GI API version warnings
- reported in Clock-19 testing.
7 years ago
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.
7 years ago
György Balló 281e56c442 Allow to disable installing .desktop files 7 years ago
Sam Parkinson f17e1a66b4 Write docs for constants in sugar3.graphics.style
The constants must be documented, because otherwise they are hidden
from the generated online documentation.

[changes arising from review comments and flake8 compliance]
Signed-off-by: James Cameron <quozl@laptop.org>
7 years ago
Hrishi f4fc8c0d1f
Write documentation for sugar3.graphics.ColorToolButton
- add one example,

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs

Added documentation and example for Colorbutton
8 years ago
Hrishi 4f7ab56c3e Write documentation for sugar3.graphics.ProgressIcon
- add one example,

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs
8 years ago
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
8 years ago
James Cameron 99130b0263
Write documentation for sugar3.power 8 years ago
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>
8 years ago
James Cameron a71a011496 Fix documentation typo, SPCAING 8 years ago
Hrishi c7d1c7acfb Write documentation for sugar3.graphics.ToggleToolButton
- add one example,

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs

Signed-off-by: James Cameron <quozl@laptop.org>
8 years ago
James Cameron c92d0009df Write documentation for sugar3.graphics.ToolButton
- add two examples,

- document critical properties as keyword arguments in the class init,

- ensure documentation is consistent between RadioToolButton and
  ToolButton, (as some of the text is similar),

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs

- follow How To Guide
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs/How_To_Write

Derived from work by

- Hrishi <hrishipatel99@gmail.com> (31176ea) and

- radicalonion <ndefilippis98@gmail.com> (db89aca).
8 years ago
James Cameron ee93ad3bef Further gi.require_version calls
Activity logs have continued to report GObject Introspection version
warnings.
8 years ago
Sam Parkinson 2330ef8ebc
Proper deprecation of Palette.popdown state argument
The popdown state argument was removed in 90cec5b, as the palette
popdowns were unified.  However, this is a public api.  Removing
the argument caused exceptions to be raised, breaking applications.
Most uses of the state argument were for the SECONDARY state, which
is now the default behaviour.

This commit re-adds the argument with a deprecation notice.
8 years ago
Sam Parkinson f06d510eba
Merge branch 'animator-do-stop' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sebastian Silva 4f3f32fd5a Assign icon to window regardless of environment.
Makes Sugar Activities more standard.
8 years ago
Sam Parkinson 92ea35d724
Fix typos in sugar3.graphics.animator docs 8 years ago
Sam Parkinson d37da7ee88
Add do_stop method for animations
This adds a explicit method for cleaning up the animation.  Previously,
animations expected the next_frame to be called where frame=end.

That guarantee was never provided by the api.  This resulted in
animations sometimes being in odd states.  For example, Browse activity
had an animation that overrode the Gtk "draw" signal.  If the signal
was not unbound, the animated object was mistakenly rendered after
the completion of the animation, obstructing the user's view.

This api is explicit and allows cleaner code in the animation
implementation.  The clean up code goes in do_stop rather than in a
conditional of next_frame.
8 years ago
Sam Parkinson 61bc42f2c2
Merge branch 'bundlebuilder' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 4d770fef01
Merge branch 'fix-4965' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
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.
8 years ago
James Cameron 1f93659c95 Avoid private member access to Bundle
ActivityBundle was making reference to _path private in Bundle, change
to use get_path public method.
8 years ago
Sam Parkinson 9b5ed7e80c
Bundlebuilder: Translate AppData files 8 years ago
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.
8 years ago
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.
8 years ago
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.
8 years ago
Sam Parkinson 2522e0b21f
Version the GdkX11 import, fixes #4965
The unversioned import results in the following log noise:

    /usr/lib/python2.7/site-packages/sugar3/graphics/window.py:26: PyGIWarning: GdkX11 was imported without specifying a version first. Use gi.require_version('GdkX11', '3.0') before import to ensure that the right version gets loaded.
      from gi.repository import GdkX11
8 years ago
Sam Parkinson e0c38a8b8a
Merge branch 'no-2nd-popdown' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson d60989cd92
Merge branch '2016-190-enter-notify' of https://github.com/quozl/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 4009e2a476
Merge branch 'long-press-eventicons' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 6c5bef2f78
Merge branch 'show-icons' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
James Cameron 433d06b025 avoid uncommanded palettes
Problem #1, buddy menu appears on Sugar startup on physical hardware, or
when mouse is centre of display.

Problem #2, Terminal toolbar steals keyboard focus, when mouse is left
in home view search box at activity start time.

Regressions were introduced in the port from Gtk2 to Gtk3.

Cause is enter-notify-events that arrive because cursor is already
present in widgets as they are realised and mapped.

Fix is to capture cursor position when the widget is being created, and
ignore enter-notify-event if the same position is seen.
8 years ago
James Cameron 65fa711e53 refactor pointer position get
Move common code into a function, and cache Gdk.Device client pointer.
8 years ago
James Cameron 552c7da884 remove surplus message
The log message "PaletteWindowWidget popup get_visible True" is not
useful, and is removed.  It can be made to occur in Terminal by repeated
right-click on any of the first three toolbar button.
8 years ago
Sam Parkinson 90cec5be2e
Unify palette popdowns
Previously there was the concept of having 2 popdowns for a palette.
The first popdown showed the of tooltip the palette, and the 2nd
showed the content of the palette.  However, this was confusing
to new users, and made users wait for little reason.

This commit removes the 2nd popdown.  An example of this is when you
mouse over an icon to invoke the palette.  Previously, it showed
the tooltip, then made you wait, then showed the content of the
palette.  With this patch, the whole palette is shown at the
first popdown, making a snappy UX.
8 years ago
Sam Parkinson 74d3a4d0c8
Revert "Don't activate EventIcons after touch long press"
This commit was never reviewed or intended for the master branch.

This reverts commit ed5e50239b.
8 years ago
Sam Parkinson da65b6db55
Merge branch 'git-submodules-bundlebuilder-try2' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
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.
8 years ago
Sam Parkinson 4a9b35a38a
Merge branch 'icon-docs' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 6e685a7e4a
Merge branch 'telepathy-idle-crash' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson f4ec9346d2
Merge branch 'fix-4960-palette-damange' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 2971749b83
Fix CursorInvoker wrongly positioning EventIcon palettes
Steps to reproduce:
1.  Long press on home view favorite icon (an event icon)
Expected:  Palette invoker where finger is
Actuall:   Palette invokes in top left corner

This is because the long press controller emits coords relative
to the widget's window, and EventIcons sometimes have their own
windows.  We can't change the long press controller, as it is a
public api.  But we fix this by translating the coords to the
root window coords in the CursorInvoker.  Using root coords is
consistent with the right click handleing in the cursor invoker.
8 years ago
Sam Parkinson 0f4309a324
Don't activate EventIcons after touch long press
Steps to reproduce:

1.  Long press activity icon on homeview
Expcected:  Palette invokes, icon not activated
Actual:     Palette invokes, icon also activated, activity launched

This was because the "activate" signal was emitted before the
palette invoker got it's signal, meaning the palette invoker couldn't
scilence the event.
8 years ago
Sam Parkinson ed5e50239b
Don't activate EventIcons after touch long press
Steps to reproduce:

1.  Long press activity icon on homeview
Expcected:  Palette invokes, icon not activated
Actual:     Palette invokes, icon also activated, activity launched

This was because the "activate" signal was emitted before the
palette invoker got it's signal, meaning the palette invoker couldn't
scilence the event.
8 years ago
Sam Parkinson 3f4a5e904d
First pass sugar3.graphics.icon docs 8 years ago
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.
8 years ago
Sam Parkinson 64f58d3992
Don't assume all connection managers support Sugar
If the user has a "random" telepathy connection manager
installed and running on the system (eg. telepathy idle being
active if they are chatting on irc with GNOME's Polari), activities
will crash on startup.

Steps to reproduce the crash:
1. Run Polari (eg. via the Terminal activity)
2. Join an irc channel in Polari (eg. #sugar on freenode)
3. Try to open an activity from the home view
    - notice that opening any sugar3 activity will crash
8 years ago
Sebastian Silva 966c65082e Allow running GTK3 Sugar Activities in HTML5 8 years ago
Sam Parkinson 52ce5af493 Merge branch 'popup' of https://github.com/AbrahmAB/sugar-toolkit-gtk3 8 years ago
AbrahmAB a803876fbf Added new popwindow module in sugar3.graphics 8 years ago
James Cameron 6f2550cde0 Ignore empty translated summary 8 years ago
Sam Parkinson ed5e9d072b
Fix palette damage for tool buttons, fixes #4960
Currently, the ToolInvoker code passes the button child in such a
way that the WidgetInvoker queues only the child's draw.  In previous
Gtk+ versions, this magically resulted in redrawing the parent as well.

However, Gtk+ 3.20 is probably trying to save power and not randomly
redraw widgets.  To fix this, we must queue the redraw of the widget
that we want to redraw explicitly.
8 years ago
Sam Parkinson ea3b673f51 Merge branch 'master' of https://github.com/icarito/sugar-toolkit-gtk3 8 years ago
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!
8 years ago
Sam Parkinson 66c01ba2c6 Merge branch 'smooth-animations-try3' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson bde85bc7e8 Merge branch 'activityhandle-docs2' of https://github.com/ndefilippis/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 4325c056a4 Merge branch 'styledocs' of https://github.com/ndefilippis/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 526c87d7c6 Merge branch 'divbyzero' of https://github.com/erilyth/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 9c0f7df739 Merge branch 'gi-require-version' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 79a45ba8e8 Merge branch 'doc-palettemenu' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson ab0f5a18aa Merge branch 'doc-combobox' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
Sam Parkinson 79e0dd44c6 Merge branch 'master' of github.com:sugarlabs/sugar-toolkit-gtk3 8 years ago
Sam Parkinson a62ddb1d87 Merge branch 'xocolor-docs' of https://github.com/ndefilippis/sugar-toolkit-gtk3 8 years ago
leonardcj 1b9da5b1d6 Update speech.py
Improve the i18n of speech strings with wiki links
8 years ago
Sam Parkinson 57fe093886 Merge branch 'ellipsize' of https://github.com/AbrahmAB/sugar-toolkit-gtk3 8 years ago
Sam Parkinson d3fbecf110 Merge branch 'gtk-3-20' of https://github.com/samdroid-apps/sugar-toolkit-gtk3 8 years ago
AbrahmAB cd449e7149 Ellipsis in title and msg of alert 8 years ago
Sam Parkinson 824e6dcb69 Set css class on toolitems when a palette or toolbar popsdown 8 years ago
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.
8 years ago
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
9 years ago
Martin Abente Lahaye 0494f704fb collaboration: handle tubes channel failure gracefully
CHANNEL_TYPE_TUBES was deprecated since telepathy-gabble 0.17.25 and
is no longer present on modern distributions. This breaks collaboration
for _all_ activities, regardless if they use tubes or not.

Therefore, check if the channel creation failed due to support and allow
channel creation process to continue.

This patch fixes collaboration for the activities that do not use tubes
channel in modern distributions, but also allow to use tubes when running
on older distributions.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
9 years ago
radicalonion 79d11c3a28 Write docs for sugar3.graphics.xocolor 9 years ago
Sam Parkinson c374b63990 Merge branch 'scrolldetector-docs' of https://github.com/ndefilippis/sugar-toolkit-gtk3 9 years ago
Sam Parkinson 37d3b63a90 Merge branch 'notebook-docs' of https://github.com/ndefilippis/sugar-toolkit-gtk3 9 years ago
radicalonion 28053c83b1 Improve docs for sugar3.activity.activityhandle 9 years ago
radicalonion 8b947ed02f Write docs for sugar3.graphics.scrollingdetector 9 years ago
radicalonion 486988035a Write docs for sugar3.graphics.notebook 9 years ago
Sam Parkinson 8d66786a31 Merge branch 'radiotoolbutton-docs' of https://github.com/ndefilippis/sugar-toolkit-gtk3 9 years ago
radicalonion db89aca86a Write docs for sugar3.graphics.radiotoolbutton 9 years ago
Sam Parkinson 8d0cc98e43 Set css name for widgets
In Gtk+ 3.20, you need to use the css name to select elements,
rather than the gtype name.  Therefore, these must be added.

The css name must be set before the class instances are created, as
it effects the class rather than the instance.  This is why it must
be places after the class definition.
9 years ago
radicalonion ec2dca92f1 Write docs for sugar3.graphics.toolbox 9 years ago
radicalonion 031af31029 Write docs for sugar3.graphics.style 9 years ago
mandarj7 51057baef5 Add usage example to sugar3.graphics.objectchooser 9 years ago
mandarj7 c95d74eab4 Improve docstrings in sugar3.graphics.objectchooser 9 years ago
mandarj7 264ee2b5a3 Add and improve docs for sugar3.graphics.objectchooser 9 years ago
erilyth 3ceb14f884 et value of "ph" to 0 if division by zero takes place 9 years ago
James Cameron 7ba120fe25 Fix persistent tree view palettes
A rework of the TreeViewInvoker used by the journal and activity list.

Fixes a persistent journal entry palette that reappears in journal or
home view.  https://bugs.sugarlabs.org/ticket/4918

Also fixes an over-sensitive journal icon; with the journal mostly
empty, rapidly move the mouse from the bottom of the screen into the
lowest icon and then out again.  Before this patch, the palette was
shown.  After this patch, the mouse must rest in the icon.

Changes made:

- override _ensure_palette_exists in parent class Invoker,

- remove reference to MouseSpeedDetector, it is no longer required,

- remove enter and leave events; they are for the TreeView as a whole,
  and are not required,

- properly detect that None is returned by get_path_at_pos, when the
  coordinates are outside the TreeView cells.

Not fixed:

- moving the mouse out of the journal icon invoker does not popdown the
  palette, but it does when moving the mouse out of the activity icon in
  the activity list; so this is a problem beyond the invoker,

Tested on Fedora 18 and Ubuntu 15.10.

Test cases:

- check a click will activate item,

- check a right-click will show palette,

- check a mouse hover will show palette,

- check a brief mouse passing will not show palette,

- check if mouse leaving palette will popdown.
9 years ago
Sam Parkinson b1386665b1 Merge branch 'master' of https://github.com/mjuvekar7/sugar-toolkit-gtk3 9 years ago
James Cameron ae80df7725 Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.

Additional change missed from already merged 70bc4db.
9 years ago
Sam Parkinson 739dacbd01 Position palette based on event coords, fixes #4897
Instead of getting the position of the mouse later in the code,
this commit uses the coords given to sugar by Gtk that say where
the event happened.  This means that if the system is busy, or
the user is fast with the mouse, the palette will pop up where
they originally clicked.
9 years ago
James Cameron 70bc4dbe6a Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.
9 years ago
mandarj7 c75655a134 Add documentation for sugar3.graphics.window module 9 years ago
James Cameron a11639eb86 demote warning to debug for sugar_accel_group 9 years ago
James Cameron 280c74cd9e allow start on full disk
When disk is full, Sugar will not start, because the backup log
directory cannot be created.

X session logs in tmpfs show this exception:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 20, in <module>
    logger.cleanup()
  File "/usr/lib/python2.7/site-packages/sugar3/logger.py", line 113, in cleanup
    os.mkdir(backup_dir)
OSError: [Errno 28] No space left on device: '/home/user/.sugar/default/logs/1448258018'

Fix is to ignore the exception.

We've been here before!  Was previously fixed in 2010:

	https://github.com/sugarlabs/sugar/commit/4cde481
	https://bugs.sugarlabs.org/ticket/1720
	http://dev.laptop.org/ticket/9623

But new regression introduced in 2012 during reorganisation of
code by Daniel Narvaez; the exception was no longer handled:

	https://github.com/sugarlabs/sugar/commit/0e45f9d
	https://github.com/sugarlabs/sugar/commit/19db9c5

Reported-by: Nathan Riddle <nathanr333@charter.net>
Tested-by: James Cameron <quozl@laptop.org>
9 years ago
Sam Parkinson a334888eb9 Write documentation for sugar3.graphics.combobox 9 years ago
Sam Parkinson aea65408f0 Specify library version prior to import, fixes #4900
Gi has been emitting warnings into the log to do this for some
time now. Not doing this has also caused bugs, such as #4900.
9 years ago
James Cameron 0e724a78eb move guts of TimeoutAlert and NotifyAlert to a private class
Create a private class for the button, timeout and response.  Use the
private class as parent for both NotifyAlert and TimeoutAlert.

Extends the spurious response fix (cfeabdc) to NotifyAlert.

Also use g_timeout_add in preference to g_timeout_add_seconds, because
the latter is less precise in implementation.

Tested by changing the Register alert temporarily.
9 years ago
Sam Parkinson d2e1793108 Merge branch '12813-e' of https://github.com/quozl/sugar-toolkit-gtk3 9 years ago
James Cameron cfeabdc3af remove GSource used by TimeoutAlert
For an object of class TimeoutAlert, an OK response occurs on timeout,
even if user has clicked a button.

Remove the timeout when the user clicks a button.

A new method _response is added which overrides the parent method.
9 years ago
James Cameron 9de70acfff fix alerts documentation
- s/Set/Get for a get property method,

- fix two typos.
9 years ago