Pep8 and pyflakes fixes to sugar-activity
Avoid breaking activity startup by dbus timeout on sigle instance - Fixes #4773

This problem only happen in activities configured with the option -s
in the activity.info "exec" field, and the objective is use a single process,
even when starting more than one instance. If the process do not reply,
start a new process, instead of show a error.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
Show palettes at the screen bottom with the right size - Fixes #4673

On Gtk 3.10, Gtk.Menu at the bottom of the screen are resized
to avoid fall out of the screen, then report a wrong height.
We need calculate the size of the children and move the Menu up.

This problem is visible on the Clipboard icon palettes,
and in journal objects palettes at the bottom of the screen.

This patch also rename a variable 'rect' to 'req', because is
a Requisition (width, height) and not a Rectangle (x, y, width, height).

Finally, to avoid a error with the secondary text on the palette,
when copy text from the terminal, reove the '¬r' character.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
Fix and clean Palette secondary label

Removes unnecessary code ie., changing label color.

Refactor label settings, to put all in the same place.

Fix changes to label_alignment that does not honor
original vertical padding settings.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Fix drawing of gap on palettes attached to widget - Fixes #4776

In Gtk 3.10, Gtk.Window is drawing a gray border around the palette.
This patch draw a black rectangle defore we draw Gtk.render_frame_gap
to draw the border but with a gap to connect to the attached widget.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
Fix regression introduced by b9d6b628a98fc17f5e92a344450b6336f1a2b2ce

When calculated the palette height based in the size of children,
forgoten add the border size. That moved the palette in the device icons
4 pixels to the bottom, then the gap was miscalcuated and the border
button border was not draw.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
Remove a double / in webkit1 activity's request's filenames
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] d0cca91fe8510e11de8f332bf659789daf9c0d8d
Fix black palettes

Push the palette widget opening process to the latest
in order to avoid the race condition where the animation
takes of the place of the real palette.

Fixes #2184

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Remove Palette logic out of PaletteWindow

PaletteWindow is the parent class of two different subclases,
Palette and _ToolBarPalette. Palette uses state changes intensively
in order to display secondary content, but _ToolBarPalette does not.

Because of this, Palette overwrites PaletteWindow's popup and popdown
methods adding one extra param called "state". This param is not required
either in PaletteWindow and specially not in _ToolBarPalette.

Therefore, any piece of code inside PaletteWindow which is meant for
Palette subclassing, should be moved out of PaletteWindow and placed
in the Palette class, where it corresponds.

This patch fixes the cases where _ToolBarPalette breaks because of this
mismatch.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Merge branch 'master' of https://github.com/native93/sugar-toolkit-gtk3
design changes after review