Stefan Reitz | 1 Apr 02:40
Picon

Re: Update.1 RC3: candidate-703 Published!

Well, allmost ;-) ...

> From: bert <at> freudenbergs.de
> To: devel <at> lists.laptop.org
> Date: Mon, 31 Mar 2008 09:58:14 +0200
> CC: sugar <at> lists.laptop.org
> Subject: Re: [sugar] Update.1 RC3: candidate-703 Published!
>
>
> On 31.03.2008, at 05:06, Joshua Minor wrote:
> > On Mar 30, 2008, at 7:35 PM, Stefan Reitz wrote:
> >
> >> > .. or you can use Bert's script:
> >> >
> >> > wget dev.laptop.org/~bert/update-activities.py
> >> no problem
> >>
> >> > python update-activities.py
> >> -bash-3.2# python update-activities.py (auto complete worked for
> >> the command)
> >> switching to user olpc ...
> >> bash: update-activities.py: command not found
> >>
> >> what am I missing?
> >
> > Run it as user olpc instead of root.
>
> That, or
>
> chmod +x update-activities.py
> ./update-activities.py
>
> Looks like my user-switching hack does not work when run as "python
> update-activities.py".
>
> - Bert -
>
>

Since my system came back with no activities (and a new bios) the only way to do something was ctrl-alt-f2.
Enter got me logged in as root. As such
wget dev.laptop.org/~bert/update-activities.py    worked, then did
chmod +x update-activities.py        and
./update-activities.py       same result as before (--> switching to user olpc ...
> >> bash: update-activities.py: command not found)
switching to user olpc didn't help right away since now I couldn't see the file (belonging to root and being in root's ~) anymore... And I couldn't download it as olpc to its ~ because dev.laptop.org couldn't be resolved (as olpc)
So I turned root again and copied update-activities.py to /home/olpc, changed the owner
chown olpc:olpc update-activities.py         turned root again
su olpc          Then
./update-activities.py worked (If this doesn't work for someone else, remember I did the
chmod +x update-activities.py   early on...)
ctrl-alt-f3 got my back to the sugar interface

I encountered a bunch of "caution: excluded filename not matched: mimetype", but I don't know if this has any consequences.
The order of the activity Icons has greatly changed - is there a way for me to influence their order of appearance?
 
Thanks for the hints, I couldn't have done without.
Stefan

> _______________________________________________
> Sugar mailing list
> Sugar <at> lists.laptop.org
> http://lists.laptop.org/listinfo/sugar

Windows Live Messenger Automatisch über neue E-Mails informiert!
_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Tomeu Vizoso | 1 Apr 11:48

Re: Merging sugar-toolkit changes from tomeu repository

On Mon, Mar 31, 2008 at 11:09 PM, Tomeu Vizoso <tomeu <at> tomeuvizoso.net> wrote:
> On Mon, Mar 31, 2008 at 9:46 PM, Eben Eliason <eben.eliason <at> gmail.com> wrote:
>
> > Here is my attempt at consolidating the changes to palette.py.  The
>  >  layout is tested with respect to primary text, secondary text, and
>  >  icons, but I have not visually tested the accel labels.  All of the
>  >  other changes applicable have been merged.
>
>  Hmm, accel labels don't appear, but they are correctly set. I suspect
>  something in do_size_request(). Tomorrow will check further.

Looks like gtk.AccelLabel's container isn't allocating enough width.
Just enough for the label, but not enough for the accelerator.

Setting xscale to 1 makes the gtk.Alignment to allocate more
horizontal space for its child and the accelerator appears:

        self._label_alignment = gtk.Alignment(xalign=0, yalign=0.5,
                                              xscale=1, yscale=0.33)

I'm not sure the layout is what you want, could you check?

Thanks,

Tomeu
Bert Freudenberg | 1 Apr 12:19
Picon
Gravatar

Re: Update.1 RC3: candidate-703 Published!


On 01.04.2008, at 02:40, Stefan Reitz wrote:
> > >> > wget dev.laptop.org/~bert/update-activities.py
> > >> > python update-activities.py
> > >> -bash-3.2# python update-activities.py (auto complete worked for
> > >> the command)
> > >> switching to user olpc ...
> > >> bash: update-activities.py: command not found
> > >>
> > >> what am I missing?
> > >
> > > Run it as user olpc instead of root.
> >
> > That, or
> >
> > chmod +x update-activities.py
> > ./update-activities.py
> >
> > Looks like my user-switching hack does not work when run as "python
> > update-activities.py".
> >
> > - Bert -
>
> Since my system came back with no activities (and a new bios) the  
> only way to do something was ctrl-alt-f2.
> Enter got me logged in as root. As such
> wget dev.laptop.org/~bert/update-activities.py    worked, then did
> chmod +x update-activities.py        and
> ./update-activities.py       same result as before (--> switching to  
> user olpc ...
> > >> bash: update-activities.py: command not found)
> switching to user olpc didn't help right away since now I couldn't  
> see the file (belonging to root and being in root's ~) anymore...  
> And I couldn't download it as olpc to its ~ because dev.laptop.org  
> couldn't be resolved (as olpc)
> So I turned root again and copied update-activities.py to /home/ 
> olpc, changed the owner
> chown olpc:olpc update-activities.py         turned root again
> su olpc          Then
> ./update-activities.py worked (If this doesn't work for someone  
> else, remember I did the
> chmod +x update-activities.py   early on...)
> ctrl-alt-f3 got my back to the sugar interface
>
> I encountered a bunch of "caution: excluded filename not matched:  
> mimetype", but I don't know if this has any consequences.
> The order of the activity Icons has greatly changed - is there a way  
> for me to influence their order of appearance?
>
> Thanks for the hints, I couldn't have done without.

Ah. Thanks, I identified the problem: when you download the script to  
~root then the user olpc cannot read from that directory. It's better  
to download to ~olpc anyway so it survives the next system upgrade. I  
will remove the user-switching magic from the script, learned my  
lesson ;)

New instructions are:

su - olpc
wget dev.laptop.org/~bert/update-activities.py
python update-activities.py

- Bert -
Tomeu Vizoso | 1 Apr 13:22

OLPC is hiring a Sugar developer

Hi all,

as you may have already noticed, some days ago (so not an April fools'
hoax) appeared a new job posting in the main laptop.org site:

http://www.laptop.org/en/jobs.shtml#User%20Interface%20Developer%20for%20Sugar

So, if you would like to become part of the core Sugar team and help
to deliver a  new platform for education, please apply!

Thanks,

Tomeu
Tomeu Vizoso | 1 Apr 15:22

[PATCH] add a secondary label and icon to palettes WAS Merging sugar-toolkit changes from tomeu repository

Hi, follow some nitpicks, Marco can hopefully give some insights in
reducing the containers used for the layout, looks quite complex right
now.

     __gproperties__ = {
-        'invoker'    : (object, None, None,
-                        gobject.PARAM_READWRITE)
+        'invoker'        : (object, None, None,
+                            gobject.PARAM_READWRITE),
+        'primary-text'   : (str, None, None, None,
+                            gobject.PARAM_READWRITE),
+        'secondary-text' : (str, None, None, None,
+                            gobject.PARAM_READWRITE),
+        'icon'           : (object, None, None,
+                            gobject.PARAM_READWRITE),
+        'icon-visible'   : (bool, None, None, True,
+                            gobject.PARAM_READWRITE),
+        'group-id'       : (str, None, None, None,
+                            gobject.PARAM_READWRITE),
+
+        'menu-after-content' : (bool, None, None, False,
+                                gobject.PARAM_CONSTRUCT_ONLY)
     }

Any reason for that empty space?

     __gsignals__ = {
@@ -143,61 +156,105 @@ class Palette(gtk.Window):
     }

+        palette_box = gtk.VBox()

-        self._secondary_anim = animator.Animator(1.0, 10)
-        self._secondary_anim.add(_SecondaryAnimation(self))
+        primary_box = gtk.HBox()
+        palette_box.pack_start(primary_box, expand=False)
+        primary_box.show()

-        self._popdown_anim = animator.Animator(0.6, 10)
-        self._popdown_anim.add(_PopdownAnimation(self))
+        self._icon_box = gtk.HBox()
+        self._icon_box.set_size_request(style.zoom(style.GRID_CELL_SIZE), -1)
+        primary_box.pack_start(self._icon_box, expand=False)

-        vbox = gtk.VBox()
+        labels_box = gtk.VBox()
+        self._label_alignment = gtk.Alignment(xalign=0, yalign=0.5,
+                                              xscale=0, yscale=0.33)
+        self._label_alignment.set_padding(0, 0, style.DEFAULT_SPACING,
+                                          style.DEFAULT_SPACING)
+        self._label_alignment.add(labels_box)
+        self._label_alignment.show()
+        primary_box.pack_start(self._label_alignment, expand=True)
+        labels_box.show()

I think the most common thing is to do:

container = SomeContainer()
container.props.foo = bar
grand_father.add(container)
container.show() # if appropriate

child = SomeWidget()
child.props.foo = bar
container.add(child)
child.show() # if appropriate

etc.

Makes sense?

         self._label = gtk.AccelLabel('')
-        self._label.set_size_request(-1, style.zoom(style.GRID_CELL_SIZE) -
-                                         2 * self.get_border_width())
         self._label.set_alignment(0, 0.5)
-        self._label.set_padding(style.DEFAULT_SPACING, 0)

         if text_maxlen > 0:
             self._label.set_max_width_chars(text_maxlen)
             self._label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)

-        vbox.pack_start(self._label)
+        labels_box.pack_start(self._label, expand=True)
+
+        self._secondary_label = gtk.Label()
+        self._secondary_label.set_alignment(0, 0.5)
+
+        if text_maxlen > 0:
+            self._secondary_label.set_max_width_chars(text_maxlen)
+            self._secondary_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
+
+        labels_box.pack_start(self._secondary_label, expand=True)
+        #self._secondary_label.show()

         self._secondary_box = gtk.VBox()
-        vbox.pack_start(self._secondary_box)
+        palette_box.pack_start(self._secondary_box)

         self._separator = gtk.HSeparator()
         self._secondary_box.pack_start(self._separator)

         self._menu_content_separator = gtk.HSeparator()

-        if menu_after_content:
+        self._popup_anim = animator.Animator(0.3, 10)
+        self._popup_anim.add(_PopupAnimation(self))
+
+        self._secondary_anim = animator.Animator(1.0, 10)
+        self._secondary_anim.add(_SecondaryAnimation(self))
+
+        self._popdown_anim = animator.Animator(0.6, 10)
+        self._popdown_anim.add(_PopdownAnimation(self))
+

-        self.set_primary_text(label)
-        self.set_group_id('default')
+        #self.set_primary_text(self._primary_text)
+        #self.set_group_id('default')

Can we remove this?

So, apart from this style nitpicks, my only two remaining concerns are
the complexity of using so many containers and passing an Icon as a
property.

What worries me about this last one is that if the user of this API
sets its own widget or icon, Palette may need to change some
properties so it fits correctly on the palette. So the user could be
setting some properties and later these are overridden by Palette.
This could be disconcerting to the user unless we document which
properties are set by Palette. But that would be a complex API and we
probably will need to set other properties at future revisions, so
some earlier activities may look wrong, etc.

So, what I propose is having the properties 'icon-name',
'icon-filename' and 'icon-xo-colors'. For more advanced uses, we could
have a method create_icon() that could be overriden for palettes that
wish to set its own Widget in place of the normal Icon.

Sounds good?

Tomeu
Simon Schampijer | 1 Apr 15:51
Picon

Sugar mtg April 1 2008

Today's sugar meeting (again at 17.00 UTC)

We do not have setup topics - but we will have a 30 minutes question 
session this week. I have add two short questions here myself: 
http://wiki.laptop.org/go/Sugar_dev_meeting#Topics

Best,
    Simon
Picon

Re: [PATCH] add a secondary label and icon to palettes WAS Merging sugar-toolkit changes from tomeu repository

On Tue, Apr 1, 2008 at 3:22 PM, Tomeu Vizoso <tomeu <at> tomeuvizoso.net> wrote:
>  What worries me about this last one is that if the user of this API
>  sets its own widget or icon, Palette may need to change some
>  properties so it fits correctly on the palette.

Do you have any specific property in mind here? Can't think of cases
where this could happen myself...

Marco
Tomeu Vizoso | 1 Apr 16:16

Re: [PATCH] add a secondary label and icon to palettes WAS Merging sugar-toolkit changes from tomeu repository

On Tue, Apr 1, 2008 at 4:11 PM, Marco Pesenti Gritti <mpgritti <at> gmail.com> wrote:
> On Tue, Apr 1, 2008 at 3:22 PM, Tomeu Vizoso <tomeu <at> tomeuvizoso.net> wrote:
>  >  What worries me about this last one is that if the user of this API
>  >  sets its own widget or icon, Palette may need to change some
>  >  properties so it fits correctly on the palette.
>
>  Do you have any specific property in mind here? Can't think of cases
>  where this could happen myself...

All related to size, padding, spacing, etc

Tomeu
Eben Eliason | 1 Apr 16:21
Picon

Re: [PATCH] add a secondary label and icon to palettes WAS Merging sugar-toolkit changes from tomeu repository

On Tue, Apr 1, 2008 at 9:22 AM, Tomeu Vizoso <tomeu <at> tomeuvizoso.net> wrote:
> Hi, follow some nitpicks, Marco can hopefully give some insights in
>  reducing the containers used for the layout, looks quite complex right
>  now.
>
>      __gproperties__ = {
>  -        'invoker'    : (object, None, None,
>  -                        gobject.PARAM_READWRITE)
>  +        'invoker'        : (object, None, None,
>  +                            gobject.PARAM_READWRITE),
>  +        'primary-text'   : (str, None, None, None,
>  +                            gobject.PARAM_READWRITE),
>  +        'secondary-text' : (str, None, None, None,
>  +                            gobject.PARAM_READWRITE),
>  +        'icon'           : (object, None, None,
>  +                            gobject.PARAM_READWRITE),
>  +        'icon-visible'   : (bool, None, None, True,
>  +                            gobject.PARAM_READWRITE),
>  +        'group-id'       : (str, None, None, None,
>  +                            gobject.PARAM_READWRITE),
>  +
>  +        'menu-after-content' : (bool, None, None, False,
>  +                                gobject.PARAM_CONSTRUCT_ONLY)
>      }
>
>  Any reason for that empty space?

Not really -- only that it separates the READWRITEs from the
CONSTRUCT_ONLY, and when it was added (last), I didn't want to redo
the left margin on all of the other properties.

>      __gsignals__ = {
>  @@ -143,61 +156,105 @@ class Palette(gtk.Window):
>      }
>
>  +        palette_box = gtk.VBox()
>
>  -        self._secondary_anim = animator.Animator(1.0, 10)
>  -        self._secondary_anim.add(_SecondaryAnimation(self))
>  +        primary_box = gtk.HBox()
>  +        palette_box.pack_start(primary_box, expand=False)
>  +        primary_box.show()
>
>  -        self._popdown_anim = animator.Animator(0.6, 10)
>  -        self._popdown_anim.add(_PopdownAnimation(self))
>  +        self._icon_box = gtk.HBox()
>  +        self._icon_box.set_size_request(style.zoom(style.GRID_CELL_SIZE), -1)
>  +        primary_box.pack_start(self._icon_box, expand=False)
>
>  -        vbox = gtk.VBox()
>  +        labels_box = gtk.VBox()
>  +        self._label_alignment = gtk.Alignment(xalign=0, yalign=0.5,
>  +                                              xscale=0, yscale=0.33)
>  +        self._label_alignment.set_padding(0, 0, style.DEFAULT_SPACING,
>  +                                          style.DEFAULT_SPACING)
>  +        self._label_alignment.add(labels_box)
>  +        self._label_alignment.show()
>  +        primary_box.pack_start(self._label_alignment, expand=True)
>  +        labels_box.show()
>
>  I think the most common thing is to do:
>
>  container = SomeContainer()
>  container.props.foo = bar
>  grand_father.add(container)
>  container.show() # if appropriate
>
>  child = SomeWidget()
>  child.props.foo = bar
>  container.add(child)
>  child.show() # if appropriate
>
>  etc.
>
>  Makes sense?

Hmm, I guess our minds differ in how we read this logically.  I follow
the same steps as you propose, but I mentally split them between "pre"
and "post" commands (the first two lines, and the second two lines),
and then construct all of a containers children in the middle.  That
is, I "push" after child.props.foo = bar, set up all subchildren, and
"pop" with container.add(child) and child.show() where needed.

>
>          self._label = gtk.AccelLabel('')
>  -        self._label.set_size_request(-1, style.zoom(style.GRID_CELL_SIZE) -
>  -                                         2 * self.get_border_width())
>          self._label.set_alignment(0, 0.5)
>  -        self._label.set_padding(style.DEFAULT_SPACING, 0)
>
>          if text_maxlen > 0:
>              self._label.set_max_width_chars(text_maxlen)
>              self._label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
>
>  -        vbox.pack_start(self._label)
>  +        labels_box.pack_start(self._label, expand=True)
>  +
>  +        self._secondary_label = gtk.Label()
>  +        self._secondary_label.set_alignment(0, 0.5)
>  +
>  +        if text_maxlen > 0:
>  +            self._secondary_label.set_max_width_chars(text_maxlen)
>  +            self._secondary_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
>  +
>  +        labels_box.pack_start(self._secondary_label, expand=True)
>  +        #self._secondary_label.show()
>
>          self._secondary_box = gtk.VBox()
>  -        vbox.pack_start(self._secondary_box)
>  +        palette_box.pack_start(self._secondary_box)
>
>          self._separator = gtk.HSeparator()
>          self._secondary_box.pack_start(self._separator)
>
>          self._menu_content_separator = gtk.HSeparator()
>
>  -        if menu_after_content:
>  +        self._popup_anim = animator.Animator(0.3, 10)
>  +        self._popup_anim.add(_PopupAnimation(self))
>  +
>  +        self._secondary_anim = animator.Animator(1.0, 10)
>  +        self._secondary_anim.add(_SecondaryAnimation(self))
>  +
>  +        self._popdown_anim = animator.Animator(0.6, 10)
>  +        self._popdown_anim.add(_PopdownAnimation(self))
>  +
>
>
>  -        self.set_primary_text(label)
>  -        self.set_group_id('default')
>  +        #self.set_primary_text(self._primary_text)
>  +        #self.set_group_id('default')
>
>  Can we remove this?

Yup, that can go.  Sorry.

>  So, apart from this style nitpicks, my only two remaining concerns are
>  the complexity of using so many containers and passing an Icon as a
>  property.

I don't think the container situation is really very complex any more.
 The only container that could possibly be extraneous, I believe, is
_icon_box, which is used so that all necessary formatting can be done
without needing to have an icon widget in hand (which may change).

>  What worries me about this last one is that if the user of this API
>  sets its own widget or icon, Palette may need to change some
>  properties so it fits correctly on the palette. So the user could be
>  setting some properties and later these are overridden by Palette.
>  This could be disconcerting to the user unless we document which
>  properties are set by Palette. But that would be a complex API and we
>  probably will need to set other properties at future revisions, so
>  some earlier activities may look wrong, etc.

I think that size would be the only one we care about.  As long as it
doesn't break the layout, we shouldn't care.

>  So, what I propose is having the properties 'icon-name',
>  'icon-filename' and 'icon-xo-colors'. For more advanced uses, we could
>  have a method create_icon() that could be overriden for palettes that
>  wish to set its own Widget in place of the normal Icon.

This could work, too.

- Eben
Eben Eliason | 1 Apr 16:27
Picon

Re: [PATCH] add a secondary label and icon to palettes WAS Merging sugar-toolkit changes from tomeu repository

>  Hmm, I guess our minds differ in how we read this logically.  I follow
>  the same steps as you propose, but I mentally split them between "pre"
>  and "post" commands (the first two lines, and the second two lines),
>  and then construct all of a containers children in the middle.  That
>  is, I "push" after child.props.foo = bar, set up all subchildren, and
>  "pop" with container.add(child) and child.show() where needed.

Heh, upon further inspection I realize that I don't actually follow
this very consistently.  It's still the method that makes more sense
to me, though, since it can help to visualize the hierarchy.  I guess
we could use an in-order traversal or something instead, while
adhering to your code structure.

- Eben

Gmane