Make sure can_close_tabs can be passed in as a keyword parameter (to be set
by the GObject constructor).
[split out from another patch]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
8f1a821d68 only changed imports starting with
"import", but not those using "from ... import ...".
[replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
The old gtk-2 based module will be present in
the 0.94 branch in the sugar-toolkit.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
Follow up patch for b582736375
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Daniel Drake <dsd@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
Due to the removal of the manifest support we lost as well
the part of the code that does build the locale. This patch
adds that functionality back.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Remove an unnecessary toplevel widget.
This event box was originally added by Marco "to make it easier
to take screenshot of the canvas area only" (7f731457c2) but we're
unsure why this is, and it doesn't seem to be needed for our current
screenshot-taking mechanism. Screenshots continue to work fine after
removing this.
We need to set the title when we join a shared session AND when
we run a private session.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Tested-By: Gonzalo Odiard <gonzalo@laptop.org>
Reviewed-By: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
There had been reports about Activities that had unexpected files in
the xo bundle (e.g. patches). There have been a recent change that the support
for the MANIFEST has been removed from the bundle builder. The MANIFEST
'controlled' which files were bundled. The code did include all the
files present in the folder (which includes patches etc).
The patch does use git-ls to get a list of files to include (like the
tarball packager). Furthermore the locale folder is included which has been
generated. Due to the API freeze we made '_get_files_in_git' a private method
which adds a bit of duplication to the 'get_files' method in the tarball
packager. A patch for master which will implement Builder.get_files_git(),
that can be used by XOPackager and SourcePackager.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-By: Daniel Drake <dsd@laptop.org>
In order to allow activities keeping their backward compatibility
we keep the Keep button around but do not add it to the toolbar. This
fixes activities that either remove or hide the Keep button or
alter it in any other way. The Keep button is deprecated and we
discourage the usage.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
The keep button has led to a false assumption: learners
confused it with a traditional save button and not recognising
it as what it is, an option to duplicate an entry.
Eben suggested to remove the button [1] and others have since
then. The functionality of duplicating an entry will be moved
to the entry palette in the Journal and the entry detail view [2].
We will print a warning when the KeepButton is used and remove
it after another cycle.
[1] http://lists.sugarlabs.org/archive/sugar-devel/2010-April/023439.html
[2] http://lists.sugarlabs.org/archive/sugar-devel/2011-May/031316.html
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
This patch depends on the addition of the SugarTimeoutIcon
to the artwork where we set the font and background color.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Benjamin Berg <benzea@sugarlabs.org>
Our custom entry widget, which was based on sexyicon, did
support placing an icon in the entry (e.g. the magnifier icon
for the search entry) and displaying progress in the case of
the url entry in Browse. Both is supported since GTK+ 2.16 in the
gtk.Entry.
The patch does keep the old API, that is why we can land it in
0.94 no change in the shell needed only a small change in Browse,
in a second step I would like to use the upstream API e.g.
's/set_icon_from_name/set_icon_from_icon_name'.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Benjamin Berg <benzea@sugarlabs.org>
I had to modify the patch slightly because of
0269f819761cfd803cf4d694298c8ab6a753e242, changes
reviewed by Sascha.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-By: Simon Schampijer <simon@laptop.org>
Reviewed-by: Sascha Silbe <silbe@activitycentral.com>
The patch updates the window title when the user changes
the title in the toolbar or in the Journal.
Signed-of-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-By: Simon Schampijer <simon@laptop.org>
This incomplete feature contributes to confuse new activity authors and
slightly complicates our bundle installation logic.
The day someone finds something useful to do with the MANIFEST
specification, we can revert this patch in no time.
Signed-off-by: Bernie Innocenti <bernie@codewiz.org>
Tested-by: Bernie Innocenti <bernie@codewiz.org>
Tested-by: James Cameron <quozl@laptop.org>
Tested-by: Sascha Silbe <silbe@activitycentral.com>
Reviewed-by: Sascha Silbe <silbe@activitycentral.com>
[rebased on git master, minor style fix]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
To avoid that we try to access the datastore entry before
it has been created we need to move the creation code up,
before we do get the possible information from a shared
session. If we have a shared session we do then get the
title and icon-color information from it and adjust
accordingly.
Tested that no other operation like for example resuming
has issues with that change.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
To add the accelerator to the ToolButton the activity must have set
the 'sugar-accel-group' before. The patch does make the ToolbarButton
listen to the 'hierarchy-changed' signal and repack itself accordingly.
Since the ToolButtons of the subtoolbar do listen to 'hierarchy-changed'
as well to set the accelerator they will set it accordingly.
This fixes the accelerators for new-style-toolbar activities
like Terminal, TurtleArt and Paint, more info in #10930.
Signed-by-off: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
In Python 2.7, shutdown_request was added to the BaseServer class and
TCPServer was adopted to use it instead of close_request in the
_handle_request_noblock() path.
GlibTCPServer must be adapted to account for this, so that
shutdown_request is not allowed to prematurely allowed to close the socket,
in the same way that close_request is ignored.
Fixes collaboration in activities that rely on this mechanism for
sharing (including ImageViewer and Read)
Signed-off-by: Daniel Drake <daniel@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
Tested-by: Gonzalo Odiard <gonzalo@laptop.org>
Tested-by: Simon Schampijer <simon@laptop.org>
The generic path does not work for the telepathy logs. As we
have removed the support for different profiles it is ok
to just use the default path.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-By: Marco Pesenti Gritti <marco@marcopg.org>
To determine if the title has changed we use the 'focus-out'
event now instead of the 'changed' signal of the gtk.Entry. This
removes races we had before.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-By: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
When we join a shared activity we use the name of the shared activity
as the title of the activity. As we set the activity metadata
accordingly this will be visible in the activity toolbar, the Journal
and the activity frame.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
This differentiates between sugar and non sugar invitations using the
handle type. For non-sugar invitations we use the activity id to
determine which activity to join.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
This is a follow-up patch to 95b4eeec758ffa729d0dbb219b21d428115fcc74
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
This fixes a copy and paste error. A good test case is the Memorize
activity since we listen for the 'buddy-left' signal there to
update the members list inside the activity.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
As a side effect, activity start-up is now subjectively faster, maybe even
objectively (due to avoiding a resize).
Tested on XO-1 running Debian Squeeze.
Acked-By: Simon Schampijer <simon@laptop.org>
Before only the buddies that were present when closing the activity
were logged in the Journal. This patch does add another dictionary
'_joined_buddies' to keep track of the users that did join. The
'_buddies' dictionary keeps on tracking the users currently in the
activity.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
GTK pops down the palette before it invokes the actions on the
menu item. We need to postpone destruction of the palette until
after all signals have propagated from the menu item to the
palette owner.
Symptoms included the "View Details" palette menu item in the Journal list
view not working.
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Acked-by: Simon Schampijer <simon@laptop.org>
Remove the path parameter as it is not used anyhow. The patch
for the sugar module does make sure the method is called
correctly.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-By: Simon Schampijer <simon@laptop.org>
Reviewed-By: Sascha Silbe<silbe@activitycentral.com>
Allow the toolbar_box to be removed by setting it to None, like is supported
for canvas.
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Acked-by: Simon Schampijer <simon@laptop.org>
Python 2 will never have pgettext() [1], so we need to ship our own version.
sugar.activity.i18n is the best place for that.
[1] http://bugs.python.org/issue2504#msg122482
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Acked-by: Simon Schampijer <simon@laptop.org>
sugar.bundle.bundle.Bundle users (e.g.
jarabe.model.bundleregistry.BundleRegistry._add_bundle) only expect
MalformedBundleException to be thrown, not exceptions of zipfile.
This patch solves the most severe issue in #1876: filling up the
filesystem with temporary files that won't be deleted afterwards.
Before we can consider this bug completely fixed, we still need
to do something for the remaining issues:
1) Unpacking shouldn't be attempted if there isn't a safety margin
2) System becomes unresponsive during unpacking
3) No progress indication for the operation, so users are tempted
to click multiple times
4) No error messages displayed for unpacking errors, which is a
common Sugar nuisance.
http://bugs.sugarlabs.org/ticket/1876#comment:5 offers possible
strategies for (1) and (2).
Signed-off-by: Martin Dengler <martin@martindengler.com>
Signed-off-by: Bernie Innocenti <bernie@codewiz.org>
[style fixes, adjusted description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Reviewed-by: Aleksey Lim <alsroot@activitycentral.org>
Color data is stored in the Journal as a JSON dump, so we can get back
arbitrary types. XoColor already checks the color string for validity and
handles invalid strings gracefully, so it makes sense to enhance this to
invalid types as well.
Acked-by: Simon Schampijer <simon@schampijer.de>
As we do create the ActivityBundle in the config of the bundlebuilder
we can use the code from the activitybundle as well to install
the mime type.
Reviewed-By: Sascha Silbe <sascha-pgp@silbe.org>
pylint isn't smart enough to figure out the return type of Popen.communicate(),
so squelch the warning.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
"format" is the name of a parameter of the function we are wrapping, so we
shouldn't change it.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
We know that our code is correct and column should always be assigned, but it
never hurts to act defensively and guard against bugs in other pieces of the
code (or other components like GTK).
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
Caught by pylint. I wonder if we need this piece of code as nobody every
triggered it.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
This avoids the overhead from the string formatting on production systems.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
logging.exception() handles exceptions nicely for us, no need to explicitly
use traceback.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
Adapt to upstream format change.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
Tomeu prefers ' for strings, so let's use it wherever we don't have a good
reason to use ".
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
Most of the code uses """, so adjust the few deviations.
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
pep8 wants inline comments to be prefixed by at least two spaces. Let's just
move them to a separate line as that's easier to read anyway.
Acked-by: Simon Schampijer <simon@laptop.org>
CC: Aleksey Lim <alsroot@member.fsf.org>
Caught by PEP8. This is important for Sugar because the XO has a small screen
where long lines would make the code hard to understand (because you need to
constantly scroll horizontally).
Reviewed-by: James Cameron <quozl@laptop.org>
Acked-by: Simon Schampijer<simon@schampijer.de>
CC: Aleksey Lim <alsroot@member.fsf.org>
- add class NormalizedVersion to parse and compare the new activity versions
- change the bundlebuilder and activitybundle to use the new scheme, instead
of an int version we expect a string that matches the format defined in
NormalizedVersion
* sugar/presence/presenceservice.py: Specify the D-Bus interface when
calling ActivityProperties.GetActivity
* sugar/activity/main.py: Set a default for the --invite option and
make the create() D-Bus method accept a{sv} so we can pass the
boolean value.
When activities are uninstalled, profile data persists. Profile
data can consume a lot of storage space. Therefore it is necessary
to delete it when required.
Signed-off-by: Martin Abente <mabente@paraguayeduca.org>
src/sugar/activity/activity.py: If the activity is being invoked to
handle an invite, create a Client.Handler instance and share the
activity when HandleChannels is invoked.
src/sugar/activity/activityfactory.py,
src/sugar/activity/activityhandle.py,
src/sugar/activity/main.py: Add a -i switch that indicates to the
activity that it should handle the channel from an invitation.
src/sugar/presence/activity.py: Expose Activity.room_handle.
src/sugar/presence/presenceservice.py: Add get_activity_by_handle().
src/sugar/presence/util.py: Add get_account_for_connection().
* src/sugar/activity/activity.py: Get the shared activity wrapper from
sugar.presence.
* src/sugar/activity/activityfactory.py: Disable checking in the PS for
activity_id duplicates.
* src/sugar/presence/activity.py: Remove the PS dependency and query Telepathy
directly. Implemented enough to join an activity.
* src/sugar/presence/buddy.py: Remove the PS dependency and query Telepathy
directly. Implemented enough to join an activity. Added an Owner subclass of
Buddy()
* src/sugar/presence/presenceservice.py: Remove the PS dependency and query Telepathy
directly. Implemented enough to join an activity.
* src/sugar/presence/util.py: Add ConnectionManager for discovering and tracking
connections.
Adds the ErrorAlert class which is an alert inherited from
the base Alert class. This is very similar to the
ConfirmationAlert class with the difference being that it
only displays an 'Ok' button in the Alert popup.
Signed-off-by: anishmangal2002 <anishmangal2002@gmail.com>
The error we were seeing was that the '(env.get_profile_path(),
'data'))' does not exist yet at system start. Symlinks are created
there when accessing data on an external device. The directory
gets created when an activity like Browse or Terminal has been
run for the first time or you start Read for the first time by
resuming the file on the external device.
http://dev.laptop.org/ticket/10218
Some distros retain config files after removing packages, so /etc/olpc-security
might exist even if rainbow is not installed.
Signed-off-by: Sascha Silbe <sascha@silbe.org>
Most content bundles use global_name as the ID-style thing, as suggested
on the OLPC wiki. bundle_class seems undocumented and hence is not
present in any of the content bundles I have here.
Change get_bundle_id() to fall back on the global_name if no bundle_class
is set. This fixes a complete sugar crash when installing the standard
content bundles (it tried to send a None value over dbus).
Future extensions:
a) we are now able to reliably detect when an activity's main process has
exited. We should take advantage of this to give better feedback on activity
crashes; e.g. by turning the frame's activity-icon into an error icon and by
inserting the activity's log into the datastore so that it appears in the
Journal.
b) in the future, I'd like rainbow to provide more narrow interfaces for
manipulating jails; e.g. for garbage-collecting them, nuking their contents, or
for reusing them. Please consider this an invitation to show me which interfaces
would work best for Sugar.
P.S. - Thanks to Sascha Silbe for testing and for improvements to this patch.
Don't try to align the palette to the edges if the invoker is AT_CURSOR,
and always try to move the palette completely into the screen if at all
possible.
This attempts to align second-granularity wakeups across the system,
reducing CPU wakeups a little.
I considered all timeouts of duration 1 second or greater, and moved
the non-timing-critical ones to g_timeout_add_seconds(). (Actually,
I didn't find any that I felt were timing-critical)
sugar-install-bundle is broken because ActivityBundle.install() gained a
required parameter. Please can we make it optional? This also fixes one
of the problems with the activity updater.
self._cleanup does the self._file.close() anyway if the file exists.
The self._file.close() removed here is redundant, and will always
fail on file not found, which is handled in send_head by returning
None for self._file.
The drag-active property can be set to provide a highlight
when the tray control is accepting target of an ongoing drag.
We can't use the drag_highlight method because we desire to
adjust the background of the widget, rather than drawing on
top of it. Overriding these methods would work in most cases,
but in cases where GTK+ calls drag_unhighlight itself things
could break, so we use a property instead.
The software updater was deleting ~/Activities when it encountered a bad
bundle. Two separate issues: we didn't sanity check the bundle root to
ensure it wasn't '.' or '..' or something crazy like that, and our "clean
up on failure" code was deleting the install_root instead of the activity
root (!). This was a regression introduced by the fix for #7733 in
commit db2d1c42e2481d6dbc15405840ac23e46eab7318 (0.82.2).
The gtk Menu class supports 'table menus', where the menu entries can
be laid out in a grid. This is useful for horizontal menus, and for
dense menus of icons, and for wrapping the menu when it gets too long,
etc.
The Menu.attach() method is used to add entries to a menu by row and
column:
http://www.pygtk.org/docs/pygtk/class-gtkmenu.html#method-gtkmenu--attach
However, the callback in _Menu, defined in palette.py, only triggers
on do_insert(), and so the signal emission (and subsequent
palette._update_separators() call, which places the line underneath
the menu title text at top) never occurs when you add entries using
attach(). _Menu now overrides attach() and emits the proper signal.
Threads and signals don't get along too well together. Instead, use
gobject's spawn_async functionality which already has the necessary zombie-
reaping integrated into the gobject event loop.
screenshots on user-initiated activity save and close. Check before saving
that the window is not fully obscured, as it might be if the user initiates the
close from the frame--- this would produce incorrect screenshots. The check
for visibility is done by attaching a handler to the Activity class which
handles visibility-notify-events from X. In the sugar repository equivalent
changes remove automated screenshot acquisition from window manager navigation
events (e.g. tabbing).
- setup.py install takes a --prefix option and no arguments.
- mo files are installed in /usr/share/locale.
- po files are not installed
- 8136 (marco)
This is bobby's patch to #7759 changing the default home view to ring.
|TestCase|
Remove the "[Layout]" section from ~olpc/.sugar/default/config, or rm
-rf ~olpc/.sugar, or reflash. Start sugar. Verify the initial Home
layout is the Ring layout.