Re: [Sugar-devel] Issues i have found in os2

2012-09-18 Thread Alan Jhonn Aguiar Schwyn



Hello!
I have a strange problem.I use the command copy-nand to install the image but 
at the end says: Error writing to NAND FLASH
I try twice and get the same error..
Now, I use 21018o0.img and have the same problem!
I try with the 21018o0.img and his respective fs.zip (using the 4 game-keys 
buttons) and works!
I'm making something wrong?
Someone have a similar problem with copy-nand ??
This is an old XO-1 (SKU 1) with firmware Q2F13
Regards!
Alan

Date: Fri, 14 Sep 2012 13:45:14 -0300
From: gonz...@laptop.org
To: si...@schampijer.de; ma...@laptop.org; sugar-devel@lists.sugarlabs.org
Subject: [Sugar-devel] Issues i have found in os2

First, congrats by the port, is a huge mass of work.
I know is early, but I report here a few issues I have found, just if is useful 
to you:
* Palettes in speak and speech don't show.
* Palette in central kid icon in the home does not show at times.* In the 
control panel,  Power, Keyboard, Network and Software Update panel does not 
work.* In the control panel,  Language,Switch Desktop panel reset sugar!
* In the control panel,  Modem panel is bigger than expected* The home is 
unresponsive at times, in the log there are many errors: favoritesview.py line 
210: Expected Gtk.TargetList, but got list

Touch stop working in my system at times, and I need restart the XO,was 
happening with the last images, anybody else see this issue?
Gonzalo

___
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 Browse] Cancel a download if space is very tight SL #394

2012-09-18 Thread Manuel Kaufmann
On Mon, Sep 17, 2012 at 7:40 PM, James Cameron qu...@laptop.org wrote:
 I've no other comments about the patch.

Thanks for your comments. I'm about to send a new patch.

-- 
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 2/2] Signal to check free available space

2012-09-18 Thread Manuel Kaufmann
Datastore will emit the 'datastore.error' signal when the free
available space will be under SPACE_THRESHOLD. This will allow
activities to handle this situation properly. For example, Browse
could cancel a download in progress.

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

diff --git a/src/sugar3/datastore/datastore.py 
b/src/sugar3/datastore/datastore.py
index 33100e8..6a39b4e 100644
--- a/src/sugar3/datastore/datastore.py
+++ b/src/sugar3/datastore/datastore.py
@@ -39,6 +39,11 @@ DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore'
 DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore'
 DS_DBUS_PATH = '/org/laptop/sugar/DataStore'
 
+SPACE_THRESHOLD = 52428800  # 50Mb
+
+# Error codes
+LOW_SPACE = 1
+
 _data_store = None
 
 
@@ -57,14 +62,25 @@ def _get_data_store():
 return _data_store
 
 
+def free_available_space(path='/'):
+s = os.statvfs(path)
+return s.f_bavail * s.f_frsize
+
+
 def __datastore_created_cb(object_id):
 metadata = _get_data_store().get_properties(object_id, byte_arrays=True)
 updated.send(None, object_id=object_id, metadata=metadata)
+if free_available_space()  SPACE_THRESHOLD:
+error.send(None, errno=LOW_SPACE)
 
 
 def __datastore_updated_cb(object_id):
 metadata = _get_data_store().get_properties(object_id, byte_arrays=True)
 updated.send(None, object_id=object_id, metadata=metadata)
+if free_available_space()  SPACE_THRESHOLD:
+logging.warning('Free space below SPACE_THRESHOLD: %s Kb',
+SPACE_THRESHOLD)
+error.send(None, errno=LOW_SPACE)
 
 
 def __datastore_deleted_cb(object_id):
@@ -74,6 +90,8 @@ created = dispatch.Signal()
 deleted = dispatch.Signal()
 updated = dispatch.Signal()
 
+error = dispatch.Signal()
+
 _get_data_store()
 
 
-- 
1.7.11.4

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


[Sugar-devel] [PATCH Browse 1/2] Cancel a download if space is very tight SL #394

2012-09-18 Thread Manuel Kaufmann
It checks for enough space (using Activity.enough_space) before
downloading the file. If not, Browse will cancel the download process
before starting it and an Alert will be shown to the user to inform
this situation.

Signed-off-by: Manuel Kaufmann humi...@gmail.com
---
 downloadmanager.py | 63 +-
 1 file changed, 48 insertions(+), 15 deletions(-)

diff --git a/downloadmanager.py b/downloadmanager.py
index 9950c16..5ad1a6f 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -74,16 +74,18 @@ class Download(object):
 self._stop_alert = None
 
 # figure out download URI
-temp_path = os.path.join(activity.get_activity_root(), 'instance')
-if not os.path.exists(temp_path):
-os.makedirs(temp_path)
+self.temp_path = os.path.join(activity.get_activity_root(), 'instance')
+if not os.path.exists(self.temp_path):
+os.makedirs(self.temp_path)
 
-fd, self._dest_path = tempfile.mkstemp(dir=temp_path,
+fd, self._dest_path = tempfile.mkstemp(dir=self.temp_path,
 suffix=download.get_suggested_filename(),
 prefix='tmp')
 os.close(fd)
 logging.debug('Download destination path: %s' % self._dest_path)
 
+# We have to start the download to get 'total-size'
+# property. It not, 0 is returned
 self._download.set_destination_uri('file://' + self._dest_path)
 self._download.start()
 
@@ -95,17 +97,48 @@ class Download(object):
 def __state_change_cb(self, download, gparamspec):
 state = self._download.get_status()
 if state == WebKit.DownloadStatus.STARTED:
-self._create_journal_object()
-self._object_id = self.dl_jobject.object_id
-
-alert = TimeoutAlert(9)
-alert.props.title = _('Download started')
-alert.props.msg = _('%s' % self._download.get_suggested_filename())
-self._activity.add_alert(alert)
-alert.connect('response', self.__start_response_cb)
-alert.show()
-global _active_downloads
-_active_downloads.append(self)
+# Check free space and cancel the download if there is not enough.
+total_size = self._download.get_total_size()
+logging.debug('Total size of the file: %s', total_size)
+enough_space = self._activity.enough_space(
+total_size, path=self.temp_path)
+if not enough_space:
+logging.debug('Download canceled because of Disk Space')
+self.cancel()
+
+self._canceled_alert = Alert()
+self._canceled_alert.props.title = _('Not enough space '
+ 'to download')
+
+total_size_mb = total_size / 1024.0 ** 2
+free_space_mb = datastore.free_available_space(
+path=self.temp_path) - datastore.SPACE_THRESHOLD \
+/ 1024.0 ** 2
+filename = self._download.get_suggested_filename()
+self._canceled_alert.props.msg = \
+_('Download %s requires %.2f MB of free space, only '
+  '%.2f MB is available' % (filename, total_size_mb,
+  free_space_mb))
+ok_icon = Icon(icon_name='dialog-ok')
+self._canceled_alert.add_button(Gtk.ResponseType.OK,
+_('Ok'), ok_icon)
+ok_icon.show()
+self._canceled_alert.connect('response',
+ self.__stop_response_cb)
+self._activity.add_alert(self._canceled_alert)
+else:
+self._create_journal_object()
+self._object_id = self.dl_jobject.object_id
+
+alert = TimeoutAlert(9)
+alert.props.title = _('Download started')
+alert.props.msg = _('%s' %
+self._download.get_suggested_filename())
+self._activity.add_alert(alert)
+alert.connect('response', self.__start_response_cb)
+alert.show()
+global _active_downloads
+_active_downloads.append(self)
 
 elif state == WebKit.DownloadStatus.FINISHED:
 self._stop_alert = Alert()
-- 
1.7.11.4

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


[Sugar-devel] [PATCH Browse 2/2] Handle datastore.error signal

2012-09-18 Thread Manuel Kaufmann
Stop the downloading process when this signal is received with the
datastore.LOW_SPACE error code.

Signed-off-by: Manuel Kaufmann humi...@gmail.com
---
 downloadmanager.py | 8 
 1 file changed, 8 insertions(+)

diff --git a/downloadmanager.py b/downloadmanager.py
index 5ad1a6f..bd8386d 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -65,6 +65,9 @@ class Download(object):
 self._download.connect('notify::status', self.__state_change_cb)
 self._download.connect('error', self.__error_cb)
 
+# connect the error datastore signal to manage LOW_SPACE
+datastore.error.connect(self.__datastore_error_cb)
+
 self.datastore_deleted_handler = None
 
 self.dl_jobject = None
@@ -89,6 +92,11 @@ class Download(object):
 self._download.set_destination_uri('file://' + self._dest_path)
 self._download.start()
 
+def __datastore_error_cb(self, sender, **kwargs):
+logging.debug('__datastore_error_cb')
+if kwargs.get('errno', -1) == datastore.LOW_SPACE:
+self._download.cancel()
+
 def __progress_change_cb(self, download, something):
 progress = self._download.get_progress()
 self.dl_jobject.metadata['progress'] = str(int(progress * 100))
-- 
1.7.11.4

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


[Sugar-devel] Not enough space adventure

2012-09-18 Thread Manuel Kaufmann
Hello people,

I'd like to comment what I've been doing these days regarding
Downloading a file with Browse without having enough space to keep
it.

 * http://bugs.sugarlabs.org/ticket/394

We where discussing about this last week[1] and we found the root
issue of this problem: Sugar is not handling ENOSPC error. This could
cause some problems at boot time when the XO is restarted, but as we
discussed[2], Linux has made some improvement on this side and it
seems that it recovers without problem (we need more testing here, I
think).

So, there are different problems to manage here:
 1. What are we going to do when ENOSPC is reached?

I'm not sure about this point and I think we have to discuss what to
do here and how implement this. There is an important ticket for this

 * http://bugs.sugarlabs.org/ticket/2317

 2. How are we going to avoid ENOSCP?

Well, this is the topic where I focused my work. Trying to avoid
reaching ENOSCP. A good place to do some work is Browse (but this work
include some extra modifications in other components as well) because
it's the main activity that generate big files by downloading them
from the internet. So, Gonzalo and I were discussing about a good
implementation regarding this and we found, at least, an alternative.
It consists in:

 - remove the annoying check of free space
(sugar3.datastore.datastore.SPACE_THRESHOLD = 50Mb at the moment) from
the Journal Activity that shows all the time the ModalAlert saying
Your Journal is full. Please remove some entries every time and it
doesn't allow you to do another things.

 - create a signal inside sugar-toolkit-gtk3 datastore that is emitted
when free space is behind
sugar3.datastore.datastore.SPACE_THRESHOLD. This check is done every
time a model is updated or created by the datastore.

 - this signal can be connected from every activity that wants to
handle this situation. For example in Browse we are cancelling the
download in progress when we get that signal

 - the same signal is captured in Journal Activity to show the
ModalAlert saying Your Journal is full that was shown before

 - create a helper function in sugar-toolkit-gtk3 activity Activity
class to check if there is enough space to keep a new file (Browse
uses this before downloading a file from the internet). I decided to
put this helper inside Activity class because I think it could be
useful for many activities.

 - compare (in Browse) the Content-Length with the free space
available + SPACE_THRESHOLD (this is done by the helper function) and
decide if the download is going to take place or not

These are all the patches involved on this change:

 * http://patchwork.sugarlabs.org/patch/1749/
 * http://patchwork.sugarlabs.org/patch/1750/
 * http://patchwork.sugarlabs.org/patch/1751/
 * http://patchwork.sugarlabs.org/patch/1752/
 * http://patchwork.sugarlabs.org/patch/1753/

Thanks, comments and suggestions are welcomed.

[1] http://lists.sugarlabs.org/archive/sugar-devel/2012-September/039516.html
[2] http://lists.sugarlabs.org/archive/sugar-devel/2012-September/039576.html

PD: Gonzalo, please, add whatever thing that I missed.

-- 
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] Not enough space adventure

2012-09-18 Thread Gonzalo Odiard

  - remove the annoying check of free space
 (sugar3.datastore.datastore.SPACE_THRESHOLD = 50Mb at the moment) from
 the Journal Activity that shows all the time the ModalAlert saying
 Your Journal is full. Please remove some entries every time and it
 doesn't allow you to do another things.


This control was not removed, only the code was moved from sugar to
sugar-toolkit,
to be available for sugar and activities.


  - compare (in Browse) the Content-Length with the free space
 available + SPACE_THRESHOLD (this is done by the helper function) and
 decide if the download is going to take place or not


In Browse there are two controls:
* Before start the download, check space available.
* While download, catch the low space signal from sugar-toolkit and stop
downlad if needed.
(This can be the case of multiple simultaneous download, or when the
browser can't get the size before downloading)

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


[Sugar-devel] [PATCH sugar 2/2] Add feedback in Home View, List View when there are no matching entries - SL #3838

2012-09-18 Thread Manuel Quiñones
The scrolled window widget that contains the list of activities is
replaced by a message box when there are no matching entries.  This is
the same as the Journal does.  An alert can be packed also, so we use
pack_end to add the message box or the list of activities again.

Use Gtk.TreeModel.iter_n_children() [1] to count the matches, note
that this work only for tree model lists.

The message box widget is copied from the Journal listview.  Is done
in a separate class and can be generalized later.  The only important
change here is the icon colors: to make the 'system-search' icon look
ok, the stroke color and fill color were switched.

[1] 
http://developer.gnome.org/gtk3/stable/GtkTreeModel.html#gtk-tree-model-iter-n-children

Signed-off-by: Manuel Quiñones ma...@laptop.org
---
 src/jarabe/desktop/activitieslist.py | 102 +++
 src/jarabe/desktop/homebox.py|   1 +
 src/jarabe/desktop/viewtoolbar.py|   9 
 3 files changed, 103 insertions(+), 9 deletions(-)

diff --git a/src/jarabe/desktop/activitieslist.py 
b/src/jarabe/desktop/activitieslist.py
index ab62b58..6731df3 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -19,6 +19,7 @@ import os
 import logging
 from gettext import gettext as _
 
+import glib
 from gi.repository import GObject
 from gi.repository import Pango
 from gi.repository import GConf
@@ -31,6 +32,7 @@ from sugar3.graphics.icon import Icon, CellRendererIcon
 from sugar3.graphics.xocolor import XoColor
 from sugar3.graphics.menuitem import MenuItem
 from sugar3.graphics.alert import Alert
+from sugar3.graphics.icon import EventIcon
 
 from jarabe.model import bundleregistry
 from jarabe.view.palettes import ActivityPalette
@@ -50,7 +52,8 @@ class ActivitiesTreeView(Gtk.TreeView):
 
 self._query = ''
 
-self.modify_base(Gtk.StateType.NORMAL, 
style.COLOR_WHITE.get_gdk_color())
+self.modify_base(Gtk.StateType.NORMAL,
+ style.COLOR_WHITE.get_gdk_color())
 self.set_headers_visible(False)
 selection = self.get_selection()
 selection.set_mode(Gtk.SelectionMode.NONE)
@@ -147,8 +150,14 @@ class ActivitiesTreeView(Gtk.TreeView):
 misc.launch(bundle)
 
 def set_filter(self, query):
+Set a new query and refilter the model, return the number
+of matching activities.
+
+
 self._query = query.lower()
 self.get_model().refilter()
+matches = self.get_model().iter_n_children(None)
+return matches
 
 def __model_visible_cb(self, model, tree_iter, data):
 title = model[tree_iter][ListModel.COLUMN_TITLE]
@@ -296,30 +305,78 @@ class CellRendererActivityIcon(CellRendererIcon):
 self.emit('erase-activated', bundle_id)
 
 
+class ClearMessageBox(Gtk.EventBox):
+def __init__(self, message, button_callback):
+Gtk.EventBox.__init__(self)
+
+self.modify_bg(Gtk.StateType.NORMAL,
+   style.COLOR_WHITE.get_gdk_color())
+
+alignment = Gtk.Alignment.new(0.5, 0.5, 0.1, 0.1)
+self.add(alignment)
+alignment.show()
+
+box = Gtk.VBox()
+alignment.add(box)
+box.show()
+
+icon = EventIcon(pixel_size=style.LARGE_ICON_SIZE,
+ icon_name='system-search',
+ stroke_color=style.COLOR_TRANSPARENT.get_svg(),
+ fill_color=style.COLOR_BUTTON_GREY.get_svg())
+box.pack_start(icon, expand=True, fill=False, padding=0)
+icon.show()
+
+label = Gtk.Label()
+color = style.COLOR_BUTTON_GREY.get_html()
+label.set_markup('span weight=bold color=%s%s/span' % ( \
+color, glib.markup_escape_text(message)))
+box.pack_start(label, expand=True, fill=False, padding=0)
+label.show()
+
+button = Gtk.Button(label=_('Clear search'))
+button.connect('clicked', button_callback)
+button.props.image = Icon(icon_name='dialog-cancel',
+  icon_size=Gtk.IconSize.BUTTON)
+box.pack_start(button, expand=True, fill=False, padding=0)
+button.show()
+
+
 class ActivitiesList(Gtk.VBox):
 __gtype_name__ = 'SugarActivitiesList'
 
+__gsignals__ = {
+'clear-clicked': (GObject.SignalFlags.RUN_FIRST, None, ([])),
+}
+
 def __init__(self):
 logging.debug('STARTUP: Loading the activities list')
 
 Gtk.VBox.__init__(self)
 
-scrolled_window = Gtk.ScrolledWindow()
-scrolled_window.set_policy(Gtk.PolicyType.NEVER, 
Gtk.PolicyType.AUTOMATIC)
-scrolled_window.set_shadow_type(Gtk.ShadowType.NONE)
-scrolled_window.connect('key-press-event', self.__key_press_event_cb)
-self.pack_start(scrolled_window, True, True, 0)
-scrolled_window.show()
+self._scrolled_window = Gtk.ScrolledWindow()
+

[Sugar-devel] [sugar-toolkit-gtk3] Set getter an setter in icon_name property - SL #3849

2012-09-18 Thread godiard
From: Gonzalo Odiard godi...@gmail.com

With g-i bindings, setting the property don't change the size
and the button is bigger than should be.
Now we have two properties for the same, icon_name and named_icon,
maybe one should be deprecated.

Signed-off-by: Gonzalo Odiard gonz...@laptop.org
---
 src/sugar3/graphics/radiotoolbutton.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sugar3/graphics/radiotoolbutton.py 
b/src/sugar3/graphics/radiotoolbutton.py
index 006d167..0c44347 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -131,6 +131,9 @@ class RadioToolButton(Gtk.RadioToolButton):
 named_icon = GObject.property(type=str, setter=set_named_icon,
   getter=get_named_icon)
 
+icon_name = GObject.property(type=str, setter=set_named_icon,
+  getter=get_named_icon)
+
 def set_xo_color(self, xo_color):
 if self._xo_color != xo_color:
 self._xo_color = xo_color
-- 
1.7.11.4

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


[Sugar-devel] [ASLO] Release Turtle Blocks-158

2012-09-18 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4027

Sugar Platform:
0.82 - 0.98

Download Now:
http://activities.sugarlabs.org/downloads/file/28221/turtle_art-158.xo

Release notes:
158

ENHANCEMENTS:
* New translations

BUG FIX:
* Properly display blocks with four labels
* Don't hide blocks when hitting stop button
* Use different warning messages when plugin fails to import vs load



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

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


Re: [Sugar-devel] [PATCH sugar] Fix screenshot extension, port to cairo - SL #3906

2012-09-18 Thread Simon Schampijer

Thanks Manuel.

On 09/18/2012 06:38 AM, Manuel Quiñones wrote:

1. API fix, Gdk.Window now has get_width() and get_height(), not
get_size().


Yes.


2. Use cairo to make the screenshot: paint the window surface in a new
surface and then save it as png to the path that will be provided
to the datastore.

3. Use the same cairo code as in the toolkit-gtk3 to make a preview of
the screenshot surface, store it as an array of bytes.


Yes, as you say, same as in the toolkit. Is the right thing to do.

And it even works!

Please push,
   Simon


Signed-off-by: Manuel Quiñones ma...@laptop.org
---
  extensions/globalkey/screenshot.py | 53 ++
  1 file changed, 36 insertions(+), 17 deletions(-)

diff --git a/extensions/globalkey/screenshot.py 
b/extensions/globalkey/screenshot.py
index d5b88ea..5abf15b 100644
--- a/extensions/globalkey/screenshot.py
+++ b/extensions/globalkey/screenshot.py
@@ -18,6 +18,8 @@
  import os
  import tempfile
  from gettext import gettext as _
+import StringIO
+import cairo

  from gi.repository import Gtk
  from gi.repository import Gdk
@@ -38,15 +40,15 @@ def handle_key_press(key):
  os.close(fd)

  window = Gdk.get_default_root_window()
-width, height = window.get_size()
-x_orig, y_orig = window.get_origin()
+width, height = window.get_width(), window.get_height()

-screenshot = GdkPixbuf.Pixbuf(GdkPixbuf.Colorspace.RGB, has_alpha=False,
-bits_per_sample=8, width=width,
-height=height)
-screenshot.get_from_drawable(window, window.get_colormap(), x_orig,
-y_orig, 0, 0, width, height)
-screenshot.save(file_path, 'png')
+window_cr = Gdk.cairo_create(window)
+window_surface = window_cr.get_target()
+screenshot_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
+cr = cairo.Context(screenshot_surface)
+cr.set_source_surface(window_surface)
+cr.paint()
+screenshot_surface.write_to_png(file_path)

  client = GConf.Client.get_default()
  color = client.get_string('/desktop/sugar/user/color')
@@ -79,7 +81,7 @@ def handle_key_press(key):
  jobject.metadata['title'] = title
  jobject.metadata['keep'] = '0'
  jobject.metadata['buddies'] = ''
-jobject.metadata['preview'] = _get_preview_data(screenshot)
+jobject.metadata['preview'] = _get_preview_data(screenshot_surface)
  jobject.metadata['icon-color'] = color
  jobject.metadata['mime_type'] = 'image/png'
  jobject.file_path = file_path
@@ -89,14 +91,31 @@ def handle_key_press(key):
  del jobject


-def _get_preview_data(screenshot):
-preview = screenshot.scale_simple(style.zoom(300), style.zoom(225),
-  GdkPixbuf.InterpType.BILINEAR)
-preview_data = []
+def _get_preview_data(screenshot_surface):
+screenshot_width = screenshot_surface.get_width()
+screenshot_height = screenshot_surface.get_height()

-def save_func(buf, data):
-data.append(buf)
+preview_width, preview_height = style.zoom(300), style.zoom(225)
+preview_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32,
+ preview_width, preview_height)
+cr = cairo.Context(preview_surface)

-preview.save_to_callback(save_func, 'png', user_data=preview_data)
+scale_w = preview_width * 1.0 / screenshot_width
+scale_h = preview_height * 1.0 / screenshot_height
+scale = min(scale_w, scale_h)

-return dbus.ByteArray(''.join(preview_data))
+translate_x = int((preview_width - (screenshot_width * scale)) / 2)
+translate_y = int((preview_height - (screenshot_height * scale)) / 2)
+
+cr.translate(translate_x, translate_y)
+cr.scale(scale, scale)
+
+cr.set_source_rgba(1, 1, 1, 0)
+cr.set_operator(cairo.OPERATOR_SOURCE)
+cr.paint()
+cr.set_source_surface(screenshot_surface)
+cr.paint()
+
+preview_str = StringIO.StringIO()
+preview_surface.write_to_png(preview_str)
+return dbus.ByteArray(preview_str.getvalue())



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


Re: [Sugar-devel] [sugar-toolkit-gtk3] Set getter an setter in icon_name property - SL #3849

2012-09-18 Thread Manuel Quiñones
Thanks Gonzalo.  Yes this fixes the regression, which was affecting
Paint, and may affect other ports so I vote for adding this instead of
deprecating the API.  So now both:

radial_button = RadioToolButton(named_icon='view-radial')

and:

radial_button = RadioToolButton()
radial_button.props.icon_name = 'view-radial'

works.  Great.

2012/9/18  godi...@sugarlabs.org:
 From: Gonzalo Odiard godi...@gmail.com

 With g-i bindings, setting the property don't change the size
 and the button is bigger than should be.
 Now we have two properties for the same, icon_name and named_icon,
 maybe one should be deprecated.

 Signed-off-by: Gonzalo Odiard gonz...@laptop.org

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

 ---
  src/sugar3/graphics/radiotoolbutton.py | 3 +++
  1 file changed, 3 insertions(+)

 diff --git a/src/sugar3/graphics/radiotoolbutton.py 
 b/src/sugar3/graphics/radiotoolbutton.py
 index 006d167..0c44347 100644
 --- a/src/sugar3/graphics/radiotoolbutton.py
 +++ b/src/sugar3/graphics/radiotoolbutton.py
 @@ -131,6 +131,9 @@ class RadioToolButton(Gtk.RadioToolButton):
  named_icon = GObject.property(type=str, setter=set_named_icon,
getter=get_named_icon)

 +icon_name = GObject.property(type=str, setter=set_named_icon,
 +  getter=get_named_icon)

I will take care of the indentation here before pushing.

 +
  def set_xo_color(self, xo_color):
  if self._xo_color != xo_color:
  self._xo_color = xo_color
 --
 1.7.11.4

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



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


[Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Manuel Kaufmann
Added an Error page with Sugar style that informs the users about
they are not connected to the internet when the page can not reached
for any reason.

This patch contains a HTML template (error_page.tmpl) that is used to
generate the error page with the correct language.

Signed-off-by: Manuel Kaufmann humi...@gmail.com
---
 browser.py   |  31 +
 data/activity-web.png| Bin 0 - 6064 bytes
 data/browse-view-refresh.png | Bin 0 - 481 bytes
 data/error_page.tmpl |  53 +++
 4 files changed, 84 insertions(+)
 create mode 100644 data/activity-web.png
 create mode 100644 data/browse-view-refresh.png
 create mode 100644 data/error_page.tmpl

diff --git a/browser.py b/browser.py
index de546f2..c9bcc1c 100644
--- a/browser.py
+++ b/browser.py
@@ -58,6 +58,9 @@ _NON_SEARCH_REGEX = re.compile('''
 ^file:.*$)
 ''', re.VERBOSE)
 
+DEFAULT_ERROR_PAGE = os.path.join(activity.get_bundle_path(),
+  'data/error_page.html')
+
 
 class CommandListener(object):
 def __init__(self, window):
@@ -462,6 +465,7 @@ class Browser(WebKit.WebView):
  self.__mime_type_policy_cb)
 self.connect('new-window-policy-decision-requested',
  self.__new_window_policy_cb)
+self.connect('load-error', self.__load_error_cb)
 
 try:
 self.connect('run-file-chooser', self.__run_file_chooser)
@@ -603,6 +607,33 @@ class Browser(WebKit.WebView):
 downloadmanager.add_download(download, browser)
 return True
 
+def __create_error_page(self, url):
+Create the error page in the correct language
+
+data = {
+'page_title': _('You are not connected to the internet'),
+'title': _('You are not connected to the internet'),
+'message': _('You will need to connect using the '
+ 'Neighborhoodbr /view in order '
+ 'to continue browsing'),
+'btn_value': _('Try again'),
+'url': url,
+}
+filepath = os.path.join(activity.get_bundle_path(),
+'data/error_page.tmpl')
+html = open(filepath, 'r').read() % data
+
+f = open(DEFAULT_ERROR_PAGE, 'w')
+f.write(html)
+f.close()
+
+def __load_error_cb(self, web_view, web_frame, uri, web_error):
+Show Sugar's error page
+
+self.__create_error_page(uri)
+self.load_uri('file://' + DEFAULT_ERROR_PAGE)
+return True
+
 
 class PopupDialog(Gtk.Window):
 def __init__(self):
diff --git a/data/activity-web.png b/data/activity-web.png
new file mode 100644
index 
..d27964350a22e13fef454fb1923a722b5d64a921
GIT binary patch
literal 6064
zcmXw71yoe;)22Zhln{_cQX1*br9)t8kZxEIess5jbVw-OCE(Jrgn-1--7DQK^BY
ze0$E_d+zT0O38wo@XLPQ(X}cn*tjN2?-CRBQABL!U1!4B$H!mGA+$p?S!FK41YK
ze=MtL;Q57{l7R;j5^LP^h0MNGPXqk;+EX6vspD$n1_eAM)LOd=CpTl^suyWv*vV#
z*nT?_qd-C;dk2z}{_tP+VUCfi@$7VPXEPFv9QXZPUw6C(Q~;x-zuU{n(rUooLD=PN
zN?EsX(kvimYPOUEq7AlL%^4mD7~}9e5G9-%HdDb{0(zodl5F22W~usvM6Ue{IM)
zVfO^vxYXR~?N^x=7(ENbekSm^ByxF58G!A{halMsBG9jX49tl3u*nwP?;9eI3x
zi=?U$K)oob7()G;fx2@^1scFzW((E{#=xzxZpoZlprtOgGs=;x6PWtcD$$cQ}
zVzHAy-+xvs!z#A_7m^GP4I(K;TY9lKiZYJkA6Z0x8EK))RLZsBL?O?uHi#qe#3O~
z_G|7Ob=466iT)bi3W^Y=EYG0F{lQRK#hjG_Rd@*w3We{@CJ(;4+c%$8LgDpW(2?
z;#|X9Gg-3ZGFjJjoOLXhW_r(SA{=jW)@@+%*_9US)JNWBe;-bQfW$Nf1%ik#5
zHVd%NlwPAsPgsG6Uv*eB$YgScZnDEpat)njR`m?WcELzDp9gA`#a$fWnxUfY
z5rAJxu8FiiIP;y!m25PCyI~!P7_cqds{*Bh+juOOtyq){{jO0EM4N;pqYjoQEWY
z=ulpbj|}Rrkwsegw`vhAal2;QXKmLl)${10qz}t0DD?j$ks+!M-}4X;okgFqCN-3
z@X))7u6LO}qc}6PF)%QSd=wo5fncGbI4w4PX=xE5B_;kz%+AGC($!}vSRA%q|}@
zZ?DRRdr$P=EcfST@cXuG=~a|3)Touw}j`8Z5I?4hD*^(FJSLT3Xe90%EYdA%nc
zanvy}QKKb9GIw(NoSRGC($a#35mx8ho8C2s2ir-|4I7U62B_hK1VuUUSVtvem-(y
zLR*ZQ0IA#ju@?3pRn+5gU`T!V$^|W$$4MDeQUjG)nt*gwPij$JXBTdW5k#y$mYY{
z^x~i}Qa66p%|G(8tE5Yv`OwPBNfWq+TESUvMv+mF3k2C?Ag0gZ`+~izhZtm!Q
zO=tY-vDw*OLD+EYpcDZV_d{UJdgUZb7%b~Ku;vtr1OLgVrH#l^+i1_mH|``y@=
zbx-%(lK$r-f*W4vXJ_OT6xuB_`J|uTpl-wtu42srDpjG5;Y;J;-5d0)6zwWas3
zxZMXq48t*HfW%wHQBC;MFmI@8#v#d1Jpeo*I1;43SfF4w=FL4P7CgJcOogpX
zbl1nL+oziY`P;8ZNg;bvdpHH=+)9~4C3PA`CjQf1Z_a{mK=atNlq!Xd=FUp~m!k
zXlSEx*0i9d#aEXJV2GMocB)pRuv=5iVXR@U}!ucEN9F#2f!@DMRmHO(+8k(aQy
z=V0o0C{SNtFXybdj{a!Xd7eS|Qoc4SjNsET7d!iAPXx{u0#W5Vaf_L=6@OiJxod
zW@BS(_?McRDzB#YWlm#!VPPl?)6p*$cq34^brfss_WFB3$%w@g{3bk1)OeenW
zQUrJ2Xl2K1JibU`})hnM949wqw+$f%Ef20+NzuqcAKqZdy5n-{W#PzyGorD
zOJLL5rNe7u9KK|sER_`Xnrv_tQ0R{2M11^#!x9~F$=m1d8qBmJ^rN`aL63dNC
zAauxUY7Fm@JQ?EBu_M=qoW%`-9msZIYjPc?R93Pwauwr~uv}nKUBgFmfxzlP#
zz_O#FqN2Tv3u$85FYbCZTmLw45=go{bTZ^BI4umF)%SxtCu?hM7PKCY!vkMV1#|
z7}r_nN2Jluxom2TyOENRkhuT-^O{MA96JK)d0WtM6mU^q@-_BU$$6rDh9CX
zVt2BzWcagLKtTH$1ipU0k*`(#(K6u2^=%VCjw34PDJ^a`T=3tVm{jQ#=jaGPIeNV
zhP%piN`4QjHO|8u8w8$+0NvQ$?*vY^j+@Hrq*~j8$Yl14!z?|bLx#I5h+XXJ|hz
zN;f4|YXLNG4lw$w7O);cHur0+PSH;dU;|;VgNVA0G3C~t;{XkC+o1biwTu{Kc^LV

Re: [Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Manuel Kaufmann
On Tue, Sep 18, 2012 at 1:55 PM, Manuel Kaufmann humi...@gmail.com wrote:
 This patch contains a HTML template (error_page.tmpl) that is used to
 generate the error page with the correct language.

Please, comments and suggestions are welcomed here. I didn't find an
existent way (inside Sugar) to translate html content, so I decide to
make it by myself.

I created a file called error_page.tmpl that contains the html
structure of the page with some placeholders to put the translated
strings (those placeholders are substituted with the % operator) and a
new html file is create: error_page.html with the correct strings
and url to try again. Then, this file is used to tell WekKit to load
that file as an uri:

  self.load_uri('file://' + DEFAULT_ERROR_PAGE)

That file is generated every time that the web page can't be reached
for any reason.

See you,

-- 
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 Browse] Error page SL #3500

2012-09-18 Thread Daniel Narvaez
Perhaps you could use the data protocol to avoid the temporary file

http://www.ietf.org/rfc/
http://www.ietf.org/rfc/rfc2397.txtrfc2397.txthttp://www.ietf.org/rfc/rfc2397.txt

Or a custom protocol handler, not sure if that's possible with
webkit/libsoup.

On Tuesday, 18 September 2012, Manuel Kaufmann wrote:

 On Tue, Sep 18, 2012 at 1:55 PM, Manuel Kaufmann humi...@gmail.com
 wrote:
  This patch contains a HTML template (error_page.tmpl) that is used to
  generate the error page with the correct language.

 Please, comments and suggestions are welcomed here. I didn't find an
 existent way (inside Sugar) to translate html content, so I decide to
 make it by myself.

 I created a file called error_page.tmpl that contains the html
 structure of the page with some placeholders to put the translated
 strings (those placeholders are substituted with the % operator) and a
 new html file is create: error_page.html with the correct strings
 and url to try again. Then, this file is used to tell WekKit to load
 that file as an uri:

   self.load_uri('file://' + DEFAULT_ERROR_PAGE)

 That file is generated every time that the web page can't be reached
 for any reason.

 See you,

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



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


Re: [Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Daniel Drake
On Tue, Sep 18, 2012 at 11:00 AM, Manuel Kaufmann humi...@gmail.com wrote:
 On Tue, Sep 18, 2012 at 1:55 PM, Manuel Kaufmann humi...@gmail.com wrote:
 This patch contains a HTML template (error_page.tmpl) that is used to
 generate the error page with the correct language.

 Please, comments and suggestions are welcomed here. I didn't find an
 existent way (inside Sugar) to translate html content, so I decide to
 make it by myself.

How does epiphany handle this?

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


Re: [Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Manuel Quiñones
2012/9/18 Daniel Drake d...@laptop.org:
 On Tue, Sep 18, 2012 at 11:00 AM, Manuel Kaufmann humi...@gmail.com wrote:
 On Tue, Sep 18, 2012 at 1:55 PM, Manuel Kaufmann humi...@gmail.com wrote:
 This patch contains a HTML template (error_page.tmpl) that is used to
 generate the error page with the correct language.

 Please, comments and suggestions are welcomed here. I didn't find an
 existent way (inside Sugar) to translate html content, so I decide to
 make it by myself.

 How does epiphany handle this?

http://git.gnome.org/browse/epiphany/tree/embed/ephy-web-view.c#n2487

Humitos, you can compare with your solution and take ideas from there.
 I haven't tested your patch yet.

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


Re: [Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Daniel Narvaez
On 18 September 2012 19:33, Manuel Quiñones ma...@laptop.org wrote:
 2012/9/18 Daniel Drake d...@laptop.org:
 On Tue, Sep 18, 2012 at 11:00 AM, Manuel Kaufmann humi...@gmail.com wrote:
 On Tue, Sep 18, 2012 at 1:55 PM, Manuel Kaufmann humi...@gmail.com wrote:
 This patch contains a HTML template (error_page.tmpl) that is used to
 generate the error page with the correct language.

 Please, comments and suggestions are welcomed here. I didn't find an
 existent way (inside Sugar) to translate html content, so I decide to
 make it by myself.

 How does epiphany handle this?

 http://git.gnome.org/browse/epiphany/tree/embed/ephy-web-view.c#n2487

 Humitos, you can compare with your solution and take ideas from there.
  I haven't tested your patch yet.

Oh cool, load_alternate_string definitely looks like the way to go.
(it doesn't break history etc).
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH Browse] Error page SL #3500

2012-09-18 Thread Manuel Kaufmann
On Tue, Sep 18, 2012 at 2:54 PM, Daniel Narvaez dwnarv...@gmail.com wrote:
 Oh cool, load_alternate_string definitely looks like the way to go.
 (it doesn't break history etc).

Yeah!

http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView--load-status

Thanks, I will patch my patch :) , I will send it again :)

-- 
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 Browse] Error page SL #3500

2012-09-18 Thread Manuel Kaufmann
On Tue, Sep 18, 2012 at 2:21 PM, Daniel Narvaez dwnarv...@gmail.com wrote:
 Perhaps you could use the data protocol to avoid the temporary file

 http://www.ietf.org/rfc/rfc2397.txt

I used this to put the images inside the html-string.

img id=browse-logo src=data:image/png;base64,iVBO (...) /img

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] Hidden Browse feature (from webkit I think)

2012-09-18 Thread Gary C Martin
Hi folks,

While I remember... Just accidentally spotted a rather nice sneaky feature in 
the new webkit browse (in 13.0.1 build 2). Apologies if this is old news, but 
is rather handy... You can type non-URL text into the Browse location field and 
web kit will realise it is not a valid url and will try a google search with it 
instead. Something for the release notes :)

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


Re: [Sugar-devel] Hidden Browse feature (from webkit I think)

2012-09-18 Thread rihoward1
That is a standard feature of both webkit browsers and of mozilla based 
browsers.

- Original message -
 Hi folks,
 
 While I remember... Just accidentally spotted a rather nice sneaky
 feature in the new webkit browse (in 13.0.1 build 2). Apologies if this
 is old news, but is rather handy... You can type non-URL text into the
 Browse location field and web kit will realise it is not a valid url and
 will try a google search with it instead. Something for the release
 notes :)
 
 Regards,
 --Gary
 ___
 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] Not enough space adventure

2012-09-18 Thread Martin Langhoff
On Tue, Sep 18, 2012 at 8:42 AM, Manuel Kaufmann humi...@gmail.com wrote:
 We where discussing about this last week[1] and we found the root
 issue of this problem: Sugar is not handling ENOSPC error. This could
 cause some problems at boot time when the XO is restarted, but as we
 discussed[2], Linux has made some improvement on this side and it
 seems that it recovers without problem (we need more testing here, I
 think).

Thanks for diving into this!

 So, there are different problems to manage here:
  1. What are we going to do when ENOSPC is reached?

I did some work lastweek, and plan to hack on it tomorrow.

  2. How are we going to avoid ENOSCP?
...

  - remove the annoying check of free space

I hope that's not completely removed (I see Gonzalo's email...). It is
not very effective preventing you from using activities, but it does
prompt users to do something (remove stuff?).

BTW, 50MB may be too high, some units with 2GB storage, installing
modern builds, end up with 150MB free total :-/

  - create a signal inside sugar-toolkit-gtk3 datastore that is emitted
 when free space is behind
 sugar3.datastore.datastore.SPACE_THRESHOLD. This check is done every
 time a model is updated or created by the datastore.

A model? Maybe my lingo is a bit stale... a datastore entry you mean?

  - this signal can be connected from every activity that wants to
 handle this situation. For example in Browse we are cancelling the
 download in progress when we get that signal

So there is a bit of confusion here...

 - When we start the download, if we get Content-Length, we compare it
with disk space available, or with disk space available minus
datastore.SPACE_THRESHOLD?

 - Related: can we ask the datastore to tell us its SPACE_THRESHOLD,
so we don't hardcode it? Ah, I see you have a helper function.

Personally, I would prefer to preserve a relatively high threshold
(lower than 50MB, but say, 10MB) for the _warnings_. But still allow a
download to complete. I would only cancel a download in Browse if will
leave us with 1MB disk space.

To put it in other words, we are investing too much effort in...
warnings. And we are mixing a high threshold that is good for a
warning, with something that disrupts an operation (cancel download).
You may be downloading an activity that allows you to delete stuff :-)

Finally, we seem to be missing the tmpfile cleanup related to
incomplete downloads. That can invisibly eat a ton of disk space in
a way that the end user cannot cleanup...

cheers,



m
-- 
 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 2/2] Add feedback in Home View, List View when there are no matching entries - SL #3838

2012-09-18 Thread Manuel Quiñones
2012/9/18 Simon Schampijer si...@schampijer.de:
 Thanks for working on that Manuel!

 - the EventIcon in the box could be just an Icon, we don't listen for events
 here (same to the one in the Journal box) (in patch)

Ah you are right!  Good.

 - the attach_to_clear, I would listen to the 'clear-clicked' signal in
 homebox.py and then call clear_search (in patch)

Thanks I was in doubt with that, yes now I see is better to connect it
directly in the homebox instead of doing unneded calls.  Thanks for
the fix.

 - as you already mentioned, would be great to put a generalized clearbox in
 jarabe/view so it can be used in both places (can be done in a follow up)

 - the box is a typical candidate for theming in artwork (can be done in a
 follow up)

Yes I think we can do those items together, we will need only one
MessageBox class so we can style it in the theme.

Cheers.

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


Re: [Sugar-devel] Hidden Browse feature (from webkit I think)

2012-09-18 Thread Manuel Quiñones
2012/9/18 Gary C Martin garycmar...@googlemail.com:
 Hi folks,

 While I remember... Just accidentally spotted a rather nice sneaky feature in 
 the new webkit browse (in 13.0.1 build 2). Apologies if this is old news, but 
 is rather handy... You can type non-URL text into the Browse location field 
 and web kit will realise it is not a valid url and will try a google search 
 with it instead. Something for the release notes :)

Yes thanks for raising this Gary, is a good improvement over the old
gecko-based Browse, and just got a techy message in the release notes
Normalize and autosearch url input..  My fault.

We use exactly the same method as Epiphany to know if load an URL or
perform a web search.

Cheers,

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


[Sugar-devel] Sugar Digest 2012-09-18

2012-09-18 Thread Walter Bender
== Sugar Digest ==

1. Bradley and Tony have ask us for a summary of Sugar Labs activity
for the Software Freedom Conservancy annual report. It has been a busy
year, with tremendous progress on the technical front, but also real
in roads into better understanding how to deploy Sugar in a wide
variety of contexts.

;GTK-3: The major technical effort over the past twelve months has
been the transition to GNOME Toolkit 3. The developer team, lead by
Simon Schampijer, has migrated Sugar to GTK-3 and in the process both
made Sugar easier to maintain and also easier to support on devices
such as the OLPC XO 4.0 Touch. This has been a community effort with
contributions coming from engineers at OLPC, Activity Central, and the
Sugar community at large.

;Sugar Activities: Our app store continues to grow, thanks in large
part to contributions from Sugar users who have made the transition to
Sugar developers. More than 10% of our apps were written by children
who grew up with Sugar. Meanwhile, we are approaching eight-million
downloads.

;The next generation of hackers: Not only are Sugar users becoming
Sugar activity developers, they are also beginning to work on Sugar
itself. A large part of the effort to migrate Sugar activities to
GTK-3 has been accomplished by youths; and these same young hackers
are submitting patches to the Sugar toolkit as well. They are
full-fledge members of our community.

;Internationalization push: Internationalization push: Chris Leonard
has led an effort to recruit and assist translation teams so that
Sugar has better coverage in the mother tongues and indigenous
languages of our users. Over the past twelve months, we have seen
substantive progress in the languages of:
:* Oceania:  Māori, Samoan (Gagana Sāmoa), Niuean (Vagahau Niue)
:* Central and South America: Huastec (Tének), Xi'úi (Central Pame),
Aymara (Aru), Quechua (Cusco-Collao)

:These efforts have often included working with the local experts to
establish glibc locales for their languages, which will facilitate
further localization work on any Linux-based system.

;Sugar in the USA: While the majority of Sugar users are in Latin
America and Africa, we are starting to make in roads into the United
States. Programs like the ones led by Gerald Ardito have demonstrated
the efficacy of Sugar within the US educational market. Larger-scale
efforts by OLPC in Miami and Charlotte a driving growth.

;Teacher communities: Teachers are forming communities around Sugar to
provide mutual support and to drive further pedagogical developments.
They are using social media tools to form communities in which
teachers and developers discuss problems and opportunities. Amazonas,
Australia, et al. are leading the way.

;Local initiatives: We have back down from our formal local labs
initiative, but not from working locally. There are strong local
support teams in Uruguay, Argentina, Peru, etc., working on extending
Sugar to support local needs.

;Sugar on a Stick: There have been more than 500,000 visits to the
Sugar on a Stick page (a version of Sugar that will run on any
x86-based computer that can boot from a USB stick).

;GNU/Linux distributions: Thomas Gilliard compiled a list of
distributions that have seen significant advances in the past year.
:* Sugar Network [1] (Aleksey Lim et al.)
:: Fedora-14 based OLPC OS for XO laptops (i586)
:: Ubuntu-10.04 and derivatives (i586, x86_64)
:: Ubuntu-11.10 and derivatives (i586, x86_64)
:: Ubuntu-11.04 and derivatives (i586, x86_64)
:: Ubuntu-10.10 and derivatives (i586, x86_64)
:* Trisquel [2] 5.0 and 5.5 (Ruben Rodríguez)
:* openSUSE-EDU [3] (Jigish Gohil and Dram Wang)
:* ARM [4] (Peter Robinson)
:* Fedora 18 [5]
:* Mageia [6]

;Community outreach: Sugar Labs provided support for several developer
gatherings, including Sugar Camps in Lima Peru, Cambridge Mass, San
Francisco CA, Prague Czech Republic, and GUADEC.

2. Isabelle Duston has created a database of images ([7]) that is
intended to reduce the cost of creating educational apps in particular
for literacy. Feel free to use these images in your Sugar activities
and to contribute to the database. She is also launching an App
Challenge (See [8]); Sugar activities qualify.

3. Edgar Quispe has finished 100% of Aymara for Fructose, a major step
in supporting local languages in Peru. Quechua is also making rapid
progress.

=== In the community ===

4. There are plans to hold the next OLPC SF summit in San Francisco
the weekend of October 19-21. We are holding a Sugar Camp
''following'' the summit (Oct 22-24). Please register at [9].

=== Tech Talk ===

5. Simon Schampijer announced the I am a GTK+ 3 shell release of
Sugar and the Sugar toolkit (See [10]).

6. Daniel Drake announced that a new 13.1.0 development build is
available (This one comes with the first development release of the
GTK-3 port of Sugar and probably a fair number of bugs for you to help
us find and solve.) See [11].

7. Thomas Gilliard reports at there is a new live CD of Sugar 

Re: [Sugar-devel] Sugar Digest 2012-09-18

2012-09-18 Thread Flavio Danesse
Congratulations!

Next year it will celebrate the birthday of the son of pablo newcomer next
to your grandson.


Felicidades !!

El año que viene habrá que celebrar el cumpleaños del hijo recien llegado
de pablo junto al de tu nieto.


2012/9/18 Walter Bender walter.ben...@gmail.com

 == Sugar Digest ==

 1. Bradley and Tony have ask us for a summary of Sugar Labs activity
 for the Software Freedom Conservancy annual report. It has been a busy
 year, with tremendous progress on the technical front, but also real
 in roads into better understanding how to deploy Sugar in a wide
 variety of contexts.

 ;GTK-3: The major technical effort over the past twelve months has
 been the transition to GNOME Toolkit 3. The developer team, lead by
 Simon Schampijer, has migrated Sugar to GTK-3 and in the process both
 made Sugar easier to maintain and also easier to support on devices
 such as the OLPC XO 4.0 Touch. This has been a community effort with
 contributions coming from engineers at OLPC, Activity Central, and the
 Sugar community at large.

 ;Sugar Activities: Our app store continues to grow, thanks in large
 part to contributions from Sugar users who have made the transition to
 Sugar developers. More than 10% of our apps were written by children
 who grew up with Sugar. Meanwhile, we are approaching eight-million
 downloads.

 ;The next generation of hackers: Not only are Sugar users becoming
 Sugar activity developers, they are also beginning to work on Sugar
 itself. A large part of the effort to migrate Sugar activities to
 GTK-3 has been accomplished by youths; and these same young hackers
 are submitting patches to the Sugar toolkit as well. They are
 full-fledge members of our community.

 ;Internationalization push: Internationalization push: Chris Leonard
 has led an effort to recruit and assist translation teams so that
 Sugar has better coverage in the mother tongues and indigenous
 languages of our users. Over the past twelve months, we have seen
 substantive progress in the languages of:
 :* Oceania:  Māori, Samoan (Gagana Sāmoa), Niuean (Vagahau Niue)
 :* Central and South America: Huastec (Tének), Xi'úi (Central Pame),
 Aymara (Aru), Quechua (Cusco-Collao)

 :These efforts have often included working with the local experts to
 establish glibc locales for their languages, which will facilitate
 further localization work on any Linux-based system.

 ;Sugar in the USA: While the majority of Sugar users are in Latin
 America and Africa, we are starting to make in roads into the United
 States. Programs like the ones led by Gerald Ardito have demonstrated
 the efficacy of Sugar within the US educational market. Larger-scale
 efforts by OLPC in Miami and Charlotte a driving growth.

 ;Teacher communities: Teachers are forming communities around Sugar to
 provide mutual support and to drive further pedagogical developments.
 They are using social media tools to form communities in which
 teachers and developers discuss problems and opportunities. Amazonas,
 Australia, et al. are leading the way.

 ;Local initiatives: We have back down from our formal local labs
 initiative, but not from working locally. There are strong local
 support teams in Uruguay, Argentina, Peru, etc., working on extending
 Sugar to support local needs.

 ;Sugar on a Stick: There have been more than 500,000 visits to the
 Sugar on a Stick page (a version of Sugar that will run on any
 x86-based computer that can boot from a USB stick).

 ;GNU/Linux distributions: Thomas Gilliard compiled a list of
 distributions that have seen significant advances in the past year.
 :* Sugar Network [1] (Aleksey Lim et al.)
 :: Fedora-14 based OLPC OS for XO laptops (i586)
 :: Ubuntu-10.04 and derivatives (i586, x86_64)
 :: Ubuntu-11.10 and derivatives (i586, x86_64)
 :: Ubuntu-11.04 and derivatives (i586, x86_64)
 :: Ubuntu-10.10 and derivatives (i586, x86_64)
 :* Trisquel [2] 5.0 and 5.5 (Ruben Rodríguez)
 :* openSUSE-EDU [3] (Jigish Gohil and Dram Wang)
 :* ARM [4] (Peter Robinson)
 :* Fedora 18 [5]
 :* Mageia [6]

 ;Community outreach: Sugar Labs provided support for several developer
 gatherings, including Sugar Camps in Lima Peru, Cambridge Mass, San
 Francisco CA, Prague Czech Republic, and GUADEC.

 2. Isabelle Duston has created a database of images ([7]) that is
 intended to reduce the cost of creating educational apps in particular
 for literacy. Feel free to use these images in your Sugar activities
 and to contribute to the database. She is also launching an App
 Challenge (See [8]); Sugar activities qualify.

 3. Edgar Quispe has finished 100% of Aymara for Fructose, a major step
 in supporting local languages in Peru. Quechua is also making rapid
 progress.

 === In the community ===

 4. There are plans to hold the next OLPC SF summit in San Francisco
 the weekend of October 19-21. We are holding a Sugar Camp
 ''following'' the summit (Oct 22-24). Please register at [9].

 === Tech Talk ===

 5. Simon Schampijer announced the I 

Re: [Sugar-devel] Not enough space adventure

2012-09-18 Thread Gonzalo Odiard

   - remove the annoying check of free space

 I hope that's not completely removed (I see Gonzalo's email...). It is
 not very effective preventing you from using activities, but it does
 prompt users to do something (remove stuff?).

 BTW, 50MB may be too high, some units with 2GB storage, installing
 modern builds, end up with 150MB free total :-/


Yes, we agree, but decided not change it in this patch to avoid a long
discussion about the size.
Can be changed in another patch.

  - create a signal inside sugar-toolkit-gtk3 datastore that is emitted
  when free space is behind
  sugar3.datastore.datastore.SPACE_THRESHOLD. This check is done every
  time a model is updated or created by the datastore.

 A model? Maybe my lingo is a bit stale... a datastore entry you mean?


Yes. The datastore related code in sugar is separated between the model and
the view ;)



   - this signal can be connected from every activity that wants to
  handle this situation. For example in Browse we are cancelling the
  download in progress when we get that signal

 So there is a bit of confusion here...

  - When we start the download, if we get Content-Length, we compare it
 with disk space available, or with disk space available minus
 datastore.SPACE_THRESHOLD?


with availabe - SPACE_THRESHOLD


  - Related: can we ask the datastore to tell us its SPACE_THRESHOLD,
 so we don't hardcode it? Ah, I see you have a helper function.

 Personally, I would prefer to preserve a relatively high threshold
 (lower than 50MB, but say, 10MB) for the _warnings_. But still allow a
 download to complete. I would only cancel a download in Browse if will
 leave us with 1MB disk space.


Well, Manuel proposed that, and I said better not, :(
but have sense, and can be implemented,
that is the reason there are a error code, to enable us more specific
messages.


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