[Sugar-devel] OLPC SF Community Summit 2012! Fri, Oct 19 - Sun, Oct 21

2012-08-06 Thread rihoward1
The OLPC-SF volunteers are planning the upcoming OLPC San Francisco Community
Summit 2012 in San Francisco, CA, USA.

The dates are:

Oct 19 (registration and reception)
Oct 20 (full day)
Oct 21 (full day)

The web page will be fully active in a couple of weeks. We will be
accepting proposals for topics and talks soon. Please start thinking of
topics which you might like to present.

http://olpcsf.org/summit






___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Finance-9

2012-08-06 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4040

Sugar Platform:
0.98 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28183/finance-9.xo

Release notes:
Port to Gtk3 - Manuel Kaufmann
Pep8 fixes - Manuel Kaufmann


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH Implode] Port to Gtk3 SL #3715

2012-08-06 Thread Manuel Kaufmann
This commit ports the Implode Activity to its Gtk3 version.

The sugarless.py version is not ported on this commit.

Signed-off-by: Manuel Kaufmann 
---
 anim.py|   4 +-
 gridwidget.py  |  89 +--
 helpwidget.py  | 155 ---
 implodeactivity.py | 174 -
 implodegame.py |   8 +--
 keymap.py  |  82 -
 setup.py   |   2 +-
 7 files changed, 248 insertions(+), 266 deletions(-)

diff --git a/anim.py b/anim.py
index 2c19a15..f34406e 100644
--- a/anim.py
+++ b/anim.py
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-import gobject
+from gi.repository import GObject
 
 # Animation timer interval (in msec)
 _TIMER_INTERVAL = 20
@@ -34,7 +34,7 @@ class Anim(object):
 def start(self):
 self._animating = True
 self._update_func()
-gobject.timeout_add(_TIMER_INTERVAL, self._timer)
+GObject.timeout_add(_TIMER_INTERVAL, self._timer)
 
 def stop(self):
 if self._animating:
diff --git a/gridwidget.py b/gridwidget.py
index 8ee3aad..c3b6596 100644
--- a/gridwidget.py
+++ b/gridwidget.py
@@ -20,8 +20,9 @@ import logging
 _logger = logging.getLogger('implode-activity.gridwidget')
 
 import cairo
-import gobject
-import gtk
+from gi.repository import GObject
+from gi.repository import Gtk
+from gi.repository import Gdk
 import math
 import random
 import time
@@ -93,39 +94,38 @@ _ANIM_SCALE = 0.04
 def _log_errors(func):
 return func
 
-class GridWidget(gtk.DrawingArea):
+class GridWidget(Gtk.DrawingArea):
 """Gtk widget for rendering the game board."""
 
 __gsignals__ = {
-'piece-selected'  : (gobject.SIGNAL_RUN_LAST, None, (int, int)),
-'undo-key-pressed': (gobject.SIGNAL_RUN_LAST, None, (int,)),
-'redo-key-pressed': (gobject.SIGNAL_RUN_LAST, None, (int,)),
-'new-key-pressed' : (gobject.SIGNAL_RUN_LAST, None, (int,)),
-'button-press-event': 'override',
-'key-press-event': 'override',
-'expose-event': 'override',
-'size-allocate': 'override',
-'motion-notify-event': 'override',
+'piece-selected': (GObject.SignalFlags.RUN_LAST, None, (int, int)),
+'undo-key-pressed': (GObject.SignalFlags.RUN_LAST, None, (int,)),
+'redo-key-pressed': (GObject.SignalFlags.RUN_LAST, None, (int,)),
+'new-key-pressed': (GObject.SignalFlags.RUN_LAST, None, (int,)),
 }
 
 def __init__(self, *args, **kwargs):
 super(GridWidget, self).__init__(*args, **kwargs)
-self.set_events(gtk.gdk.BUTTON_PRESS_MASK
-| gtk.gdk.POINTER_MOTION_MASK
-| gtk.gdk.KEY_PRESS_MASK)
-self.set_flags(gtk.CAN_FOCUS)
+self.set_events(Gdk.EventMask.BUTTON_PRESS_MASK
+| Gdk.EventMask.POINTER_MOTION_MASK
+| Gdk.EventMask.KEY_PRESS_MASK)
+self.set_can_focus(True)
 
 self._board_drawer = BoardDrawer(self._get_size, self._invalidate_rect)
 self._win_drawer = WinDrawer(self._get_size, self._invalidate_rect)
 self._removal_drawer = RemovalDrawer(self._get_size, 
self._invalidate_rect)
 self._set_current_drawer(self._board_drawer)
 
+self.connect('draw', self._draw_event_cb)
+self.connect('configure-event', self._configure_event_cb)
+self.connect('button-press-event', self._button_press_event_cb)
+
 def _get_size(self):
-return (self.allocation.width, self.allocation.height)
+return (self.get_allocated_width(), self.get_allocated_height())
 
 def _invalidate_rect(self, rect):
-if self.window:
-self.window.invalidate_rect(rect, True)
+if self.get_window():
+self.get_window().invalidate_rect(rect, True)
 
 def set_board(self, board):
 self._board_drawer.set_board(board)
@@ -141,7 +141,9 @@ class GridWidget(gtk.DrawingArea):
 
 def _invalidate_board(self):
 (width, height) = self._get_size()
-self._invalidate_rect(gtk.gdk.Rectangle(0, 0, width, height))
+rect = Gdk.Rectangle()
+rect.x, rect.y, rect.width, rect.height = (0, 0, width, height)
+self._invalidate_rect(rect)
 
 def get_win_draw_flag(self):
 return (self._current_drawer is self._win_drawer)
@@ -160,12 +162,12 @@ class GridWidget(gtk.DrawingArea):
 self._board_drawer.select_center_cell()
 
 @_log_errors
-def do_button_press_event(self, event):
+def _button_press_event_cb(self, widget, event):
 # Ignore mouse clicks while animating.
 if self._is_animating():
 return True
 # Ignore double- and triple-clicks.
-if event.type != gtk.gdk.BUTTON_PRESS:
+if event.type != Gdk.EventType.BUTTON_PRESS:

Re: [Sugar-devel] Idea for a New Activity in Sugar: To code and run C, C++ programs

2012-08-06 Thread Gonzalo Odiard
On Sun, Aug 5, 2012 at 12:03 PM, Kartik Kumar  wrote:

> Hi All,
>
> I was thinking of an Activity for Sugar using which children can write
> programs in C and C++ and execute them.


Why? Why, poor kids?! :)

Jokes aside, I don't think is a good idea:
* C is more difficult to learn than python.
* In the images there are not gcc and make.
* Compiled c code is dependent of the platform,
and we do not have a good solution to multiplatform binaries in the
activities.

Why you think, learning C can be good for kids?

Create a IDE with the simplicity needed by the sugar design is a challenge.
If you want help with a development tool to write python activities,
check http://git.sugarlabs.org/develop

Gonzalo



> This is similar to Pippy activity but this activity will use GCC for
> compilation and execution of these programs created by children.
>
> We can present them with such features:
> 1. Use pre-existing code snippets( from Journal)
> 2. Write custom code
> 3. Compilation and Execution
>
> Please provide your inputs whether this seems useful with classroom
> perspective and is worth taking it further?
>
>
> Kartik Perisetla
>
>
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] props.accelerator available at ToggleToolButton SL#3774

2012-08-06 Thread Manuel Kaufmann
Hello,

On Wed, Aug 1, 2012 at 11:10 PM, Daniel Francis  wrote:
> Signed-off-by: Daniel Francis 
>
> ---
>  src/sugar3/graphics/toggletoolbutton.py | 39 
> +

The patchs look great. Good work, Daniel!

I tested both and they are working properly. I made a comment on the ticket[1].

Tested-by: Manuel Kaufmann 


[1] http://bugs.sugarlabs.org/ticket/3774


-- 
Kaufmann Manuel
Blog: http://humitos.wordpress.com/
Porfolio: http://fotos.mkaufmann.com.ar/
PyAr: http://www.python.com.ar/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Benjamin Berg
On Mon, 2012-08-06 at 15:49 +0200, Sascha Silbe wrote:
> Benjamin Berg  writes:
> >> +# HACK to supress the grey background around the icon
> >> +# won't be needed in GTK3
> >> +self.modify_bg(gtk.STATE_NORMAL, 
> >> style.COLOR_WHITE.get_gdk_color())
> >
> > Not really too bad, but I am pretty sure that
> > gtk.EventBox.set_visible_window(False) should work fine here.
> 
> Doesn't look that way to me:

Oh, thanks for the screenshot. That is kinda obvious. One needs to add
allocation.x and allocation.y to the coordinates if you don't have a
visible window.

So:

+def do_expose_event(self, event):
+surface = self._buffer.get_surface()
+if surface:
+allocation = self.get_allocation()
+
+x = (allocation.width - surface.get_width()) / 2
+y = (allocation.height - surface.get_height()) / 2
+
+cr = self.window.cairo_create()
+cr.set_source_surface(surface, x, y)
+if self._alpha == 1.0:
+cr.paint()
+else:
+cr.paint_with_alpha(self._alpha)


Also change the x/y calculation to add allocation.x and allocation.y
respectively. Then things should work fine.

Benjamin

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Sascha Silbe
Benjamin Berg  writes:

>  Reviewed-by: Benjamin Berg 

Thanks!


>> +# HACK to supress the grey background around the icon
>> +# won't be needed in GTK3
>> +self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
>
> Not really too bad, but I am pretty sure that
> gtk.EventBox.set_visible_window(False) should work fine here.

Doesn't look that way to me:
<>
So for the original patch:

Acked-by: Sascha Silbe 

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgp2VmyccZFz4.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Simon Schampijer

On 08/06/2012 02:02 PM, Benjamin Berg wrote:

Hi,

On Mon, 2012-08-06 at 12:04 +0200, Simon Schampijer wrote:

Signed-off-by: Simon Schampijer 
[moved from sugar-toolkit to sugar]
Signed-off-by: Sascha Silbe 

Reviewed-by: Benjamin Berg 


+def __init__(self, **kwargs):
+self._buffer = _IconBuffer()
+self._alpha = 1.0
+
+gtk.EventBox.__init__(self)
+for key, value in kwargs.iteritems():
+self.set_property(key, value)
+
+self._palette_invoker = CursorInvoker()
+self._palette_invoker.attach(self)
+
+# HACK to supress the grey background around the icon
+# won't be needed in GTK3
+self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())


Not really too bad, but I am pretty sure that
gtk.EventBox.set_visible_window(False) should work fine here.




Hmm, there is something I do not understand yet. If I set the 
visible_window to False the container can not handle the allocation 
anymore correctly and position the icons over each other - the (x,y) 
values are not handled anymore correctly, the icon itself is drawn, even 
without background.


I just tried it with a little test program with a custom container and 
with Gtk.Fixed with the same result for both.


Regards,
   Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 1/5] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Simon Schampijer
The icon consists of an GtkEventBox and an IconBuffer. The
GtkEventBox is a subclass of GtkBin which has its own window
and therefor is used to catch events for our IconBuffer
which does not have it's own window.

The EventIcon uses the CursorInvoker that has been introduced in
the GTK+ 3 toolkit to invoke a palette the same way as the
CanvasIcon did.

We keep the same API as with the CanvasIcon, only the 'size'
property is changed to be called 'pixel_size' in order to
make clearer which values it expects to be passed. We don't
expect a GtkIconSize to be passed here.

Another option would have been to put a SugarIcon inside a
a GtkEventBox and make the properties available through an
icon property but the API would have not been as nice and
logically it seems to make more sense to have the IconBuffer
being the base for both the SugarIcon and the SugarEventIcon.

This patch is highly based on the work from Walter Bender,
Daniel Drake and Raul Gutierrez Segales.

Signed-off-by: Simon Schampijer 
[moved from sugar-toolkit to sugar]
Signed-off-by: Sascha Silbe 

[1] http://developer.gnome.org/gtk/2.24/GtkEventBox.html
[2] 
http://developer.gnome.org/gtk/2.24/gtk-Themeable-Stock-Images.html#GtkIconSize
---
 src/jarabe/view/Makefile.am  |   1 +
 src/jarabe/view/eventicon.py | 277 +++
 2 files changed, 278 insertions(+)
 create mode 100644 src/jarabe/view/eventicon.py

diff --git a/src/jarabe/view/Makefile.am b/src/jarabe/view/Makefile.am
index 630f184..31ccfa4 100644
--- a/src/jarabe/view/Makefile.am
+++ b/src/jarabe/view/Makefile.am
@@ -4,6 +4,7 @@ sugar_PYTHON =  \
buddyicon.py\
buddymenu.py\
customizebundle.py  \
+   eventicon.py\
keyhandler.py   \
launcher.py \
palettes.py \
diff --git a/src/jarabe/view/eventicon.py b/src/jarabe/view/eventicon.py
new file mode 100644
index 000..4166798
--- /dev/null
+++ b/src/jarabe/view/eventicon.py
@@ -0,0 +1,277 @@
+# Copyright (C) 2012, One Laptop Per Child
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+import gobject
+import gtk
+
+from sugar.graphics import style
+from sugar.graphics.icon import _IconBuffer
+from sugar.graphics.palette import Palette
+from sugar.graphics.palettewindow import Invoker
+
+
+class CursorInvoker(Invoker):
+
+def __init__(self, parent=None):
+Invoker.__init__(self)
+
+self._position_hint = self.AT_CURSOR
+self._enter_hid = None
+self._leave_hid = None
+self._release_hid = None
+self._item = None
+
+if parent:
+self.attach(parent)
+
+def attach(self, parent):
+Invoker.attach(self, parent)
+
+self._item = parent
+self._enter_hid = self._item.connect('enter-notify-event',
+ self.__enter_notify_event_cb)
+self._leave_hid = self._item.connect('leave-notify-event',
+ self.__leave_notify_event_cb)
+self._release_hid = self._item.connect('button-release-event',
+   self.__button_release_event_cb)
+
+def detach(self):
+Invoker.detach(self)
+self._item.disconnect(self._enter_hid)
+self._item.disconnect(self._leave_hid)
+self._item.disconnect(self._release_hid)
+
+def get_default_position(self):
+return self.AT_CURSOR
+
+def get_rect(self):
+window = self._item.get_window()
+allocation = self._item.get_allocation()
+rect = Gdk.Rectangle()
+rect.x, rect.y = window.get_root_coords(allocation.x, allocation.y)
+rect.width = allocation.width
+rect.height = allocation.height
+return rect
+
+def __enter_notify_event_cb(self, button, event):
+self.notify_mouse_enter()
+return False
+
+def __leave_notify_event_cb(self, button, event):
+self.notify_mouse_leave()
+return False
+
+def __button_release_event_cb(self, button, event):
+if event.button == 3:
+self.notify_right_click()
+return True
+else:
+  

[Sugar-devel] [PATCH sugar 5/5] Drop unused intro.py

2012-08-06 Thread Simon Schampijer
From: Daniel Narvaez 

It was moved inside jarabe and ported to GTK+.

Signed-off-by: Daniel Narvaez 
Acked-by: Simon Schampijer 
---
 src/intro/intro.py | 271 -
 1 file changed, 271 deletions(-)
 delete mode 100644 src/intro/intro.py

diff --git a/src/intro/intro.py b/src/intro/intro.py
deleted file mode 100644
index 342ce1d..000
--- a/src/intro/intro.py
+++ /dev/null
@@ -1,271 +0,0 @@
-# Copyright (C) 2007, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-import os
-from gettext import gettext as _
-
-import gtk
-import gobject
-import hippo
-import logging
-
-from sugar import env
-from sugar.graphics import style
-from sugar.graphics.icon import Icon
-from sugar.graphics.entry import CanvasEntry
-from sugar.profile import get_profile
-
-import colorpicker
-
-_BACKGROUND_COLOR = style.COLOR_WHITE
-
-class _Page(hippo.CanvasBox):
-__gproperties__ = {
-'valid': (bool, None, None, False,
-  gobject.PARAM_READABLE)
-}
-
-def __init__(self, **kwargs):
-hippo.CanvasBox.__init__(self, **kwargs)
-self.valid = False
-
-def set_valid(self, valid):
-self.valid = valid
-self.notify('valid')
-
-def do_get_property(self, pspec):
-if pspec.name == 'valid':
-return self.valid
-
-def activate(self):
-pass
-
-class _NamePage(_Page):
-def __init__(self, intro):
-_Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,
-   background_color=_BACKGROUND_COLOR.get_int(),
-   spacing=style.DEFAULT_SPACING,
-   orientation=hippo.ORIENTATION_HORIZONTAL,)
-
-self._intro = intro
-
-label = hippo.CanvasText(text=_("Name:"))
-self.append(label)
-
-self._entry = CanvasEntry(box_width=style.zoom(300))
-self._entry.set_background(_BACKGROUND_COLOR.get_html())
-self._entry.connect('notify::text', self._text_changed_cb)
-
-widget = self._entry.props.widget
-widget.set_max_length(45)
-
-self.append(self._entry)
-
-if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
-self.reverse()
-
-def _text_changed_cb(self, entry, pspec):
-valid = len(entry.props.text.strip()) > 0
-self.set_valid(valid)
-
-def get_name(self):
-return self._entry.props.text
-
-def activate(self):
-self._entry.props.widget.grab_focus()
-
-class _ColorPage(_Page):
-def __init__(self, **kwargs):
-_Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,
-   background_color=_BACKGROUND_COLOR.get_int(),
-   spacing=style.DEFAULT_SPACING,
-   yalign=hippo.ALIGNMENT_CENTER, **kwargs)
-
-self._label = hippo.CanvasText(text=_("Click to change color:"),
-   xalign=hippo.ALIGNMENT_CENTER)
-self.append(self._label)
-
-self._cp = colorpicker.ColorPicker(xalign=hippo.ALIGNMENT_CENTER)
-self.append(self._cp)
-
-self._color = self._cp.get_color()
-self.set_valid(True)
-
-def get_color(self):
-return self._cp.get_color()
-
-class _IntroBox(hippo.CanvasBox):
-__gsignals__ = {
-'done': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT,
-   gobject.TYPE_PYOBJECT]))
-}
-
-PAGE_NAME = 0
-PAGE_COLOR = 1
-
-PAGE_FIRST = PAGE_NAME
-PAGE_LAST = PAGE_COLOR
-
-def __init__(self):
-hippo.CanvasBox.__init__(self, padding=style.zoom(30),
- background_color=_BACKGROUND_COLOR.get_int())
-
-self._page = self.PAGE_NAME
-self._name_page = _NamePage(self)
-self._color_page = _ColorPage()
-self._current_page = None
-self._next_button = None
-
-self._setup_page()
-
-def _setup_page(self):
-self.remove_all()
-
-if self._page == self.PAGE_NAME:
-self._current_page = self._name_page
-elif self._page == self.PAGE_COLOR:
-self._current_page = self._color_page
-
-self.append(self._current_page, hippo.PACK_EXPAND)
-
-button_box = hippo.CanvasBox

[Sugar-devel] [PATCH sugar 4/5] Remove hippo mentions

2012-08-06 Thread Simon Schampijer
From: Daniel Narvaez 

This is probably all very outdated anyway.

Signed-off-by: Daniel Narvaez 
Acked-by: Simon Schampijer 
---
 docs/controls.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs/controls.txt b/docs/controls.txt
index fa977ef..bfe9b78 100644
--- a/docs/controls.txt
+++ b/docs/controls.txt
@@ -26,7 +26,6 @@ gtk.Button
 
 sugar.Icon
 
-* Used in canvas-like views so probably an Hippo item.
 * Svg Only.
 * It should support xo colors easily.
 * Rollovers with a focus mark.
@@ -180,7 +179,7 @@ Palettes in ToolIconButton, IconButton
 * After a bigger delay, show the popup secondary state.
 * Could be animated.
 * Menu Items would go on the top and then the free-form rollover content.
-* The popup would be a gtk.Window that contains a Label, a MenuShell, an 
hippo.Canvas (or whatever) and finally a button bar (OK/Cancel).
+* The popup would be a gtk.Window that contains a Label, a MenuShell and 
finally a button bar (OK/Cancel).
 * The popup will have a setPrimaryState(label, accelerator) method. For action 
buttons would be a MenuItem, for the others would only be a Label.
 * The primary state should already have the same width as the secondary state 
and the expandable areas.
 * Primary states appear and disappear automatically (with a short delay). A 
click outside makes it disappear instantly.
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 2/5] ControlPanel AboutMe section: use the EventIcon from the shell

2012-08-06 Thread Simon Schampijer
We had a similar implmentation of the EventIcon in this section, now
we can reuse the one from the shell.

Signed-off-by: Simon Schampijer 
---
 extensions/cpsection/aboutme/view.py | 27 ---
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/extensions/cpsection/aboutme/view.py 
b/extensions/cpsection/aboutme/view.py
index 84daec7..ea7c7c8 100644
--- a/extensions/cpsection/aboutme/view.py
+++ b/extensions/cpsection/aboutme/view.py
@@ -19,12 +19,12 @@ import gtk
 import gobject
 from gettext import gettext as _
 
-from sugar.graphics.icon import Icon
 from sugar.graphics import style
 from sugar.graphics.xocolor import XoColor, colors
 
 from jarabe.controlpanel.sectionview import SectionView
 from jarabe.controlpanel.inlinealert import InlineAlert
+from jarabe.view.eventicon import EventIcon
 
 _STROKE_COLOR = 0
 _FILL_COLOR = 1
@@ -111,22 +111,6 @@ _NEXT_STROKE_COLOR = 3
 _PREVIOUS_STROKE_COLOR = 4
 
 
-class EventIcon(gtk.EventBox):
-__gtype_name__ = 'SugarEventIcon'
-
-def __init__(self, **kwargs):
-gtk.EventBox.__init__(self)
-
-self.icon = Icon(pixel_size=style.XLARGE_ICON_SIZE, **kwargs)
-
-self.set_visible_window(False)
-self.set_app_paintable(True)
-self.set_events(gtk.gdk.BUTTON_PRESS_MASK)
-
-self.add(self.icon)
-self.icon.show()
-
-
 class ColorPicker(EventIcon):
 __gsignals__ = {
 'color-changed': (gobject.SIGNAL_RUN_FIRST,
@@ -135,14 +119,11 @@ class ColorPicker(EventIcon):
 }
 
 def __init__(self, picker):
-EventIcon.__init__(self)
-
-self.icon.props.icon_name = 'computer-xo'
+EventIcon.__init__(self, icon_name='computer-xo',
+   pixel_size=style.XLARGE_ICON_SIZE)
 self._picker = picker
 self._color = None
 
-self.icon.props.pixel_size = style.XLARGE_ICON_SIZE
-
 self.connect('button_press_event', self.__pressed_cb, picker)
 
 def update(self, color):
@@ -156,7 +137,7 @@ class ColorPicker(EventIcon):
 self._color = XoColor(_get_next_stroke_color(color))
 else:
 self._color = color
-self.icon.props.xo_color = self._color
+self.props.xo_color = self._color
 
 def __pressed_cb(self, button, event, picker):
 if picker != _CURRENT_COLOR:
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 0/7] Remove last hippo occurrences from the shell (v2)

2012-08-06 Thread Simon Schampijer
This is a patch series to make the Sugar shell hippo free. Based on the
work that has been done in [1] and [2]. It incorporates the patch from
Sascha to move the EventIcon into the shell temporary. 

[1] http://git.sugarlabs.org/~erikos/sugar/erikos-shell-port
[2] http://git.sugarlabs.org/~erikos/sugar-toolkit/erikos-shell-port

Daniel Narvaez (3):
  Move SpreadLayout logic to favoriteslayout.py
  Remove hippo mentions
  Drop unused intro.py

Simon Schampijer (4):
  SugarEventIcon: Add a hippo-free implementation of the CanvasIcon
  ControlPanel AboutMe section: use the EventIcon from the shell
  Views: Replace the hippo based layout with one using GTK+ containers
  Journal: set white background in the ExpandedEntry of the Detail View

 docs/controls.txt |   3 +-
 extensions/cpsection/aboutme/view.py  |  27 +--
 src/intro/intro.py| 271 ---
 src/jarabe/desktop/Makefile.am|   4 +-
 src/jarabe/desktop/favoriteslayout.py | 390 +
 src/jarabe/desktop/favoritesview.py   | 398 --
 src/jarabe/desktop/friendview.py  |  31 +--
 src/jarabe/desktop/grid.py|   3 +
 src/jarabe/desktop/groupbox.py|  51 ++---
 src/jarabe/desktop/homebox.py |  22 +-
 src/jarabe/desktop/homewindow.py  |   2 +
 src/jarabe/desktop/meshbox.py | 119 +-
 src/jarabe/desktop/networkviews.py|  28 +--
 src/jarabe/desktop/snowflakelayout.py | 103 +
 src/jarabe/desktop/spreadlayout.py|  89 
 src/jarabe/desktop/transitionbox.py   |  50 +
 src/jarabe/journal/detailview.py  |  73 +++
 src/jarabe/journal/expandedentry.py   | 342 +
 src/jarabe/journal/keepicon.py|  61 +++---
 src/jarabe/journal/listview.py|  50 ++---
 src/jarabe/view/Makefile.am   |   1 +
 src/jarabe/view/buddyicon.py  |  10 +-
 src/jarabe/view/eventicon.py  | 277 +++
 src/jarabe/view/pulsingicon.py|  11 +-
 24 files changed, 1115 insertions(+), 1301 deletions(-)
 delete mode 100644 src/intro/intro.py
 delete mode 100644 src/jarabe/desktop/spreadlayout.py
 create mode 100644 src/jarabe/view/eventicon.py

-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 6/7] Remove hippo mentions

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

[docs/controls.txt]
> It is a spec. I would leave it and someone can look at updating it or 
> remove it. But has not to be decided in this patch series.

OK, let's just merge Daniel's patch as-is then:

Acked-by: Sascha Silbe 

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpvtkUi2Ou3L.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [sugar 0.98 PATCH] sl#1630, sl#3325: Support for mobile broadband provider database, plus ensure that all settings are persisted.

2012-08-06 Thread Ajay Garg
A yet another gentle reminder :D

Thanks and Regards,
Ajay


On Wed, Aug 1, 2012 at 1:44 AM, Ajay Garg  wrote:

> Hi all.
>
> Just a gentle reminder :)
> Or, at least a status update will be highly appreciated :)
>
> Thanks and Regards,
> Ajay
>
>
> On Sun, Jul 29, 2012 at 2:49 PM, Ajay Garg wrote:
>
>> Hi all.
>>
>> Kindly review the patch, so that progress may be made in pushing this :)
>>
>>
>> Thanks and Regards,
>> Ajay
>>
>>
>>
>> On Fri, Jul 20, 2012 at 5:02 PM, Ajay Garg wrote:
>>
>>>
>>> First of all, please note that the first, major part of adding the
>>> database support
>>> has been done by ::
>>>
>>>   Andres Ambrois 
>>>
>>> Details of Andres's work are present at
>>> http://bugs.sugarlabs.org/ticket/1630
>>>
>>>
>>>
>>> ===
>>>
>>>
>>> So, this patch ::
>>>
>>>a)
>>>Ports Andres's patch from Sugar-0.88 to Sugar-0.98.
>>>
>>>b)
>>>Adds the functionality, to keep the "Country, Provider, Plan" settings
>>>persisted as well.
>>>
>>>c)
>>>Also, some refactoring has been done, to avoid duplicate code as much
>>> as possible.
>>>
>>>
>>>
>>> 
>>>
>>>
>>> Other relevant literature/discussions/logs at ::
>>>
>>>a) Wiki Feature Page ::
>>>http://wiki.sugarlabs.org/go/Features/3G_Support/Database_Support
>>>
>>>b)
>>>Feature Design ML ::
>>>http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038429.html
>>>
>>>c)
>>>Brain-storming / Go-ahead meeting logs ::
>>>
>>> http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-07-18T15:00:17
>>>
>>>
>>>
>>> 
>>>
>>>
>>> This patch has been tested to work on NM 0.9.
>>>
>>> The 3G modem gets connected, only and only when the correct entries are
>>> entered
>>> (by choosing the correct plan, amongst the vast number of available
>>> plans).
>>>
>>>
>>>
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  .../cpsection/modemconfiguration/Makefile.am   |2 +
>>>  extensions/cpsection/modemconfiguration/config.py  |   25 +++
>>>  extensions/cpsection/modemconfiguration/model.py   |  163
>>> 
>>>  extensions/cpsection/modemconfiguration/view.py|  198
>>> +---
>>>  4 files changed, 365 insertions(+), 23 deletions(-)
>>>  create mode 100644 extensions/cpsection/modemconfiguration/config.py
>>>
>>> diff --git a/extensions/cpsection/modemconfiguration/Makefile.am
>>> b/extensions/cpsection/modemconfiguration/Makefile.am
>>> index 3e2613e..525e02e 100644
>>> --- a/extensions/cpsection/modemconfiguration/Makefile.am
>>> +++ b/extensions/cpsection/modemconfiguration/Makefile.am
>>> @@ -4,3 +4,5 @@ sugar_PYTHON =  \
>>> __init__.py \
>>> model.py\
>>> view.py
>>> +
>>> +nodist_sugar_PYTHON = config.py
>>> diff --git a/extensions/cpsection/modemconfiguration/config.py
>>> b/extensions/cpsection/modemconfiguration/config.py
>>> new file mode 100644
>>> index 000..963616d
>>> --- /dev/null
>>> +++ b/extensions/cpsection/modemconfiguration/config.py
>>> @@ -0,0 +1,25 @@
>>> +# -*- encoding: utf-8 -*-
>>> +# Copyright (C) 2010 Andres Ambrois
>>> +#
>>> +# This program is free software; you can redistribute it and/or modify
>>> +# it under the terms of the GNU General Public License as published by
>>> +# the Free Software Foundation; either version 2 of the License, or
>>> +# (at your option) any later version.
>>> +#
>>> +# This program is distributed in the hope that it will be useful,
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> +# GNU General Public License for more details.
>>> +#
>>> +# You should have received a copy of the GNU General Public License
>>> +# along with this program; if not, write to the Free Software
>>> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
>>>  US
>>> +
>>> +
>>> +PROVIDERS_PATH =
>>> "/usr/share/mobile-broadband-provider-info/serviceproviders.xml"
>>> +PROVIDERS_FORMAT_SUPPORTED = "2.0"
>>> +COUNTRY_CODES_PATH = "/usr/share/zoneinfo/iso3166.tab"
>>> +
>>> +GSM_COUNTRY_PATH = '/desktop/sugar/network/gsm/country'
>>> +GSM_PROVIDERS_PATH = '/desktop/sugar/network/gsm/providers'
>>> +GSM_PLAN_PATH = '/desktop/sugar/network/gsm/plan'
>>> diff --git a/extensions/cpsection/modemconfiguration/model.py
>>> b/extensions/cpsection/modemconfiguration/model.py
>>> index 969b5d9..2e4cd7d 100755
>>> --- a/extensions/cpsection/modemconfiguration/model.py
>>> +++ b/extensions/cpsection/modemconfiguration/model.py
>>> @@ -1,4 +1,8 @@
>>>  # Copyright (C) 2009 Paraguay Educa, Martin Abente
>>> +# Copyright (C) 2010 Andres Ambrois 
>>> +# Copyright (C) 2010 Anish Mangal   
>>> +# 

Re: [Sugar-devel] [PATCH sugar 7/7] Drop unused intro.py

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

[src/intro/intro.py]
> It has been moved a long time ago, outside this patch series. I guess 
> Daniel came across this when grepping for hippo.

OK. Please mention in the commit message that it has been unused since
1f91f7f7afd34143721ac66936546e950369.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpl3abz2jn0A.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 3/7] Views: Replace the hippo based layout with one using GTK+ containers

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

[...]
>  src/jarabe/desktop/transitionbox.py   |  50 +
>  src/jarabe/journal/detailview.py  |  73 +++
[...]

[src/jarabe/desktop/Makefile.am]
> @@ -15,4 +15,5 @@ sugar_PYTHON =  \
>  schoolserver.py  \
>   snowflakelayout.py  \
>   spreadlayout.py \
> - transitionbox.py
> + transitionbox.py\
> + viewcontainer.py

viewcontainer.py is missing from this patch. Noticed while trying to
test the series with Benjamin's suggested change.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpTwkWieR26n.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 0/7] Remove last hippo occurrences from the shell

2012-08-06 Thread Simon Schampijer

On 08/06/2012 02:18 PM, Sascha Silbe wrote:

Simon Schampijer  writes:


This is a patch series to make the Sugar shell hippo free. Based on the
work that has been done in [1] and [2]. It incorporates the patch from
Sascha to move the EventIcon into the shell temporary.

[...]

Thanks for the patch series and especially for the detailed
descriptions, they are rather helpful!

One thing I noticed while working on the UI tests (or rather the
prerequisite, making Sugar "accessible"): The Owner Icon is the _last_
entry in the list, at least for the Home View. Can we make it the first
one instead (without going to great lengths)?

With the version I tested, there was also some issue with positioning;
IIRC the Owner Icon was off-center. Has this been fixed? Are there any
(other) known bugs?

I've discussed the approach for both the hippo removal series and the
GTK3 port with a couple of community members over the past few weeks and
we agreed that we should focus on the architecture (i.e. external API,
internal API, interactions with other components / APIs) and work
towards merging the patches sooner rather than later. We fully expect
there to be major bugs, but by merging early we enable a) widespread
manual testing and b) development of automated UI tests that can verify
the GTK3 port against the current behaviour of the GTK2 version. Unless
we can't solve a number of technical issues [1] with accessibility
support, my plan would be to do things in this order:

1. Merge hippo removal patch series.
2. Finish and merge accessibility patch series. It should be complete
enough to test all major parts of the UI. Accessibility support for
humans (e.g. using screen readers) is only a side effect at this
stage, not a goal. Help with this effort (especially fixing the
current blockers [1]) would be quite appreciated.


Is there a branch to look at the scope of this work? What is the 
timeframe for this? Do you have some more background info on the 
subject, e.g. a Feature page.


Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 0/7] Remove last hippo occurrences from the shell

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> This is a patch series to make the Sugar shell hippo free. Based on the
> work that has been done in [1] and [2]. It incorporates the patch from
> Sascha to move the EventIcon into the shell temporary. 
[...]

Thanks for the patch series and especially for the detailed
descriptions, they are rather helpful!

One thing I noticed while working on the UI tests (or rather the
prerequisite, making Sugar "accessible"): The Owner Icon is the _last_
entry in the list, at least for the Home View. Can we make it the first
one instead (without going to great lengths)?

With the version I tested, there was also some issue with positioning;
IIRC the Owner Icon was off-center. Has this been fixed? Are there any
(other) known bugs?

I've discussed the approach for both the hippo removal series and the
GTK3 port with a couple of community members over the past few weeks and
we agreed that we should focus on the architecture (i.e. external API,
internal API, interactions with other components / APIs) and work
towards merging the patches sooner rather than later. We fully expect
there to be major bugs, but by merging early we enable a) widespread
manual testing and b) development of automated UI tests that can verify
the GTK3 port against the current behaviour of the GTK2 version. Unless
we can't solve a number of technical issues [1] with accessibility
support, my plan would be to do things in this order:

1. Merge hippo removal patch series.
2. Finish and merge accessibility patch series. It should be complete
   enough to test all major parts of the UI. Accessibility support for
   humans (e.g. using screen readers) is only a side effect at this
   stage, not a goal. Help with this effort (especially fixing the
   current blockers [1]) would be quite appreciated.
3a. Develop a UI test suite based on the latest GTK2 version of Sugar.
3b. Finish and merge GTK3 port.

3a. and 3b. can happen in parallel.

Caspar and me would still review the patches and make a couple of
suggestions where the patches can be _easily_ improved, but in general
we'd focus on the interfaces rather than the implementation.

Would that work for you?

Sascha

[1] message-id:toeehnrlhad@twin.sascha.silbe.org

https://mail.gnome.org/archives/gnome-accessibility-list/2012-July/msg00029.html
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpU3QHJvpLsY.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Benjamin Berg
Hi,

On Mon, 2012-08-06 at 12:04 +0200, Simon Schampijer wrote:
> Signed-off-by: Simon Schampijer 
> [moved from sugar-toolkit to sugar]
> Signed-off-by: Sascha Silbe 
Reviewed-by: Benjamin Berg 

> +def __init__(self, **kwargs):
> +self._buffer = _IconBuffer()
> +self._alpha = 1.0
> +
> +gtk.EventBox.__init__(self)
> +for key, value in kwargs.iteritems():
> +self.set_property(key, value)
> +
> +self._palette_invoker = CursorInvoker()
> +self._palette_invoker.attach(self)
> +
> +# HACK to supress the grey background around the icon
> +# won't be needed in GTK3
> +self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())

Not really too bad, but I am pretty sure that
gtk.EventBox.set_visible_window(False) should work fine here.

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 6/7] Remove hippo mentions

2012-08-06 Thread Simon Schampijer

On 08/06/2012 01:32 PM, Sascha Silbe wrote:

Simon Schampijer  writes:


From: Daniel Narvaez 

This is probably all very outdated anyway.


It's not even clear to me what the file is about. Is it a TODO list, a
specification, documentation of current behaviour, ...? So +1 from me
for simply dropping the file.

In case we decide to keep the file for some reason:

Acked-by: Sascha Silbe 

Sascha



It is a spec. I would leave it and someone can look at updating it or 
remove it. But has not to be decided in this patch series.


Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 5/7] Move SpreadLayout logic to favoriteslayout.py

2012-08-06 Thread Simon Schampijer

On 08/06/2012 01:38 PM, Sascha Silbe wrote:

Simon Schampijer  writes:


From: Daniel Narvaez 

The SpreadLayout derives now from the ViewLayout. The ViewLayout
has a grid by default and the allocation happens here as well.


I don't see any code moves in this patch, just removal. Like for "Drop
unused intro.py" (7/7), the removal should happen in the same patch that
adds the codes elsewhere, so that we can follow the code movement.

Sascha



Ok, can be be squashed as well into:

"[PATCH sugar 3/7] Views: Replace the hippo based layout with one using 
GTK+ containers"


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 7/7] Drop unused intro.py

2012-08-06 Thread Simon Schampijer

On 08/06/2012 01:35 PM, Sascha Silbe wrote:

Simon Schampijer  writes:


From: Daniel Narvaez 

It was moved inside jarabe and ported to GTK+.


This file should be removed in the same patch that added the code to
jarabe, so that the code movement can easily be tracked and the actual
code changes be examined.

Sascha


It has been moved a long time ago, outside this patch series. I guess 
Daniel came across this when grepping for hippo.


Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 5/7] Move SpreadLayout logic to favoriteslayout.py

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> From: Daniel Narvaez 
>
> The SpreadLayout derives now from the ViewLayout. The ViewLayout
> has a grid by default and the allocation happens here as well.

I don't see any code moves in this patch, just removal. Like for "Drop
unused intro.py" (7/7), the removal should happen in the same patch that
adds the codes elsewhere, so that we can follow the code movement.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgprMBvUnksFQ.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 7/7] Drop unused intro.py

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> From: Daniel Narvaez 
>
> It was moved inside jarabe and ported to GTK+.

This file should be removed in the same patch that added the code to
jarabe, so that the code movement can easily be tracked and the actual
code changes be examined.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpdiSSh9Q9Z2.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 4/7] Journal: set white background in the ExpandedEntry of the Detail View

2012-08-06 Thread Simon Schampijer

On 08/06/2012 01:17 PM, Sascha Silbe wrote:

Simon Schampijer  writes:


Change the ExpandedEntry class to subclass gtk.EventBox because the
gtk.VBox doesn't have a gtk.gdk.Window associated and the background
can't be set otherwise.


Is this a bug affecting current mainline master or is it a result of
applying one of the other patches in this series? If the latter, please
include a reference to the patch that changes the behaviour and if
possible a reason for the breakage (i.e. why did it work before the
patch, but not afterwards?). Depending on the details, it may even make
sense to just squash these changes into the patch that changes the
behaviour.


Can be squashed into:

"[PATCH sugar 3/7] Views: Replace the hippo based layout with one using 
GTK+ containers"


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 6/7] Remove hippo mentions

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> From: Daniel Narvaez 
>
> This is probably all very outdated anyway.

It's not even clear to me what the file is about. Is it a TODO list, a
specification, documentation of current behaviour, ...? So +1 from me
for simply dropping the file.

In case we decide to keep the file for some reason:

Acked-by: Sascha Silbe 

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpvzWTpZ4aUc.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 2/7] ControlPanel AboutMe section: use the EventIcon from the shell

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> We had a similar implmentation of the EventIcon in this section, now
> we can reuse the one from the shell.

Once the EventIcon patch has been merged:

Acked-by: Sascha Silbe 

Thanks for the clean-up!

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgppUjK8I4xx5.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> The icon consists of an GtkEventBox and an IconBuffer. The
> GtkEventBox is a subclass of GtkBin which has its own window
> and therefor is used to catch events for our IconBuffer
> which does not have it's own window.
[...]

This is fine from my side, but as discussed during the Development Team
meeting a few weeks ago, I'd like Benjamin (CC'ed) to have a look at it
to make sure there are no (obvious) problems with the approach that will
cause significant trouble further down the road.

If Benjamin doesn't have time to do the review, I'll just accept the
patch as-is.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpUOOSkaLM6z.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar 4/7] Journal: set white background in the ExpandedEntry of the Detail View

2012-08-06 Thread Sascha Silbe
Simon Schampijer  writes:

> Change the ExpandedEntry class to subclass gtk.EventBox because the
> gtk.VBox doesn't have a gtk.gdk.Window associated and the background
> can't be set otherwise.

Is this a bug affecting current mainline master or is it a result of
applying one of the other patches in this series? If the latter, please
include a reference to the patch that changes the behaviour and if
possible a reason for the breakage (i.e. why did it work before the
patch, but not afterwards?). Depending on the details, it may even make
sense to just squash these changes into the patch that changes the
behaviour.


> Acked-by: Simon Schampijer 

Please use Reviewed-By: instead of Acked-by: when posting patches on
sugar-devel. Ack'ing should be the result of the public peer review, not
done beforehand in private. The review itself is rather welcome, of
course.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpXIUwyCC88Y.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 7/7] Drop unused intro.py

2012-08-06 Thread Simon Schampijer
From: Daniel Narvaez 

It was moved inside jarabe and ported to GTK+.

Signed-off-by: Daniel Narvaez 
Acked-by: Simon Schampijer 
---
 src/intro/intro.py | 271 -
 1 file changed, 271 deletions(-)
 delete mode 100644 src/intro/intro.py

diff --git a/src/intro/intro.py b/src/intro/intro.py
deleted file mode 100644
index 342ce1d..000
--- a/src/intro/intro.py
+++ /dev/null
@@ -1,271 +0,0 @@
-# Copyright (C) 2007, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-import os
-from gettext import gettext as _
-
-import gtk
-import gobject
-import hippo
-import logging
-
-from sugar import env
-from sugar.graphics import style
-from sugar.graphics.icon import Icon
-from sugar.graphics.entry import CanvasEntry
-from sugar.profile import get_profile
-
-import colorpicker
-
-_BACKGROUND_COLOR = style.COLOR_WHITE
-
-class _Page(hippo.CanvasBox):
-__gproperties__ = {
-'valid': (bool, None, None, False,
-  gobject.PARAM_READABLE)
-}
-
-def __init__(self, **kwargs):
-hippo.CanvasBox.__init__(self, **kwargs)
-self.valid = False
-
-def set_valid(self, valid):
-self.valid = valid
-self.notify('valid')
-
-def do_get_property(self, pspec):
-if pspec.name == 'valid':
-return self.valid
-
-def activate(self):
-pass
-
-class _NamePage(_Page):
-def __init__(self, intro):
-_Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,
-   background_color=_BACKGROUND_COLOR.get_int(),
-   spacing=style.DEFAULT_SPACING,
-   orientation=hippo.ORIENTATION_HORIZONTAL,)
-
-self._intro = intro
-
-label = hippo.CanvasText(text=_("Name:"))
-self.append(label)
-
-self._entry = CanvasEntry(box_width=style.zoom(300))
-self._entry.set_background(_BACKGROUND_COLOR.get_html())
-self._entry.connect('notify::text', self._text_changed_cb)
-
-widget = self._entry.props.widget
-widget.set_max_length(45)
-
-self.append(self._entry)
-
-if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
-self.reverse()
-
-def _text_changed_cb(self, entry, pspec):
-valid = len(entry.props.text.strip()) > 0
-self.set_valid(valid)
-
-def get_name(self):
-return self._entry.props.text
-
-def activate(self):
-self._entry.props.widget.grab_focus()
-
-class _ColorPage(_Page):
-def __init__(self, **kwargs):
-_Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,
-   background_color=_BACKGROUND_COLOR.get_int(),
-   spacing=style.DEFAULT_SPACING,
-   yalign=hippo.ALIGNMENT_CENTER, **kwargs)
-
-self._label = hippo.CanvasText(text=_("Click to change color:"),
-   xalign=hippo.ALIGNMENT_CENTER)
-self.append(self._label)
-
-self._cp = colorpicker.ColorPicker(xalign=hippo.ALIGNMENT_CENTER)
-self.append(self._cp)
-
-self._color = self._cp.get_color()
-self.set_valid(True)
-
-def get_color(self):
-return self._cp.get_color()
-
-class _IntroBox(hippo.CanvasBox):
-__gsignals__ = {
-'done': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT,
-   gobject.TYPE_PYOBJECT]))
-}
-
-PAGE_NAME = 0
-PAGE_COLOR = 1
-
-PAGE_FIRST = PAGE_NAME
-PAGE_LAST = PAGE_COLOR
-
-def __init__(self):
-hippo.CanvasBox.__init__(self, padding=style.zoom(30),
- background_color=_BACKGROUND_COLOR.get_int())
-
-self._page = self.PAGE_NAME
-self._name_page = _NamePage(self)
-self._color_page = _ColorPage()
-self._current_page = None
-self._next_button = None
-
-self._setup_page()
-
-def _setup_page(self):
-self.remove_all()
-
-if self._page == self.PAGE_NAME:
-self._current_page = self._name_page
-elif self._page == self.PAGE_COLOR:
-self._current_page = self._color_page
-
-self.append(self._current_page, hippo.PACK_EXPAND)
-
-button_box = hippo.CanvasBox

[Sugar-devel] [PATCH sugar 6/7] Remove hippo mentions

2012-08-06 Thread Simon Schampijer
From: Daniel Narvaez 

This is probably all very outdated anyway.

Signed-off-by: Daniel Narvaez 
Acked-by: Simon Schampijer 
---
 docs/controls.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs/controls.txt b/docs/controls.txt
index fa977ef..bfe9b78 100644
--- a/docs/controls.txt
+++ b/docs/controls.txt
@@ -26,7 +26,6 @@ gtk.Button
 
 sugar.Icon
 
-* Used in canvas-like views so probably an Hippo item.
 * Svg Only.
 * It should support xo colors easily.
 * Rollovers with a focus mark.
@@ -180,7 +179,7 @@ Palettes in ToolIconButton, IconButton
 * After a bigger delay, show the popup secondary state.
 * Could be animated.
 * Menu Items would go on the top and then the free-form rollover content.
-* The popup would be a gtk.Window that contains a Label, a MenuShell, an 
hippo.Canvas (or whatever) and finally a button bar (OK/Cancel).
+* The popup would be a gtk.Window that contains a Label, a MenuShell and 
finally a button bar (OK/Cancel).
 * The popup will have a setPrimaryState(label, accelerator) method. For action 
buttons would be a MenuItem, for the others would only be a Label.
 * The primary state should already have the same width as the secondary state 
and the expandable areas.
 * Primary states appear and disappear automatically (with a short delay). A 
click outside makes it disappear instantly.
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

2012-08-06 Thread Simon Schampijer
The icon consists of an GtkEventBox and an IconBuffer. The
GtkEventBox is a subclass of GtkBin which has its own window
and therefor is used to catch events for our IconBuffer
which does not have it's own window.

The EventIcon uses the CursorInvoker that has been introduced in
the GTK+ 3 toolkit to invoke a palette the same way as the
CanvasIcon did.

We keep the same API as with the CanvasIcon, only the 'size'
property is changed to be called 'pixel_size' in order to
make clearer which values it expects to be passed. We don't
expect a GtkIconSize to be passed here.

Another option would have been to put a SugarIcon inside a
a GtkEventBox and make the properties available through an
icon property but the API would have not been as nice and
logically it seems to make more sense to have the IconBuffer
being the base for both the SugarIcon and the SugarEventIcon.

This patch is highly based on the work from Walter Bender,
Daniel Drake and Raul Gutierrez Segales.

Signed-off-by: Simon Schampijer 
[moved from sugar-toolkit to sugar]
Signed-off-by: Sascha Silbe 

[1] http://developer.gnome.org/gtk/2.24/GtkEventBox.html
[2] 
http://developer.gnome.org/gtk/2.24/gtk-Themeable-Stock-Images.html#GtkIconSize
---
 src/jarabe/view/Makefile.am  |   1 +
 src/jarabe/view/eventicon.py | 277 +++
 2 files changed, 278 insertions(+)
 create mode 100644 src/jarabe/view/eventicon.py

diff --git a/src/jarabe/view/Makefile.am b/src/jarabe/view/Makefile.am
index 630f184..31ccfa4 100644
--- a/src/jarabe/view/Makefile.am
+++ b/src/jarabe/view/Makefile.am
@@ -4,6 +4,7 @@ sugar_PYTHON =  \
buddyicon.py\
buddymenu.py\
customizebundle.py  \
+   eventicon.py\
keyhandler.py   \
launcher.py \
palettes.py \
diff --git a/src/jarabe/view/eventicon.py b/src/jarabe/view/eventicon.py
new file mode 100644
index 000..4166798
--- /dev/null
+++ b/src/jarabe/view/eventicon.py
@@ -0,0 +1,277 @@
+# Copyright (C) 2012, One Laptop Per Child
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+import gobject
+import gtk
+
+from sugar.graphics import style
+from sugar.graphics.icon import _IconBuffer
+from sugar.graphics.palette import Palette
+from sugar.graphics.palettewindow import Invoker
+
+
+class CursorInvoker(Invoker):
+
+def __init__(self, parent=None):
+Invoker.__init__(self)
+
+self._position_hint = self.AT_CURSOR
+self._enter_hid = None
+self._leave_hid = None
+self._release_hid = None
+self._item = None
+
+if parent:
+self.attach(parent)
+
+def attach(self, parent):
+Invoker.attach(self, parent)
+
+self._item = parent
+self._enter_hid = self._item.connect('enter-notify-event',
+ self.__enter_notify_event_cb)
+self._leave_hid = self._item.connect('leave-notify-event',
+ self.__leave_notify_event_cb)
+self._release_hid = self._item.connect('button-release-event',
+   self.__button_release_event_cb)
+
+def detach(self):
+Invoker.detach(self)
+self._item.disconnect(self._enter_hid)
+self._item.disconnect(self._leave_hid)
+self._item.disconnect(self._release_hid)
+
+def get_default_position(self):
+return self.AT_CURSOR
+
+def get_rect(self):
+window = self._item.get_window()
+allocation = self._item.get_allocation()
+rect = Gdk.Rectangle()
+rect.x, rect.y = window.get_root_coords(allocation.x, allocation.y)
+rect.width = allocation.width
+rect.height = allocation.height
+return rect
+
+def __enter_notify_event_cb(self, button, event):
+self.notify_mouse_enter()
+return False
+
+def __leave_notify_event_cb(self, button, event):
+self.notify_mouse_leave()
+return False
+
+def __button_release_event_cb(self, button, event):
+if event.button == 3:
+self.notify_right_click()
+return True
+else:
+  

[Sugar-devel] [PATCH sugar 2/7] ControlPanel AboutMe section: use the EventIcon from the shell

2012-08-06 Thread Simon Schampijer
We had a similar implmentation of the EventIcon in this section, now
we can reuse the one from the shell.

Signed-off-by: Simon Schampijer 
---
 extensions/cpsection/aboutme/view.py | 27 ---
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/extensions/cpsection/aboutme/view.py 
b/extensions/cpsection/aboutme/view.py
index 84daec7..ea7c7c8 100644
--- a/extensions/cpsection/aboutme/view.py
+++ b/extensions/cpsection/aboutme/view.py
@@ -19,12 +19,12 @@ import gtk
 import gobject
 from gettext import gettext as _
 
-from sugar.graphics.icon import Icon
 from sugar.graphics import style
 from sugar.graphics.xocolor import XoColor, colors
 
 from jarabe.controlpanel.sectionview import SectionView
 from jarabe.controlpanel.inlinealert import InlineAlert
+from jarabe.view.eventicon import EventIcon
 
 _STROKE_COLOR = 0
 _FILL_COLOR = 1
@@ -111,22 +111,6 @@ _NEXT_STROKE_COLOR = 3
 _PREVIOUS_STROKE_COLOR = 4
 
 
-class EventIcon(gtk.EventBox):
-__gtype_name__ = 'SugarEventIcon'
-
-def __init__(self, **kwargs):
-gtk.EventBox.__init__(self)
-
-self.icon = Icon(pixel_size=style.XLARGE_ICON_SIZE, **kwargs)
-
-self.set_visible_window(False)
-self.set_app_paintable(True)
-self.set_events(gtk.gdk.BUTTON_PRESS_MASK)
-
-self.add(self.icon)
-self.icon.show()
-
-
 class ColorPicker(EventIcon):
 __gsignals__ = {
 'color-changed': (gobject.SIGNAL_RUN_FIRST,
@@ -135,14 +119,11 @@ class ColorPicker(EventIcon):
 }
 
 def __init__(self, picker):
-EventIcon.__init__(self)
-
-self.icon.props.icon_name = 'computer-xo'
+EventIcon.__init__(self, icon_name='computer-xo',
+   pixel_size=style.XLARGE_ICON_SIZE)
 self._picker = picker
 self._color = None
 
-self.icon.props.pixel_size = style.XLARGE_ICON_SIZE
-
 self.connect('button_press_event', self.__pressed_cb, picker)
 
 def update(self, color):
@@ -156,7 +137,7 @@ class ColorPicker(EventIcon):
 self._color = XoColor(_get_next_stroke_color(color))
 else:
 self._color = color
-self.icon.props.xo_color = self._color
+self.props.xo_color = self._color
 
 def __pressed_cb(self, button, event, picker):
 if picker != _CURRENT_COLOR:
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 5/7] Move SpreadLayout logic to favoriteslayout.py

2012-08-06 Thread Simon Schampijer
From: Daniel Narvaez 

The SpreadLayout derives now from the ViewLayout. The ViewLayout
has a grid by default and the allocation happens here as well.

Signed-off-by: Daniel Narvaez 
Acked-by: Simon Schampijer 
---
 src/jarabe/desktop/Makefile.am |  1 -
 src/jarabe/desktop/spreadlayout.py | 89 --
 2 files changed, 90 deletions(-)
 delete mode 100644 src/jarabe/desktop/spreadlayout.py

diff --git a/src/jarabe/desktop/Makefile.am b/src/jarabe/desktop/Makefile.am
index 9e928e2..b36404e 100644
--- a/src/jarabe/desktop/Makefile.am
+++ b/src/jarabe/desktop/Makefile.am
@@ -14,6 +14,5 @@ sugar_PYTHON =\
networkviews.py \
 schoolserver.py\
snowflakelayout.py  \
-   spreadlayout.py \
transitionbox.py\
viewcontainer.py
diff --git a/src/jarabe/desktop/spreadlayout.py 
b/src/jarabe/desktop/spreadlayout.py
deleted file mode 100644
index b5c623e..000
--- a/src/jarabe/desktop/spreadlayout.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (C) 2007 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-import math
-
-import hippo
-import gobject
-import gtk
-
-from sugar.graphics import style
-
-from jarabe.desktop.grid import Grid
-
-
-_CELL_SIZE = 4.0
-
-
-class SpreadLayout(gobject.GObject, hippo.CanvasLayout):
-__gtype_name__ = 'SugarSpreadLayout'
-
-def __init__(self):
-gobject.GObject.__init__(self)
-self._box = None
-
-min_width, width = self.do_get_width_request()
-min_height, height = self.do_get_height_request(width)
-
-self._grid = Grid(int(width / _CELL_SIZE), int(height / _CELL_SIZE))
-self._grid.connect('child-changed', self._grid_child_changed_cb)
-
-def add(self, child):
-self._box.append(child)
-
-width, height = self._get_child_grid_size(child)
-self._grid.add(child, width, height)
-
-def remove(self, child):
-self._grid.remove(child)
-self._box.remove(child)
-
-def move(self, child, x, y):
-self._grid.move(child, x / _CELL_SIZE, y / _CELL_SIZE, locked=True)
-
-def do_set_box(self, box):
-self._box = box
-
-def do_get_height_request(self, for_width):
-return 0, gtk.gdk.screen_height() - style.GRID_CELL_SIZE
-
-def do_get_width_request(self):
-return 0, gtk.gdk.screen_width()
-
-def do_allocate(self, x, y, width, height,
-req_width, req_height, origin_changed):
-for child in self._box.get_layout_children():
-# We need to always get  requests to not confuse hippo
-min_w, child_width = child.get_width_request()
-min_h, child_height = child.get_height_request(child_width)
-
-rect = self._grid.get_child_rect(child.item)
-child.allocate(int(round(rect.x * _CELL_SIZE)),
-   int(round(rect.y * _CELL_SIZE)),
-   child_width,
-   child_height,
-   origin_changed)
-
-def _get_child_grid_size(self, child):
-min_width, width = child.get_width_request()
-min_height, height = child.get_height_request(width)
-width = math.ceil(width / _CELL_SIZE)
-height = math.ceil(height / _CELL_SIZE)
-
-return int(width), int(height)
-
-def _grid_child_changed_cb(self, grid, child):
-child.emit_request_changed()
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 4/7] Journal: set white background in the ExpandedEntry of the Detail View

2012-08-06 Thread Simon Schampijer
Change the ExpandedEntry class to subclass gtk.EventBox because the
gtk.VBox doesn't have a gtk.gdk.Window associated and the background
can't be set otherwise.

Signed-off-by: Manuel QuiƱones 
Acked-by: Simon Schampijer 
---
 src/jarabe/journal/expandedentry.py | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/jarabe/journal/expandedentry.py 
b/src/jarabe/journal/expandedentry.py
index c2cd3b2..e0c603f 100644
--- a/src/jarabe/journal/expandedentry.py
+++ b/src/jarabe/journal/expandedentry.py
@@ -58,22 +58,26 @@ class BuddyList(gtk.Alignment):
 self.add(hbox)
 
 
-class ExpandedEntry(gtk.VBox):
+class ExpandedEntry(gtk.EventBox):
 def __init__(self):
-gtk.VBox.__init__(self)
+gtk.EventBox.__init__(self)
+self._vbox = gtk.VBox()
+self.add(self._vbox)
 
 self._metadata = None
 self._update_title_sid = None
 
+self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
+
 # Create a header
 header = gtk.HBox()
-self.pack_start(header, False, False, style.DEFAULT_SPACING * 2)
+self._vbox.pack_start(header, False, False, style.DEFAULT_SPACING * 2)
 
 # Create a two-column body
 body_box = gtk.EventBox()
 body_box.set_border_width(style.DEFAULT_SPACING)
 body_box.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
-self.pack_start(body_box)
+self._vbox.pack_start(body_box)
 body = gtk.HBox()
 body_box.add(body)
 
@@ -149,8 +153,10 @@ class ExpandedEntry(gtk.VBox):
 self._buddy_list.pack_start(self._create_buddy_list(), False, False,
 style.DEFAULT_SPACING)
 
-self._description.get_buffer().set_text(metadata.get('description', 
''))
-self._tags.get_buffer().set_text(metadata.get('tags', ''))
+description = metadata.get('description', '')
+self._description.get_buffer().set_text(description)
+tags = metadata.get('tags', '')
+self._tags.get_buffer().set_text(tags)
 
 def _create_keep_icon(self):
 keep_icon = KeepIcon()
-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar 0/7] Remove last hippo occurrences from the shell

2012-08-06 Thread Simon Schampijer
This is a patch series to make the Sugar shell hippo free. Based on the
work that has been done in [1] and [2]. It incorporates the patch from
Sascha to move the EventIcon into the shell temporary. 

[1] http://git.sugarlabs.org/~erikos/sugar/erikos-shell-port
[2] http://git.sugarlabs.org/~erikos/sugar-toolkit/erikos-shell-port

Daniel Narvaez (3):
  Move SpreadLayout logic to favoriteslayout.py
  Remove hippo mentions
  Drop unused intro.py

Simon Schampijer (4):
  SugarEventIcon: Add a hippo-free implementation of the CanvasIcon
  ControlPanel AboutMe section: use the EventIcon from the shell
  Views: Replace the hippo based layout with one using GTK+ containers
  Journal: set white background in the ExpandedEntry of the Detail View

 docs/controls.txt |   3 +-
 extensions/cpsection/aboutme/view.py  |  27 +--
 src/intro/intro.py| 271 ---
 src/jarabe/desktop/Makefile.am|   4 +-
 src/jarabe/desktop/favoriteslayout.py | 390 +
 src/jarabe/desktop/favoritesview.py   | 398 --
 src/jarabe/desktop/friendview.py  |  31 +--
 src/jarabe/desktop/grid.py|   3 +
 src/jarabe/desktop/groupbox.py|  51 ++---
 src/jarabe/desktop/homebox.py |  22 +-
 src/jarabe/desktop/homewindow.py  |   2 +
 src/jarabe/desktop/meshbox.py | 119 +-
 src/jarabe/desktop/networkviews.py|  28 +--
 src/jarabe/desktop/snowflakelayout.py | 103 +
 src/jarabe/desktop/spreadlayout.py|  89 
 src/jarabe/desktop/transitionbox.py   |  50 +
 src/jarabe/journal/detailview.py  |  73 +++
 src/jarabe/journal/expandedentry.py   | 342 +
 src/jarabe/journal/keepicon.py|  61 +++---
 src/jarabe/journal/listview.py|  50 ++---
 src/jarabe/view/Makefile.am   |   1 +
 src/jarabe/view/buddyicon.py  |  10 +-
 src/jarabe/view/eventicon.py  | 277 +++
 src/jarabe/view/pulsingicon.py|  11 +-
 24 files changed, 1115 insertions(+), 1301 deletions(-)
 delete mode 100644 src/intro/intro.py
 delete mode 100644 src/jarabe/desktop/spreadlayout.py
 create mode 100644 src/jarabe/view/eventicon.py

-- 
1.7.11.2

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] How to have "CellRenderer.props" take effect, without a UI refresh?

2012-08-06 Thread Ajay Garg
Hi all.

The issue has been solved !! :)

The patch link ::
http://git.sugarlabs.org/dextrose/mainline/commit/381e706de7e7309d27a44ed064794a44d50aad4a


Thanks for everyone's help.


Thanks and Regards,
Ajay


On Wed, Aug 1, 2012 at 1:33 PM, Ajay Garg  wrote:

> Thanks Sascha and Flavio.
>
>
> a)
> I modified the code to ::
>
>
>
> 
> def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):
> favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]
>
> if favorite:
> client = gconf.client_get_default()
> color = XoColor(client.get_string('/desktop/sugar/user/color'))
> cell.props.xo_color = color
> else:
> cell.props.xo_color = None
>
>
> .get_property('window').invalidate_rect(.get_allocation(), False)
> .get_property('window').process_updates(True)
>
> 
>
> where I tried with values of  to ::
>
>   *  self
>   *  self.tree_view
>
> However, it made no difference.
>
>
>
>
> b)
> I modified the code to ::
>
>
>
> 
> def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):
> favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]
>
> if favorite:
> client = gconf.client_get_default()
> color = XoColor(client.get_string('/desktop/sugar/user/color'))
> cell.props.xo_color = color
> else:
> cell.props.xo_color = None
>
>
> .get_property('window').invalidate_rect(.get_allocation(), True)
> .get_property('window').process_updates(True)
>
> 
>
> where I tried with values of  to ::
>
>   *  self
>   *  self.tree_view
>
> However, it caused an infinite recursive loop, and the journal never
> loaded.
>
>
>
>
> c)
> I modified the code to ::
>
>
>
> 
> def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):
> favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]
>
> if favorite:
> client = gconf.client_get_default()
> color = XoColor(client.get_string('/desktop/sugar/user/color'))
> cell.props.xo_color = color
> else:
> cell.props.xo_color = None
>
>
> .get_property('window').invalidate_rect(.get_allocation(), False)
> .get_property('window').process_updates(True)
>
> 
>
> where I tried with values of  to ::
>
>   *  column
>   *  cell
>
> However, it caused the following traceback ::
>
> Traceback (most recent call last):
>   File
> "/home/ajay/sugar-jhbuild-dx3/install/lib/python2.7/site-packages/jarabe/journal/listview.py",
> line 329, in __favorite_set_data_cb
> column.get_property('window').invalidate_rect(column.get_allocation(),
> False)
> TypeError: object of type `GtkTreeViewColumn' does not have property
> `window'
>
>
>
>
> d)
> I modified the code to ::
>
>
>
> 
> def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):
> favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]
>
> if favorite:
> client = gconf.client_get_default()
> color = XoColor(client.get_string('/desktop/sugar/user/color'))
> cell.props.xo_color = color
> else:
> cell.props.xo_color = None
>
>
> .get_property('window').invalidate_rect(.get_allocation(), True)
> .get_property('window').process_updates(True)
>
> 
>
> where I tried with values of  to ::
>
>   *  column
>   *  cell
>
> Same as before - it caused the following traceback ::
>
> Traceback (most recent call last):
>   File
> "/home/ajay/sugar-jhbuild-dx3/install/lib/python2.7/site-packages/jarabe/journal/listview.py",
> line 329, in __favorite_set_data_cb
> column.get_property('window').invalidate_rect(column.get_allocation(),
> False)
> TypeError: object of type `GtkTreeViewColumn' does not have property
> `window'
>
>
>
> :-\
>
>
>
> Regards,
> Ajay
>
>
>
>
>
> On Tue, Jul 31, 2012 at 7:07 AM, Flavio Danesse wrote:
>
>> self.get_property('window').invalidate_rect(self.get_allocation(), True)
>> self.get_property('window').process_updates(True)
>>
>>
>>
>>
>> 2012/7/30 Sascha Silbe 
>>
>>>  Ajay Garg  writes:
>>>
>>>

Re: [Sugar-devel] [DESIGN] Proposal: Multi-Selection and Batch Operations on Journal entries

2012-08-06 Thread Ajay Garg
Hi Gary.

Finally... the checkbox-issue has been solved :)

Please find the "fixed" rpm, containing the checkbox-fix at
http://people.sugarlabs.org/ajay/root/multi-select-with-checkbox-fix/sugar-0.94.1-31.dx3.noarch.rpm

For brevity, here is the patch link ::
http://git.sugarlabs.org/dextrose/mainline/commit/381e706de7e7309d27a44ed064794a44d50aad4a

The sugar-toolkit rpm remains the same as before.



So, in addition to the "a) - i)" points of the previous mail, I add the
next point ::

j)
Now there is prompt feedback of checking/unchecking the checkboxes and
favorite-icons.

However, note that for favorite-icons, there is a logical hinderance to
true prompt feedback, as described in http://bugs.sugarlabs.org/ticket/3147.

Checkboxes' feedbacks work perfectly !!



Thanks and Regards,
Ajay


On Sun, Aug 5, 2012 at 12:02 PM, Ajay Garg  wrote:

> Hi Gary.
>
> Please find attached the links to the "fixed" rpms.
> Please "--upgrade --force --nodeps" on the dx3ng143 image, on which you
> have been testing.
>
>
> http://people.sugarlabs.org/ajay/root/multi-select/sugar-0.94.1-31.dx3.noarch.rpm
>
> http://people.sugarlabs.org/ajay/root/multi-select/sugar-toolkit-0.94.0-20120805.dx3.fc14.i386.rpm
>
>
> For brevity, the patches are at ::
>
> http://git.sugarlabs.org/dextrose/mainline/commit/38a261887ed44756147bae44277642252cae628f
>
> http://git.sugarlabs.org/dextrose/mainline/commit/0c71cf00dfb8fe507627109748b5539e0eeba87f
>
>
>
> Following are the changes/fixes ::
> All courtesy you :)
>
>
>
>
> a)
> 'Select none' renamed as 'Deselect all'.
>
>
>
> b)
> Now, a text-widget has been added to the top of EditToolBar.
> This serves the following two purposes ::
>
>
> * The widget is supposed to display only one line, at ANY time.
>
> * Usually, while in "multi-select" mode, it will display " of 97
> selected", where "x" is the number of entries currently selected,
>   and 97 is assumed to be the total number of entries.
>
>
>   Here, as we select/deselect by single-click, or "select
> all"/"deselect all" button,  the update happens consequently.
>
>   So, as is obvious, this modification helps show the number of
> selected entries, even when entries are selected/deselected one at a time
>   (previously, the status was shown, only when "select all" or
> "deselect all" was done).
>
> * During batch-copy, or batch-erase, this widget shows the running
> status of the entry currently being processed.
>
>
>
> c)
> Due to b), the progress-statuses are now NOT shown as alerts; rather as
> texts in the text-widget.
>
>
>
> d)
> However, any errors (such as "Entries without a file cannot be copied")
> are continued to be shown as alerts.
>
>
>
> e)
> Other than the progress-texts, and error-alerts, the only other
> notification shown are the confirmation-alerts before beginning
> with the "Batch-Copy" and "Batch-Erase".
>
>
>
> f)
> During Batch-Operations (almost exclusively Batch-Copy), if an error
> occurs, users are presented with two options ::
>
> * "Stop" - This stops the batch-operation there and then.
>
> * "Continue" - Proceed forward with the next journal entry.
>
>
>
> g)
> As seen in f), the "Ok" of the error-alert has been replaced (only
> textually) by "Continue".
>
>
>
> h)
> There were exceptions of the form "KeyError: 'keep'" occuring in logs.
> This was due to some cases, wherein "keep" property was not present in a
> particular journal entry.
>
> So now, as a fix, we first check if "keep" is a valid metadata-key. If
> yes, we read its value to gauge favorite-status.
> Else, we assume that the journal-entry is an unfavorite by default.
>
>
>
> i)
> VERY IMPORTANT NOTE ::
>
> Renaming a journal-entry (by clicking and modifying the contents of the
> title-cell, has been disabled functionally.
> This is because, the following happens when a rename is done in the
> "Documents" view ::
>
> * Initially, the UID is same as the path of the entry in "Documents".
>
> * User changes the name. The change is written on the DS, and the UID
> changed.
>
> * Now, since refresh is inhibited in multi-select view, we need to
> fetch the new value of the title from the DS.
>   This requires the UID, through which the UID could be fetched. Since
> the name of the "Documents" journal-entry has
>   changed, so has its UID. But in the memory, the old UID still
> resides. Fetching the "new" title from the "old" UID does not
>   work.
>
>   Now, I tried disabling the renaming while rendering the listview,
> but that could not be done, as rendering th listview requires
>   knowing whether we are in multi-select mode, while multi-select mode
> is set, after the listview is rendered. So, we are in a catch-22
>   situation.
>
> So, the way it works now in multi-select mode ::
>
> * User is apparently able to edit the title, but that is all what
> happens.
>   There is no efective change - neither in backend, nor in frontend.
>
> In the normal view, the renamin