[sugar] June 20, Sucrose 0.81.2 Tarballs Due

2008-06-19 Thread Marco Pesenti Gritti
Hello!

Here are the modules which are included in the release:

http://wiki.sugarlabs.org/go/ReleaseTeam/Roadmap#Glucose_Modules
http://wiki.sugarlabs.org/go/ReleaseTeam/Roadmap#Fructose_Modules

Please provide source code tarballs and announce them as explained
here:

http://wiki.sugarlabs.org/go/ReleaseTeam#Module_release

Marco
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] June 20, Sucrose 0.81.2 Tarballs Due

2008-06-19 Thread Marco Pesenti Gritti
I forgot to mention that the release has been delayed of one day in
respect of the original schedule, mainly due to my lameness in not
sending out the tarballs announcement earlier.

Marco

On Thu, Jun 19, 2008 at 2:19 PM, Marco Pesenti Gritti
[EMAIL PROTECTED] wrote:
 Hello!

 Here are the modules which are included in the release:

 http://wiki.sugarlabs.org/go/ReleaseTeam/Roadmap#Glucose_Modules
 http://wiki.sugarlabs.org/go/ReleaseTeam/Roadmap#Fructose_Modules

 Please provide source code tarballs and announce them as explained
 here:

 http://wiki.sugarlabs.org/go/ReleaseTeam#Module_release

 Marco

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] Feature, strings, ABI freeze

2008-06-19 Thread Marco Pesenti Gritti
With the release of 0.81.3 we will be in feature freeze.

The feature freeze affects all the modules included in the release and
comprise also strings and ABI for public libraries. Exceptions might
be considered by the release team but they will be extremely rare. To
request an exception send mail to [EMAIL PROTECTED], copying
[EMAIL PROTECTED] and including the patches you would like to
land. It will have to be granted by two members of the release team,
on the base of community feedback. For string changes please also copy
[EMAIL PROTECTED]

http://wiki.sugarlabs.org/go/ReleaseTeam#Feature_freeze

Marco
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] feature freeze coming

2008-06-19 Thread Eben Eliason
Basically, I approve in principle everything on this list, and would
like to see it all get in.  I've inserted a couple of minor
comments/requests below.

On Wed, Jun 18, 2008 at 5:18 PM, Martin Dengler
[EMAIL PROTECTED] wrote:
 I've ordered these in decreasing order of likelihood of being accepted
 (IMO) for ease of triaging, and then have provided links to the git
 trees (clearly I will mail the ML as usual, if I haven't but might be
 quicker for triage).

 Features:

 - #2954 - patch Browse and Read for cursor hiding in handheld mode.
   Mature patch, the approach was verbally ok'ed by eben  bemasc and
   hasn't been shouted down by marco/tomeu recently :)
   
 http://dev.laptop.org/git?p=users/mdengler/sugar-toolkit;a=commitdiff;h=bb8f54e9bfad18699386cf814ca2c592ca0d258f

This actually applies to all python activities, right?  I've been
wanting this for a while.

 - #7249 - device ordering in the Frame is not fixed.  Not submitted
   before but quite trivial to accept/reject the design.
   
 http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=aec9692c7c3d146e512d1c873de0082b09902d7c

How would this work in conjunction with the future ability to manually
rearrange the device tray?  Do we need/want the modules to declare
their position at all anyway, or should we instead store a list (as
would be needed for manual positioning anyway) and set the defaults
indices (simple integer index) there?  This could be a simpler short
term solution until we have a truly modular (a la control panel)
device system.

 - #6995 - Add a mesh device to frame, remove mesh icons from
   Neighbourhood/Mesh view.  This might take some time to stabilize as
   it's non-trivial to really test, but eben seems keen on the
   functionality and want it in. No patch yet (but can get a flavor of
   the UI from the commits mentioned below).
   http://dev.laptop.org/git?p=users/mdengler/sugar;a=shortlog;h=mesh-icon
   
 http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=0580693dbc857c2c09a22cc717c69a02c85ec1fb
   
 http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=abe8cb96ad18ee894d5930bed0a4f7079ea9201b

I know you've been working toward the mockups, which is all I can
really ask for right now.  I think that the connected to a school
mesh portal string would work better as the secondary text of the
primary palette, instead of a separate section.  I'd prefer
simplifying the language: how about simple mesh, school mesh, and
 (no secondary label) for the three states (the third being that
there is no mesh/turned off)?

Also, make sure that the mesh devices get removed completely from
Neighborhood view!

 - #2651 - Add an option to the journal for duplicating an entry.  Old
   patch but without feedback.
   
 https://dev.laptop.org/attachment/ticket/2651/2651-0001-Add-Duplicate-this-entry-to-the-Copy-icon-s-palett.patch

I like the idea.  Let's simplify the language to just Duplicate
entry (or even just Duplicate?) instead.

 Also, please remind to the list any bug fixes already with code
 waiting to get in after the feature freeze.

Clearly all the bug fixes should make it in!

 Bugfixes:
 - #7248.1 - speaker icon doesn't show 33 and 66% levels.
   patches (sugar  sugar-toolkit) submitted, very trivial
   http://lists.laptop.org/pipermail/sugar/2008-June/006472.html
   http://lists.laptop.org/pipermail/sugar/2008-June/006473.html

 - #7248.2 - speaker icon flips to unmuted from muted most of the time
   the palette is shown; not submitted, still being debugged, should be
   very localized and low-risk.

 - #7248.3 - speaker icon should unmute when volume set to  0:
   trivial, patch not submitted but in my d.l.o sugar git tree
   
 http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=5f54d8e6375508a88752a7a041caf56a10c9c55b

- Eben
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] feature freeze coming

2008-06-19 Thread Martin Dengler
On Thu, Jun 19, 2008 at 01:33:28PM -0400, Eben Eliason wrote:
 Basically, I approve in principle everything on this list, and would
 like to see it all get in.  I've inserted a couple of minor
 comments/requests below.
 
 On Wed, Jun 18, 2008 at 5:18 PM, Martin Dengler
 [EMAIL PROTECTED] wrote:
  I've ordered these in decreasing order of likelihood of being accepted
  (IMO) for ease of triaging, and then have provided links to the git
  trees (clearly I will mail the ML as usual, if I haven't but might be
  quicker for triage).
 
  Features:
 
  - #2954 - patch Browse and Read for cursor hiding in handheld mode.
Mature patch, the approach was verbally ok'ed by eben  bemasc and
hasn't been shouted down by marco/tomeu recently :)

  http://dev.laptop.org/git?p=users/mdengler/sugar-toolkit;a=commitdiff;h=bb8f54e9bfad18699386cf814ca2c592ca0d258f
 
 This actually applies to all python activities, right?  I've been
 wanting this for a while.

Yes, exactly, and it's less code than doing it just in Browse and
Read.

  - #7249 - device ordering in the Frame is not fixed.  Not submitted
before but quite trivial to accept/reject the design.

  http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=aec9692c7c3d146e512d1c873de0082b09902d7c
 
 How would this work in conjunction with the future ability to manually
 rearrange the device tray?

My simple patch will need to be extended to store the tray
position/placement as configurable information rather than hardcoded.
But it's so little code that even if we throw it away it's 1)
obvious what needs to be changed; and 2) trivial to remove.


  Do we need/want the modules to declare their position at all
 anyway, or should we instead store a list (as would be needed for
 manual positioning anyway) and set the defaults indices (simple
 integer index) there?  This could be a simpler short term solution
 until we have a truly modular (a la control panel) device system.

That's better, but as I didn't know how the control panel information
was stored and best practices / future goals I thought at least
I'd have proposed a straw man that people could drop on the floor or
use in the interim.

  - #6995 - Add a mesh device to frame, remove mesh icons from
Neighbourhood/Mesh view.  This might take some time to stabilize as
it's non-trivial to really test, but eben seems keen on the
functionality and want it in. No patch yet (but can get a flavor of
the UI from the commits mentioned below).
http://dev.laptop.org/git?p=users/mdengler/sugar;a=shortlog;h=mesh-icon

  http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=0580693dbc857c2c09a22cc717c69a02c85ec1fb

  http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=abe8cb96ad18ee894d5930bed0a4f7079ea9201b
 
 I know you've been working toward the mockups, which is all I can
 really ask for right now.  I think that the connected to a school
 mesh portal string would work better as the secondary text of the
 primary palette, instead of a separate section.  I'd prefer
 simplifying the language: how about simple mesh, school mesh, and
  (no secondary label) for the three states (the third being that
 there is no mesh/turned off)?

No problem!

 Also, make sure that the mesh devices get removed completely from
 Neighborhood view!

Yup, that's the easy part, done in this earlier commit:
http://dev.laptop.org/git?p=users/mdengler/sugar;a=commitdiff;h=b22fd34cd593b0178daef8b6b30180eaef433595

  - #2651 - Add an option to the journal for duplicating an entry.  Old
patch but without feedback.

  https://dev.laptop.org/attachment/ticket/2651/2651-0001-Add-Duplicate-this-entry-to-the-Copy-icon-s-palett.patch
 
 I like the idea.  Let's simplify the language to just Duplicate
 entry (or even just Duplicate?) instead.

Cool!

  Also, please remind to the list any bug fixes already with code
  waiting to get in after the feature freeze.
 
 Clearly all the bug fixes should make it in!

:)

 - Eben

Martin



pgpslcIlmQJLZ.pgp
Description: PGP signature
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH] Add an option for choosing the layout in the favorites view.

2008-06-19 Thread Tomeu Vizoso
Hi,

this patch adds an option to what used to be the Ring view palette for
choosing the layout to use in the favorites view.

Thanks,

Tomeu
From 97a1ef00389bbc2a9724070889164b78527a6f55 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso [EMAIL PROTECTED](none)
Date: Thu, 19 Jun 2008 20:52:09 +0200
Subject: [PATCH] Add an option for choosing the layout in the favorites view.

---
 src/view/home/HomeBox.py |   81 --
 src/view/home/MeshBox.py |5 +-
 src/view/home/favoriteslayout.py |   25 +++
 src/view/home/favoritesview.py   |   90 --
 4 files changed, 143 insertions(+), 58 deletions(-)

diff --git a/src/view/home/HomeBox.py b/src/view/home/HomeBox.py
index 14c0911..61ceee9 100644
--- a/src/view/home/HomeBox.py
+++ b/src/view/home/HomeBox.py
@@ -21,9 +21,11 @@ import gtk
 
 from sugar.graphics import style
 from sugar.graphics import iconentry
+from sugar.graphics.palette import Palette
+from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.radiotoolbutton import RadioToolButton
 
-from view.home.favoritesview import FavoritesView
+from view.home import favoritesview
 from view.home.activitieslist import ActivitiesList
 
 _FAVORITES_VIEW = 0
@@ -37,7 +39,7 @@ class HomeBox(gtk.VBox):
 def __init__(self):
 gobject.GObject.__init__(self)
 
-self._favorites_view = FavoritesView()
+self._favorites_view = favoritesview.FavoritesView()
 self._list_view = ActivitiesList()
 self._enable_xo_palette = False
 
@@ -47,7 +49,7 @@ class HomeBox(gtk.VBox):
 self.pack_start(self._toolbar, expand=False)
 self._toolbar.show()
 
-self._set_view(_FAVORITES_VIEW)
+self._set_view(_FAVORITES_VIEW, favoritesview.RANDOM_LAYOUT)
 
 def __toolbar_query_changed_cb(self, toolbar, query):
 if self._list_view is None:
@@ -55,19 +57,22 @@ class HomeBox(gtk.VBox):
 query = query.lower()
 self._list_view.set_filter(query)
 
-def __toolbar_view_changed_cb(self, toolbar, view):
-self._set_view(view)
+def __toolbar_view_changed_cb(self, toolbar, view, layout):
+self._set_view(view, layout)
 
-def _set_view(self, view):
+def _set_view(self, view, layout):
 if view == _FAVORITES_VIEW:
 if self._list_view in self.get_children():
 self.remove(self._list_view)
 
+self._favorites_view.layout = layout
+
 if self._enable_xo_palette:
 self._favorites_view.enable_xo_palette()
 
-self.add(self._favorites_view)
-self._favorites_view.show()
+if self._favorites_view not in self.get_children():
+self.add(self._favorites_view)
+self._favorites_view.show()
 elif view == _LIST_VIEW:
 if self._favorites_view in self.get_children():
 self.remove(self._favorites_view)
@@ -104,7 +109,7 @@ class HomeToolbar(gtk.Toolbar):
   ([str])),
 'view-changed':  (gobject.SIGNAL_RUN_FIRST,
   gobject.TYPE_NONE,
-  ([int]))
+  ([object, object]))
 }
 
 def __init__(self):
@@ -131,9 +136,7 @@ class HomeToolbar(gtk.Toolbar):
 
 self._add_separator(expand=True)
 
-favorites_button = RadioToolButton(named_icon='view-radial', group=None)
-favorites_button.props.tooltip = _('Favorites view')
-favorites_button.props.accelerator = _('CtrlR')
+favorites_button = FavoritesButton()
 favorites_button.connect('toggled', self.__view_button_toggled_cb,
  _FAVORITES_VIEW)
 self.insert(favorites_button, -1)
@@ -152,8 +155,11 @@ class HomeToolbar(gtk.Toolbar):
 
 def __view_button_toggled_cb(self, button, view):
 if button.props.active:
-self.emit('view-changed', view)
-
+if view == _FAVORITES_VIEW:
+self.emit('view-changed', view, button.layout)
+else:
+self.emit('view-changed', view, None)
+
 def _add_separator(self, expand=False):
 separator = gtk.SeparatorToolItem()
 separator.props.draw = False
@@ -188,3 +194,50 @@ class HomeToolbar(gtk.Toolbar):
 self._search_entry.activate()
 return False
 
+class FavoritesButton(RadioToolButton):
+__gtype_name__ = 'SugarFavoritesButton'
+
+def __init__(self):
+RadioToolButton.__init__(self)
+
+self.props.named_icon = 'view-radial'
+self.props.tooltip = _('Favorites view')
+self.props.accelerator = _('CtrlR')
+self.props.group = None
+
+self._layout = favoritesview.RANDOM_LAYOUT
+
+# TRANS: label for the free layout in the favorites view
+menu_item = MenuItem(_('Free'), 'activity-start')
+menu_item.connect('activate', 

[sugar] [PATCH] Tabbing again

2008-06-19 Thread Benjamin Berg
Hello,

here is another go at the tabbing patches, after Eben gave his feedback.
There are no palettes anymore, instead it tries to get close to
switching the activities instantly. However, the actual activity
switching is delayed by 1/4 of a second, to help against long expose
times.

There are again two patch series. One for sugar-toolkit (2 Patches) and
another one for sugar (6 patches).

Benjamin


signature.asc
Description: This is a digitally signed message part
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 1/2] Add is_modifier and is_special_modifier functions to SugarKeyGrabber.

2008-06-19 Thread Benjamin Berg

---

 src/sugar/_sugarext.defs  |   19 +
 src/sugar/sugar-key-grabber.c |   59 +
 src/sugar/sugar-key-grabber.h |6 
 3 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/src/sugar/_sugarext.defs b/src/sugar/_sugarext.defs
index 02b673c..6bc068f 100644
--- a/src/sugar/_sugarext.defs
+++ b/src/sugar/_sugarext.defs
@@ -121,6 +121,25 @@
   )
 )
 
+(define-method is_modifier
+  (of-object SugarKeyGrabber)
+  (c-name sugar_key_grabber_is_modifier)
+  (return-type gboolean)
+  (parameters
+'(guint keycode)
+  )
+)
+
+(define-method is_specific_modifier
+  (of-object SugarKeyGrabber)
+  (c-name sugar_key_grabber_is_specific_modifier)
+  (return-type gboolean)
+  (parameters
+'(guint keycode)
+'(guint mask)
+  )
+)
+
 ;; From sexy-icon-entry.h
 
 (define-function sexy_icon_entry_get_type
diff --git a/src/sugar/sugar-key-grabber.c b/src/sugar/sugar-key-grabber.c
index baddab5..ed0cf9f 100644
--- a/src/sugar/sugar-key-grabber.c
+++ b/src/sugar/sugar-key-grabber.c
@@ -217,3 +217,62 @@ sugar_key_grabber_grab(SugarKeyGrabber *grabber, const 
char *key)
 
grabber-keys = g_list_append(grabber-keys, keyinfo);  
 }
+
+gboolean
+sugar_key_grabber_is_modifier(SugarKeyGrabber *grabber, guint keycode)
+{
+   Display *xdisplay;
+   XModifierKeymap *modmap;
+   gint size, i;
+   gboolean is_modifier = FALSE;
+
+   xdisplay = gdk_x11_drawable_get_xdisplay(GDK_DRAWABLE (grabber-root));
+
+   modmap = XGetModifierMapping (xdisplay);
+   
+   size = 8 * modmap-max_keypermod;
+   for (i = 0; i  size; i++) {
+   if (keycode == modmap-modifiermap[i]) {
+   is_modifier = TRUE;
+   break;
+   }
+   }
+   
+   XFreeModifiermap (modmap);
+   
+   return is_modifier;
+}
+
+
+gboolean
+sugar_key_grabber_is_specific_modifier(SugarKeyGrabber *grabber, guint 
keycode, guint mask)
+{
+   Display *xdisplay;
+   XModifierKeymap *modmap;
+   gint start, end, i, mod_index;
+   gboolean is_modifier = FALSE;
+
+   xdisplay = gdk_x11_drawable_get_xdisplay(GDK_DRAWABLE (grabber-root));
+
+   modmap = XGetModifierMapping (xdisplay);
+   
+   mod_index = 0;
+   mask = mask  1;
+   while (mask != 0) {
+   mask = mask  1;
+   mod_index += 1;
+   }
+   
+   start = mod_index * modmap-max_keypermod;
+   end = (mod_index + 1) * modmap-max_keypermod;
+   for (i = start; i  end; i++) {
+   if (keycode == modmap-modifiermap[i]) {
+   is_modifier = TRUE;
+   break;
+   }
+   }
+   
+   XFreeModifiermap (modmap);
+   
+   return is_modifier;
+}
diff --git a/src/sugar/sugar-key-grabber.h b/src/sugar/sugar-key-grabber.h
index 5b734e7..cf6efe2 100644
--- a/src/sugar/sugar-key-grabber.h
+++ b/src/sugar/sugar-key-grabber.h
@@ -60,6 +60,12 @@ void sugar_key_grabber_grab  
(SugarKeyGrabber *grabber,
 char*sugar_key_grabber_get_key  (SugarKeyGrabber *grabber,
 guint  
  keycode,
 guint  
  state);
+gboolean sugar_key_grabber_is_modifier  (SugarKeyGrabber *grabber,
+ guintkeycode);
+gboolean sugar_key_grabber_is_specific_modifier (SugarKeyGrabber *grabber,
+ guintkeycode,
+ guintmask);
+
 
 G_END_DECLS
 

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 2/2] Add scroll_to_item functions to the trays to show a button that may be hidden.

2008-06-19 Thread Benjamin Berg

---

 src/sugar/graphics/tray.py |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/sugar/graphics/tray.py b/src/sugar/graphics/tray.py
index d7d5918..2f5db9a 100644
--- a/src/sugar/graphics/tray.py
+++ b/src/sugar/graphics/tray.py
@@ -67,6 +67,25 @@ class _TrayViewport(gtk.Viewport):
 elif direction == _NEXT_PAGE:
 self._scroll_next()
 
+def scroll_to_item(self, item):
+This function scrolls the viewport so that item will be visible.
+assert item in self.traybar.get_children()
+
+# Get the allocation, and make sure that it is visible
+if self.orientation == gtk.ORIENTATION_HORIZONTAL:
+adj = self.get_hadjustment()
+start = item.allocation.x
+stop = item.allocation.x + item.allocation.width
+else:
+adj = self.get_vadjustment()
+start = item.allocation.y
+stop = item.allocation.y + item.allocation.height
+
+if start  adj.value:
+adj.value = start
+elif stop  adj.value + adj.page_size:
+adj.value = stop - adj.page_size
+
 def _scroll_next(self):
 allocation = self.get_allocation()
 if self.orientation == gtk.ORIENTATION_HORIZONTAL:
@@ -218,6 +237,9 @@ class HTray(gtk.HBox):
 def get_item_index(self, item):
 return self._viewport.traybar.get_item_index(item)
 
+def scroll_to_item(self, item):
+self._viewport.scroll_to_item(item)
+
 class VTray(gtk.VBox):
 def __init__(self, **kwargs):
 gobject.GObject.__init__(self, **kwargs)
@@ -249,6 +271,9 @@ class VTray(gtk.VBox):
 def get_item_index(self, item):
 return self._viewport.traybar.get_item_index(item)
 
+def scroll_to_item(self, item):
+self._viewport.scroll_to_item(item)
+
 class TrayButton(ToolButton):
 def __init__(self, **kwargs):
 ToolButton.__init__(self, **kwargs)

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 1/6] Add functionallity for tabbing trough activities.

2008-06-19 Thread Benjamin Berg
To be able to raise activity windows on a delay, the homemodel needs to
be set directly. It also needs to ignore window raises while the user is
tabbing.
---

 src/model/homemodel.py |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/model/homemodel.py b/src/model/homemodel.py
index a75adcf..be46ffb 100644
--- a/src/model/homemodel.py
+++ b/src/model/homemodel.py
@@ -64,6 +64,7 @@ class HomeModel(gobject.GObject):
 
 self._activities = []
 self._active_activity = None
+self._tabbing = False
 
 screen = wnck.screen_get_default()
 screen.connect('window-opened', self._window_opened_cb)
@@ -102,6 +103,15 @@ class HomeModel(gobject.GObject):
 Returns the activity that the user is currently working in
 return self._active_activity
 
+def tabbing_set_activity(self, activity):
+self._set_active_activity(activity)
+
+def tabbing_start(self):
+self._tabbing = True
+
+def tabbing_stop(self):
+self._tabbing = False
+
 def _set_active_activity(self, home_activity):
 if self._active_activity == home_activity:
 return
@@ -185,6 +195,11 @@ class HomeModel(gobject.GObject):
 logging.error(set_active() failed: %s % err)
 
 def _active_window_changed_cb(self, screen, previous_window=None):
+if self._tabbing:
+# Ignore any window changes when tabbing, as these are comming
+# in delayed.
+return
+
 window = screen.get_active_window()
 if window is None:
 return

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 2/6] Implement API to handle tabbing.

2008-06-19 Thread Benjamin Berg
This adds some functions to to start/stop the tabbing and to switch to the
next and previous activity. It also takes care of raising the activities
window after a short delay.
---

 src/view/Shell.py |   63 +
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/src/view/Shell.py b/src/view/Shell.py
index b77465d..35f4073 100644
--- a/src/view/Shell.py
+++ b/src/view/Shell.py
@@ -57,6 +57,7 @@ class Shell(gobject.GObject):
 self._screen = wnck.screen_get_default()
 self._current_host = None
 self._screen_rotation = 0
+self._tabbing_timeout = None
 
 self._key_handler = KeyHandler()
 
@@ -222,6 +223,68 @@ class Shell(gobject.GObject):
 self.take_activity_screenshot()
 next_activity.get_window().activate(gtk.get_current_event_time())
 
+def tabbing_activate_current(self):
+home_model = self._model.get_home()
+activity = home_model.get_active_activity()
+if activity and activity.get_window():
+activity.get_window().activate(1)
+
+def __tabbing_timeout_cb(self):
+self._tabbing_timeout = None
+self.tabbing_activate_current()
+return False
+
+def tabbing_previous_activity(self, first_switch):
+home_model = self._model.get_home()
+zoom_level = self._model.get_zoom_level()
+
+if first_switch and zoom_level != shellmodel.ShellModel.ZOOM_ACTIVITY:
+activity = home_model.get_active_activity()
+else:
+activity = home_model.get_previous_activity()
+
+home_model.tabbing_set_activity(activity)
+
+if self._tabbing_timeout:
+gobject.source_remove(self._tabbing_timeout)
+self._tabbing_timeout = \
+gobject.timeout_add(250, self.__tabbing_timeout_cb)
+
+def tabbing_next_activity(self, first_switch):
+home_model = self._model.get_home()
+zoom_level = self._model.get_zoom_level()
+
+if first_switch and zoom_level != shellmodel.ShellModel.ZOOM_ACTIVITY:
+activity = home_model.get_active_activity()
+else:
+activity = home_model.get_next_activity()
+
+home_model.tabbing_set_activity(activity)
+
+if self._tabbing_timeout:
+gobject.source_remove(self._tabbing_timeout)
+self._tabbing_timeout = \
+gobject.timeout_add(250, self.__tabbing_timeout_cb)
+
+def tabbing_start(self):
+self.take_activity_screenshot()
+self._frame.show(self._frame.MODE_NON_INTERACTIVE)
+
+home_model = self._model.get_home()
+home_model.tabbing_start()
+
+def tabbing_stop(self):
+self._frame.hide()
+
+if self._tabbing_timeout:
+gobject.source_remove(self._tabbing_timeout)
+
+self.tabbing_activate_current()
+self._model.get_home().tabbing_stop()
+
+home_model = self._model.get_home()
+home_model.tabbing_stop()
+
 def close_current_activity(self):
 if self._model.get_zoom_level() != shellmodel.ShellModel.ZOOM_ACTIVITY:
 return

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 3/6] Handle the keyboard event handling for tabbing.

2008-06-19 Thread Benjamin Berg

---

 src/view/keyhandler.py |   91 +++-
 1 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/src/view/keyhandler.py b/src/view/keyhandler.py
index 16f5a43..b42b93c 100644
--- a/src/view/keyhandler.py
+++ b/src/view/keyhandler.py
@@ -33,6 +33,10 @@ _BRIGHTNESS_STEP = 2
 _VOLUME_STEP = 10
 _BRIGHTNESS_MAX = 15
 _VOLUME_MAX = 100
+# The modifier used for tabbing. Should the shortcuts ever be made user
+# configurable, then some code to figure out the apropriate modifier is
+# needed instead of hardcoding it.
+_TABBING_MODIFIER = gtk.gdk.MOD1_MASK
 
 _actions_table = {
 'F1' : 'zoom_mesh',
@@ -78,10 +82,13 @@ class KeyHandler(object):
 self._keycode_pressed = 0
 self._keystate_pressed = 0
 self._speech_proxy = None
+self._tabbing_windows = False
 
 self._key_grabber = KeyGrabber()
 self._key_grabber.connect('key-pressed',
   self._key_pressed_cb)
+self._key_grabber.connect('key-released',
+  self._key_released_cb)
 
 for key in _actions_table.keys():
 self._key_grabber.grab(key)
@@ -132,15 +139,70 @@ class KeyHandler(object):
 self._get_speech_proxy().SayText(text, reply_handler=lambda: None, 
\
 error_handler=self._on_speech_err)
 
+def _window_tabbing(self, direction):
+shell = view.Shell.get_instance()
+if not self._tabbing_windows:
+logging.debug('Grabing the input.')
+
+screen = gtk.gdk.screen_get_default()
+window = screen.get_root_window() 
+keyboard_grab_result = gtk.gdk.keyboard_grab(window)
+pointer_grab_result = gtk.gdk.pointer_grab(window)
+
+self._tabbing_windows = (keyboard_grab_result == 
gtk.gdk.GRAB_SUCCESS and
+ pointer_grab_result == 
gtk.gdk.GRAB_SUCCESS)
+
+# Now test that the modifier is still active to prevent race
+# conditions. We also test if one of the grabs failed.
+mask = window.get_pointer()[2]
+if not self._tabbing_windows or not (mask  _TABBING_MODIFIER):
+logging.debug('Releasing grabs again.')
+
+if keyboard_grab_result != gtk.gdk.GRAB_SUCCESS:
+gtk.gdk.keyboard_ungrab()
+if pointer_grab_result != gtk.gdk.GRAB_SUCCESS:
+gtk.gdk.pointer_ungrab()
+self._tabbing_windows = False
+else:
+shell.tabbing_start()
+
+first_switch = True
+else:
+first_switch = False
+
+if self._tabbing_windows:
+if direction == 1:
+shell.tabbing_next_activity(first_switch)
+else:
+shell.tabbing_previous_activity(first_switch)
+
+return self._tabbing_windows
+
+def _stop_window_tabbing(self):
+# Some useless key was pressed, or Alt released.
+if not self._tabbing_windows:
+return
+
+logging.debug('Releasing grabs again.')
+gtk.gdk.keyboard_ungrab()
+gtk.gdk.pointer_ungrab()
+
+shell = view.Shell.get_instance()
+shell.tabbing_stop()
+
+self._tabbing_windows = False
+
 def handle_say_text(self):
 clipboard = gtk.clipboard_get(selection=PRIMARY)
 clipboard.request_text(self._primary_selection_cb)
 
 def handle_previous_window(self):
-view.Shell.get_instance().activate_previous_activity()
+if not self._window_tabbing(-1):
+view.Shell.get_instance().activate_previous_activity()
 
 def handle_next_window(self):
-view.Shell.get_instance().activate_next_activity()
+if not self._window_tabbing(1):
+view.Shell.get_instance().activate_next_activity()
 
 def handle_close_window(self):
 view.Shell.get_instance().close_current_activity()
@@ -252,9 +314,34 @@ class KeyHandler(object):
 self._keystate_pressed = state
 
 action = _actions_table[key]
+if self._tabbing_windows:
+# Only accept window tabbing events, everything else
+# cancels the tabbing operation.
+if not action in [next_window, previous_window]:
+self._stop_window_tabbing()
+return True
+
 method = getattr(self, 'handle_' + action)
 method()
 
 return True
+else:
+# If this is not a registered key, then cancel any active
+# tabbing.
+if self._tabbing_windows:
+if not grabber.is_modifier(keycode):
+self._stop_window_tabbing()
+return True
 
 return False
+
+def _key_released_cb(self, grabber, keycode, state):
+if self._tabbing_windows:
+

[sugar] [PATCH 4/6] Ignore click events during the activity_changed_cb.

2008-06-19 Thread Benjamin Berg
It is neccessary to ignore any click events that happen as a result of the
activity_changed_cb. If these were not ignored they would cause an instant
activity switch to the new activity.
---

 src/view/frame/activitiestray.py |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/view/frame/activitiestray.py b/src/view/frame/activitiestray.py
index 0c5b3f8..03a523e 100644
--- a/src/view/frame/activitiestray.py
+++ b/src/view/frame/activitiestray.py
@@ -302,6 +302,7 @@ class ActivitiesTray(HTray):
 
 self._buttons = {}
 self._invite_to_item = {}
+self._freeze_button_clicks = False
 
 self._home_model = shellmodel.get_instance().get_home()
 self._home_model.connect('activity-added', self.__activity_added_cb)
@@ -336,11 +337,14 @@ class ActivitiesTray(HTray):
 
 def __activity_changed_cb(self, home_model, home_activity):
 logging.debug('__activity_changed_cb: %r' % home_activity)
+
 button = self._buttons[home_activity.get_activity_id()]
+self._freeze_button_clicks = True
 button.props.active = True
+self._freeze_button_clicks = True
 
 def __activity_clicked_cb(self, button, home_activity):
-if button.props.active:
+if not self._freeze_button_clicks and button.props.active:
 logging.debug('ActivitiesTray.__activity_clicked_cb')
 window = home_activity.get_window()
 if window:

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 5/6] Scroll to the button that is selected in the tabbing operation.

2008-06-19 Thread Benjamin Berg

---

 src/view/frame/activitiestray.py |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/view/frame/activitiestray.py b/src/view/frame/activitiestray.py
index 03a523e..c34c119 100644
--- a/src/view/frame/activitiestray.py
+++ b/src/view/frame/activitiestray.py
@@ -342,6 +342,8 @@ class ActivitiesTray(HTray):
 self._freeze_button_clicks = True
 button.props.active = True
 self._freeze_button_clicks = True
+
+self.scroll_to_item(button)
 
 def __activity_clicked_cb(self, button, home_activity):
 if not self._freeze_button_clicks and button.props.active:

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH 6/6] Use Alt+Tab for reverse tabbing direction

2008-06-19 Thread Benjamin Berg

---

 src/view/keyhandler.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/view/keyhandler.py b/src/view/keyhandler.py
index b42b93c..ab779ec 100644
--- a/src/view/keyhandler.py
+++ b/src/view/keyhandler.py
@@ -59,7 +59,7 @@ _actions_table = {
 'altq' : 'quit_emulator',
 'altTab'   : 'next_window',
 'altn' : 'next_window',
-'ctrlaltTab' : 'previous_window',
+'altshiftTab': 'previous_window',
 'altp' : 'previous_window',
 'ctrlEscape'   : 'close_window',
 'ctrlq': 'close_window',

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] etoys-3.0.2029 / etoys-activity-83

2008-06-19 Thread Bert Freudenberg
Fresh from the press:

http://dev.laptop.org/pub/sugar/sources/etoys/etoys-3.0.2029.tar.gz
http://dev.laptop.org/pub/sugar/sources/etoys-activity/etoys-activity-83.tar.gz

bundled:

http://etoys.laptop.org/rpms/etoys-3.0.2007-1.noarch.rpm
http://etoys.laptop.org/rpms/Etoys-83.xo

NEWS

* Pango fixes (tested with Nepalese)
* new DBus bindings
* updated QuickGuides
* a few more strings made translatable

The one still not ready feature is tubes support, it should land in a  
few days.

- Bert -
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] etoys-3.0.2029 / etoys-activity-83

2008-06-19 Thread Sayamindu Dasgupta
On Fri, Jun 20, 2008 at 5:55 AM, Bert Freudenberg [EMAIL PROTECTED] wrote:

..snip snip


 * Pango fixes (tested with Nepalese)




Thanks a lot for this. Awesome :-).
Cheers,
Sayamindu




-- 
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar