Re: [Sugar-devel] Deprecating class and service_name in activity.info file

2011-09-06 Thread Simon Schampijer

On 09/01/2011 08:40 AM, Simon Schampijer wrote:

On 08/31/2011 04:33 PM, Gonzalo Odiard wrote:

In the ticket #2870 we tried to change all the activities included by
default to use
bundle_id and exec configuration due to deprecation of class and
service_name.
The only pending activity is Record
The change is simple and I have tested it:

[gonzalo@aronax mainline]$ git diff
diff --git a/activity/activity.info b/activity/activity.info
index 3b6b219..f3215a0 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -1,7 +1,7 @@
[Activity]
name = Record
bundle_id = org.laptop.RecordActivity
-class = record.Record
+exec = sugar-activity record.Record
icon = activity-record
activity_version = 93
show_launcher = yes

Thanks

Gonzalo


Looks good: Reviewed-by: Simon Schampijer 

Regards,
Simon


Has this been pushed?

If yes, please mind to note the commit id and update patchwork 
accordingly: http://patchwork.sugarlabs.org/patch/950/


Regards,
   Simon

PS: Who is maintaining patchwork? What keywords does it look for to 
close tickets? Is a cron-job handling that? Works rather badly for me.

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


Re: [Sugar-devel] [PATCH] Change string "Remove" in device palette by "Remove device"

2011-09-06 Thread Simon Schampijer
Thanks for all the feedback! I pushed [1] now Sascha's patch which uses 
pgettext to give context for translators. Chris will be making sure the 
translators can pick those changes up.


Regards,
   Simon

[1] 
http://git.sugarlabs.org/sugar/mainline/commit/7e1fa4e984e00cfaaddb46d0c043bdf21ce09fd6

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


Re: [Sugar-devel] [PATCH sugar] Only show DOCUMENTS folder when it is not $HOME

2011-09-06 Thread Simon Schampijer

On 09/06/2011 08:10 PM, Gonzalo Odiard wrote:

Tested-by: Gonzalo Odiard

Acked-by: Gonzalo Odiard


Thanks Gonzalo for testing and the review, pushed as:

http://git.sugarlabs.org/sugar/mainline/commit/e4f7d81e73fe445f4d4d7b1b168855835fcc09ea

Sidenote: The guideline says that only a maintainer can acknowledge a 
patch. For a review it is 'Reviewed-by'.


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


Re: [Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-06 Thread Simon Schampijer

On 09/06/2011 08:59 PM, Gonzalo Odiard wrote:

Tested and works ok.
IMHO, sending the constants had more sense when we only had two messages,
now should be more clear if we do:

 if len(tree_model) == 0:


 if self._is_query_empty():
-self._show_message(MESSAGE_EMPTY_JOURNAL)
+if self._query['mountpoints'] == ['/']:
+self._show_message(_('Your Journal is empty'))
+elif self._query['mountpoints'] == \
+[model.get_documents_path()]:
+self._show_message(_('Your documents folder is
empty'))
+else:
+self._show_message(_('The device is empty'))
 else:
 self._show_message(_('No matching
entries'),show_clear_query=True)
 else:
@@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):




def _show_message(self, message, show_clear_query=False):

   .

   if show_clear_query:
 button = gtk.Button(label=_('Clear search'))
 button.connect('clicked', self.__clear_button_clicked_cb)
 button.props.image = Icon(icon_name='dialog-cancel',
   icon_size=gtk.ICON_SIZE_BUTTON)
 canvas_button = hippo.CanvasWidget(widget=button,

xalign=hippo.ALIGNMENT_CENTER)
 box.append(canvas_button)


... but is only me.
Regards,

Gonzalo


Thanks Gonzalo for the feedback. Addressed your suggestion in the 
follow-up patch. Can you retest before I push?


Regards,
   Simon



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


[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-06 Thread Simon Schampijer
Currently the message will be the same for an empty Journal
or an empty external device or an empty documents folder. This
patch does distinguish between the different cases. In order to
get the path of the documents folder as well from the listview
the function has been moved to the model.

@design team: because I could not figure out an easy way to get
the volume's label in the listview I did change the text for an
empty device to: 'The device is empty'

This patch depends on the previous patch: "Only show DOCUMENTS
folder when it is not $HOME"

Signed-off-by: Simon Schampijer 
---
 src/jarabe/journal/listview.py   |   27 ---
 src/jarabe/journal/model.py  |   23 +++
 src/jarabe/journal/volumestoolbar.py |   26 +-
 3 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index a9f5a53..0d7e112 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -37,9 +37,6 @@ from jarabe.journal import misc
 
 UPDATE_INTERVAL = 300
 
-MESSAGE_EMPTY_JOURNAL = 0
-MESSAGE_NO_MATCH = 1
-
 
 class TreeView(gtk.TreeView):
 __gtype_name__ = 'JournalTreeView'
@@ -315,9 +312,16 @@ class BaseListView(gtk.Bin):
 
 if len(tree_model) == 0:
 if self._is_query_empty():
-self._show_message(MESSAGE_EMPTY_JOURNAL)
+if self._query['mountpoints'] == ['/']:
+self._show_message(_('Your Journal is empty'))
+elif self._query['mountpoints'] == \
+[model.get_documents_path()]:
+self._show_message(_('Your documents folder is empty'))
+else:
+self._show_message(_('The device is empty'))
 else:
-self._show_message(MESSAGE_NO_MATCH)
+self._show_message(_('No matching entries'),
+   show_clear_query=True)
 else:
 self._clear_message()
 
@@ -364,7 +368,7 @@ class BaseListView(gtk.Bin):
 self.add(self._scrolled_window)
 self._progress_bar = None
 
-def _show_message(self, message):
+def _show_message(self, message, show_clear_query=False):
 canvas = hippo.Canvas()
 self.remove(self.child)
 self.add(canvas)
@@ -383,20 +387,13 @@ class BaseListView(gtk.Bin):
   fill_color=style.COLOR_TRANSPARENT.get_svg())
 box.append(icon)
 
-if message == MESSAGE_EMPTY_JOURNAL:
-text = _('Your Journal is empty')
-elif message == MESSAGE_NO_MATCH:
-text = _('No matching entries')
-else:
-raise ValueError('Invalid message')
-
-text = hippo.CanvasText(text=text,
+text = hippo.CanvasText(text=message,
 xalign=hippo.ALIGNMENT_CENTER,
 font_desc=style.FONT_BOLD.get_pango_desc(),
 color=style.COLOR_BUTTON_GREY.get_int())
 box.append(text)
 
-if message == MESSAGE_NO_MATCH:
+if show_clear_query:
 button = gtk.Button(label=_('Clear search'))
 button.connect('clicked', self.__clear_button_clicked_cb)
 button.props.image = Icon(icon_name='dialog-cancel',
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 1242787..c57dfc4 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -17,6 +17,7 @@
 import logging
 import os
 import errno
+import subprocess
 from datetime import datetime
 import time
 import shutil
@@ -794,3 +795,25 @@ def is_editable(metadata):
 return True
 else:
 return os.access(metadata['mountpoint'], os.W_OK)
+
+
+def get_documents_path():
+"""Gets the path of the DOCUMENTS folder
+
+If xdg-user-dir can not find the DOCUMENTS folder it will
+return the user directory instead. It also handles
+localization (i.e. translation) of the filenames.
+
+Returns: Path to $HOME/DOCUMENTS or None if an error occurs
+"""
+try:
+pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
+stdout=subprocess.PIPE)
+documents_path = os.path.normpath(pipe.communicate()[0].strip())
+if os.path.exists(documents_path) and \
+os.environ.get('HOME') != documents_path:
+return documents_path
+except OSError, exception:
+if exception.errno != errno.ENOENT:
+logging.exception('Could not run xdg-user-dir')
+return None
diff --git a/src/jarabe/journal/volumestoolbar.py 
b/src/jarabe/journal/volumestoolbar.py
index 1cc764f..77bb955 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -16,8 +16,6 @@
 
 import logging
 import os
-import subprocess
-import errno
 import statvfs
 from gettext import gettext as _
 
@@ -55,28 +53,6 @@ def _get_id(document):

Re: [Sugar-devel] Features/GTK3 updated

2011-09-06 Thread Marco Pesenti Gritti
On 6 September 2011 23:08, Daniel Drake  wrote:
> It's been mentioned, but so far I've been unconvinced of strapping it
> onto an already huge project.
>
> GConf does have introspectable bindings, and while nobody is
> contesting moving to gsettings, its effects would be limited to sugar
> (not activities) and it would be an invisible change to the user. So
> it doesn't need to be bolted onto the GTK3 project, and I think its
> simpler to keep it separate, but it could certainly happen immediately
> after as a separate step, and your help would be much appreciated
> there.

Oh yeah, the fact that it would not affect activities is a very good
point to do it separately. I didn't realise that.

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


Re: [Sugar-devel] SecretAgent.GetSecrets() return value

2011-09-06 Thread Daniel Drake
On Tue, Sep 6, 2011 at 11:20 PM, Dan Williams  wrote:
> Like you say if a secret is wrong or needs to be changed, there's no
> facility to ask for that secret.  We can (and should) make sure NM would
> fail the connection with a NM_DEVICE_REASON_NO_SECRETS or something like
> that if NM can find out the secrets are wrong, which could trigger the
> applet to toss up the "your connection failed, please re-enter your PSK"
> dialog or whatever.
>
> Or, if you use a secret agent, NM will ask for the secrets when it
> thinks it needs them.

I think I'll go with the secret agent option for now, as it doesn't
require immediate NM work, and as you say, it is quite easy to morph
the NM-0.8 implementation into a SecretAgent, and it really doesn't
need much code (only GetSecrets). I think this may even be the more
simplistic option, as it offloads all the tricky "do I need secrets
right now?" logic to NM.

> Return value should be a hash table of hash tables (basically an
> NMConnection of only the secrets), so for example if you're returning a
> WPA-PSK connection's secrets, it would be simply:
>
> wsec = { 'psk': 'some-really-secure-psk' }
> hash = { '802-11-wireless-security': wsec }
> return hash

Thanks for the clarification.

What would happen if a WEP connection was originally added with
auth-alg='open', but then in my GetSecrets response, I give:

wsec = { 'wep-key0': 'some-unsecure-key', 'auth-alg': 'shared' }
hash = { '802-11-wireless-security': wsec }

Would NM then use shared or open authentication?
('shared' is what would be desired, for the context of this see
http://mail.gnome.org/archives/networkmanager-list/2009-December/msg00018.html
)

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


Re: [Sugar-devel] Features/GTK3 updated

2011-09-06 Thread Daniel Drake
On Tue, Sep 6, 2011 at 7:01 PM, Marco Pesenti Gritti  wrote:
> On 1 September 2011 17:41, Daniel Drake  wrote:
>> Hi,
>>
>> http://wiki.sugarlabs.org/go/Features/GTK3 has been updated.
>> Ready for the next round of feedback!
>
> Did we consider moving from gconf to gsettings? It's not strictly
> necessary but it seems like it should be straightforward and perhaps a
> good idea while we are breaking API.

It's been mentioned, but so far I've been unconvinced of strapping it
onto an already huge project.

GConf does have introspectable bindings, and while nobody is
contesting moving to gsettings, its effects would be limited to sugar
(not activities) and it would be an invisible change to the user. So
it doesn't need to be bolted onto the GTK3 project, and I think its
simpler to keep it separate, but it could certainly happen immediately
after as a separate step, and your help would be much appreciated
there.

> Is there any way to track the status of this work? For example I've
> seen mentions of several dehippoification branches but I'm not sure if
> they landed yet.

Yeah, there are a few branches around. A handful of patches have landed.
This weekend we'll be in paris to work on things like this. I'll make
sure that at the end of the session we have definitive documentation
of pending patches, and I'll put this on the Features/GTK3 page. Feel
free to join us on #sugar Saturday/Sunday/Monday if you want to help!

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


Re: [Sugar-devel] SecretAgent.GetSecrets() return value

2011-09-06 Thread Daniel Drake
On Tue, Sep 6, 2011 at 10:54 PM, Dan Williams  wrote:
> Not sure I follow this...  you shouldn't need a secret agent if all that
> the UI is doing is Update() and AddConnection().  A secret agent is only
> required if there are any agent-provided secrets (ie, some secret has
> the flag AGENT_OWNED).  If you let NM handle all secrets then no secret
> agent should be required; initial secrets get to NM via the
> Connection.Update() call, which shouldn't require a secret agent (as
> long as all secrets are not AGENT_OWNED).

The way I've implemented it at the moment is (I think) the same as
nm-applet. I implement the SecretAgent interface, but I don't set any
special flags, so the secrets do get stored by NM.

However, the first time a connection is established, NetworkManager
needs to communicate the need for secrets, Sugar then needs to request
the info from the user and communicate it to NM. I implemented
SecretAgent for that purpose, and it is working.

I think you might be suggesting that before activating a connection,
Sugar somehow queries NM to see if secrets are present, and if they
aren't, it pops up a dialog requesting them, then it modifies the
connection to add the secrets, then it activates it?

It seems roundabout but it might work, but I wonder what happens when
the secrets are wrong or the password has changed, and the user needs
to be prompted? Seems like impementing SecretAgent (for the purpose of
prompting the user when the user needs to be prompted, not for the
purpose of actually storing secrets) would smooth out those corner
cases, and it looks like nm-applet works this way.

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


Re: [Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-06 Thread Gonzalo Odiard
Tested and works ok.
IMHO, sending the constants had more sense when we only had two messages,
now should be more clear if we do:

if len(tree_model) == 0:

> if self._is_query_empty():
> -self._show_message(MESSAGE_EMPTY_JOURNAL)
> +if self._query['mountpoints'] == ['/']:
> +self._show_message(_('Your Journal is empty'))
> +elif self._query['mountpoints'] == \
> +[model.get_documents_path()]:
> +self._show_message(_('Your documents folder is
> empty'))
> +else:
> +self._show_message(_('The device is empty'))
> else:
> self._show_message(_('No matching
> entries'),show_clear_query=True)
> else:
> @@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):
>
>

   def _show_message(self, message, show_clear_query=False):

  .

  if show_clear_query:
button = gtk.Button(label=_('Clear search'))
button.connect('clicked', self.__clear_button_clicked_cb)
button.props.image = Icon(icon_name='dialog-cancel',
  icon_size=gtk.ICON_SIZE_BUTTON)
canvas_button = hippo.CanvasWidget(widget=button,

xalign=hippo.ALIGNMENT_CENTER)
box.append(canvas_button)


... but is only me.
Regards,

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


Re: [Sugar-devel] Activities for teacher-oriented and mouse-based interactions?

2011-09-06 Thread Bastien
Walter Bender  writes:

> Beyond the usual suspects: web browser and other document and media
> activities, I'd focus on activities such as Etoys and Turtle Art. But
> also, many games could be done interactively with a class where
> students are asked for their rationale as they suggest moves. I am
> thinking for example of Sokoban.

Mhh...  yes.  Abacus would be great too!

Thanks for the answer, I'll share it with the people interested in 
OLPC France.

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


Re: [Sugar-devel] Activities for teacher-oriented and mouse-based interactions?

2011-09-06 Thread Walter Bender
On Tue, Sep 6, 2011 at 11:23 AM, Bastien  wrote:
> All right, don't scream and run away.
>
> http://sankore.org/ is a project by a french governemental department
> (DIENA¹) for selling low-cost digital whiteboards to teachers in Africa.
>
> OLPC France has been sollicited by the DIENA back in october 2010, and
> I underlined the differences between the OLPC/Sugar educational approach
> and that of the Sankoré project:
>
> | Sankoré project                  | OLPC / Sugar                       |
> |--+|
> | one computer per teacher         | one laptop per child               |
> | digital whiteboards for teachers | small laptops for children         |
> | in-school program                | always-available learning resource |
>
> Still, since people from the Sankoré project appear to look favorably
> at Free Software in education (they opened the code for the Sankoré
> application -- http://open-sankore.org, are using Ubuntu and consider
> deploying Kiwix to let users browse Wikipedia offline) we kept in touch.
>
> Now a member of OLPC France, also working for the DIENA, is about to
> push the idea of having Sugar installed on the teachers laptop.
>
> 1) How would you consider this idea?
>
> 2) What set of meaningful activities would you pick up?

Beyond the usual suspects: web browser and other document and media
activities, I'd focus on activities such as Etoys and Turtle Art. But
also, many games could be done interactively with a class where
students are asked for their rationale as they suggest moves. I am
thinking for example of Sokoban.

-walter
>
> Hope you're still here.  And thanks in advance for any answer!
>
> --
>  Bastien
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
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] [DESIGN] Stop start-up icon pulsing when an activity fails to start

2011-09-06 Thread Samuel Greenfeld
I would like to propose that we stop pulsing the animated icons (in the main
screen area as well as the upper toolbar frame) when an activity fails to
start, and Sugar already knows to display a message stating this happened.

When this happens the animated icons should either be switched to the
highest transparency/alpha state to indicate failure, or be made
non-transparent.

Otherwise, if a user is not actively watching the launcher screen, or the
activity started but Sugar failed to detect it, the pulsing icons will
continue to pulse using CPU cycles in the background until a users spots the
issue and presses the "Stop" button found on the failed launch screen.
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar] Add empty messages for empty devices and empty DOCUMENTS folders

2011-09-06 Thread Simon Schampijer
Currently the message will be the same for an empty Journal
or an empty external device or an empty documents folder. This
patch does distinguish between the different cases. In order to
get the path of the documents folder as well from the listview
the function has been moved to the model.

@design team: because I could not figure out an easy way to get
the volume's label in the listview I did change the text for an
empty device to: 'The device is empty'

This patch depends on the previous patch: "Only show DOCUMENTS
folder when it is not $HOME"

Signed-off-by: Simon Schampijer 
---
 src/jarabe/journal/listview.py   |   16 ++--
 src/jarabe/journal/model.py  |   23 +++
 src/jarabe/journal/volumestoolbar.py |   26 +-
 3 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index a9f5a53..c642617 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -38,7 +38,9 @@ from jarabe.journal import misc
 UPDATE_INTERVAL = 300
 
 MESSAGE_EMPTY_JOURNAL = 0
-MESSAGE_NO_MATCH = 1
+MESSAGE_EMPTY_DOCUMENTS_FOLDER = 1
+MESSAGE_EMPTY_DEVICE = 2
+MESSAGE_NO_MATCH = 3
 
 
 class TreeView(gtk.TreeView):
@@ -315,7 +317,13 @@ class BaseListView(gtk.Bin):
 
 if len(tree_model) == 0:
 if self._is_query_empty():
-self._show_message(MESSAGE_EMPTY_JOURNAL)
+if self._query['mountpoints'] == ['/']:
+self._show_message(MESSAGE_EMPTY_JOURNAL)
+elif self._query['mountpoints'] == \
+[model.get_documents_path()]:
+self._show_message(MESSAGE_EMPTY_DOCUMENTS_FOLDER)
+else:
+self._show_message(MESSAGE_EMPTY_DEVICE)
 else:
 self._show_message(MESSAGE_NO_MATCH)
 else:
@@ -385,6 +393,10 @@ class BaseListView(gtk.Bin):
 
 if message == MESSAGE_EMPTY_JOURNAL:
 text = _('Your Journal is empty')
+elif message == MESSAGE_EMPTY_DOCUMENTS_FOLDER:
+text = _('Your documents folder is empty')
+elif message == MESSAGE_EMPTY_DEVICE:
+text = _('The device is empty')
 elif message == MESSAGE_NO_MATCH:
 text = _('No matching entries')
 else:
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 1242787..c57dfc4 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -17,6 +17,7 @@
 import logging
 import os
 import errno
+import subprocess
 from datetime import datetime
 import time
 import shutil
@@ -794,3 +795,25 @@ def is_editable(metadata):
 return True
 else:
 return os.access(metadata['mountpoint'], os.W_OK)
+
+
+def get_documents_path():
+"""Gets the path of the DOCUMENTS folder
+
+If xdg-user-dir can not find the DOCUMENTS folder it will
+return the user directory instead. It also handles
+localization (i.e. translation) of the filenames.
+
+Returns: Path to $HOME/DOCUMENTS or None if an error occurs
+"""
+try:
+pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
+stdout=subprocess.PIPE)
+documents_path = os.path.normpath(pipe.communicate()[0].strip())
+if os.path.exists(documents_path) and \
+os.environ.get('HOME') != documents_path:
+return documents_path
+except OSError, exception:
+if exception.errno != errno.ENOENT:
+logging.exception('Could not run xdg-user-dir')
+return None
diff --git a/src/jarabe/journal/volumestoolbar.py 
b/src/jarabe/journal/volumestoolbar.py
index 1cc764f..77bb955 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -16,8 +16,6 @@
 
 import logging
 import os
-import subprocess
-import errno
 import statvfs
 from gettext import gettext as _
 
@@ -55,28 +53,6 @@ def _get_id(document):
 return None
 
 
-def _get_documents_path():
-"""Gets the path of the DOCUMENTS folder
-
-If xdg-user-dir can not find the DOCUMENTS folder it will
-return the user directory instead. It also handles
-localization (i.e. translation) of the filenames.
-
-Returns: Path to $HOME/DOCUMENTS or None if an error occurs
-"""
-try:
-pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
-stdout=subprocess.PIPE)
-documents_path = os.path.normpath(pipe.communicate()[0].strip())
-if os.path.exists(documents_path) and \
-os.environ.get('HOME') != documents_path:
-return documents_path
-except OSError, exception:
-if exception.errno != errno.ENOENT:
-logging.exception('Could not run xdg-user-dir')
-return None
-
-
 def _convert_entries(root):
 """Convert entries written by the datastore version 0.
 
@@ -225,7 

Re: [Sugar-devel] [PATCH sugar] Only show DOCUMENTS folder when it is not $HOME

2011-09-06 Thread Gonzalo Odiard
Tested-by: Gonzalo Odiard 

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


Re: [Sugar-devel] Features/GTK3 updated

2011-09-06 Thread Marco Pesenti Gritti
On 1 September 2011 17:41, Daniel Drake  wrote:
> Hi,
>
> http://wiki.sugarlabs.org/go/Features/GTK3 has been updated.
> Ready for the next round of feedback!

Did we consider moving from gconf to gsettings? It's not strictly
necessary but it seems like it should be straightforward and perhaps a
good idea while we are breaking API.

Is there any way to track the status of this work? For example I've
seen mentions of several dehippoification branches but I'm not sure if
they landed yet.

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


[Sugar-devel] [PATCH sugar] Only show DOCUMENTS folder when it is not $HOME

2011-09-06 Thread Simon Schampijer
'xdg-user-dir DOCUMENTS' will return $HOME when DOCUMENTS
does not exist, only display the DOCUMENTS folder
when the actual folder exists

Signed-off-by: Simon Schampijer 
---
 src/jarabe/journal/volumestoolbar.py |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/journal/volumestoolbar.py 
b/src/jarabe/journal/volumestoolbar.py
index 84d9e31..1cc764f 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -67,8 +67,9 @@ def _get_documents_path():
 try:
 pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
 stdout=subprocess.PIPE)
-documents_path = pipe.communicate()[0].strip()
-if os.path.exists(documents_path):
+documents_path = os.path.normpath(pipe.communicate()[0].strip())
+if os.path.exists(documents_path) and \
+os.environ.get('HOME') != documents_path:
 return documents_path
 except OSError, exception:
 if exception.errno != errno.ENOENT:
-- 
1.7.4.4

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


[Sugar-devel] Activities for teacher-oriented and mouse-based interactions?

2011-09-06 Thread Bastien
All right, don't scream and run away.

http://sankore.org/ is a project by a french governemental department
(DIENA¹) for selling low-cost digital whiteboards to teachers in Africa.

OLPC France has been sollicited by the DIENA back in october 2010, and 
I underlined the differences between the OLPC/Sugar educational approach
and that of the Sankoré project:

| Sankoré project  | OLPC / Sugar   |
|--+|
| one computer per teacher | one laptop per child   |
| digital whiteboards for teachers | small laptops for children |
| in-school program| always-available learning resource |

Still, since people from the Sankoré project appear to look favorably 
at Free Software in education (they opened the code for the Sankoré
application -- http://open-sankore.org, are using Ubuntu and consider
deploying Kiwix to let users browse Wikipedia offline) we kept in touch.

Now a member of OLPC France, also working for the DIENA, is about to
push the idea of having Sugar installed on the teachers laptop.

1) How would you consider this idea?

2) What set of meaningful activities would you pick up?

Hope you're still here.  And thanks in advance for any answer!

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


Re: [Sugar-devel] Play java in Browse Activity

2011-09-06 Thread Esteban Bordón
2011/9/6 Esteban Bordón 

> Anyone could run java applets in Browse Activity?
>
> I'm trying to play java in Dextrose - 0.88 buy browse closes. I attach the
> log.
>
> Cheers,
> Esteban
>
>
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [DESIGN] Design Team meeting, Monday 5 Sept, 15:00 UTC, #sugar-meeting

2011-09-06 Thread Simon Schampijer

On 09/05/2011 11:02 PM, manuel quiñones wrote:

Hi Gary,

El 5 de septiembre de 2011 16:14, Gary Martin
escribió:



There are a quite a number of ways the rounded details could be styled, but
as mockups go I like 5 the most (If we want to go rounded tabs), and 3 (if
we want to keep it simple with square corner tabs).




Very good work!  Indeed, 5) would be ideal and 3) may be easier to archive.

Thanks,


Yes, for now I would go for (3). I agree that (5) looks nice but will be 
more complicated to achieve.


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


[Sugar-devel] Play java in Browse Activity

2011-09-06 Thread Esteban Bordón
Anyone could run java applets in Browse Activity?

I'm trying to play java in Dextrose - 0.88 buy browse closes. I attach the
log.

Cheers,
Esteban
returning /home/olpc/.sugar/default/org.laptop.WebActivity/data/gecko/prefs.js for key NS_APP_PREFS_50_FILE
/home/olpc/Activities/Browse.activity/model.py:20: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
1314741650.350156 WARNING root: No gtk.AccelGroup in the top level window.
1314741650.389834 WARNING root: No gtk.AccelGroup in the top level window.
1314741650.632166 WARNING root: No gtk.AccelGroup in the top level window.
1314741650.692377 WARNING root: No gtk.AccelGroup in the top level window.
1314741650.746800 WARNING root: No gtk.AccelGroup in the top level window.
1314741650.781547 WARNING root: No gtk.AccelGroup in the top level window.
/usr/lib/xulrunner-1.9.1/python/xpcom/__init__.py:54: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
** (sugar-activity:3065): DEBUG: Got client ID "10bae3aa026a74438213147416542354620018710002"
** (sugar-activity:3065): DEBUG: Setting initial properties
Traceback (most recent call last):
  File "/home/olpc/Activities/Browse.activity/webtoolbar.py", line 310, in 
self._connect_to_browser(tabbed_view.props.current_browser))
  File "/home/olpc/Activities/Browse.activity/webtoolbar.py", line 326, in _connect_to_browser
self._set_address(self._progress_listener.location)
  File "/home/olpc/Activities/Browse.activity/webtoolbar.py", line 378, in _set_address
ui_uri = self._browser.get_url_from_nsiuri(uri)
AttributeError: 'NoneType' object has no attribute 'get_url_from_nsiuri'
** (sugar-activity:3065): DEBUG: Received SaveYourself(SmSaveLocal, !Shutdown, SmInteractStyleNone, !Fast) in state idle
** (sugar-activity:3065): DEBUG: Sending SaveYourselfDone(True) for initial SaveYourself
** (sugar-activity:3065): DEBUG: Received SaveComplete message in state save-yourself-done
/home/olpc/Activities/Browse.activity/webtoolbar.py:69: GtkWarning: gtk_entry_set_text: assertion `text != NULL' failed
  self.props.text = text
*** glibc detected *** python: double free or corruption (!prev): 0x0a04eb90 ***
=== Backtrace: =
/lib/libc.so.6[0x71fa71]
/lib/libglib-2.0.so.0(g_free+0x36)[0x8cd986]
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/IcedTeaPlugin.so(NP_Initialize+0x769)[0xaff651d9]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb62bbf4f]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb62c2acf]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb62c34d6]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb62c1fb6]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb62cabb2]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb5d59ccd]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb5d5cf9c]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb5e8d821]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb5e905c4]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb6474f8c]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb6441126]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb63b1d3d]
/usr/lib/xulrunner-1.9.1/libxul.so[0xb639b6f8]
/lib/libglib-2.0.so.0[0x8fc0db]
/lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f8)[0x8c5308]
/lib/libglib-2.0.so.0[0x8c89e0]
/lib/libglib-2.0.so.0(g_main_loop_run+0x1bf)[0x8c8e4f]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xb9)[0x2d29c09]
/usr/lib/python2.6/site-packages/gtk-2.0/gtk/_gtk.so[0xb73ab15c]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x486f)[0x370b7bf]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x5345)[0x370c295]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x7b2)[0x370d102]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x63)[0x370d263]
/usr/lib/libpython2.6.so.1.0[0x372817b]
/usr/lib/libpython2.6.so.1.0(PyRun_FileExFlags+0x92)[0x3728242]
/usr/lib/libpython2.6.so.1.0(PyRun_SimpleFileExFlags+0xda)[0x37297ca]
/usr/lib/libpython2.6.so.1.0(PyRun_AnyFileExFlags+0x82)[0x372a052]
/usr/lib/libpython2.6.so.1.0(Py_Main+0xb75)[0x3736815]
python(main+0x27)[0x80485c7]
/lib/libc.so.6(__libc_start_main+0xe6)[0x6c6a86]
python[0x8048501]
=== Memory map: 
00101000-0011f000 r-xp  1f:00 25103  /usr/lib/libdbus-glib-1.so.2.1.0
0011f000-0012 rw-p 0001e000 1f:00 25103  /usr/lib/libdbus-glib-1.so.2.1.0
00122000-0025a000 r-xp  1f:00 25855  /usr/lib/libxml2.so.2.7.6
0025a000-0025f000 rw-p 00138000 1f:00 25855  /usr/lib/libxml2.so.2.7.6
0025f000-0026 rw-p  00:00 0 
00262000-00276000 r-xp  1f:00 22069  /lib/libresolv-2.10.2.so
00276000-00277000 r--p 00013000 1f:00 22069  /lib/libresolv-2.10.2.so
00277000-00278000 rw-p 00014000 1f:00 22069  /lib/libresolv-2.10.2.so
00278000-0027a000 rw-p  00:00 0 
0027c000-002ad000 r-xp  1f:00 25213  /usr/lib/libfontconfig.so.1.4.4
002ad000-002af000 rw-p 0003 1f:00 25213  /usr/lib/libfontconfig.so.1.4.4
002b1000-002d7000 r-xp  1f:00 25605  /usr/lib/libpng12.so.0.43.0
002d7000-002d8000 rw-p 00025000 1f:00 25605  /usr/lib/libpng12.so.0.43.0
002da000-002de000 r-xp  1f

Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-06 Thread Simon Schampijer

On 09/06/2011 12:48 PM, Simon Schampijer wrote:

On 09/05/2011 08:44 PM, Manuel Quiñones wrote:

The Add Tab button has been relocated next to the tab labels, allowing
more space for the URL entry.

Tabs are always shown. There is at least one tab. In that case, it
cannot be closed. We prevent the closing by hidding the 'X' button.
Also, the close image was sugarized.

There is now a fixed width for tabs. The label text does ellipsize.
The width depends on the amount of tabs. There is a maximun size that
is used when there is extra space. There is a minimun size to prevent
hiding the information.

When a new tab is opened, it now shows an empty page, not the default
page. In the future, we will add a hint in this empty page, similar
to what we have for an empty Journal.

Added the option to "follow link in new tab" in the link's palette.
Added an icon for this item, and also the icon for "follow link" is
also updated.


Wow, this is great stuff!

As always, some small comments :)

- when you open a new tab FF is setting the label to 'Untitled' (see
patch untitled.patch)

- when we have a new tab open, enter a url and then load it we see a
'about:blank' shortly, we can show 'Loading...' like FF there (see
loading. patch (there might be better ways of doing it but the timing
looks like it is the same as FF))

- 3 tabs open: when using the 'follow link in new tab' option in
tab_index=1 the new tab is appended to the list of open tabs - will be
tab_index=3, in FF it will be the tab right next to tab_index=1
(tab_index=2) (maybe just try to open a link in a new tab from any tab
in FF not the one a the right to see :)

- when you select a tab, one gets the white ellipse. if you compare with
the the old toolbar (you can see in Memorize) which is a notebook as
well you do not get the ellipse when selecting with a single click,
however you do get it when you double click once: I did try and looked
through the properties (border, can-focus...) but no property does seem
to fix it, what is funny if you change the BrowserNotebook to derive
from a gtk.Notebook istead of the sugar.graphics.notebook.Notebook we
get the same behavior as with the old-style toolbars, h


Hmm, at least until you open a new tab :/

@Benjamin: do you have an idea why this is the case?

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


Re: [Sugar-devel] [PATCH] Browse: tabs usability improved

2011-09-06 Thread Simon Schampijer

On 09/05/2011 08:44 PM, Manuel Quiñones wrote:

The Add Tab button has been relocated next to the tab labels, allowing
more space for the URL entry.

Tabs are always shown.  There is at least one tab.  In that case, it
cannot be closed.  We prevent the closing by hidding the 'X' button.
Also, the close image was sugarized.

There is now a fixed width for tabs.  The label text does ellipsize.
The width depends on the amount of tabs.  There is a maximun size that
is used when there is extra space.  There is a minimun size to prevent
hiding the information.

When a new tab is opened, it now shows an empty page, not the default
page.  In the future, we will add a hint in this empty page, similar
to what we have for an empty Journal.

Added the option to "follow link in new tab" in the link's palette.
Added an icon for this item, and also the icon for "follow link" is
also updated.


Wow, this is great stuff!

As always, some small comments :)

- when you open a new tab FF is setting the label to 'Untitled' (see 
patch untitled.patch)


- when we have a new tab open, enter a url and then load it we see a 
'about:blank' shortly, we can show 'Loading...' like FF there (see 
loading. patch (there might be better ways of doing it but the timing 
looks like it is the same as FF))


- 3 tabs open: when using the 'follow link in new tab' option in 
tab_index=1 the new tab is appended to the list of open tabs - will be 
tab_index=3, in FF it will be the tab right next to tab_index=1 
(tab_index=2) (maybe just try to open a link in a new tab from any tab 
in FF not the one a the right to see :)


- when you select a tab, one gets the white ellipse. if you compare with 
the the old toolbar (you can see in Memorize) which is a notebook as 
well you do not get the ellipse when selecting with a single click, 
however you do get it when you double click once: I did try and looked 
through the properties (border, can-focus...) but no property does seem 
to fix it, what is funny if you change the BrowserNotebook to derive 
from a gtk.Notebook istead of the sugar.graphics.notebook.Notebook we 
get the same behavior as with the old-style toolbars, h


- coloring of the tabs: the currently selected one should maybe have the 
same color as the toolbar, we should maybe do similar than in the 
old-style toolbar?




Extra food:

- Future: would be nice if the tabs would as well show the page logo on 
the left side and an animation while loading (see FF)


Regards,
   Simon
diff --git a/browser.py b/browser.py
index 0a32dd5..2c8331b 100644
--- a/browser.py
+++ b/browser.py
@@ -18,6 +18,7 @@
 
 import os
 import time
+from gettext import gettext as _
 
 import gobject
 import gtk
@@ -295,7 +296,7 @@ class TabLabel(gtk.HBox):
 self._browser = browser
 self._browser.connect('is-setup', self.__browser_is_setup_cb)
 
-self._label = gtk.Label('')
+self._label = gtk.Label(_('Untitled'))
 self._label.set_ellipsize(pango.ELLIPSIZE_END)
 self._label.set_alignment(0, 0.5)
 self.pack_start(self._label, )
diff --git a/browser.py b/browser.py
index 2c8331b..d3d09fb 100644
--- a/browser.py
+++ b/browser.py
@@ -334,7 +334,10 @@ class TabLabel(gtk.HBox):
 
 def __location_changed_cb(self, progress_listener, pspec):
 url = self._browser.get_url_from_nsiuri(progress_listener.location)
-self._label.set_text(url)
+if url == 'about:blank':
+self._label.set_text(_('Loading...'))
+else:
+self._label.set_text(url)
 
 def __title_changed_cb(self, browser, pspec):
 self._label.set_text(browser.props.title)
<>___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel