[Sugar-devel] [PATCH v3][sucrose-0.94][RFC]Add capability to connect to WPA/WPA2-Enterprise networks.

2011-12-11 Thread Ajay Garg
From: Ajay Garg 

(Note that this is a consolidated patch, to be applied in full;
and NOT OVER version-2, and version-1 patches).

Enhancements/Fixes of current version (version-3), over version-2 ::


a. Now, TLS-based-authentication is also supported.
   ---

   Thus, now, the following three authentication types are supported :
   (i)   TTLS
   (ii)  PEAP
   (iii) TLS

   Following authentication types are still not supported :
   (i)   LEAP (actually this may work, but the set-up has not been
   able to be worked out, and hence, this has not been
   verified, even with nm-applet).

b. Journal-Chooser integration.
   

   This is useful in picking up chooser-entries (especially in case
   of certificates requirements, like in TLS and TTLS).

(For the record)

Enhancements/Fixes of version-2, over version-1 ::
--

a. Network-Autoconnect-Upon-Hibernate-Resume
   --

   Fixing the case, when network wouldn't (auto-)come-up,
   when the XO resumed from hibernation. However, there wasn't
   a problem with auto-connect-on-reboot; it's working fine.

Signed-off-by: Ajay Garg 
---
 src/jarabe/desktop/keydialog.py |  245 +-
 src/jarabe/desktop/networkviews.py  |  253 ++-
 src/jarabe/journal/objectchooser.py |   19 +++
 src/jarabe/model/network.py |   28 +++-
 4 files changed, 533 insertions(+), 12 deletions(-)

diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
index c72f498..8c18a06 100644
--- a/src/jarabe/desktop/keydialog.py
+++ b/src/jarabe/desktop/keydialog.py
@@ -20,9 +20,13 @@ from gettext import gettext as _
 
 import gtk
 import dbus
+import os
+import shutil
 
+from sugar import env
 from jarabe.model import network
 from jarabe.model.network import Secrets
+from jarabe.journal.objectchooser import ObjectChooser
 
 
 IW_AUTH_ALG_OPEN_SYSTEM = 'open'
@@ -32,6 +36,11 @@ WEP_PASSPHRASE = 1
 WEP_HEX = 2
 WEP_ASCII = 3
 
+SETTING_TYPE_STRING = 1
+SETTING_TYPE_LIST = 2
+SETTING_TYPE_CHOOSER = 3
+
+
 
 def string_is_hex(key):
 is_hex = True
@@ -120,6 +129,224 @@ class KeyDialog(gtk.Dialog):
 return self._response
 
 
+# Plain Old Python Object (POPO)
+class NetworkParametersPOPO(gtk.HBox):
+def __init__(self, auth_param):
+gtk.HBox.__init__(self, homogeneous=True)
+self._key = auth_param._key_name
+self._label = gtk.Label(_(auth_param._key_label))
+self._key_type = auth_param._key_type
+self._auth_param = auth_param
+
+self.pack_start(self._label)
+self._label.show()
+
+if self._is_entry():
+self._entry = gtk.Entry()
+self.pack_start(self._entry)
+self._entry.show()
+elif self._is_liststore():
+self._option_store = gtk.ListStore(str, str)
+for option in auth_param._options:
+self._option_store.append(option)
+
+self._entry = auth_param._options[0][1]
+self._option_combo = gtk.ComboBox(self._option_store)
+cell = gtk.CellRendererText()
+self._option_combo.pack_start(cell, True)
+self._option_combo.add_attribute(cell, 'text', 0)
+self._option_combo.set_active(0)
+self._option_combo.connect('changed',
+self._option_combo_changed_cb)
+self.pack_start(self._option_combo)
+self.show()
+self._option_combo.show()
+elif self._is_chooser():
+self._chooser_button = gtk.Button(_('Choose..'))
+self._chooser_button.connect('clicked',
+  self._object_chooser_cb)
+self.pack_start(self._chooser_button)
+self._chooser_button.show()
+self._entry = ''
+
+def _is_entry(self):
+return ( not self._is_chooser() ) and \
+   ( len(self._auth_param._options) == 0 )
+
+def _is_liststore(self):
+return ( not self._is_chooser() ) and \
+   ( len(self._auth_param._options) > 0 )
+
+def _is_chooser(self):
+return self._key_type == SETTING_TYPE_CHOOSER
+
+def _object_chooser_cb(self, chooser_button):
+self._want_document = True
+self._show_picker_cb()
+
+def _show_picker_cb(self):
+if not self._want_document:
+return
+self._chooser = ObjectChooser()
+self._chooser._set_callback(self.__process_selected_journal_object)
+
+self._chooser.show()
+
+def __process_selected_journal_object(self, object_id):
+jobject = self._chooser.get_selected_object()
+if jobject and jobject.file_path:
+file_basename = \
+ 

Re: [Sugar-devel] quiz activity using chat

2011-12-11 Thread Frederick Grose
On Sun, Dec 11, 2011 at 9:00 AM, Nagarjuna G  wrote:

> We have been using chat activity in the Khairat School near Mumbai on
> OLPC.  While working with the kids we thought about some modified behavior
> of chat activity that may be useful.  I am posting this idea to know if any
> such activity already exists, if not would any one be interested in
> developing.
>
> One of the persons in the room announces quiz, the person who does this
> can post questions to the others in the room.  When others reply, the
> messages will not be broadcasted immediately, till the 'quiz master'
> releases or asks another question or exceeds the auto set time.  If we do
> this simple change of the chat activity, we can get excellent continuous
> evaluation tool.
>
> What do you think of the idea?  Unless i have surprise to know it is
> already possible in one of the activities.
>
> thanks in advance
> --
> GN
> http://metaStudio.org/ reShaping Education
>

Consider the Activity Poll,
http://activities.sugarlabs.org/en-US/sugar/addon/4074

It has some of these features.

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


Re: [Sugar-devel] [Systems] Multi-lingual relaying on Sugar IRC channles is stopped

2011-12-11 Thread Chris Leonard
On Sun, Dec 11, 2011 at 5:20 AM, Stefan Unterhauser
 wrote:
> good job :)
>
> can we test this new translation feature in #treehouse
>
> ... so Claudia can see
>


Excellent!  Well done. I know you have been busy, but that's a nice
piece of work.

Maybe we can get Australian translation going next? :-)

cjl

[Aussie]

˙ɐʞʞɐʎ ɟo ʇıq ɯnʞuıp ɹıɐɟ ɐ s,ʇɐɥʇ ʇnq `ƃuıʞuıɹp pɹɐzıl ɐ ǝʞıl ʇno
ʇɐlɟ uǝǝq ǝʌ,noʎ ʍouʞ ı ˙ɐʎuo pooƃ ˙ǝɔɐ
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] State of Palettes for GTK+ 3.x

2011-12-11 Thread Daniel Drake
On Thu, Nov 3, 2011 at 2:59 PM, Benjamin Berg  wrote:
> Palettes are still very broken in the sugar-toolkit-gtk3 branch. The
> problem is not very simple, and there is some unexpected trouble that we
> have not been able to figure out yet.
>
> For those that haven't heard any details, I'll try to explain what is
> going on here.
>
> In GTK+ 3.x we are not able to use the current hack to embed menus into
> normal palettes. The idea that we came up with during the Hackfest was
> to create two separate implementations (the API stays the same). So that
> either a sugar palette is popped up, or a sugarized GTK+ menu.
>
> Alone the fact that we are using a normal GTK+ menu means, that we need
> to handle grabbing correctly (ie. the opened menu/palette gets all the
> events). At the same time, doing this also results in proper touchscreen
> support because palettes can be dismissed by clicking anywhere on the
> screen.
> What happens during a grab is, that one widget receives all events.
> These can be forwarded to other widgets so that they can act upon them.
> The palettegroup already forwards the mouse-enter/mouse-leave events to
> all invokers; the idea is that they can keep track of their state.
>
> The behaviour that we are currently trying to achive is, that the
> palette should close after a while when the mouse is outside of the
> invoker/palette. The trouble is, that we have not been able to figure
> out how the mouse-enter/mouse-leave events to achieve this. The result
> of this is that the menu palettes will continuously pop up and down
> again.

We have now fixed this in the branch.

While the suggested approach of making the non-menu style palettes
perform a grab (like GtkMenu does) may have some value, we have
managed to avoid this for now.

The non-menu "window" style palettes are all working as before, and do
not perform a grab.

The menu-style palettes use GtkMenu and this does perform a grab, but
we managed to figure out how we can handle events to do what we want.
Marco determined how to filter the incoming enter/leave events in
order to accurately determine when the mouse is inside/outside the
palette. Unfortunately we do not always have access to enter/leave
events for the invoker (try hovering over a toolbar palette invoker
button, then moving the mouse away from the button without entering
the palette --> no event generated), so we use motion events to track
the position of the mouse relative to the invoker to determine when
the mouse is inside/outside the invoker.

Combining those things mean we have all the palette use cases working fine.

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


[Sugar-devel] quiz activity using chat

2011-12-11 Thread Nagarjuna G
We have been using chat activity in the Khairat School near Mumbai on OLPC.
 While working with the kids we thought about some modified behavior of
chat activity that may be useful.  I am posting this idea to know if any
such activity already exists, if not would any one be interested in
developing.

One of the persons in the room announces quiz, the person who does this can
post questions to the others in the room.  When others reply, the messages
will not be broadcasted immediately, till the 'quiz master' releases or
asks another question or exceeds the auto set time.  If we do this simple
change of the chat activity, we can get excellent continuous evaluation
tool.

What do you think of the idea?  Unless i have surprise to know it is
already possible in one of the activities.

thanks in advance
-- 
GN
http://metaStudio.org/ reShaping Education
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Systems] Multi-lingual relaying on Sugar IRC channles is stopped

2011-12-11 Thread Stefan Unterhauser
good job :)

can we test this new translation feature in #treehouse

... so Claudia can see

cu
dogi

On Mon, Dec 5, 2011 at 7:01 PM, Aleksey Lim wrote:

> On Sun, Oct 30, 2011 at 06:26:33PM +, Aleksey Lim wrote:
> > Hi all!
> >
> > Starting from the recent times, translation[1] on Sugar IRC channels
> > stopped working properly (messages started being skipped). This feature
> > is disabled entirely for now, since missed IRC posts on translated
> channels
> > might lead to many confusions.
> >
> > Infrastructure Team is working on the problem to fix this issue
> > as soon as possible. Sorry for inconveniences.
> >
> > [1]
> http://wiki.sugarlabs.org/go/Service/meeting/Usage#Multi-lingual_relaying
>
> The multi-lingual relaying started functioning in testing mode.
> It is only Spanish language.
>
> Translation is provided by Apertium[1] project. If it
> is not good, please consider possibility to improve[2] it.
>
> Use meeting-test channel[3] for testing.
>
> [1] http://apertium.org
> [2] http://wiki.apertium.org/wiki/Contributing_to_an_existing_pair
> [3] http://chat.sugarlabs.org:9090/?channels=meeting-test
>
> --
> Aleksey
> ___
> Systems mailing list
> syst...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/systems
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel