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

2012-08-14 Thread Simon Schampijer

On 08/13/2012 11:23 PM, Simon Schampijer wrote:

On 08/06/2012 12:04 PM, Simon Schampijer wrote:

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.


I merged those patches now with the suggestions made in the review. The
work has been gone through several eyes, never less if you find any
issues please report them so we can fix them.

Regards,
Simon


If you find issues regarding the 'nohippo' changes please add the 
'nohippo' keyword. I created an rpm (from current master) to test on the 
XO [1] with the latest 12.1.0 build [2].


Just found one regression, only visible on the XO, regarding displaying 
of thumbnails in the Journal [3].


So please test and keep the bug reports coming. If we are stable in 
regards to the hippo changes next Monday I will make an official 
no-hippo release.


Regards,
   Simon

[1] 
http://dev.laptop.org/~erikos/nohippo/sugar-0.97.1-1.fc17.olpc.noarch.rpm

[2] http://wiki.laptop.org/go/Release_notes/12.1.0
[3] http://bugs.sugarlabs.org/ticket/3804

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


Re: [Sugar-devel] [sugar-toolkit-gtk3] Replace signal used in UnfullscreenButton to enable use with touch - SL #3798

2012-08-14 Thread Simon Schampijer

On 08/09/2012 10:27 PM, Manuel Quiñones wrote:

Thanks Gonzalo,


Thanks Gonzalo. I was intrigued by that fact and looked a bit at the issue.


2012/8/9  :

From: Gonzalo Odiard 

Use clicked instead of button-pressed, because this is not triggered
by touch device.


Makes sense, clicked is more general than button-pressed.  From the
docs, "is emitted when the button has been activated (pressed and
released)".

http://developer.gnome.org/gtk3/stable/GtkButton.html#GtkButton-clicked


Signed-off-by: Gonzalo Odiard 


Acked-by: Manuel Quiñones 


I tested the behavior in GTK+3 and GTK+2, and it does behave differently:

In Gtk+2 I do get as well the press&release events with touch. In Gtk+3 
I do not, only the clicked signal. Looking at the docs [1] the 
button-release-event is only submitted when it is enabled using the 
mask. Tried that, but the behavior is the same.


I am fine to go with 'clicked' as Gonzalo suggested but would be nice to 
know the details as well.


Regards,
   Simon

[1] 
http://developer.gnome.org/gtk3/3.2/GtkWidget.html#GtkWidget-button-release-event




from gi.repository import Gtk, Gdk

def _destroy_cb(widget, data=None):
Gtk.main_quit()

def __pressed_cb(button, event):
print 'pressed'

def __released_cb(button, event):
print 'released'

def __clicked_cb(button):
print 'clicked'

window = Gtk.Window()
window.connect("destroy", _destroy_cb)
window.set_default_size(450, 450)

b = Gtk.Button()
b.connect('clicked', __clicked_cb)
b.add_events(Gdk.EventMask.BUTTON_PRESS_MASK |
 Gdk.EventMask.BUTTON_RELEASE_MASK)
b.connect('button-press-event', __pressed_cb)
b.connect('button-release-event', __released_cb)

window.add(b)
b.show()

window.show()

Gtk.main()

---

import gtk

def _destroy_cb(widget, data=None):
gtk.main_quit()

def __pressed_cb(button, event):
print 'pressed'

def __released_cb(button, event):
print 'released'

def __clicked_cb(button):
print 'clicked'

window = gtk.Window()
window.connect("destroy", _destroy_cb)
window.set_default_size(450, 450)

b = gtk.Button()
b.connect('button-press-event', __pressed_cb)
b.connect('button-release-event', __released_cb)
b.connect('clicked', __clicked_cb)
window.add(b)
b.show()

window.show()
gtk.main()

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


Re: [Sugar-devel] [DESIGN] higher-resolution thumbnails

2012-08-14 Thread Manuel Quiñones
2012/8/13 Walter Bender :
> I have a proposal from the learning team regarding the resolution of
> the thumbnail images in the Journal. They'd like the thumbnails to be
> of a higher resolution, both for the detail view in the Journal and in
> the Portfolio activity. The motivation is that the current resolution
> (300x225) is not sufficient to see important details, such as the text
> in a Write document, the layout of a Mindmap (Labrynth), or the blocks
> in a Turtle Art project.

+1 !

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


Re: [Sugar-devel] [sugar-artwork] A scrolled window inside a palette should have a black background - SL #3751

2012-08-14 Thread Manuel Quiñones
Thanks Gonzalo, tested with Terminal GTK+3, patch looks good.

2012/8/13  :
> From: Gonzalo Odiard 
>
> Signed-off-by: Gonzalo Odiard 

Acked-by: Manuel Quiñones 

> ---
>  gtk3/theme/gtk-widgets.css.em | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
> index 62ca475..538d4dd 100644
> --- a/gtk3/theme/gtk-widgets.css.em
> +++ b/gtk3/theme/gtk-widgets.css.em
> @@ -549,6 +549,10 @@ SugarPaletteWindowWidget GtkToolButton .button:active {
>  border-radius: $(toolbutton_padding)px;
>  }
>
> +SugarPaletteWindowWidget GtkScrolledWindow * {
> +background-color: @black;
> +}
> +
>  /* Scales */
>
>  GtkScale {
> --
> 1.7.11.2
>



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


Re: [Sugar-devel] [sugar-artwork] Apply theme in RadioToolButton

2012-08-14 Thread Manuel Quiñones
Thanks, this patch fixes the issue.

The tool buttons still need some margin around, but that's a separate issue.

2012/8/13  :
> From: Gonzalo Odiard 
>
> This issue is displayed in the activities ported to gtk3,
> Finance SL#3739, Jukebox SL#3765, and Paint.
>
> Signed-off-by: Gonzalo Odiard 

Acked-by: Manuel Quiñones 

> ---
>  gtk3/theme/gtk-widgets.css.em | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
> index f3e4fde..62ca475 100644
> --- a/gtk3/theme/gtk-widgets.css.em
> +++ b/gtk3/theme/gtk-widgets.css.em
> @@ -521,6 +521,7 @@ background-color: @black;
>  }
>
>  .toolbar GtkToolButton .button,
> +.toolbar SugarRadioToolButton *,
>  SugarPaletteWindowWidget SugarRadioToolButton *,
>  SugarPaletteWindowWidget GtkToolButton .button{
>  background-color: transparent;
> @@ -533,6 +534,7 @@ SugarPaletteWindowWidget GtkToolButton .button:prelight {
>  background-color: @black;
>  }
>
> +.toolbar SugarRadioToolButton *:active,
>  SugarPaletteWindowWidget SugarRadioToolButton *:active {
>  background-color: @button_grey;
>  border-radius: $(toolbutton_padding)px;
> --
> 1.7.11.2
>



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


Re: [Sugar-devel] [DESIGN] higher-resolution thumbnails

2012-08-14 Thread Gary Martin
On 13 Aug 2012, at 17:38, Walter Bender  wrote:

> I have a proposal from the learning team regarding the resolution of
> the thumbnail images in the Journal. They'd like the thumbnails to be
> of a higher resolution, both for the detail view in the Journal and in
> the Portfolio activity. The motivation is that the current resolution
> (300x225) is not sufficient to see important details, such as the text
> in a Write document, the layout of a Mindmap (Labrynth), or the blocks
> in a Turtle Art project.
> 
> The tradeoff is primarily one of storage space, although there maybe
> some potential workarounds, such as having a way to ask an activity to
> generate a thumbnail on the fly.

+1 though this is raises the question of what resolution would be good enough. 
Ideally we would store images at the full display resolution, and try to 
minimise the storage space tradeoff by being more aggressive on compression. 
This would also open up an option for the illusion of fast starting Activities. 
iOS relies on this quite heavily as you start and switch between images, you're 
often looking at a transition animation and the static screen shot for a number 
of seconds (maybe 4 or 5 in some cases) while the actual code is still starting 
in the background.

Regards,
--Gary

> regards.
> 
> -walter
> 
> -- 
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
> ___
> 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] [REMINDER] Design team meeting today - Tuesday August 14th 2012 - 16:30 UTC

2012-08-14 Thread Gary C Martin
Hi folks!

Just a reminder about today's Design Meeting - Tuesday August 14th 2012 - 16:30 
UTC

http://wiki.sugarlabs.org/go/Design_Team/Meetings

Agenda:
 - Home list view, hover highlight/click results in confusion for favourite 
icons [1] ''Frederick''
 - "Examples" support for activities – using the ObjectChooser and/or also the 
Journal volumes bar to allow activities to provide access to an examples folder 
inside their bundles. [2] ''tch'' 
 - Followup on lease expiry information display in My Settings -> About My 
Computer, [3], [4]. ''Anish''
 - Followup on multi-selection and batch operations on Journal entries [5], [6]
 - Design review/testing/feedback of touch [7] features, patches [8] available 
for testing ''Simon''
 - Visual clue about secondary palette options [9] ''Gonzalo''
 - Higher-resolution Journal thumbnails for Activities [10] ''Walter''
 - 

Regards,
--Gary

[1] http://bugs.sugarlabs.org/ticket/3147#comment:3
[2] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038588.html
[3] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038571.html
[4] http://wiki.sugarlabs.org/go/Features/Lease_Information_Display
[5] http://wiki.sugarlabs.org/go/Features/Multi_selection_screenshots
[6] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038558.html
[7] http://wiki.sugarlabs.org/go/Features/Touch/Development
[8] http://dev.laptop.org/~erikos/touch/
[9] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038926.html
[10] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038929.html
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread Martin Langhoff
On Mon, Aug 13, 2012 at 7:15 PM, S. Daniel Francis
 wrote:
> I look some people is needing to know more about Unicode:

Hi danielf,

one thing to keep in mind is that UTF-8 is one of the possible ways to
represent Unicode data. We will, most of the time, use UTF-8 mixed up
with straight old ASCII. Our python code files are one example.

But that is actually a bit of a trick. A very practical, pragmatic
trick -- for example: we mostly didn't need a major rewrite of our
text editors, or script parsers. That's great. But at the same time,
we pay for it with a degree of ambiguity (is it an ASCII encoded file,
or is it a UTF-8 encoded file?).

So what we are out to do here is to reduce the ambiguity, declaring in
all the relevant spots that these are UTF-8.

The BOM header didn't become popular (for good technical reasons). Is
there a way to tell the Python interpreter that assume that our code
(inc strings in our code) should be assumed to be unicode? If so, we
can set that in sugar-session.

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 10:56 AM, Martin Langhoff
 wrote:
> The BOM header didn't become popular (for good technical reasons). Is
> there a way to tell the Python interpreter that assume that our code
> (inc strings in our code) should be assumed to be unicode? If so, we
> can set that in sugar-session.

Yes, I'm working on that. I've already found the solution but I didn't
finish yet.

I will send a patch when I finish my work to discuss about it.

-- 
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] Strings in global scope go untranslated

2012-08-14 Thread Manuel Kaufmann
On Tue, May 29, 2012 at 4:25 PM, Daniel Drake  wrote:
> Are there other options that I'm missing? Any thoughts?

Did you find any solution to this?

I'm working on a patch that is related to translated string (returning
Unicode objects instead of 8bits ones). I've already have working
version and I'm going to send it to the mailing list in a while.

-- 
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] Strings in global scope go untranslated

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 12:47 PM, Manuel Kaufmann  wrote:
> Did you find any solution to this?

Oh, sorry. I found the solution here:
 * http://bugs.sugarlabs.org/ticket/3654

You move the code from one file to another one. Thanks

-- 
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


[Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Manuel Kaufmann
gettext[1] supports both the GNU gettext catalog API and higher level,
class-based API that may be more appropriate for Python files.

This commit changes the code to use the higher level, class-based API
to return Unicode objects instead 8bits strings as it was. This allows
us to have the code consistent throughout all our activities.

Signed-off-by: Manuel Kaufmann 
---
 bin/sugar-activity |  7 ---
 src/sugar3/activity/activity.py|  5 +++--
 src/sugar3/activity/widgets.py |  4 +++-
 src/sugar3/graphics/alert.py   |  4 +++-
 src/sugar3/graphics/colorbutton.py |  4 +++-
 src/sugar3/util.py | 11 ++-
 6 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/bin/sugar-activity b/bin/sugar-activity
index 5aef1ae..2bc82b0 100644
--- a/bin/sugar-activity
+++ b/bin/sugar-activity
@@ -101,9 +101,10 @@ def main():
 
 # must be done early, some activities set translations globally, SL #3654
 locale_path = i18n.get_locale_path(bundle.get_bundle_id())
-gettext.bindtextdomain(bundle.get_bundle_id(), locale_path)
-gettext.bindtextdomain('sugar-toolkit', sugar3.locale_path)
-gettext.textdomain(bundle.get_bundle_id())
+
+# Install the actual Activity Domain to be able to use _() to
+# translate strings and get Unicode objects
+gettext.install(bundle.get_bundle_id(), locale_path, unicode=1)
 
 splitted_module = args[0].rsplit('.', 1)
 module_name = splitted_module[0]
diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py
index 8386c1e..b340853 100644
--- a/src/sugar3/activity/activity.py
+++ b/src/sugar3/activity/activity.py
@@ -73,6 +73,7 @@ from telepathy.interfaces import CHANNEL, \
 from telepathy.constants import CONNECTION_HANDLE_TYPE_CONTACT
 from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM
 
+import sugar3
 from sugar3 import util
 from sugar3.presence import presenceservice
 from sugar3.activity.activityservice import ActivityService
@@ -84,8 +85,8 @@ from sugar3.datastore import datastore
 from sugar3.session import XSMPClient
 from sugar3 import wm
 
-
-_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
+t = gettext.translation('sugar-toolkit', sugar3.locale_path)
+_ = t.ugettext
 
 SCOPE_PRIVATE = 'private'
 SCOPE_INVITE_ONLY = 'invite'  # shouldn't be shown in UI, it's implicit
diff --git a/src/sugar3/activity/widgets.py b/src/sugar3/activity/widgets.py
index c4015ce..5865cd3 100644
--- a/src/sugar3/activity/widgets.py
+++ b/src/sugar3/activity/widgets.py
@@ -23,6 +23,7 @@ import gettext
 from gi.repository import GConf
 import logging
 
+import sugar3
 from sugar3.graphics.toolbutton import ToolButton
 from sugar3.graphics.toolbarbox import ToolbarButton
 from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton
@@ -34,7 +35,8 @@ from sugar3.bundle.activitybundle import ActivityBundle
 from sugar3.graphics import style
 
 
-_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
+t = gettext.translation('sugar-toolkit', sugar3.locale_path)
+_ = t.ugettext
 
 
 def _create_activity_icon(metadata):
diff --git a/src/sugar3/graphics/alert.py b/src/sugar3/graphics/alert.py
index 16392cd..600d7fc 100644
--- a/src/sugar3/graphics/alert.py
+++ b/src/sugar3/graphics/alert.py
@@ -52,11 +52,13 @@ from gi.repository import GObject
 from gi.repository import GLib
 import math
 
+import sugar3
 from sugar3.graphics import style
 from sugar3.graphics.icon import Icon
 
 
-_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
+t = gettext.translation('sugar-toolkit', sugar3.locale_path)
+_ = t.ugettext
 
 
 class Alert(Gtk.EventBox):
diff --git a/src/sugar3/graphics/colorbutton.py 
b/src/sugar3/graphics/colorbutton.py
index 95d023a..56f668c 100644
--- a/src/sugar3/graphics/colorbutton.py
+++ b/src/sugar3/graphics/colorbutton.py
@@ -24,12 +24,14 @@ from gi.repository import GObject
 import struct
 import logging
 
+import sugar3
 from sugar3.graphics import style
 from sugar3.graphics.icon import Icon
 from sugar3.graphics.palette import Palette, ToolInvoker, WidgetInvoker
 
 
-_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
+t = gettext.translation('sugar-toolkit', sugar3.locale_path)
+_ = t.ugettext
 
 
 def get_svg_color_string(color):
diff --git a/src/sugar3/util.py b/src/sugar3/util.py
index baec3b1..923dc72 100644
--- a/src/sugar3/util.py
+++ b/src/sugar3/util.py
@@ -30,8 +30,10 @@ import tempfile
 import logging
 import atexit
 
+import sugar3
 
-_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
+t = gettext.translation('sugar-toolkit', sugar3.locale_path)
+_ = t.ugettext
 
 
 def printable_hash(in_hash):
@@ -270,10 +272,9 @@ def timestamp_to_elapsed_string(timestamp, max_levels=2):
 if key in _i18n_timestamps_cache:
 time_period += _i18n_timestamps_cache[key]
 else:
-tmp = gettext.dngettext('sugar-toolkit',
-name_singular,
-   

Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 11:35 AM, Manuel Kaufmann  wrote:
> I will send a patch when I finish my work to discuss about it.

http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038959.html

-- 
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] [DESIGN] Proposal: Multi-Selection and Batch Operations on Journal entries

2012-08-14 Thread Gary Martin
Hi Ajay,

On 14 Aug 2012, at 11:51, Ajay Garg  wrote:

> Hi Gary, Anish, Gonzalo.
> 
> The "impatient" UI-interaction bug has been fixed via ::
> http://git.sugarlabs.org/dextrose/mainline/commit/e34ba2bc5554621a7770c8f5960f257bff9787f8
> 
> The latest sugar-rpm (containing the fix) can be found at ::
> http://people.sugarlabs.org/ajay/root/multi-select-latest-sugar-rpm-14th-august/sugar-0.94.1-31.dx3.noarch.rpm
> 
> 
> Please test on the dextrose image as usual :)

Thanks. have just been testing an bumped into this new issue with the Journal 
UI is locking during a batch operation. You can't interact with error alerts:


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

Regards,
--Gary

> 
> 
> Thanks and Regards,
> Ajay
> 
> 
> 
> On Tue, Aug 14, 2012 at 8:59 AM, Gonzalo Odiard  wrote:
> Probably have sense blocking the Journal ui (and show a clock cursor)
> when doing a slow operation.
> 
> Gonzalo
> 
> 
> On Mon, Aug 13, 2012 at 11:27 PM, Anish Mangal  
> wrote:
> There seem to be many bugs where something 'ugly' happens when
> something is clicked "while" an operation is happening.
> 
> Can't we just lock all UI actions *while* batch operations are taking
> place (and only have an abort/cancel button)? Of course, this might be
> harder said than done, and might not be the best way codewise (was
> just thinking in terms of UX)
> 
> On Tue, Aug 14, 2012 at 4:34 AM, Gary Martin  
> wrote:
> > Thanks Ajay,
> >
> > On 13 Aug 2012, at 07:05, Ajay Garg  wrote:
> >
> >> Hi Gary.
> >>
> >> Made the change via the patch ::
> >> http://git.sugarlabs.org/dextrose/mainline/commit/d9426b3b0be8249110d3073015d2514402734930
> >
> > That's a much smaller code change than mine ;)
> >
> >> The latest sugar-rpm can be found at ::
> >> http://people.sugarlabs.org/ajay/root/multi-select-latest-sugar-rpm-13th-august/sugar-0.94.1-31.dx3.noarch.rpm
> >>
> >>
> >> Please test with it, on your dextrose image as usual :)
> >
> > Have found a new nasty bug. If, while a batch operation is in progress, you 
> > uncheck some items, multi-select gets rather unhappy. My test case:
> >
> > 1) copy ~100 items over to the Documents folder
> > 2) switch to view the Documents folder
> > 3) check an entry and the select all
> > 4) scroll down a few pages
> > 5) click Erase
> > 6) confirm the Erase
> > 7) uncheck some entries while the batch is running
> > 8) wait for Erase batch to complete
> >
> > Result: I now see the Toolbar hint that says "Selected 3 of 100" (I 
> > unchecked 3 items during the Erase batch operation), however all ~100 items 
> > are still displayed and shown checked. I then clicked Select all and got a 
> > spinning cursor and a seemingly stalled Journal stuck in multi-select mode. 
> > As I moved the cursor over the list area the activity icons started to 
> > redraw in black and white (no more ownership stroke and fill colour, I 
> > guess due to catching up with erased metadata). Needed to reboot Sugar to 
> > recover, and on checking Documents all items had been erased.
> >
> > You can get into similar multi-select stalls by being 'impatient' with the 
> > UI:
> >
> > 1) select ~100 items
> > 2) click erase
> > 3) confirm erase
> > 4) click Deselect all while the batch is still running
> >
> > I'll post the shell log to you in a separate email.
> >
> > Regards,
> > --Gary
> >
> >> Thanks and Regards,
> >> Ajay
> >>
> >> On Mon, Aug 13, 2012 at 5:24 AM, Gary Martin  
> >> wrote:
> >> Hi Ajay,
> >>
> >> On 12 Aug 2012, at 20:30, Gary Martin  wrote:
> >>
> >> > Hi Ajay,
> >> >
> >> > On 8 Aug 2012, at 10:42, Ajay Garg  wrote:
> >> >
> >> >> Hi Gary.
> >> >>
> >> >> Please find the link, for the latest sugar-rpm, that contains the 
> >> >> fixes/changes, as per the 3 action-items marked for me, in 7th August's 
> >> >> design-meeting ::
> >> >> http://people.sugarlabs.org/ajay/root/multi-select-with-checkbox-fix-plus-3-more-7th-august-action-items/sugar-0.94.1-31.dx3.noarch.rpm
> >> >>
> >> >> For brevity, here are the action items, and the corresponding patches ::
> >> >>
> >> >> #action improve batch tick redraw-intervals (ajay)
> >> >> http://git.sugarlabs.org/dextrose/mainline/commit/cdcf2717fe4bdd42cdbb632c51b0b371e2e3352f
> >> >
> >> > Spotted one case here, in line 96:
> >> >
> >> >   if (current_entry_number % twenty_percent_of_total_items) == 0:
> >> >
> >> > If there are only a small number of items (e.g. 11) being batched 
> >> > operated on then it redraws too frequently (in ~2 at a time for 11 
> >> > entries), so is quite slow. Batch operations should be in blocks of 10 
> >> > or more at a time (unless there are less than 10 items in which case do 
> >> > them all at once). This also means your test at line 80 isn't being 
> >> > usefully triggered and I think can be removed (as far as I can tell, 
> >> > please test).
> >> >
> >> > The test case at line 96 should be something like:
> >> >
> >> >   if min (total_items, max (10, (current_entry_num

Re: [Sugar-devel] Proposal: Adding Manuel Quiñones as a Sugar shell maintainer

2012-08-14 Thread Simon Schampijer

Thanks for all the responses.

Welcome Manuel [1]!

Regards,
   Simon

[1] http://wiki.sugarlabs.org/go/Development_Team/Release/Modules#Glucose



On 08/08/2012 04:57 PM, Daniel Narvaez wrote:

+1 !

(and I think the maintainers for sugar-artwork, sugar-toolkit and
sugar should just be the same).

On 7 August 2012 16:51, Simon Schampijer  wrote:

Hi,

Something I wanted to propose in todays developer meeting (but as it did not
happen), I send it here for an async proposal.

We are short on maintainers and we have to grow new members that helps us
share the load. The patch list is long and help in that regard will be
appreciated that especially small patches do not take so long to get in.

Lately Manuel Quiñones have been stepping up as a Sugar module maintainer.
He is already maintaining sugar-artwork and sugar-toolkit-gtk3 [1]. He has
been showing great talent with porting the Browse activity to WebkitGtk [2]
and he has been working on porting the Sugar theme and the sugar-toolkit to
GTK+ 3.

We are currently working on the shell port to GTK+ 3 and introspection and
Manuel has been advancing already quite a lot [3]. As all of those Sugar
sub-modules are interlinked I think it makes absolute sense to add him as a
maintainer to the Sugar shell as well.

To make sure: the general work-flow should not change, patches have to be
sent to the mailing list for review. For non-trivial reviews a maintainer
should have at least one review, preferred a review and acknowledgment from
another maintainer. It is good practice to leave a patch for a few days so
everyone maintainer can at least have a high level look if he disagrees with
an approach.

I hope we can address the issues listed in that way,
Simon

[1] http://wiki.sugarlabs.org/go/Development_Team/Release/Modules
[2] http://git.sugarlabs.org/browse
[3] http://git.sugarlabs.org/~manuq/sugar/manuqs-erikos-shell-port
___
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] [MINUTES] Development team meeting --- 14 August 2012 (15:00 UTC)

2012-08-14 Thread Simon Schampijer
Minutes: 
http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-08-14T15:04:58.html
Log: 
http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-08-14T15:04:58


Cheers,
   Simon

On 08/13/2012 11:47 PM, Simon Schampijer wrote:

Hi,

tomorrow we will have our weekly dev team meeting.

Time: 14. August 2012 (15:00 UTC)
Place: #sugar-meeting (freenode)

Topics:

- introducing new contributors

- follow up the shell port:
http://wiki.sugarlabs.org/go/Features/GTK3/Shell (manuq)

- follow up the touch support in the shell:
http://wiki.sugarlabs.org/go/Features/Touch/Development (erikos)

- follow up the activities port, touch addition (including gestures),
releasing of new activities (gonzalo)

- 

Regards,
Simon
___
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] [sugar-toolkit-gtk3] Replace signal used in UnfullscreenButton to enable use with touch - SL #3798

2012-08-14 Thread Gonzalo Odiard
>
>
> I am fine to go with 'clicked' as Gonzalo suggested but would be nice to
> know the details as well.
>
> Regards,
>Simon
>
>
The following info can be related:

In gtk3, a patch to check emulating_pointer before use touch as
button_press/release:

http://osdir.com/ml/commits.gnome/2012-02/msg09694.html

The code involved:

http://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c#n5851

A XOrg announcement with changes related:

http://www.spinics.net/lists/xorg/msg53528.html

More patches to get the info:

https://mail.gnome.org/archives/commits-list/2012-March/msg01384.html

http://osdir.com/ml/commits.gnome/2012-03/msg01344.html

https://mail.gnome.org/archives/commits-list/2012-February/msg09965.html
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [REMINDER] Design team meeting today - Tuesday August 14th 2012 - 16:30 UTC

2012-08-14 Thread Gary C Martin
Thanks all who made it to the meeting! Think we managed to cover lots of ground 
– here's the logs for those who couldn't be there:

 Minutes: 
http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-08-14T16:47:13.html
 Log: http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-08-14T16:47:13

Regards,
--Gary

On 14 Aug 2012, at 14:40, Gary C Martin  wrote:

> Hi folks!
> 
> Just a reminder about today's Design Meeting - Tuesday August 14th 2012 - 
> 16:30 UTC
> 
>   http://wiki.sugarlabs.org/go/Design_Team/Meetings
> 
> Agenda:
> - Home list view, hover highlight/click results in confusion for favourite 
> icons [1] ''Frederick''
> - "Examples" support for activities – using the ObjectChooser and/or also the 
> Journal volumes bar to allow activities to provide access to an examples 
> folder inside their bundles. [2] ''tch'' 
> - Followup on lease expiry information display in My Settings -> About My 
> Computer, [3], [4]. ''Anish''
> - Followup on multi-selection and batch operations on Journal entries [5], [6]
> - Design review/testing/feedback of touch [7] features, patches [8] available 
> for testing ''Simon''
> - Visual clue about secondary palette options [9] ''Gonzalo''
> - Higher-resolution Journal thumbnails for Activities [10] ''Walter''
> - 
> 
> Regards,
> --Gary
> 
> [1] http://bugs.sugarlabs.org/ticket/3147#comment:3
> [2] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038588.html
> [3] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038571.html
> [4] http://wiki.sugarlabs.org/go/Features/Lease_Information_Display
> [5] http://wiki.sugarlabs.org/go/Features/Multi_selection_screenshots
> [6] http://lists.sugarlabs.org/archive/sugar-devel/2012-July/038558.html
> [7] http://wiki.sugarlabs.org/go/Features/Touch/Development
> [8] http://dev.laptop.org/~erikos/touch/
> [9] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038926.html
> [10] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038929.html

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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Gonzalo Odiard
Humitos,

We need help form more experienced people here to do the review.
Can you explain the problem you are trying to solve and
why you think this is the right solution?

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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 3:49 PM, Gonzalo Odiard  wrote:
> Can you explain the problem you are trying to solve and
> why you think this is the right solution?

I sent an email yesterday commenting what the problem is and what the
best solution is. Here is the thread:

 * http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html

Broadly speaking, the issue is related with "merging Unicode string
with 8bits ones" and this convey many problems that are difficult to
find out and solve. In Python, is highly recommended to use Unicode
throughout the source code and encode the string when it is necessary.
For example, when you want to save some text into a file or send data
through internet (via HTTP POST).

With this patch there is no need to change the source code of all the
activities, they should work as they are. But, we can omit the import
of gettext as _ because this patch installs it as a builtin
function[1]:

from gettext import gettext as _

For this reason, we can omit this line in new Activities.

Is it clearer now?

Thanks,

[1] http://docs.python.org/library/gettext.html#gettext.install

-- 
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


[Sugar-devel] [PATCH] Fix the label text color for checkboxes and radiobuttons in the toolbars and the palettes

2012-08-14 Thread Manuel Quiñones
Signed-off-by: Manuel Quiñones 
Tested-by: Gonzalo Odiard 
Reviewed-by: Gonzalo Odiard 
---
 gtk3/theme/gtk-widgets.css.em | 5 +
 1 file changed, 5 insertions(+)

diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
index 538d4dd..5549970 100644
--- a/gtk3/theme/gtk-widgets.css.em
+++ b/gtk3/theme/gtk-widgets.css.em
@@ -592,6 +592,11 @@ GtkCheckButton:prelight {
 background-color: alpha(@theme_base_color, 0.0);
 }
 
+.toolbar GtkCheckButton *:active,
+SugarPaletteWindowWidget GtkCheckButton *:active {
+color: @theme_base_color;
+}
+
 .radio,
 .radio row:selected,
 .radio row:selected:focused {
-- 
1.7.11.2

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


Re: [Sugar-devel] [PATCH] Fix the label text color for checkboxes and radiobuttons in the toolbars and the palettes

2012-08-14 Thread Manuel Quiñones
I will push this one as Gonzalo already tested and reviewed.

2012/8/14 Manuel Quiñones :
> Signed-off-by: Manuel Quiñones 
> Tested-by: Gonzalo Odiard 
> Reviewed-by: Gonzalo Odiard 
> ---
>  gtk3/theme/gtk-widgets.css.em | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
> index 538d4dd..5549970 100644
> --- a/gtk3/theme/gtk-widgets.css.em
> +++ b/gtk3/theme/gtk-widgets.css.em
> @@ -592,6 +592,11 @@ GtkCheckButton:prelight {
>  background-color: alpha(@theme_base_color, 0.0);
>  }
>
> +.toolbar GtkCheckButton *:active,
> +SugarPaletteWindowWidget GtkCheckButton *:active {
> +color: @theme_base_color;
> +}
> +
>  .radio,
>  .radio row:selected,
>  .radio row:selected:focused {
> --
> 1.7.11.2
>



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


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread S. Daniel Francis
2012/8/14 Martin Langhoff :
> Hi danielf,
Hi Martin,
> wrote:
>> I look some people is needing to know more about Unicode:
First I'll apologize because the first part of my message sounds a bit rude.

> one thing to keep in mind is that UTF-8 is one of the possible ways to
> represent Unicode data. We will, most of the time, use UTF-8 mixed up
> with straight old ASCII. Our python code files are one example.

Yes, I know UTF-8 is only one of the possible ways, but there is a
reason to use it instead of any other. Also the python code files
could be ASCII and the header line could say utf-8. The line tells
Python the charset for encode the strings.

> The BOM header didn't become popular (for good technical reasons). Is
> there a way to tell the Python interpreter that assume that our code
> (inc strings in our code) should be assumed to be unicode? If so, we
> can set that in sugar-session.

Unicode (Python Type) is for process text, but for input/output, that
text will need to be encoded as a string, and for that you will need a
code charset. Now it's the time to ask: Must we get all the translated
strings as Unicode and encode them as utf-8? I think there are too few
cases when an activity gets translated strings and needs to work
directly with unicode. Maybe I also need to get informed, this is the
good part of use a mailing list, we all know different things.

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


Re: [Sugar-devel] [PATCH] Fix the label text color for checkboxes and radiobuttons in the toolbars and the palettes

2012-08-14 Thread Gonzalo Odiard
Thanks

On Tue, Aug 14, 2012 at 5:25 PM, Manuel Quiñones  wrote:

> I will push this one as Gonzalo already tested and reviewed.
>
> 2012/8/14 Manuel Quiñones :
> > Signed-off-by: Manuel Quiñones 
> > Tested-by: Gonzalo Odiard 
> > Reviewed-by: Gonzalo Odiard 
> > ---
> >  gtk3/theme/gtk-widgets.css.em | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/gtk3/theme/gtk-widgets.css.em
> b/gtk3/theme/gtk-widgets.css.em
> > index 538d4dd..5549970 100644
> > --- a/gtk3/theme/gtk-widgets.css.em
> > +++ b/gtk3/theme/gtk-widgets.css.em
> > @@ -592,6 +592,11 @@ GtkCheckButton:prelight {
> >  background-color: alpha(@theme_base_color, 0.0);
> >  }
> >
> > +.toolbar GtkCheckButton *:active,
> > +SugarPaletteWindowWidget GtkCheckButton *:active {
> > +color: @theme_base_color;
> > +}
> > +
> >  .radio,
> >  .radio row:selected,
> >  .radio row:selected:focused {
> > --
> > 1.7.11.2
> >
>
>
>
> --
> .. 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] Unicode strings in translations

2012-08-14 Thread Gonzalo Odiard
>
>
> Unicode (Python Type) is for process text, but for input/output, that
> text will need to be encoded as a string, and for that you will need a
> code charset. Now it's the time to ask: Must we get all the translated
> strings as Unicode and encode them as utf-8? I think there are too few
> cases when an activity gets translated strings and needs to work
> directly with unicode.


Probably because you do not speak chinese or any other asian language :)

All our translations are already encoded as utf-8

I tested it:

In my honey directory, with all the activities included by default in OLPC
image:

[gonzalo@nautilus honey]$ grep charset */*/po/*.po | wc
   4118   12354  293287

[gonzalo@nautilus honey]$ grep charset */*/po/*.po | grep -i "utf-8" | wc
   4118   12354  293287

Linux is encoding by default as UTF-8 by years now.

Gonzalo



> Maybe I also need to get informed, this is the
> good part of use a mailing list, we all know different things.
>
> Regards.
> ~danielf
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread S. Daniel Francis
2012/8/14 Gonzalo Odiard :
>>
>> Unicode (Python Type) is for process text, but for input/output, that
>> text will need to be encoded as a string, and for that you will need a
>> code charset. Now it's the time to ask: Must we get all the translated
>> strings as Unicode and encode them as utf-8? I think there are too few
>> cases when an activity gets translated strings and needs to work
>> directly with unicode.
>
>
> Probably because you do not speak chinese or any other asian language :)
>
We can represent all unicode characters in utf-8 and that's one of the
reasons Linux has it by default, of course the translations are
encoded in utf-8 because it can represent characters from Asia,
Africa, languages with derivation from Latin and non-existent
languages.

Now the question is: Why should we get translations as Python type
Unicode and encode them again in utf-8?

We have our translations encoded in files. The activity can get the
strings directly for output, but if the activity will modify or only
iterate a string, it's recommended to decode the utf-8 string and work
with the text in the Python type Unicode and then encode it as a utf-8
string for use it as output. What Manuel is purposing, is setup
gettext appropriately for get text of type unicode with the _
function. A big part of the translated strings don't need that step of
encode and decode...

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


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread Martin Langhoff
On Tue, Aug 14, 2012 at 5:18 PM, S. Daniel Francis
 wrote:
>>> strings as Unicode and encode them as utf-8? I think there are too few
>>> cases when an activity gets translated strings and needs to work
>>> directly with unicode.
>>
>>
>> Probably because you do not speak chinese or any other asian language :)
>>
> We can represent all unicode characters in utf-8 and that's one of the

danielf -- I think you are tangled in your confused terminology. UTF-8
_is a form of Unicode_. So when you say "I think there are too few
cases when an activity gets translated strings and needs to work
directly with unicode", it is... well, wrong for any software that
will be used internationally.

Perhaps you mean something else, like the "Python type Unicode". But
in general discussion, people do use Unicode to mean... Unicode ;-)

cheers,




-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Daniel Drake
On Tue, Aug 14, 2012 at 1:15 PM, Manuel Kaufmann  wrote:
> Broadly speaking, the issue is related with "merging Unicode string
> with 8bits ones" and this convey many problems that are difficult to
> find out and solve. In Python, is highly recommended to use Unicode
> throughout the source code

Personally, I'd say that recommending universal use of unicode in
Python 2 is questionable.

> With this patch there is no need to change the source code of all the
> activities, they should work as they are. But, we can omit the import
> of gettext as _ because this patch installs it as a builtin
> function[1]:
>
> from gettext import gettext as _

So _ will suddenly change from returning a string to a unicode for all
activities? That is likely to break several things, for the same
reasons that we recently saw in another thread: why doesn't pygi
return unicode strings for GtkEntry.get_text() and so on?

The unicode mess is sorted in Python 3; it may be better to invest
effort in moving that direction instead. (after a quick glance at the
thread you linked to, I'm not sure what the actual problem is).

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


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 6:18 PM, S. Daniel Francis
 wrote:
> Now the question is: Why should we get translations as Python type
> Unicode and encode them again in utf-8?

The reason is given here:

"Software should only work with Unicode strings internally, converting
to a particular encoding on output."[1]

http://docs.python.org/howto/unicode.html#tips-for-writing-unicode-aware-programs

You can read the whole article. It's interesting. There are a lot of
things that I didn't know :)

-- 
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-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 6:55 PM, Daniel Drake  wrote:
> So _ will suddenly change from returning a string to a unicode for all
> activities?

Yes. Actually, this patch is only for the activities that are being
ported to Gtk3 (because it affects just to sugar-toolkit-gtk3) and
it's a good point to start handling strings as it should be (Unicode)
:)

> That is likely to break several things, for the same
> reasons that we recently saw in another thread: why doesn't pygi
> return unicode strings for GtkEntry.get_text() and so on?

Can you point me out to that thread? I didn't read it.

> The unicode mess is sorted in Python 3; it may be better to invest
> effort in moving that direction instead. (after a quick glance at the
> thread you linked to, I'm not sure what the actual problem is).

How can I help you to make it clearer?

-- 
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-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Daniel Drake
On Tue, Aug 14, 2012 at 4:19 PM, Manuel Kaufmann  wrote:
>> That is likely to break several things, for the same
>> reasons that we recently saw in another thread: why doesn't pygi
>> return unicode strings for GtkEntry.get_text() and so on?
>
> Can you point me out to that thread? I didn't read it.

http://bugs.sugarlabs.org/ticket/2830

> How can I help you to make it clearer?

Show us an activity that fails because of this and give some
details/explanation.

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


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread S. Daniel Francis
2012/8/14 Manuel Kaufmann :
> The reason is given here:
>
> "Software should only work with Unicode strings internally, converting
> to a particular encoding on output."

As I said, the unicode (Python type what generated this thread), is
used only internally and our link gives more sense to what I say, the
output is usually coded in utf-8 (coded string).

Here the translated strings are usually:
- Simple arguments for a GtkWidet
Example:
button = ToolButton('gtk-add')
button.set_tooltip(_('Append'))

- Strings with format
Example:
button.set_tooltip(_('Append %s') % _('something'))

These strings aren't processed internally, the last string depends of
other programs and libraries implemented correctly (A part at the
Python interpreter), they will not generate a conflict if you have
only Asian characters.

The unicode type at python is used in cases when the text doesn't go
directly to the output and your code processes it directly. For
example if you have a long string and you'd like to insert line feeds
into the string. Too few strings in the Sugar Pootle are made for
this, but in the case of be needing it, there are the methods
unicode.encode and str.decode available and tidy at Python.

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


Re: [Sugar-devel] Unicode strings in translations

2012-08-14 Thread S. Daniel Francis
2012/8/14 Martin Langhoff :
> Perhaps you mean something else, like the "Python type Unicode". But
> in general discussion, people do use Unicode to mean... Unicode ;-)

Exactly, a lot of times I said unicode meaning PyUnicode, and this
thread started with an issue between two different python types: "str"
and "unicode".

I listened the following definitions at a talk about unicode at the
PyDayUY, I trust in the speaker but it's a good time to revise,
clarify concepts and take a little disambiguation:

Unicode: A standard repertoire of lots of characters. (Association of
numbers with letters, etc.)
UTF-8: (Unicode Transfer Format). Implementation of all the unicode
characters but in Bytes. The computer never works really with Unicode
because all what the computer works with, need to be encoded in bytes,
in this case with UTF-8.

Thinking it well:
Was the Python type well named Unicode?
What does the people usually mean with Unicode?

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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread S. Daniel Francis
2012/8/14 Manuel Kaufmann :
> On Tue, Aug 14, 2012 at 3:49 PM, Gonzalo Odiard  wrote:
>> Can you explain the problem you are trying to solve and
>> why you think this is the right solution?
>
> I sent an email yesterday commenting what the problem is and what the
> best solution is. Here is the thread:
>
>  * http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html
-1
I already explained my position at that thread, and my namesake dsd is
also disagreeing as I can see.

> With this patch there is no need to change the source code of all the
> activities, they should work as they are. But, we can omit the import
> of gettext as _ because this patch installs it as a builtin
> function[1]:
>
> from gettext import gettext as _
>
> For this reason, we can omit this line in new Activities.
>
+1
Does the old import generate a conflict or the developers must use a
conditional for backward compatibility?
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

2012-08-14 Thread Manuel Kaufmann
On Tue, Aug 14, 2012 at 7:35 PM, Daniel Drake  wrote:
> Show us an activity that fails because of this and give some
> details/explanation.

I've already explain this on the other thread (I linked it in this one
too), it talks about Typing Turtle and the "Congratulation.." string
but don't worry.

There is another activity that has this problem as well: Get Books.
This commit shows the "hack" that we have to use to combine 8bits and
Unicode strings:

 * 
http://git.sugarlabs.org/get-books/mainline/commit/165ce7c28a51ec016f9b4dcbb2dd27203539d186

I'm sure that is not the correct way to handle this problem and I'm
100% sure this should be solved using Unicode throughout the code but
maybe I'm wrong in the way that I'm proposing. I'm not a Sugar expert.

The REAL problem is mixing of Unicode with 8bits strings. We have to
decide to use ONLY one of them and there are many reasons for use
Unicode (as I pointed you out on the other thread). We MUSTN'T mix
them.

Some examples with weird results:

* Unicode + Unicode -> No problem

>>> u'Tengo un ' + u'camión'
u'Tengo un cami\xf3n'

* 8bits (utf8) + 8bits (utf8) -> No problem

>>> 'Tengo un ' + 'camión'
'Tengo un cami\xc3\xb3n'

* 8bits (utf8) + Unicode -> No problem

>>> 'Tengo un ' + u'camión'
u'Tengo un cami\xf3n'

* Unicode + 8bits (utf8) -> CRASH !!

>>> u'Tengo un ' + 'camión'
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
4: ordinal not in range(128)

So, Unicode at the left side of the operator crash... Is that an
expected behaviour? Why it doesn't crash at the right side too? Should
I check every strings on my code? We need an unique way to handle our
strings and Unicode comes to my mind  everytime :) . Python's gettext
module and Unicode's documentation recommend that, why are we going to
go in the opposite direction?

Cheers,

-- 
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] Unicode strings in translations

2012-08-14 Thread Gonzalo Odiard
>
> - Strings with format
> Example:
> button.set_tooltip(_('Append %s') % _('something'))
>
>
The problem with this example is when you have language like Spanish,
where some of the characters can be encoded in ascii, but not all.
In this case, gettext will return a str or a PyUnicode depending of the
case,
and if are not compatibles, the format will break.

The worst part, the developer can't know it, depends on the translation.

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