[Sugar-devel] [PATCH sugar-toolkit-gtk3] Key grabber: make grab_keys introspectable

2012-08-22 Thread Simon Schampijer
To the grab_keys function we pass a list of strings the key
grabber should listen for. In order to make this
introspectable we need to annotate the function correctly. I
followed the instructions for passing arrays [1] and have
chosen the type of the array data looking at [2].

A simple example on how to test this is at [3]. The 'a'
keystroke is grabbed by the key grabber.

Signed-off-by: Simon Schampijer si...@laptop.org

[1] https://live.gnome.org/PyGObject/IntrospectionPorting#Passing_arrays
[2] https://live.gnome.org/GObjectIntrospection/Annotations#Default_Basic_Types
[3] http://dev.laptop.org/~erikos/touch/test_keyhandler.py
---
 src/sugar3/sugar-key-grabber.c | 41 -
 src/sugar3/sugar-key-grabber.h |  3 ++-
 2 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/src/sugar3/sugar-key-grabber.c b/src/sugar3/sugar-key-grabber.c
index 0810edc..74a0a95 100644
--- a/src/sugar3/sugar-key-grabber.c
+++ b/src/sugar3/sugar-key-grabber.c
@@ -199,34 +199,41 @@ grab_key (SugarKeyGrabber *grabber, Key *key, gboolean 
grab)
 }
 }
 
-
+/**
+ * sugar_key_grabber_grab_keys:
+ * @grabber: a #SugarKeyGrabber
+ * @keys: (array length=n_elements) (element-type utf8): array of
+ * keys the grabber will listen to
+ * @n_elements: number of elements in @keys.
+ *
+ * Pass to the key grabber the keys it should listen to.
+ **/
 void
-sugar_key_grabber_grab_keys(SugarKeyGrabber *grabber, const char **keys)
+sugar_key_grabber_grab_keys(SugarKeyGrabber *grabber,
+   const gchar  *keys[],
+   gint  n_elements)
 {
-const char **cur = keys;
+gint i;
 const char *key;
 Key *keyinfo = NULL;
-int min_keycodes, max_keycodes;
+gint min_keycodes, max_keycodes;
 
 XDisplayKeycodes(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
  min_keycodes, max_keycodes);
 
-while (*cur != NULL) {
-key = *cur;
-cur += 1;
-
-keyinfo = g_new0 (Key, 1);
-keyinfo-key = g_strdup(key);
+for (i = 0; i  n_elements; i++){
+   keyinfo = g_new0 (Key, 1);
+   keyinfo-key = g_strdup(keys[i]);
 
-if (!egg_accelerator_parse_virtual (key, keyinfo-keysym,
+if (!egg_accelerator_parse_virtual (keys[i], keyinfo-keysym,
 keyinfo-keycode,
 keyinfo-state)) {
-g_warning (Invalid key specified: %s, key);
+g_warning (Invalid key specified: %s, keys[i]);
 continue;
 }
 
 if (keyinfo-keycode  min_keycodes || keyinfo-keycode  
max_keycodes) {
-g_warning (Keycode out of bounds: %d for key %s, 
keyinfo-keycode, key);
+g_warning (Keycode out of bounds: %d for key %s, 
keyinfo-keycode, keys[i]);
 continue;
 }
 
@@ -239,12 +246,13 @@ sugar_key_grabber_grab_keys(SugarKeyGrabber *grabber, 
const char **keys)
 if(!error_code)
 grabber-keys = g_list_append(grabber-keys, keyinfo);
 else if(error_code == BadAccess)
-g_warning (Grab failed, another application may already have 
access to key '%s', key);
+g_warning (Grab failed, another application may already have 
access to key '%s', keys[i]);
 else if(error_code == BadValue)
 g_warning (Grab failed, invalid key %s specified. keysym: %u 
keycode: %u state: %u,
-   key, keyinfo-keysym, keyinfo-keycode, keyinfo-state);
+   keys[i], keyinfo-keysym, keyinfo-keycode, 
keyinfo-state);
 else
-g_warning (Grab failed for key '%s' for unknown reason '%d', 
key, error_code);
+g_warning (Grab failed for key '%s' for unknown reason '%d', 
keys[i], error_code);
+
 }
 }
 
@@ -285,4 +293,3 @@ sugar_key_grabber_is_modifier(SugarKeyGrabber *grabber, 
guint keycode, guint mas
 
return is_modifier;
 }
-
diff --git a/src/sugar3/sugar-key-grabber.h b/src/sugar3/sugar-key-grabber.h
index 9abc887..2afebd4 100644
--- a/src/sugar3/sugar-key-grabber.h
+++ b/src/sugar3/sugar-key-grabber.h
@@ -56,7 +56,8 @@ struct _SugarKeyGrabberClass {
 
 GType   sugar_key_grabber_get_type (void);
 void sugar_key_grabber_grab_keys (SugarKeyGrabber *grabber,
- const 
char **keys);
+ const gchar *keys[],
+ gint  n_elements);
 char*sugar_key_grabber_get_key  (SugarKeyGrabber *grabber,
 guint  
  keycode,
 guint  
  state);
-- 
1.7.11.4

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


[Sugar-devel] [PATCH sugar-base] Video Mime types

2012-08-22 Thread Manuel Kaufmann
Added more mime types that are supported by Jukebox

Signed-off-by: Manuel Kaufmann humi...@gmail.com
---
 src/sugar/mime.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/sugar/mime.py b/src/sugar/mime.py
index 7f3f5ff..c90a762 100644
--- a/src/sugar/mime.py
+++ b/src/sugar/mime.py
@@ -65,7 +65,13 @@ _generic_types = [
 'id': GENERIC_TYPE_VIDEO,
 'name': _('Video'),
 'icon': 'video-x-generic',
-'types': ['video/ogg', 'application/ogg', 'video/x-theora+ogg'],
+'types': ['video/ogg', 'application/ogg', 'video/x-theora+ogg',
+  'video/x-theora', 'video/x-mng', 'video/mpeg4',
+  'video/mpeg-stream', 'video/mpeg', 'video/mpegts', 'video/mpeg2',
+  'video/mpeg1', 'video/x-cdxa', 'video/x-ogm+ogg', 'video/x-flv',
+  'video/mp4', 'video/x-matroska', 'video/x-msvideo',
+  'application/x-ogm-video', 'video/quicktime', 'video/x-quicktime'
+  'video/avi'],
 },
 {
 'id': GENERIC_TYPE_LINK,
-- 
1.7.11.4

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


[Sugar-devel] [PATCH sugar-toolkit-gtk3] Video Mime types

2012-08-22 Thread Manuel Kaufmann
Added more mime types that are supported by Jukebox

Signed-off-by: Manuel Kaufmann humi...@gmail.com
---
 src/sugar3/mime.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/sugar3/mime.py b/src/sugar3/mime.py
index 448585e..07d085e 100644
--- a/src/sugar3/mime.py
+++ b/src/sugar3/mime.py
@@ -65,7 +65,13 @@ _generic_types = [
 'id': GENERIC_TYPE_VIDEO,
 'name': _('Video'),
 'icon': 'video-x-generic',
-'types': ['video/ogg', 'application/ogg', 'video/x-theora+ogg'],
+'types': ['video/ogg', 'application/ogg', 'video/x-theora+ogg',
+  'video/x-theora', 'video/x-mng', 'video/mpeg4',
+  'video/mpeg-stream', 'video/mpeg', 'video/mpegts', 'video/mpeg2',
+  'video/mpeg1', 'video/x-cdxa', 'video/x-ogm+ogg', 'video/x-flv',
+  'video/mp4', 'video/x-matroska', 'video/x-msvideo',
+  'application/x-ogm-video', 'video/quicktime', 'video/x-quicktime'
+  'video/avi'],
 },
 {
 'id': GENERIC_TYPE_LINK,
-- 
1.7.11.4

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


[Sugar-devel] [PATCH sugar] Journal: add alert to confirm before erasing an entry

2012-08-22 Thread Simon Schampijer
Erasing an entry in the Journal does not ask for confirmation
before doing the erase. This patch adds an alert to the ListView
and the DetailView that asks for confirmation before doing the
erase. This is part of the touch interaction work [1].

The wording of the alert has been finallized with Gary
yesterday.

Signed-off-by: Simon Schampijer si...@laptop.org

[1] http://wiki.sugarlabs.org/go/Features/Touch/Development#Journal
---
 src/jarabe/journal/journaltoolbox.py | 31 +--
 src/jarabe/journal/palettes.py   | 22 +-
 2 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/src/jarabe/journal/journaltoolbox.py 
b/src/jarabe/journal/journaltoolbox.py
index 2aa4153..9a5f5a2 100644
--- a/src/jarabe/journal/journaltoolbox.py
+++ b/src/jarabe/journal/journaltoolbox.py
@@ -36,6 +36,7 @@ from sugar.graphics.combobox import ComboBox
 from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.icon import Icon
 from sugar.graphics.xocolor import XoColor
+from sugar.graphics.alert import Alert
 from sugar.graphics import iconentry
 from sugar.graphics import style
 from sugar import mime
@@ -45,6 +46,7 @@ from jarabe.journal import misc
 from jarabe.journal import model
 from jarabe.journal.palettes import ClipboardMenu
 from jarabe.journal.palettes import VolumeMenu
+from jarabe.journal import journalwindow
 
 
 _AUTOSEARCH_TIMEOUT = 1000
@@ -438,12 +440,29 @@ class EntryToolbar(gtk.Toolbar):
   _('Error'))
 
 def _erase_button_clicked_cb(self, button):
-registry = bundleregistry.get_registry()
-
-bundle = misc.get_bundle(self._metadata)
-if bundle is not None and registry.is_installed(bundle):
-registry.uninstall(bundle)
-model.delete(self._metadata['uid'])
+alert = Alert()
+erase_string = _('Erase')
+alert.props.title = erase_string
+alert.props.msg = _('Do you want to permanently erase \%s\?') \
+% self._metadata['title']
+icon = Icon(icon_name='dialog-cancel')
+alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel'), icon)
+icon.show()
+ok_icon = Icon(icon_name='dialog-ok')
+alert.add_button(gtk.RESPONSE_OK, erase_string, ok_icon)
+ok_icon.show()
+alert.connect('response', self.__erase_alert_response_cb)
+journalwindow.get_journal_window().add_alert(alert)
+alert.show()
+
+def __erase_alert_response_cb(self, alert, response_id):
+journalwindow.get_journal_window().remove_alert(alert)
+if response_id is gtk.RESPONSE_OK:
+registry = bundleregistry.get_registry()
+bundle = misc.get_bundle(self._metadata)
+if bundle is not None and registry.is_installed(bundle):
+registry.uninstall(bundle)
+model.delete(self._metadata['uid'])
 
 def _resume_menu_item_activate_cb(self, menu_item, service_name):
 misc.resume(self._metadata, service_name)
diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
index 8fc1e5d..f0d686f 100644
--- a/src/jarabe/journal/palettes.py
+++ b/src/jarabe/journal/palettes.py
@@ -29,6 +29,7 @@ from sugar.graphics.palette import Palette
 from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.icon import Icon
 from sugar.graphics.xocolor import XoColor
+from sugar.graphics.alert import Alert
 from sugar import mime
 
 from jarabe.model import friends
@@ -36,6 +37,7 @@ from jarabe.model import filetransfer
 from jarabe.model import mimeregistry
 from jarabe.journal import misc
 from jarabe.journal import model
+from jarabe.journal import journalwindow
 
 
 class ObjectPalette(Palette):
@@ -142,7 +144,25 @@ class ObjectPalette(Palette):
   _('Error'))
 
 def __erase_activate_cb(self, menu_item):
-model.delete(self._metadata['uid'])
+alert = Alert()
+erase_string = _('Erase')
+alert.props.title = erase_string
+alert.props.msg = _('Do you want to permanently erase \%s\?') \
+% self._metadata['title']
+icon = Icon(icon_name='dialog-cancel')
+alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel'), icon)
+icon.show()
+ok_icon = Icon(icon_name='dialog-ok')
+alert.add_button(gtk.RESPONSE_OK, erase_string, ok_icon)
+ok_icon.show()
+alert.connect('response', self.__erase_alert_response_cb)
+journalwindow.get_journal_window().add_alert(alert)
+alert.show()
+
+def __erase_alert_response_cb(self, alert, response_id):
+journalwindow.get_journal_window().remove_alert(alert)
+if response_id is gtk.RESPONSE_OK:
+model.delete(self._metadata['uid'])
 
 def __detail_activate_cb(self, menu_item):
 self.emit('detail-clicked', self._metadata['uid'])
-- 
1.7.11.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org

Re: [Sugar-devel] [PATCH sugar] Remove _MouseListener from the frame - SL #3820

2012-08-22 Thread Simon Schampijer

On 08/21/2012 02:50 PM, Manuel Quiñones wrote:

- Move the code of mouse_enter() method to a oneliner in the client class,
   so a class is not needed anymore.

- Fix calls to non existant mouse_leave() method from commit 238338d4 .

Signed-off-by: Manuel Quiñones ma...@laptop.org


Thanks Manuel for the patch.

For dragging I think the behavior should be:

Steps:

- I reveal the frame (hot corner, gesture, key)

- I drag something onto the Clipboard

- the Frame stays visible unless I hide it explicitly (hot corner, 
gesture, key)


Steps 2:

- I drag something

- while dragging I reveal the Frame over a hot corner and drop it in the 
clipboard


--- in that operation the Frame has been revealed, so it should stay 
visible after I finished the drop


Currently in your patch the Frame hides after the drop. There is a bit 
of more cleanup we can do. I will follow up if we agree on my described 
behavior.


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


Re: [Sugar-devel] [DESIGN] Examples objects support for activities.

2012-08-22 Thread Bert Freudenberg
On 2012-08-22, at 04:27, Martin Abente wrote:

 Hello everyone:
 
 From the meeting notes and Bert suggestion I have what could be called the 
 version 2 of this feature, greatly simplified and complies with everyones 
 rightful suggestions.
 
 To avoid spaming (for some time) the sugar-devel ML I will post the patches 
 just here:
 
 sugar: 
 http://www.sugarlabs.org/~tch/patches/examples/sugar/0001-Examples-objects-support-V2.patch
 sugar-toolkit: 
 http://www.sugarlabs.org/~tch/patches/examples/sugar-toolkit/0001-Examples_path-activity-info.patch
 
 Feedback is welcome!
 tch

I have not tried it, but by eyeballing the code looks fine :)

- Bert -


 On Tue, Aug 21, 2012 at 3:42 PM, Martin Abente 
 martin.abente.lah...@gmail.com wrote:
 I don't see why not, we can achieve both things :). Maybe someone have 
 another opinion regarding this?
 
 
 On Tue, Aug 21, 2012 at 3:07 PM, Bert Freudenberg b...@freudenbergs.de 
 wrote:
 On 2012-08-21, at 20:17, Martin Abente wrote:
 
  The design I implemented works like this:
 
  a. activity developers or deployments add a new examples folder inside 
  the activity bundle with their examples objects.
  b. when the activity starts, the example folder will be accessible through 
  the journal as new volume option, and also from __any__ ObjectChooser.
  c. Only one volume button will be shown, even when many instances of the 
  activity are running.
  d. The example folder will disappear from the journal when the last 
  instance is closed.
  [...]
  Waiting for more feedback... :)
 
 And in another thread:
 
  instead of a magic directory name, couldn't the activity.info file have a 
  new entry giving the examples path?
 
 
  What I tried, or I am trying, to do is to make this feature available as 
  easy as we can, so even deployments could add their own examples with very 
  little technical knowledge requirements. That why I try this convention 
  (magical) idea.
 
 
 Okay, so by default it should look for a directory named examples. But 
 maybe a different path could be set in activity.info?
 
 - Bert -
 
 
 ___
 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] Journal: add alert to confirm before erasing an entry

2012-08-22 Thread Manuel Quiñones
Yes, this v2 has the discussed wording.  Please commit.

2012/8/22 Simon Schampijer si...@schampijer.de:
 Erasing an entry in the Journal does not ask for confirmation
 before doing the erase. This patch adds an alert to the ListView
 and the DetailView that asks for confirmation before doing the
 erase. This is part of the touch interaction work [1].

 The wording of the alert has been finallized with Gary
 yesterday.

 Signed-off-by: Simon Schampijer si...@laptop.org

Acked-by: Manuel Quiñones ma...@laptop.org


 [1] http://wiki.sugarlabs.org/go/Features/Touch/Development#Journal
 ---
  src/jarabe/journal/journaltoolbox.py | 31 +--
  src/jarabe/journal/palettes.py   | 22 +-
  2 files changed, 46 insertions(+), 7 deletions(-)

 diff --git a/src/jarabe/journal/journaltoolbox.py 
 b/src/jarabe/journal/journaltoolbox.py
 index 2aa4153..9a5f5a2 100644
 --- a/src/jarabe/journal/journaltoolbox.py
 +++ b/src/jarabe/journal/journaltoolbox.py
 @@ -36,6 +36,7 @@ from sugar.graphics.combobox import ComboBox
  from sugar.graphics.menuitem import MenuItem
  from sugar.graphics.icon import Icon
  from sugar.graphics.xocolor import XoColor
 +from sugar.graphics.alert import Alert
  from sugar.graphics import iconentry
  from sugar.graphics import style
  from sugar import mime
 @@ -45,6 +46,7 @@ from jarabe.journal import misc
  from jarabe.journal import model
  from jarabe.journal.palettes import ClipboardMenu
  from jarabe.journal.palettes import VolumeMenu
 +from jarabe.journal import journalwindow


  _AUTOSEARCH_TIMEOUT = 1000
 @@ -438,12 +440,29 @@ class EntryToolbar(gtk.Toolbar):
_('Error'))

  def _erase_button_clicked_cb(self, button):
 -registry = bundleregistry.get_registry()
 -
 -bundle = misc.get_bundle(self._metadata)
 -if bundle is not None and registry.is_installed(bundle):
 -registry.uninstall(bundle)
 -model.delete(self._metadata['uid'])
 +alert = Alert()
 +erase_string = _('Erase')
 +alert.props.title = erase_string
 +alert.props.msg = _('Do you want to permanently erase \%s\?') \
 +% self._metadata['title']
 +icon = Icon(icon_name='dialog-cancel')
 +alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel'), icon)
 +icon.show()
 +ok_icon = Icon(icon_name='dialog-ok')
 +alert.add_button(gtk.RESPONSE_OK, erase_string, ok_icon)
 +ok_icon.show()
 +alert.connect('response', self.__erase_alert_response_cb)
 +journalwindow.get_journal_window().add_alert(alert)
 +alert.show()
 +
 +def __erase_alert_response_cb(self, alert, response_id):
 +journalwindow.get_journal_window().remove_alert(alert)
 +if response_id is gtk.RESPONSE_OK:
 +registry = bundleregistry.get_registry()
 +bundle = misc.get_bundle(self._metadata)
 +if bundle is not None and registry.is_installed(bundle):
 +registry.uninstall(bundle)
 +model.delete(self._metadata['uid'])

  def _resume_menu_item_activate_cb(self, menu_item, service_name):
  misc.resume(self._metadata, service_name)
 diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
 index 8fc1e5d..f0d686f 100644
 --- a/src/jarabe/journal/palettes.py
 +++ b/src/jarabe/journal/palettes.py
 @@ -29,6 +29,7 @@ from sugar.graphics.palette import Palette
  from sugar.graphics.menuitem import MenuItem
  from sugar.graphics.icon import Icon
  from sugar.graphics.xocolor import XoColor
 +from sugar.graphics.alert import Alert
  from sugar import mime

  from jarabe.model import friends
 @@ -36,6 +37,7 @@ from jarabe.model import filetransfer
  from jarabe.model import mimeregistry
  from jarabe.journal import misc
  from jarabe.journal import model
 +from jarabe.journal import journalwindow


  class ObjectPalette(Palette):
 @@ -142,7 +144,25 @@ class ObjectPalette(Palette):
_('Error'))

  def __erase_activate_cb(self, menu_item):
 -model.delete(self._metadata['uid'])
 +alert = Alert()
 +erase_string = _('Erase')
 +alert.props.title = erase_string
 +alert.props.msg = _('Do you want to permanently erase \%s\?') \
 +% self._metadata['title']
 +icon = Icon(icon_name='dialog-cancel')
 +alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel'), icon)
 +icon.show()
 +ok_icon = Icon(icon_name='dialog-ok')
 +alert.add_button(gtk.RESPONSE_OK, erase_string, ok_icon)
 +ok_icon.show()
 +alert.connect('response', self.__erase_alert_response_cb)
 +journalwindow.get_journal_window().add_alert(alert)
 +alert.show()
 +
 +def __erase_alert_response_cb(self, alert, response_id):
 +journalwindow.get_journal_window().remove_alert(alert)
 +if response_id is gtk.RESPONSE_OK:
 +

Re: [Sugar-devel] [PATCH sugar] Remove _MouseListener from the frame - SL #3820

2012-08-22 Thread Manuel Quiñones
2012/8/22 Simon Schampijer si...@schampijer.de:
 On 08/21/2012 02:50 PM, Manuel Quiñones wrote:

 - Move the code of mouse_enter() method to a oneliner in the client class,
so a class is not needed anymore.

 - Fix calls to non existant mouse_leave() method from commit 238338d4 .

 Signed-off-by: Manuel Quiñones ma...@laptop.org


 Thanks Manuel for the patch.

 For dragging I think the behavior should be:

 Steps:

 - I reveal the frame (hot corner, gesture, key)

 - I drag something onto the Clipboard

 - the Frame stays visible unless I hide it explicitly (hot corner, gesture,
 key)

 Steps 2:

 - I drag something

 - while dragging I reveal the Frame over a hot corner and drop it in the
 clipboard

 --- in that operation the Frame has been revealed, so it should stay
 visible after I finished the drop

 Currently in your patch the Frame hides after the drop. There is a bit of
 more cleanup we can do. I will follow up if we agree on my described
 behavior.

Agreed in those two test cases.  Yes this need more work.

Thanks!

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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Key grabber: make grab_keys introspectable

2012-08-22 Thread Simon Schampijer

On 08/22/2012 01:58 PM, Manuel Quiñones wrote:

Great Simon,I tested it in the shell port branch and the keystrokes
for changing the zoom level and showing/hiding the frame are back.

2012/8/22 Simon Schampijer si...@schampijer.de:

To the grab_keys function we pass a list of strings the key
grabber should listen for. In order to make this
introspectable we need to annotate the function correctly. I
followed the instructions for passing arrays [1] and have
chosen the type of the array data looking at [2].

A simple example on how to test this is at [3]. The 'a'
keystroke is grabbed by the key grabber.

Signed-off-by: Simon Schampijer si...@laptop.org


Tested-by: Manuel Quiñones ma...@laptop.org


[1] https://live.gnome.org/PyGObject/IntrospectionPorting#Passing_arrays
[2] https://live.gnome.org/GObjectIntrospection/Annotations#Default_Basic_Types
[3] http://dev.laptop.org/~erikos/touch/test_keyhandler.py


Thanks Manuel. Daniel did review it as well. Pushed to the porting repo 
and the main one.


Simon

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


[Sugar-devel] [PATCH sugar] Remove _MouseListener from the frame and cleanup, v2, SL #3820

2012-08-22 Thread Simon Schampijer
Move the code of mouse_enter() method into the client class,
so a class is not needed anymore. Fix calls to non existent
mouse_leave() method from commit 238338d4. Cleanup of unused
leave methods due to the new behavior.

Signed-off-by: Manuel Quiñones ma...@laptop.org
Signed-off-by: Simon Schampijer si...@laptop.org
---
 src/jarabe/frame/frame.py | 47 ---
 1 file changed, 4 insertions(+), 43 deletions(-)

diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py
index ee112a1..4bdcc40 100644
--- a/src/jarabe/frame/frame.py
+++ b/src/jarabe/frame/frame.py
@@ -54,17 +54,6 @@ class _Animation(animator.Animation):
 self._frame.move(current)
 
 
-class _MouseListener(object):
-def __init__(self, frame):
-self._frame = frame
-
-def mouse_enter(self):
-if self._frame.visible:
-self._frame.hide()
-else:
-self._frame.show()
-
-
 class _KeyListener(object):
 def __init__(self, frame):
 self._frame = frame
@@ -103,7 +92,6 @@ class Frame(object):
 screen.connect('size-changed', self._size_changed_cb)
 
 self._key_listener = _KeyListener(self)
-self._mouse_listener = _MouseListener(self)
 
 self._notif_by_icon = {}
 
@@ -143,12 +131,6 @@ class Frame(object):
 self.current_position = pos
 self._update_position()
 
-def _is_hover(self):
-return (self._top_panel.hover or \
-self._bottom_panel.hover or \
-self._left_panel.hover or \
-self._right_panel.hover)
-
 def _create_top_panel(self):
 panel = self._create_panel(gtk.POS_TOP)
 
@@ -184,9 +166,6 @@ class Frame(object):
 def _create_left_panel(self):
 panel = ClipboardPanelWindow(self, gtk.POS_LEFT)
 
-panel.connect('drag-motion', self._drag_motion_cb)
-panel.connect('drag-leave', self._drag_leave_cb)
-
 return panel
 
 def _create_panel(self, orientation):
@@ -226,29 +205,11 @@ class Frame(object):
 def _size_changed_cb(self, screen):
 self._update_position()
 
-def _enter_notify_cb(self, window, event):
-if event.detail != gtk.gdk.NOTIFY_INFERIOR:
-self._mouse_listener.mouse_enter()
-
-def _leave_notify_cb(self, window, event):
-if event.detail == gtk.gdk.NOTIFY_INFERIOR:
-return
-
-if not self._is_hover() and not self._palette_group.is_up():
-self._mouse_listener.mouse_leave()
-
-def _palette_group_popdown_cb(self, group):
-if not self._is_hover():
-self._mouse_listener.mouse_leave()
-
-def _drag_motion_cb(self, window, context, x, y, time):
-self._mouse_listener.mouse_enter()
-
-def _drag_leave_cb(self, window, drag_context, timestamp):
-self._mouse_listener.mouse_leave()
-
 def _enter_corner_cb(self, event_area):
-self._mouse_listener.mouse_enter()
+if self.visible:
+self.hide()
+else:
+self.show()
 
 def notify_key_press(self):
 self._key_listener.key_press()
-- 
1.7.11.4

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


Re: [Sugar-devel] [PATCH sugar] Remove _MouseListener from the frame - SL #3820

2012-08-22 Thread Simon Schampijer

On 08/22/2012 04:40 PM, Manuel Quiñones wrote:

2012/8/22 Simon Schampijer si...@schampijer.de:

On 08/21/2012 02:50 PM, Manuel Quiñones wrote:


- Move the code of mouse_enter() method to a oneliner in the client class,
so a class is not needed anymore.

- Fix calls to non existant mouse_leave() method from commit 238338d4 .

Signed-off-by: Manuel Quiñones ma...@laptop.org



Thanks Manuel for the patch.

For dragging I think the behavior should be:

Steps:

- I reveal the frame (hot corner, gesture, key)

- I drag something onto the Clipboard

- the Frame stays visible unless I hide it explicitly (hot corner, gesture,
key)

Steps 2:

- I drag something

- while dragging I reveal the Frame over a hot corner and drop it in the
clipboard

--- in that operation the Frame has been revealed, so it should stay
visible after I finished the drop

Currently in your patch the Frame hides after the drop. There is a bit of
more cleanup we can do. I will follow up if we agree on my described
behavior.


Agreed in those two test cases.  Yes this need more work.

Thanks!


Ok, cleaned up the unused code, and make sure the behavior from above 
works now and that the other Frame interaction still works. Hope you can 
get to the same results with the patch v2 :)


Cheers,
   Simon


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


Re: [Sugar-devel] Is there a way to purposefully do synchronous GUI updates?

2012-08-22 Thread Ajay Garg
James, Benjamin,

I replaced the gtk.ProgressBar with a running-progress-text.

It works, provided I use the Benjamin's method of using
gtk.gsk.window_process_all_updates() to have synchronous GUI updates.


Thanks and Regards,
Ajay


On Wed, Aug 22, 2012 at 5:55 AM, James Cameron qu...@laptop.org wrote:

 On Tue, Aug 21, 2012 at 03:44:13PM +0530, Ajay Garg wrote:
  I am using this to show the upload-progress of a 4 GB file, using
  gtk.ProgressBar().

 Is your upload socket registered with the main event loop as an event
 source?

  The file takes about 15 minutes to upload, and I only see the
  progress bar (fraction = 1) right at the end; which means that only
  after the uploading is done, and there is nothing else to be done,
  does the GUI update takes place.

 This is wrong, and it need not be this way.

 --
 James Cameron
 http://quozl.linux.org.au/
 ___
 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


[Sugar-devel] [Design] On Screen Keyboard – part of the 'get Sugar touch ready' feature set

2012-08-22 Thread Gary C Martin
Hi all,

I've pulled together most of the design mockups onto a wiki page [1] for the 
ongoing work on the Maliit based on screen keyboard (OSK). This is part of the 
feature set [2] to get the Sugar UI/UX touch ready, as raised by Simon on the 
mail-list already. Please feel free to use the wiki discussion page, or reply 
to this email thread if you have any OSK design related feedback!

Regards,
--Gary

P.S. For those interested in more background touch related notes see [4], [5], 
[6], and [7].

[1] 
http://wiki.sugarlabs.org/go/User:Garycmartin/Maliit#Maliit_OSK_style_and_layout_design
[2] http://wiki.sugarlabs.org/go/Features/Touch/Development#Sugar_theme
[3] http://wiki.sugarlabs.org/index.php?title=User_talk:Garycmartin/Maliit
[4] 
http://wiki.sugarlabs.org/go/Design_Team/Proposals/Touchscreen/On-screen_Keyboard
[5] http://wiki.sugarlabs.org/go/Design_Team/Sugar_Shell_Touch_Input
[6] http://wiki.sugarlabs.org/go/Talk:Design_Team/Sugar_Shell_Touch_Input
[7] http://wiki.sugarlabs.org/go/Design_Team/Activity_Touch_Input
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Design] On Screen Keyboard – part of the 'get Sugar touch ready' feature set

2012-08-22 Thread Manuel Quiñones
2012/8/22 Gary C Martin garycmar...@googlemail.com:
 Hi all,

 I've pulled together most of the design mockups onto a wiki page [1] for the 
 ongoing work on the Maliit based on screen keyboard (OSK). This is part of 
 the feature set [2] to get the Sugar UI/UX touch ready, as raised by Simon on 
 the mail-list already. Please feel free to use the wiki discussion page, or 
 reply to this email thread if you have any OSK design related feedback!

Excellent!  For the definitive one, what's the highlight color of the keys?

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


Re: [Sugar-devel] [Design] On Screen Keyboard – part of the 'get Sugar touch ready' feature set

2012-08-22 Thread Gary Martin
On 22 Aug 2012, at 20:58, Manuel Quiñones ma...@laptop.org wrote:

 2012/8/22 Gary C Martin garycmar...@googlemail.com:
 Hi all,
 
 I've pulled together most of the design mockups onto a wiki page [1] for the 
 ongoing work on the Maliit based on screen keyboard (OSK). This is part of 
 the feature set [2] to get the Sugar UI/UX touch ready, as raised by Simon 
 on the mail-list already. Please feel free to use the wiki discussion page, 
 or reply to this email thread if you have any OSK design related feedback!
 
 Excellent!  For the definitive one, what's the highlight color of the keys?

By definitive, do you mean the final selected one? I was hoping to see what the 
reaction was to these mockups first, but the highlight (on key press) certainly 
wont be the blue gradient used in the existing maliit olpc-xo theme.  Expect a 
key press will be a simple monochrome darkening of a key fill (if we go for a 
light default key fill style), or a brightening of a key fill (if we go for a 
dark default key fill style). These parts of the style definition are simple 
png images, so easy to tweak.

The key layout is a more complicated affair as it requires modification of XML 
files for each language layout [1], so I'd rather lock down an agreed layout 
before I start trying to apply them to 40+ different languages – and yes I plan 
to script the edits as far as I can ;) FWIW, looks like this will be a patch 
set we need to apply to out builds as although maliit supports custom styles 
(olpc-xo is the one they added for us), their layouts are shared between all 
styles, so they would be unlikely to accept patches from us wanting to modify 
them all for Sugar's needs.

Regards,
--Gary

[1] 
https://gitorious.org/maliit/maliit-plugins/trees/master/maliit-keyboard/data/languages

 -- 
 .. manuq ..

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


Re: [Sugar-devel] [Design] On Screen Keyboard – part of the 'get Sugar touch ready' feature set

2012-08-22 Thread Manuel Quiñones
2012/8/22 Gary Martin garycmar...@googlemail.com:
 On 22 Aug 2012, at 20:58, Manuel Quiñones ma...@laptop.org wrote:

 2012/8/22 Gary C Martin garycmar...@googlemail.com:
 Hi all,

 I've pulled together most of the design mockups onto a wiki page [1] for 
 the ongoing work on the Maliit based on screen keyboard (OSK). This is part 
 of the feature set [2] to get the Sugar UI/UX touch ready, as raised by 
 Simon on the mail-list already. Please feel free to use the wiki discussion 
 page, or reply to this email thread if you have any OSK design related 
 feedback!

 Excellent!  For the definitive one, what's the highlight color of the keys?

 By definitive, do you mean the final selected one? I was hoping to see what 
 the reaction was to these mockups first

Yes I think the final selected one is the nicest.  Then a brightening
of a key fill would make it.  Great :)

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


Re: [Sugar-devel] [DESIGN] Examples objects support for activities.

2012-08-22 Thread Martin Abente
Nice! Please also give it a try :)

@Gary, Gonzalo, ping ;) both patches are here:
http://www.sugarlabs.org/~tch/patches/examples/

On Wed, Aug 22, 2012 at 10:24 AM, Bert Freudenberg b...@freudenbergs.dewrote:

 On 2012-08-22, at 04:27, Martin Abente wrote:

  Hello everyone:
 
  From the meeting notes and Bert suggestion I have what could be called
 the version 2 of this feature, greatly simplified and complies with
 everyones rightful suggestions.
 
  To avoid spaming (for some time) the sugar-devel ML I will post the
 patches just here:
 
  sugar:
 http://www.sugarlabs.org/~tch/patches/examples/sugar/0001-Examples-objects-support-V2.patch
  sugar-toolkit:
 http://www.sugarlabs.org/~tch/patches/examples/sugar-toolkit/0001-Examples_path-activity-info.patch
 
  Feedback is welcome!
  tch

 I have not tried it, but by eyeballing the code looks fine :)

 - Bert -


  On Tue, Aug 21, 2012 at 3:42 PM, Martin Abente 
 martin.abente.lah...@gmail.com wrote:
  I don't see why not, we can achieve both things :). Maybe someone have
 another opinion regarding this?
 
 
  On Tue, Aug 21, 2012 at 3:07 PM, Bert Freudenberg b...@freudenbergs.de
 wrote:
  On 2012-08-21, at 20:17, Martin Abente wrote:
 
   The design I implemented works like this:
  
   a. activity developers or deployments add a new examples folder
 inside the activity bundle with their examples objects.
   b. when the activity starts, the example folder will be accessible
 through the journal as new volume option, and also from __any__
 ObjectChooser.
   c. Only one volume button will be shown, even when many instances of
 the activity are running.
   d. The example folder will disappear from the journal when the last
 instance is closed.
   [...]
   Waiting for more feedback... :)
 
  And in another thread:
 
   instead of a magic directory name, couldn't the activity.info file
 have a new entry giving the examples path?
  
 
   What I tried, or I am trying, to do is to make this feature available
 as easy as we can, so even deployments could add their own examples with
 very little technical knowledge requirements. That why I try this
 convention (magical) idea.
 
 
  Okay, so by default it should look for a directory named examples. But
 maybe a different path could be set in activity.info?
 
  - Bert -
 
 
  ___
  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

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


Re: [Sugar-devel] More tests of Write with introspection bindings

2012-08-22 Thread Manuel Quiñones
2012/8/23 Gonzalo Odiard gonz...@laptop.org:
 Hi Carlos,

 I continue doing tests, with little advance. Report here to see if you can
 help me.
 I have rebuilded all my env, using sugar-build, compiled libgsf and abiword,
 applied the changes ion your patch to Write activity and the activity crash
 again.

 If I replace in the gi/overrides/Abi.py the line:

 Abi.init(sys.argv)
 by
 Abi.init_noargs()

 the activity starts but the canvas is not visible. But should be present
 because when quit the activity saves a empty abiword file!

 The canvas is not displayed in this minimal example neither:

 from gi.repository import Gtk
 from gi.repository import Abi
 win = Gtk.Window()
 abi = Abi.Widget()
 win.add(abi)
 win.show_all()
 win.connect(destroy, Gtk.main_quit)
 Gtk.main()

 The environment I am using is easy to reproduce:
 In Fedora 17
 * Install sugar-build
 git clone git://git.sugarlabs.org/sugar-build/sugar-build.git
 cd sugar-build

Do you need some recent addition to the gtk stack?  You can see the
revision number sugar-build uses for each module in
scripts/system.modules .

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


Re: [Sugar-devel] python-speaking unix-guru user interface prototype implementer(s) and design critics/contributors solicited

2012-08-22 Thread Laura Vargas
 This is a timely and very interesting endeavour.

 Do we have a starting point of workflow formed?

Or will it evolve from the wiki discussions?

 We have been using XO's for quite a while now.
 We have seen sucessful implementations of the XO-laptops and have held
 and hold classes with children in rural areas on a weekly basis.

 I believe iterative development of the interface, should and must
 involve a feedback mechanism from the end-user.


Regarding development of Sugar and Sugar Activities, this is pretty much
what we are trying to achieve with the implementation of Sugar Network; a
collection of feedback resources (from automatic failure reporting to being
able to suggest ideas, questions, problems, reviews and of course usage
statistics) for end-users to exchange with developers.


 Isn't this quite the
 norm in standard software development?

 What one could set out do, is to create prototypes and have feedback
 from the children themselves,  with a proper sample set of
 participants (rural, urban, having english as a second/first
 language).


+1 we have called first prototype Red Azúcar and will be tested on the
Proyecto Piloto Hexoquinasa, only difference is it will start in Spanish
as it will be implemented starting in Perú


 If this becomes part of the development workflow, I'm sure it would
 yield some unexpected  and good results.


We really hope to be able to integrate Sugar Network to research, design
and development work flows  :D

We have recently been evaluating on providing educational content on
 tablets.
 The $35 tablet (http://blog.laptop.org/2010/07/29/welcoming-indias-tablet/
 )
 that was supposed to have been released is still going through a bunch
 of hiccups and it has been almost around a year since things have
 materialized.

 We have been looking at other configurations that offer a bit more
 bang for the buck. An inexpensive device, not a cheap one.

 We have a 80-90 USD priced ARM tablet which considerably has some good
 points. Although nowhere near as rugged as the XO tablet, the price
 point at which it can be offered increases the reach to a much larger
 base.
 As a reference, we did an install of debian with sugar (desktop)  on
 the tablet and the interface is what jumped out at us as being
 extremely tied to the keyboard and mouse paradigm.

 Hello, I'm Johnson Chetty, I work at the Gnowledge Lab, Homi Bhabha
 Centre for Science Education, TIFR, with Dr. G. Nagarjuna at Mumbai,
 India.

 Nice meeting you Johnson, I'm Laura member of Sugar Labs Colombia
Foundation and Sugar Labs Perú Community, active researcher on Technology
applied to Education for the Region at Escuelab.Org and founder member of
the SomosAZUCAR Research and Develpment Team.


 I believe we would be able to do something for this. We speak a bit of
 python, we love linux, and we have direct access to rural children
 learning on the XOs.


Our team surely would appreciate any help you can provide as we are on an
early stage of Alfa Testing for the initial activation of the Sugar
Network!

My suggestion would be to download and install the experimental XO
imageshttp://wiki.sugarlabs.org/go/Harmonic_Distribution/XO_reference_distribution#Try_a_reference_implementationand
start testing the access to the Sugar Network client (Red Azúcar)
using
it for documenting your feedback if possible (greatly appreciated even if
it is in English).

In the upcoming future -with the blessings of the Universe- we may be able
to connect your children from rural India with ours from the Andes
mountains :o)



 Thanks,
 --
 Regards,
 Johnson Chetty,


cc: to...@somosazucar.org

Thanks to you,
-- 
Laura V.
ID SomosAZUCAR.Org

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


[Sugar-devel] [ASLO] Release Conozco India-3

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

Sugar Platform:
0.82 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28197/i_know_india-3.xo

Release notes:
-New translations
-Add basic maps of Goa state
-Return posibility of select maps
-Better checks in cargarImagen
-Prevent crash when no flag image
-Resize images to 786x900 pixels
-Add waterways exploration
-Fix to works in gnome directly
-Fix gnome window size - add talukas
-Update images - add deptos.png
-Add talukas and capitals cities of goa
-Remove old data and update states for talukas
-Uses short form in help
-Add talukas and capital level
-Update news info
-Update commons info
-Execute the game in fullscreen when calls ./conozcoin.py
-Add minor stats for Goa


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] [ASLO] Release Conozco América-6

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

Sugar Platform:
0.82 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28196/i_know_america-6.xo

Release notes:
-New translations
-Better strings for introduction and questions
-Fix to works in Gnome directly
-Fix error in gnome window size
-Fix translations problems
-No depends from gtk in other platforms
-Execute in fullscreen when call ./conozcoam.py


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] [ASLO] Release Panorama-6

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

Sugar Platform:
0.92 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28194/panorama-6.xo

Release notes:
-New translations
-Remove binaries of Pygame 1.9 (break back compatibility).


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] [ASLO] Release Puntillismo-6

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

Sugar Platform:
0.92 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28193/pointillism-6.xo

Release notes:
-New translations
-Remove binaries of Pygame 1.9 (break back compatibility).


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] Dist_xo of bundlebuilder

2012-08-22 Thread Alan Jhonn Aguiar Schwyn
Hi,
I have installed the sugar-emulator-0.96 and use it without problems.
But now, when I try to make a .xo, it have a problem and only make the.xo with 
the locale folder!
Why?
If I copy the same folder to another place, for example: to the desktop.. I 
have this:
alan@alan-pc:~/Escritorio/tmp$ python setup.py dist_xofatal: Not a git 
repository (or any of the parent directories): .git
But the .xo is correct!
The python setup.py dist_xo only can be called from /home/user/Activities ??
Regards!
Alan  ___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Design] On Screen Keyboard – part of the 'get Sugar touch ready' feature set

2012-08-22 Thread Chris Leonard
On Wed, Aug 22, 2012 at 9:09 PM, Gary Martin garycmar...@googlemail.com wrote:

 The key layout is a more complicated affair as it requires modification of 
 XML files for each language layout [1], so I'd rather lock down an agreed 
 layout before I start trying to apply them to 40+ different languages – and 
 yes I plan to script the edits as far as I can ;) FWIW, looks like this will 
 be a patch set we need to apply to out builds as although maliit supports 
 custom styles (olpc-xo is the one they added for us), their layouts are 
 shared between all styles, so they would be unlikely to accept patches from 
 us wanting to modify them all for Sugar's needs.

 [1] 
 https://gitorious.org/maliit/maliit-plugins/trees/master/maliit-keyboard/data/languages

I like the most recent version well enough,

http://wiki.sugarlabs.org/go/File:Maliit_Sugar_theme_work_13.png

I'm a little concerned that the absence of the
Home/Friends/Neighborhood/World quartet of XO specific keys will be
missed, but I understand that it is tough to collapse 6 rows of XO
keys into 4 rows for Maliit.

I've got lots of other questions, but they are more i18n related, so
I'll forego inserting them into this design thread, but I can't resist
throwing one out there.

Is there currently a mechanism for re-creating the many xkb-based
layouts already designed for OLPC that never got silkscreened?

 http://wiki.laptop.org/go/Keyboard_layouts

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


Re: [Sugar-devel] Dist_xo of bundlebuilder

2012-08-22 Thread Alan Jhonn Aguiar Schwyn
I'm go to the problem..
In bundlebuilder.py I found this command that make the list of files:
git_ls = subprocess.Popen(['git', 'ls-files'], stdout=subprocess.PIPE,  
cwd=self.config.source_dir)
If I not have git installed (like in a XO) or the directory is external ofthe 
git, how make a .xo?
Compress the folder in .zip and rename to .xo ?
Why not is: ls -a to get the files?
From: alan...@hotmail.com
To: sugar-devel@lists.sugarlabs.org
Date: Thu, 23 Aug 2012 04:45:22 +
Subject: [Sugar-devel] Dist_xo of bundlebuilder




Hi,
I have installed the sugar-emulator-0.96 and use it without problems.
But now, when I try to make a .xo, it have a problem and only make the.xo with 
the locale folder!
Why?
If I copy the same folder to another place, for example: to the desktop.. I 
have this:
alan@alan-pc:~/Escritorio/tmp$ python setup.py dist_xofatal: Not a git 
repository (or any of the parent directories): .git
But the .xo is correct!
The python setup.py dist_xo only can be called from /home/user/Activities ??
Regards!
Alan  

___
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


[Sugar-devel] [PATCH sugar-toolkit-gtk3 2/2] Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton

2012-08-22 Thread Manuel Quiñones
gtk_paint_box is deprecated [1] and now we can use the CSS to change
the style of the button's prelight state.

To test the buttons, I provide a patch for HelloWorld activity [2].
They are added in the main toolbar.

Signed-off-by: Manuel Quiñones ma...@laptop.org

[1] http://developer.gnome.org/gtk3/stable/GtkStyle.html#gtk-paint-box
[2] http://dev.laptop.org/~manuq/shell-port/test_gtk3_buttons.patch
---
 src/sugar3/graphics/colorbutton.py  | 14 --
 src/sugar3/graphics/radiotoolbutton.py  | 14 --
 src/sugar3/graphics/toggletoolbutton.py | 14 --
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/src/sugar3/graphics/colorbutton.py 
b/src/sugar3/graphics/colorbutton.py
index 95d023a..0783481 100644
--- a/src/sugar3/graphics/colorbutton.py
+++ b/src/sugar3/graphics/colorbutton.py
@@ -523,20 +523,14 @@ class ColorToolButton(Gtk.ToolItem):
 
 title = GObject.property(type=str, getter=get_title, setter=set_title)
 
-def do_expose_event(self, event):
+def do_draw(self, cr):
 child = self.get_child()
 allocation = self.get_allocation()
 if self._palette and self._palette.is_up():
 invoker = self._palette.props.invoker
-invoker.draw_rectangle(event, self._palette)
-elif child.state == Gtk.StateType.PRELIGHT:
-child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
-  Gtk.ShadowType.NONE, event.area,
-  child, 'toolbutton-prelight',
-  allocation.x, allocation.y,
-  allocation.width, allocation.height)
-
-Gtk.ToolButton.do_expose_event(self, event)
+invoker.draw_rectangle(cr, self._palette)
+
+Gtk.ToolButton.do_draw(self, cr)
 
 def __notify_change(self, widget, pspec):
 self.notify(pspec.name)
diff --git a/src/sugar3/graphics/radiotoolbutton.py 
b/src/sugar3/graphics/radiotoolbutton.py
index 8fd01f7..d843b1f 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -165,18 +165,12 @@ class RadioToolButton(Gtk.RadioToolButton):
 palette_invoker = GObject.property(
 type=object, setter=set_palette_invoker, getter=get_palette_invoker)
 
-def do_expose_event(self, event):
+def do_draw(self, cr):
 child = self.get_child()
 allocation = self.get_allocation()
 
 if self.palette and self.palette.is_up():
 invoker = self.palette.props.invoker
-invoker.draw_rectangle(event, self.palette)
-elif child.state == Gtk.StateType.PRELIGHT:
-child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
-  Gtk.ShadowType.NONE, event.area,
-  child, 'toolbutton-prelight',
-  allocation.x, allocation.y,
-  allocation.width, allocation.height)
-
-Gtk.RadioToolButton.do_expose_event(self, event)
+invoker.draw_rectangle(cr, self.palette)
+
+Gtk.RadioToolButton.do_draw(self, cr)
diff --git a/src/sugar3/graphics/toggletoolbutton.py 
b/src/sugar3/graphics/toggletoolbutton.py
index c865332..63f4ed6 100644
--- a/src/sugar3/graphics/toggletoolbutton.py
+++ b/src/sugar3/graphics/toggletoolbutton.py
@@ -113,20 +113,14 @@ class ToggleToolButton(Gtk.ToggleToolButton):
 accelerator = GObject.property(type=str, setter=set_accelerator,
getter=get_accelerator)
 
-def do_expose_event(self, event):
+def do_draw(self, cr):
 allocation = self.get_allocation()
 child = self.get_child()
 
 if self.palette and self.palette.is_up():
 invoker = self.palette.props.invoker
-invoker.draw_rectangle(event, self.palette)
-elif child.state == Gtk.StateType.PRELIGHT:
-child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
-  Gtk.ShadowType.NONE, event.area,
-  child, 'toolbutton-prelight',
-  allocation.x, allocation.y,
-  allocation.width, allocation.height)
-
-Gtk.ToggleToolButton.do_expose_event(self, event)
+invoker.draw_rectangle(cr, self.palette)
+
+Gtk.ToggleToolButton.do_draw(self, cr)
 
 palette = property(get_palette, set_palette)
-- 
1.7.11.4

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


Re: [Sugar-devel] [PATCH sugar] Remove _MouseListener from the frame and cleanup, v2, SL #3820

2012-08-22 Thread Manuel Quiñones
Yes! This complies with the behavior we agreed in the other thread.
Please commit.

2012/8/22 Simon Schampijer si...@schampijer.de:
 Move the code of mouse_enter() method into the client class,
 so a class is not needed anymore. Fix calls to non existent
 mouse_leave() method from commit 238338d4. Cleanup of unused
 leave methods due to the new behavior.

 Signed-off-by: Manuel Quiñones ma...@laptop.org
 Signed-off-by: Simon Schampijer si...@laptop.org
 ---
  src/jarabe/frame/frame.py | 47 
 ---
  1 file changed, 4 insertions(+), 43 deletions(-)

 diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py
 index ee112a1..4bdcc40 100644
 --- a/src/jarabe/frame/frame.py
 +++ b/src/jarabe/frame/frame.py
 @@ -54,17 +54,6 @@ class _Animation(animator.Animation):
  self._frame.move(current)


 -class _MouseListener(object):
 -def __init__(self, frame):
 -self._frame = frame
 -
 -def mouse_enter(self):
 -if self._frame.visible:
 -self._frame.hide()
 -else:
 -self._frame.show()
 -
 -
  class _KeyListener(object):
  def __init__(self, frame):
  self._frame = frame
 @@ -103,7 +92,6 @@ class Frame(object):
  screen.connect('size-changed', self._size_changed_cb)

  self._key_listener = _KeyListener(self)
 -self._mouse_listener = _MouseListener(self)

  self._notif_by_icon = {}

 @@ -143,12 +131,6 @@ class Frame(object):
  self.current_position = pos
  self._update_position()

 -def _is_hover(self):
 -return (self._top_panel.hover or \
 -self._bottom_panel.hover or \
 -self._left_panel.hover or \
 -self._right_panel.hover)
 -
  def _create_top_panel(self):
  panel = self._create_panel(gtk.POS_TOP)

 @@ -184,9 +166,6 @@ class Frame(object):
  def _create_left_panel(self):
  panel = ClipboardPanelWindow(self, gtk.POS_LEFT)

 -panel.connect('drag-motion', self._drag_motion_cb)
 -panel.connect('drag-leave', self._drag_leave_cb)
 -
  return panel

  def _create_panel(self, orientation):
 @@ -226,29 +205,11 @@ class Frame(object):
  def _size_changed_cb(self, screen):
  self._update_position()

 -def _enter_notify_cb(self, window, event):
 -if event.detail != gtk.gdk.NOTIFY_INFERIOR:
 -self._mouse_listener.mouse_enter()
 -
 -def _leave_notify_cb(self, window, event):
 -if event.detail == gtk.gdk.NOTIFY_INFERIOR:
 -return
 -
 -if not self._is_hover() and not self._palette_group.is_up():
 -self._mouse_listener.mouse_leave()
 -
 -def _palette_group_popdown_cb(self, group):
 -if not self._is_hover():
 -self._mouse_listener.mouse_leave()
 -
 -def _drag_motion_cb(self, window, context, x, y, time):
 -self._mouse_listener.mouse_enter()
 -
 -def _drag_leave_cb(self, window, drag_context, timestamp):
 -self._mouse_listener.mouse_leave()
 -
  def _enter_corner_cb(self, event_area):
 -self._mouse_listener.mouse_enter()
 +if self.visible:
 +self.hide()
 +else:
 +self.show()

  def notify_key_press(self):
  self._key_listener.key_press()
 --
 1.7.11.4




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


Re: [Sugar-devel] Dist_xo of bundlebuilder

2012-08-22 Thread Manuel Quiñones
2012/8/23 Alan Jhonn Aguiar Schwyn alan...@hotmail.com:
 I'm go to the problem..

 In bundlebuilder.py I found this command that make the list of files:

 git_ls = subprocess.Popen(['git', 'ls-files'], stdout=subprocess.PIPE,
   cwd=self.config.source_dir)

 If I not have git installed (like in a XO) or the directory is external of
 the git, how make a .xo?

Yes Alan, you need to install git.

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


Re: [Sugar-devel] Dist_xo of bundlebuilder

2012-08-22 Thread Alan Jhonn Aguiar Schwyn
 Date: Thu, 23 Aug 2012 02:26:23 -0300
 From: ma...@laptop.org
 To: alan...@hotmail.com
 CC: sugar-devel@lists.sugarlabs.org
 Subject: Re: [Sugar-devel] Dist_xo of bundlebuilder
 
 2012/8/23 Alan Jhonn Aguiar Schwyn alan...@hotmail.com:
  I'm go to the problem..
 
  In bundlebuilder.py I found this command that make the list of files:
 
  git_ls = subprocess.Popen(['git', 'ls-files'], stdout=subprocess.PIPE,
cwd=self.config.source_dir)
 
  If I not have git installed (like in a XO) or the directory is external of
  the git, how make a .xo?
 
 Yes Alan, you need to install git.
If I don't want?
I'm only try to make a .xo..
If I try to make it on a XO (that not have GIT) ??

 
 -- 
 .. manuq ..
 ___
 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] Dist_xo of bundlebuilder

2012-08-22 Thread Chris Leonard
On Thu, Aug 23, 2012 at 1:32 AM, Alan Jhonn Aguiar Schwyn
alan...@hotmail.com wrote:

 Yes Alan, you need to install git.

 If I don't want?

 I'm only try to make a .xo..

 If I try to make it on a XO (that not have GIT) ??

I think that is part of the logic that has lead to a decision to
include git on the XO.

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


Re: [Sugar-devel] Dist_xo of bundlebuilder

2012-08-22 Thread Alan Jhonn Aguiar Schwyn
 From: cjlhomeaddr...@gmail.com
 Date: Thu, 23 Aug 2012 01:47:36 -0400
 To: alan...@hotmail.com
 CC: sugar-devel@lists.sugarlabs.org; ma...@laptop.org
 Subject: Re: [Sugar-devel] Dist_xo of bundlebuilder
 
 On Thu, Aug 23, 2012 at 1:32 AM, Alan Jhonn Aguiar Schwyn
 alan...@hotmail.com wrote:
 
  Yes Alan, you need to install git.
 
  If I don't want?
 
  I'm only try to make a .xo..
 
  If I try to make it on a XO (that not have GIT) ??
 
 I think that is part of the logic that has lead to a decision to
 include git on the XO.
Ok... but..
I have GIT installed.. I use it all the day!
To make our TurtleBots, we have some folders with the turtle, the plugins (NxT, 
butiá, WeDo, etc)and make a tmp folder to put all together..
The problem is that the ls comand in the tmp folder, return nothing!
How we can make it ? Return to the 0.88 bundlebuilder?
 
 cjl
 ___
 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