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

2008-06-22 Thread Marco Pesenti Gritti
On Sat, Jun 21, 2008 at 11:57 PM, Walter Bender <[EMAIL PROTECTED]> wrote:
> I have been thinking that the freeform vs self-arranged vs ring
> desktops might be a good first case study for an experiment with the
> teachers and children in Peru/Uruguay. (As you may be able to sense, I
> remain extremely skeptical about the utility of a random desktop.)

Yeah, that sounds like a good idea. Can you please open an Update.2
ticket for this so that it doesn't get forgot?

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


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

2008-06-21 Thread Walter Bender
I have been thinking that the freeform vs self-arranged vs ring
desktops might be a good first case study for an experiment with the
teachers and children in Peru/Uruguay. (As you may be able to sense, I
remain extremely skeptical about the utility of a random desktop.)

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


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

2008-06-21 Thread Marco Pesenti Gritti
On Sat, Jun 21, 2008 at 12:41 PM, Bert Freudenberg <[EMAIL PROTECTED]> wrote:
> I'd rather not tie Sugar too closely to Gnome. I like Michael's strawman.

Well, it's already tied since all the libraries we use comes from
there (or from freedesktop.org). Someone is working on a
freedesktop.org configuration system, but it's not there yet.

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


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

2008-06-21 Thread Bert Freudenberg

On 21.06.2008, at 10:25, Marco Pesenti Gritti wrote:

> On Sat, Jun 21, 2008 at 3:54 AM, Michael Stone <[EMAIL PROTECTED]>  
> wrote:
>> On Fri, Jun 20, 2008 at 06:27:33PM +0200, Marco Pesenti Gritti wrote:
>>> On Fri, Jun 20, 2008 at 6:24 PM, Tomeu Vizoso  
>>> <[EMAIL PROTECTED]> wrote:
 On Fri, Jun 20, 2008 at 6:08 PM, Walter Bender <[EMAIL PROTECTED] 
 > wrote:
> Is this done in a way such that it can be set by the  
> customization key
> process? I can imagine that many groups will prefer the ring to  
> random
> and want to make it an installation default.

 Not right now, but would be quite easy to add an option to the  
 control
 panel and let customization keys change the stored preference.
>>>
>>> Even if not exposed in the cp UI we should at least have an hidden  
>>> preference.
>>> We have no way right to customize sugar profiles but we should  
>>> have one.
>>>
>>> Marco
>>
>> I'm interested by the (implicit) idea that (all?) settings modifiable
>> through the control panel should also be customizable. However, as I
>> pointed out not long ago, some care needs to be taken to restrict the
>> ability of the customization process to violate our security  
>> principles.
>>
>> As a strawman, how about using a convention or technology similar to
>>
>> http://thedjbway.org/daemontools/envdir.html
>>
>> to record the key-value settings that make up the bulk of the
>> 'customizable' features?
>
> I'd rather use GConf which is what all the software we depend on uses
> and understand.


I'd rather not tie Sugar too closely to Gnome. I like Michael's  
strawman.

- Bert -


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


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

2008-06-21 Thread Marco Pesenti Gritti
On Sat, Jun 21, 2008 at 3:54 AM, Michael Stone <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 20, 2008 at 06:27:33PM +0200, Marco Pesenti Gritti wrote:
>> On Fri, Jun 20, 2008 at 6:24 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
>> > On Fri, Jun 20, 2008 at 6:08 PM, Walter Bender <[EMAIL PROTECTED]> wrote:
>> >> Is this done in a way such that it can be set by the customization key
>> >> process? I can imagine that many groups will prefer the ring to random
>> >> and want to make it an installation default.
>> >
>> > Not right now, but would be quite easy to add an option to the control
>> > panel and let customization keys change the stored preference.
>>
>> Even if not exposed in the cp UI we should at least have an hidden 
>> preference.
>> We have no way right to customize sugar profiles but we should have one.
>>
>> Marco
>
> I'm interested by the (implicit) idea that (all?) settings modifiable
> through the control panel should also be customizable. However, as I
> pointed out not long ago, some care needs to be taken to restrict the
> ability of the customization process to violate our security principles.
>
> As a strawman, how about using a convention or technology similar to
>
>  http://thedjbway.org/daemontools/envdir.html
>
> to record the key-value settings that make up the bulk of the
> 'customizable' features?

I'd rather use GConf which is what all the software we depend on uses
and understand.

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


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

2008-06-20 Thread Michael Stone
On Fri, Jun 20, 2008 at 06:27:33PM +0200, Marco Pesenti Gritti wrote:
> On Fri, Jun 20, 2008 at 6:24 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
> > On Fri, Jun 20, 2008 at 6:08 PM, Walter Bender <[EMAIL PROTECTED]> wrote:
> >> Is this done in a way such that it can be set by the customization key
> >> process? I can imagine that many groups will prefer the ring to random
> >> and want to make it an installation default.
> >
> > Not right now, but would be quite easy to add an option to the control
> > panel and let customization keys change the stored preference.
> 
> Even if not exposed in the cp UI we should at least have an hidden preference.
> We have no way right to customize sugar profiles but we should have one.
> 
> Marco

I'm interested by the (implicit) idea that (all?) settings modifiable
through the control panel should also be customizable. However, as I
pointed out not long ago, some care needs to be taken to restrict the
ability of the customization process to violate our security principles.

As a strawman, how about using a convention or technology similar to

  http://thedjbway.org/daemontools/envdir.html

to record the key-value settings that make up the bulk of the
'customizable' features?

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


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

2008-06-20 Thread Marco Pesenti Gritti
On Fri, Jun 20, 2008 at 6:24 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 20, 2008 at 6:08 PM, Walter Bender <[EMAIL PROTECTED]> wrote:
>> Is this done in a way such that it can be set by the customization key
>> process? I can imagine that many groups will prefer the ring to random
>> and want to make it an installation default.
>
> Not right now, but would be quite easy to add an option to the control
> panel and let customization keys change the stored preference.

Even if not exposed in the cp UI we should at least have an hidden preference.
We have no way right to customize sugar profiles but we should have one.

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


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

2008-06-20 Thread Tomeu Vizoso
On Fri, Jun 20, 2008 at 6:08 PM, Walter Bender <[EMAIL PROTECTED]> wrote:
> Is this done in a way such that it can be set by the customization key
> process? I can imagine that many groups will prefer the ring to random
> and want to make it an installation default.

Not right now, but would be quite easy to add an option to the control
panel and let customization keys change the stored preference.

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


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

2008-06-20 Thread Walter Bender
Is this done in a way such that it can be set by the customization key
process? I can imagine that many groups will prefer the ring to random
and want to make it an installation default.

-walter

On Fri, Jun 20, 2008 at 5:36 AM, Marco Pesenti Gritti
<[EMAIL PROTECTED]> wrote:
> r+
>
> On Thu, Jun 19, 2008 at 8:57 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
>> 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
>>
>> ___
>> Sugar mailing list
>> Sugar@lists.laptop.org
>> http://lists.laptop.org/listinfo/sugar
>>
>>
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


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

2008-06-20 Thread Marco Pesenti Gritti
r+

On Thu, Jun 19, 2008 at 8:57 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
> 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
>
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
>
___
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 = _('R')
+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 = _('R')
+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', self.__layout_activate_cb,
+