[Sugar-devel] [DESIGN] Web Services, Control Panel section

2013-04-04 Thread Manuel Quiñones
Hi, some bits of design topics for the Web Services feature.

1. Wording.  Are we OK with "Configure your Web Services"?  First of,
no other section use verbs.  According to the description in the
feature page, this is an account manager.  Other names come to my
mind:

- Social Accounts
- Web Accounts
- Web Services Configuration (similar to Modem Configuration)

More ideas?

2. Icon.  So there is no icon yet.  I did a test using dialog baloons.
 I'm not very convinced, what do people think?

http://dev.laptop.org/~manuq/websettings-icon.png
http://dev.laptop.org/~manuq/module-webservices.svg

When no web services are installed the CP section displays a message.
Good!  To close it, buttons Cancel or OK can be pressed.  They both do
the same, which can be confusing, but this is a flaw of the sugar
control panel itself, nothing to do in this feature about this.

Ideally the link in that message could be pressed by the user, but we
know the limitations of Sugar opening activities from inside other
activities.  What would be convenient, is if the text could be
selected and copied to the clipboard, or dragged to it.  I think it
could even contain the link information.

By the way I have tried the link and it doesn't exist:
http://wiki.sugarlabs.org/WebServices gives 404 not found.

Walter, can you point me to one webservice extension so I can test
further?  I can see from this screenshot it embeds a webview?

http://wiki.sugarlabs.org/go/File:FB-online-account-manager.png


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


[Sugar-devel] Webkit drag and drop bug

2013-04-04 Thread Daniel Narvaez
Hello,

I opened a bug about the issue with dragged links having a \x00 at the end.

https://bugs.webkit.org/show_bug.cgi?id=113962

I'm not really a gtk drag drop or a webkit expert, but that really seems
like the issue to me. Let's see if someone comments.

Might be worth trying if selection.get_uris() works around the issue. I'm
not too hopeful though, because the implementation is using the length.

Otherwise I guess we will have to write a Webkit patch.

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


Re: [Sugar-devel] [PATCH] Bring back dragging of elements from the activities to the frame clipboard - SL #3819

2013-04-04 Thread Manuel Quiñones
2013/4/4 Flavio Danesse :
> Actually if you for example:
>
> selection.get_uris (* args, ** kwargs)
>
> will return a list of uris in selection, so if no uris it will return an
> empty list, then do not even need to know what type of data is in selection.

Excellent Flavio!  I have to try it.  This will simplify the code a
lot as you say.


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


Re: [Sugar-devel] [PATCH] Bring back dragging of elements from the activities to the frame clipboard - SL #3819

2013-04-04 Thread Flavio Danesse
Actually if you for example:

selection.get_uris (* args, ** kwargs)

will return a list of uris in selection, so if no uris it will return an
empty list, then do not even need to know what type of data is in selection.


2013/4/4 Flavio Danesse 

> Manuel, I think this code can be improved and greatly simplified if
> instead of using things like:
>
> selection_data.split uris = ('\ n')
>
> use:
>
> uris = selection.get_uris ()
>
> Instead of using:
>
> selection.get_data (* args, ** kwargs)
>
> You can work directly on selection and get the data type with:
>
> selection.get_data_type (* args, ** kwargs)
>
> and get straight to the content:
>
> selection.get_pixbuf (* args, ** kwargs)
> selection.get_text (* args, ** kwargs)
> selection.get_uris (* args, ** kwargs)
>
>
> 2013/4/4 Manuel Quiñones 
>
>> Note I have also applied this as a pull request to the github experiment:
>>
>> https://github.com/sugarlabs/sugar/pull/14
>>
>> 2013/4/4 Manuel Quiñones :
>> > TestCase:
>> >
>> > - open an activity like Browse, Read, Log (not Write, is a special case)
>> > - bring up the frame
>> > - drag things to the left side panel of the frame (images, links, or
>> selected text)
>> >
>> > The elements should be added to the clipboard which is inside the
>> > panel.  They should have the proper icon and they should popup a
>> > palette to act on them.
>> >
>> > Note: if the dragged object is a link from Browse, Sugar tries to copy
>> > the html to the disk.  But the current implementation looks wrong.  I
>> > have opened #4477 to track it: http://bugs.sugarlabs.org/ticket/4477
>> >
>> > Note: this doesn't solve the inverse operation: drag from the
>> > clipboard to the activity.  This will be done in another patch.
>> >
>> > API fixes:
>> >
>> > - gtk.SelectionData.type  ->  Gtk.SelectionData.get_data_type() [1]
>> > - gtk.SelectionData.data  ->  Gtk.SelectionData.get_data() [2]
>> > - gtk.SelectionData.target  ->  Gtk.SelectionData.get_target() [3]
>> > - context.targets  ->  context.list_targets() [4]
>> > - context.drop_finish(...)  ->  Gdk.drop_finish(context, ...) [5]
>> > - context.drag_status(...)  ->  Gdk.drag_status(context, ...) [6]
>> > - context.get_source_widget()  ->  Gdk.drag_get_source_widget(context)
>> [7]
>> >
>> > [1]
>> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data-type
>> > [2]
>> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data
>> > [3]
>> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-target
>> > [4]
>> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-context-list-targets
>> > [5]
>> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drop-finish
>> > [6]
>> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-status
>> > [7]
>> https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-get-source-widget
>> >
>> > Cast the type of the Gtk.SelectionData from Gdk.Atom to str.  Our code
>> > treats it as str in sugar3.mime and asks methods like startswith which
>> > fails if it is not a str-like object.
>> >
>> > The data for the type 'text/uri-list' comes with a character '\x00' at
>> > the end now.  Remove it so our functions like
>> > sugar3.mime.split_uri_list don't break.
>> >
>> > Signed-off-by: Manuel Quiñones 
>> > ---
>> >  src/jarabe/frame/clipboardtray.py | 46
>> +--
>> >  1 file changed, 30 insertions(+), 16 deletions(-)
>> >
>> > diff --git a/src/jarabe/frame/clipboardtray.py
>> b/src/jarabe/frame/clipboardtray.py
>> > index abc885e..5115d61 100644
>> > --- a/src/jarabe/frame/clipboardtray.py
>> > +++ b/src/jarabe/frame/clipboardtray.py
>> > @@ -76,26 +76,39 @@ class ClipboardTray(tray.VTray):
>> >  return False
>> >
>> >  def _add_selection(self, object_id, selection):
>> > -if not selection.data:
>> > +if not selection.get_data():
>> >  return
>> >
>> > -logging.debug('ClipboardTray: adding type %r', selection.type)
>> > +selection_data = selection.get_data()
>> > +selection_type = selection.get_data_type()
>> > +
>> > +# The type comes as a Gdk.Atom but we need it as str to
>> > +# compare it.
>> > +assert isinstance(selection_type, Gdk.Atom)
>> > +selection_type = str(selection_type)
>> > +
>> > +logging.debug('ClipboardTray: adding type %r', selection_type)
>> >
>> >  cb_service = clipboard.get_instance()
>> > -if selection.type == 'text/uri-list':
>> > -uris = selection.data.split('\n')
>> > +if selection_type == 'text/uri-list':
>> > +# For 'text/uri-list' type, last character is '\x00'.  This
>> > +# wasn't the case in GTK2.
>> > +assert selection_data[-1] == '\x00'
>> > +selection_data = selection_data[:-1]
>> > +
>> > +uris = selection_data.split('\n')
>> > 

Re: [Sugar-devel] [PATCH] Bring back dragging of elements from the activities to the frame clipboard - SL #3819

2013-04-04 Thread Flavio Danesse
Manuel, I think this code can be improved and greatly simplified if instead
of using things like:

selection_data.split uris = ('\ n')

use:

uris = selection.get_uris ()

Instead of using:

selection.get_data (* args, ** kwargs)

You can work directly on selection and get the data type with:

selection.get_data_type (* args, ** kwargs)

and get straight to the content:

selection.get_pixbuf (* args, ** kwargs)
selection.get_text (* args, ** kwargs)
selection.get_uris (* args, ** kwargs)


2013/4/4 Manuel Quiñones 

> Note I have also applied this as a pull request to the github experiment:
>
> https://github.com/sugarlabs/sugar/pull/14
>
> 2013/4/4 Manuel Quiñones :
> > TestCase:
> >
> > - open an activity like Browse, Read, Log (not Write, is a special case)
> > - bring up the frame
> > - drag things to the left side panel of the frame (images, links, or
> selected text)
> >
> > The elements should be added to the clipboard which is inside the
> > panel.  They should have the proper icon and they should popup a
> > palette to act on them.
> >
> > Note: if the dragged object is a link from Browse, Sugar tries to copy
> > the html to the disk.  But the current implementation looks wrong.  I
> > have opened #4477 to track it: http://bugs.sugarlabs.org/ticket/4477
> >
> > Note: this doesn't solve the inverse operation: drag from the
> > clipboard to the activity.  This will be done in another patch.
> >
> > API fixes:
> >
> > - gtk.SelectionData.type  ->  Gtk.SelectionData.get_data_type() [1]
> > - gtk.SelectionData.data  ->  Gtk.SelectionData.get_data() [2]
> > - gtk.SelectionData.target  ->  Gtk.SelectionData.get_target() [3]
> > - context.targets  ->  context.list_targets() [4]
> > - context.drop_finish(...)  ->  Gdk.drop_finish(context, ...) [5]
> > - context.drag_status(...)  ->  Gdk.drag_status(context, ...) [6]
> > - context.get_source_widget()  ->  Gdk.drag_get_source_widget(context)
> [7]
> >
> > [1]
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data-type
> > [2]
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data
> > [3]
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-target
> > [4]
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-context-list-targets
> > [5]
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drop-finish
> > [6]
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-status
> > [7]
> https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-get-source-widget
> >
> > Cast the type of the Gtk.SelectionData from Gdk.Atom to str.  Our code
> > treats it as str in sugar3.mime and asks methods like startswith which
> > fails if it is not a str-like object.
> >
> > The data for the type 'text/uri-list' comes with a character '\x00' at
> > the end now.  Remove it so our functions like
> > sugar3.mime.split_uri_list don't break.
> >
> > Signed-off-by: Manuel Quiñones 
> > ---
> >  src/jarabe/frame/clipboardtray.py | 46
> +--
> >  1 file changed, 30 insertions(+), 16 deletions(-)
> >
> > diff --git a/src/jarabe/frame/clipboardtray.py
> b/src/jarabe/frame/clipboardtray.py
> > index abc885e..5115d61 100644
> > --- a/src/jarabe/frame/clipboardtray.py
> > +++ b/src/jarabe/frame/clipboardtray.py
> > @@ -76,26 +76,39 @@ class ClipboardTray(tray.VTray):
> >  return False
> >
> >  def _add_selection(self, object_id, selection):
> > -if not selection.data:
> > +if not selection.get_data():
> >  return
> >
> > -logging.debug('ClipboardTray: adding type %r', selection.type)
> > +selection_data = selection.get_data()
> > +selection_type = selection.get_data_type()
> > +
> > +# The type comes as a Gdk.Atom but we need it as str to
> > +# compare it.
> > +assert isinstance(selection_type, Gdk.Atom)
> > +selection_type = str(selection_type)
> > +
> > +logging.debug('ClipboardTray: adding type %r', selection_type)
> >
> >  cb_service = clipboard.get_instance()
> > -if selection.type == 'text/uri-list':
> > -uris = selection.data.split('\n')
> > +if selection_type == 'text/uri-list':
> > +# For 'text/uri-list' type, last character is '\x00'.  This
> > +# wasn't the case in GTK2.
> > +assert selection_data[-1] == '\x00'
> > +selection_data = selection_data[:-1]
> > +
> > +uris = selection_data.split('\n')
> >  if len(uris) > 1:
> >  raise NotImplementedError('Multiple uris in
> text/uri-list' \
> >' still not supported.')
> >
> >  cb_service.add_object_format(object_id,
> > - selection.type,
> > + selection_type,
> >   

Re: [Sugar-devel] Acked-by vs Reviewed-by

2013-04-04 Thread Daniel Narvaez
On 4 April 2013 19:02, Manuel Quiñones  wrote:

> 2013/4/3 James Cameron :
> > That's really up to the maintainer.  If the maintainer pushes the
> > patch, then Acked-by may be inferred.
> >
> > In general these procedures scale well to large numbers of
> > maintainers, contributors, and reviewers.  I'm not sure they remain
> > appropriate for Sugar given the size of the community at the moment.
>
> In the case of a pull request workflow, the merger (author of the
> merge commit) has the same meaning as the Acked-by.  So if the signing
> was useful to know who reviewed/acked, the author of the merge is the
> same in the pull-request.  I just merged a pull request from Daniel
> Narvaez
>
> Here is his commit:
>
>
> https://github.com/dnarvaez/sugar-toolkit-gtk3/commit/db448c4eea41a5661838c3a4f3788457fe28ac77
>
> And my merge:
>
>
> https://github.com/sugarlabs/sugar-toolkit-gtk3/commit/a776c72d46ac09a2791e75a7edbcbc534b158ab5
>
> Anyways I added "Acked-by" to the merge commit message to not break
> the current rules.  But we can see the duplication.
>
> Merging can be done by the command line, not only by the github UI
>
> https://help.github.com/articles/merging-a-pull-request
>
> And I think we should recommend doing the merge locally for testing
> before merge.  'git merge' automatically opens the editor since git
> git1.7.9.6
>

I agree about recommending to merge locally.

I wonder if we should have merge commits though, or if we should rebase.
They do add a bit of noise to history but they also add some information.
Maybe it depends, as argued here

http://mislav.uniqpath.com/2013/02/merge-vs-rebase/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Acked-by vs Reviewed-by

2013-04-04 Thread Manuel Quiñones
2013/4/3 James Cameron :
> That's really up to the maintainer.  If the maintainer pushes the
> patch, then Acked-by may be inferred.
>
> In general these procedures scale well to large numbers of
> maintainers, contributors, and reviewers.  I'm not sure they remain
> appropriate for Sugar given the size of the community at the moment.

In the case of a pull request workflow, the merger (author of the
merge commit) has the same meaning as the Acked-by.  So if the signing
was useful to know who reviewed/acked, the author of the merge is the
same in the pull-request.  I just merged a pull request from Daniel
Narvaez

Here is his commit:

https://github.com/dnarvaez/sugar-toolkit-gtk3/commit/db448c4eea41a5661838c3a4f3788457fe28ac77

And my merge:

https://github.com/sugarlabs/sugar-toolkit-gtk3/commit/a776c72d46ac09a2791e75a7edbcbc534b158ab5

Anyways I added "Acked-by" to the merge commit message to not break
the current rules.  But we can see the duplication.

Merging can be done by the command line, not only by the github UI

https://help.github.com/articles/merging-a-pull-request

And I think we should recommend doing the merge locally for testing
before merge.  'git merge' automatically opens the editor since git
git1.7.9.6

http://article.gmane.org/gmane.linux.kernel/1276761

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


Re: [Sugar-devel] [PATCH] Bring back dragging of elements from the activities to the frame clipboard - SL #3819

2013-04-04 Thread Manuel Quiñones
Note I have also applied this as a pull request to the github experiment:

https://github.com/sugarlabs/sugar/pull/14

2013/4/4 Manuel Quiñones :
> TestCase:
>
> - open an activity like Browse, Read, Log (not Write, is a special case)
> - bring up the frame
> - drag things to the left side panel of the frame (images, links, or selected 
> text)
>
> The elements should be added to the clipboard which is inside the
> panel.  They should have the proper icon and they should popup a
> palette to act on them.
>
> Note: if the dragged object is a link from Browse, Sugar tries to copy
> the html to the disk.  But the current implementation looks wrong.  I
> have opened #4477 to track it: http://bugs.sugarlabs.org/ticket/4477
>
> Note: this doesn't solve the inverse operation: drag from the
> clipboard to the activity.  This will be done in another patch.
>
> API fixes:
>
> - gtk.SelectionData.type  ->  Gtk.SelectionData.get_data_type() [1]
> - gtk.SelectionData.data  ->  Gtk.SelectionData.get_data() [2]
> - gtk.SelectionData.target  ->  Gtk.SelectionData.get_target() [3]
> - context.targets  ->  context.list_targets() [4]
> - context.drop_finish(...)  ->  Gdk.drop_finish(context, ...) [5]
> - context.drag_status(...)  ->  Gdk.drag_status(context, ...) [6]
> - context.get_source_widget()  ->  Gdk.drag_get_source_widget(context) [7]
>
> [1] 
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data-type
> [2] 
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data
> [3] 
> https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-target
> [4] 
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-context-list-targets
> [5] 
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drop-finish
> [6] 
> https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-status
> [7] 
> https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-get-source-widget
>
> Cast the type of the Gtk.SelectionData from Gdk.Atom to str.  Our code
> treats it as str in sugar3.mime and asks methods like startswith which
> fails if it is not a str-like object.
>
> The data for the type 'text/uri-list' comes with a character '\x00' at
> the end now.  Remove it so our functions like
> sugar3.mime.split_uri_list don't break.
>
> Signed-off-by: Manuel Quiñones 
> ---
>  src/jarabe/frame/clipboardtray.py | 46 
> +--
>  1 file changed, 30 insertions(+), 16 deletions(-)
>
> diff --git a/src/jarabe/frame/clipboardtray.py 
> b/src/jarabe/frame/clipboardtray.py
> index abc885e..5115d61 100644
> --- a/src/jarabe/frame/clipboardtray.py
> +++ b/src/jarabe/frame/clipboardtray.py
> @@ -76,26 +76,39 @@ class ClipboardTray(tray.VTray):
>  return False
>
>  def _add_selection(self, object_id, selection):
> -if not selection.data:
> +if not selection.get_data():
>  return
>
> -logging.debug('ClipboardTray: adding type %r', selection.type)
> +selection_data = selection.get_data()
> +selection_type = selection.get_data_type()
> +
> +# The type comes as a Gdk.Atom but we need it as str to
> +# compare it.
> +assert isinstance(selection_type, Gdk.Atom)
> +selection_type = str(selection_type)
> +
> +logging.debug('ClipboardTray: adding type %r', selection_type)
>
>  cb_service = clipboard.get_instance()
> -if selection.type == 'text/uri-list':
> -uris = selection.data.split('\n')
> +if selection_type == 'text/uri-list':
> +# For 'text/uri-list' type, last character is '\x00'.  This
> +# wasn't the case in GTK2.
> +assert selection_data[-1] == '\x00'
> +selection_data = selection_data[:-1]
> +
> +uris = selection_data.split('\n')
>  if len(uris) > 1:
>  raise NotImplementedError('Multiple uris in text/uri-list' \
>' still not supported.')
>
>  cb_service.add_object_format(object_id,
> - selection.type,
> + selection_type,
>   uris[0],
>   on_disk=True)
>  else:
>  cb_service.add_object_format(object_id,
> - selection.type,
> - selection.data,
> + selection_type,
> + selection_data,
>   on_disk=False)
>
>  def _object_added_cb(self, cb_service, cb_object):
> @@ -132,9 +145,9 @@ class ClipboardTray(tray.VTray):
>  logging.debug('ClipboardTray._drag_motion_cb')
>
>  if self._internal_drag(context):
> -context.dr

[Sugar-devel] [PATCH] Bring back dragging of elements from the activities to the frame clipboard - SL #3819

2013-04-04 Thread Manuel Quiñones
TestCase:

- open an activity like Browse, Read, Log (not Write, is a special case)
- bring up the frame
- drag things to the left side panel of the frame (images, links, or selected 
text)

The elements should be added to the clipboard which is inside the
panel.  They should have the proper icon and they should popup a
palette to act on them.

Note: if the dragged object is a link from Browse, Sugar tries to copy
the html to the disk.  But the current implementation looks wrong.  I
have opened #4477 to track it: http://bugs.sugarlabs.org/ticket/4477

Note: this doesn't solve the inverse operation: drag from the
clipboard to the activity.  This will be done in another patch.

API fixes:

- gtk.SelectionData.type  ->  Gtk.SelectionData.get_data_type() [1]
- gtk.SelectionData.data  ->  Gtk.SelectionData.get_data() [2]
- gtk.SelectionData.target  ->  Gtk.SelectionData.get_target() [3]
- context.targets  ->  context.list_targets() [4]
- context.drop_finish(...)  ->  Gdk.drop_finish(context, ...) [5]
- context.drag_status(...)  ->  Gdk.drag_status(context, ...) [6]
- context.get_source_widget()  ->  Gdk.drag_get_source_widget(context) [7]

[1] 
https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data-type
[2] 
https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data
[3] 
https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-target
[4] 
https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-context-list-targets
[5] 
https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drop-finish
[6] 
https://developer.gnome.org/gdk/stable/gdk-Drag-and-Drop.html#gdk-drag-status
[7] 
https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-get-source-widget

Cast the type of the Gtk.SelectionData from Gdk.Atom to str.  Our code
treats it as str in sugar3.mime and asks methods like startswith which
fails if it is not a str-like object.

The data for the type 'text/uri-list' comes with a character '\x00' at
the end now.  Remove it so our functions like
sugar3.mime.split_uri_list don't break.

Signed-off-by: Manuel Quiñones 
---
 src/jarabe/frame/clipboardtray.py | 46 +--
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/src/jarabe/frame/clipboardtray.py 
b/src/jarabe/frame/clipboardtray.py
index abc885e..5115d61 100644
--- a/src/jarabe/frame/clipboardtray.py
+++ b/src/jarabe/frame/clipboardtray.py
@@ -76,26 +76,39 @@ class ClipboardTray(tray.VTray):
 return False
 
 def _add_selection(self, object_id, selection):
-if not selection.data:
+if not selection.get_data():
 return
 
-logging.debug('ClipboardTray: adding type %r', selection.type)
+selection_data = selection.get_data()
+selection_type = selection.get_data_type()
+
+# The type comes as a Gdk.Atom but we need it as str to
+# compare it.
+assert isinstance(selection_type, Gdk.Atom)
+selection_type = str(selection_type)
+
+logging.debug('ClipboardTray: adding type %r', selection_type)
 
 cb_service = clipboard.get_instance()
-if selection.type == 'text/uri-list':
-uris = selection.data.split('\n')
+if selection_type == 'text/uri-list':
+# For 'text/uri-list' type, last character is '\x00'.  This
+# wasn't the case in GTK2.
+assert selection_data[-1] == '\x00'
+selection_data = selection_data[:-1]
+
+uris = selection_data.split('\n')
 if len(uris) > 1:
 raise NotImplementedError('Multiple uris in text/uri-list' \
   ' still not supported.')
 
 cb_service.add_object_format(object_id,
- selection.type,
+ selection_type,
  uris[0],
  on_disk=True)
 else:
 cb_service.add_object_format(object_id,
- selection.type,
- selection.data,
+ selection_type,
+ selection_data,
  on_disk=False)
 
 def _object_added_cb(self, cb_service, cb_object):
@@ -132,9 +145,9 @@ class ClipboardTray(tray.VTray):
 logging.debug('ClipboardTray._drag_motion_cb')
 
 if self._internal_drag(context):
-context.drag_status(Gdk.DragAction.MOVE, time)
+Gdk.drag_status(context, Gdk.DragAction.MOVE, time)
 else:
-context.drag_status(Gdk.DragAction.COPY, time)
+Gdk.drag_status(context, Gdk.DragAction.COPY, time)
 self.props.drag_active = True
 
 return True
@@ -148,15 +161,16 @@ class ClipboardTray(tr

Re: [Sugar-devel] Usage of Signed-off-by / Acked-by - Re: Recent movement on Sugar master repository

2013-04-04 Thread Daniel Narvaez
On 4 April 2013 14:23, Gonzalo Odiard  wrote:

>
>
>
> About Reviewed-by, if you have say a 10 patches set, is one-by-one
>> interactive rebase the only way to add the tag to all the patches? I'm not
>> too attached to the one click pull request merging from the web UI...
>> pulling and pushing on the command line is not too complicated. Though if
>> you have to modify patches one by one it starts to get annoying...
>>
>>
> True. Modify every patch can be a pain, specially if we change the way we
> are working and move to use github web tools.
> I am not sure what is the best to do here. Web interface makes a little
> more difficult to see this header info.
> (Personally, I feel better in the command line yet)
>

I'm not sure the pull request workflow makes this worst though. It's very
easy to apply the patchset from the command line (just pulling a branch).
What is annoying is to modify the patches log one by one, but I suppose
that's the same with email workflow.
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Usage of Signed-off-by / Acked-by - Re: Recent movement on Sugar master repository

2013-04-04 Thread Gonzalo Odiard
On Wed, Apr 3, 2013 at 1:27 PM, Daniel Narvaez  wrote:

> Perhaps you can explain exactly what Signed-off-by adds compared to the
> author field in tnormal cases? I know it's not much work, but it adds one
> more thing we need to request to patch submitters. I tend to think the
> simpler is the process the more patches we will get :) Or at least I
> personally get really annoyed by bureaucracy when submitting code.
>
>
Usually is redundant, but there are cases where can add value, like when
there are more than one author
or when the author sent a .diff instead of a .patch.


> About Reviewed-by, if you have say a 10 patches set, is one-by-one
> interactive rebase the only way to add the tag to all the patches? I'm not
> too attached to the one click pull request merging from the web UI...
> pulling and pushing on the command line is not too complicated. Though if
> you have to modify patches one by one it starts to get annoying...
>
>
True. Modify every patch can be a pain, specially if we change the way we
are working and move to use github web tools.
I am not sure what is the best to do here. Web interface makes a little
more difficult to see this header info.
(Personally, I feel better in the command line yet)

Gonzalo


>
>
> On 3 April 2013 15:00, Gonzalo Odiard  wrote:
>
>> I think we should keep using the Signed-off-by, Acked-by, Reviewed-by
>> signatures, because do not add too much work,
>> make clear the responsibilities, and recognize important work done
>> as the review, needed by the project.
>>
>> Gonzalo
>>
>>
>> On Tue, Apr 2, 2013 at 2:41 PM, Manuel Quiñones  wrote:
>>
>>> As we are revisiting all the review process, can we revisit the usage
>>> of signing the patches?  What are they useful for?
>>>
>>> 2013/4/2 Daniel Narvaez :
>>> > So I'm not sure these are worth the overhead. Especially for  signing
>>> it
>>> > doesn't seem to be very useful for us, if not in some special cases,
>>> and it
>>> > adds one more thing we need to require from contributors... I'd rather
>>> bug
>>> > them about improving the code then about using a tag of dubious
>>> utility.
>>> >
>>> > Just my feeling really, I'm happy to keep using the tags if we think
>>> they
>>> > are necessary. Just trying to streamline things a bit if possible.
>>>
>>> Yes, I agree with you Daniel.  I think we need the point of view of
>>> other devs, specially from those who are in the project prior than us.
>>>
>>> >
>>> > On 2 April 2013 19:25, Manuel Quiñones  wrote:
>>> >>
>>> >> Hi Daniel,
>>> >>
>>> >> 2013/4/2 Daniel Narvaez :
>>> >> > Hey,
>>> >> >
>>> >> > sorry, I forgot about those. Though I think it's worth to think if
>>> we
>>> >> > really
>>> >> > need them while we are reworking reviews a bit.
>>> >> >
>>> >> > When is signed-off-by useful in sugar?
>>> >>
>>> >> I think we just have been following other projects like the linux
>>> >> kernel.  In many projects this means "I certify that my code is
>>> >> compatible with the license of this project".  For me, it is useful
>>> >> only if the commiter is another user, to track the real author.
>>> >>
>>> >> http://wiki.sugarlabs.org/go/Development_Team/Code_Review
>>> >>
>>> >> > How is reviewed-by applied? Is it the reviewer which rebase and add
>>> them
>>> >> > before pushing?
>>> >>
>>> >> Yes we have been amending the patches before pushing, all manual work.
>>> >>  For me, the Acked-by signing has been useful to track who reviewed
>>> >> what.  But maybe not a big deal?
>>> >>
>>> >> So there are projects that do signing, and projects that don't.  I
>>> >> searched quickly for a way to add Acked-by when github merges a pull
>>> >> request, but haven't found anything.
>>> >>
>>> >> > On 2 April 2013 18:30, Manuel Quiñones  wrote:
>>> >> >>
>>> >> >> Hi devs,
>>> >> >>
>>> >> >> I've seen some movement in current master.  I suppose all this was
>>> >> >> reviewed, but what I wonder is if we are sticking to the
>>> signed-off-by
>>> >> >> / acked-by signing.
>>> >> >>
>>> >> >> The commits in question are:
>>> >> >>
>>> >> >> commit f423ec21b4bf0d953a470a383cc801b61a087e98
>>> >> >> Author: Walter Bender 
>>> >> >> Date:   Sat Mar 30 16:06:00 2013 -0400
>>> >> >>
>>> >> >> Add comment box to expanded entry
>>> >> >>
>>> >> >> commit 541af0166030a5f3b7b52bdc23d416dbf688b5e9
>>> >> >> Author: Walter Bender 
>>> >> >> Date:   Sat Mar 30 10:45:22 2013 -0400
>>> >> >>
>>> >> >> Add CommentView widget to expanded entry
>>> >> >>
>>> >> >> commit 248a758875e5a02a53ae57980f4fe2f3bb0bb91e
>>> >> >> Author: Walter Bender 
>>> >> >> Date:   Thu Mar 28 15:26:17 2013 -0400
>>> >> >>
>>> >> >> Make a separate method for _write_entry so method can be reused
>>> >> >>
>>> >> >> commit 1af4b5ec7f03ed43da1616df946fe936e8577e91
>>> >> >> Author: Walter Bender 
>>> >> >> Date:   Thu Mar 28 15:25:41 2013 -0400
>>> >> >>
>>> >> >> Pass a widget to _create_scrollable so method can be reused
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> .. manuq ..
>>> >> >> _

Re: [Sugar-devel] [IAEP] FW: Sugar 0.100 status report - April 2

2013-04-04 Thread Manuel Quiñones
2013/4/4 Ajay Garg :
>
>
>
> On Thu, Apr 4, 2013 at 1:08 AM, Manuel Quiñones  wrote:
>>
>> The feature page doesn't explicitly state, but I remember it allows
>> batch removal.
>
>
> Ahh yes... it does :)

Oh, right Ajay, it is in the summary:

http://wiki.sugarlabs.org/go/Features/Multi_selection#Summary

>>
>>
>> http://wiki.sugarlabs.org/go/Features/Multi_selection
>>
>> 2013/4/3 Daniel Narvaez :
>> > Adding devel and Ajay.
>> >
>> >
>> > On 3 April 2013 19:26, Caryl Bigenho  wrote:
>> >>
>> >> I guess this is where this should go? Clue me in if it should be posted
>> >> elsewhere.
>> >>
>> >> Caryl
>> >>
>> >> 
>> >> Date: Wed, 3 Apr 2013 18:05:36 +0200
>> >> Subject: Re: [IAEP] Sugar 0.100 status report - April 2
>> >> From: dwnarv...@gmail.com
>> >> To: cbige...@hotmail.com
>> >>
>> >>
>> >> Hi Caryl,
>> >>
>> >> could you post this on the list?. I don't know the answer to your
>> >> questions, but the patches author will know for sure...
>> >>
>> >>
>> >> On 3 April 2013 02:04, Caryl Bigenho  wrote:
>> >>
>> >> Hi...
>> >>
>> >> Looks like great stuff! Adapting Sugar to run on Android opens lots of
>> >> possibilities. My programming days ended long ago with Pascal, but I
>> >> might
>> >> be able to offer some suggestions as a Sugar user... here's one to
>> >> start...
>> >>
>> >> For the multiple selection of items in the journal... will this also
>> >> allow
>> >> multiple deletion of entries? That would be a handy feature I have
>> >> often
>> >> wished were available. Also, do the selected items have to be
>> >> consecutive?
>> >> Could some be skipped over (either initially or by allowing a deselect
>> >> of
>> >> individual items that aren't wanted on the list).
>> >>
>> >> Caryl
>> >>
>> >>
>> >>
>> >> 
>> >> Date: Wed, 3 Apr 2013 00:37:08 +0200
>> >> From: dwnarv...@gmail.com
>> >> To: sugar-devel@lists.sugarlabs.org
>> >> CC: i...@lists.sugarlabs.org
>> >> Subject: [IAEP] Sugar 0.100 status report - April 2
>> >>
>> >>
>> >> Hello,
>> >>
>> >> I will try to send out regular reports about the progress of the 0.100
>> >> release, weekly, bi-weekly or monthly depending on how much is
>> >> happening.
>> >>
>> >> 1. A bit late, but we finally have a schedule for the release.We are
>> >> not
>> >> going to have a feature acceptance deadline this time. We decided to
>> >> have
>> >> that discussion early, to try and narrow the focus of the release.
>> >>
>> >> http://wiki.sugarlabs.org/go/0.100/Roadmap
>> >>
>> >> 2. In parallel some developers will keep to refine the 0.98 series.
>> >> Help
>> >> is welcome on that effort. While perhaps not as exciting as new
>> >> features,
>> >> bug fixing and polish is essential to good software.
>> >>
>> >> 3. The main goal of the 0.100 release will be to the develop an HTML5
>> >> based toolkit for activities. This will facilitate running Sugar
>> >> activities
>> >> on other platforms, like Android. In addition we are planning to land
>> >> several other features which has seen development in the past few
>> >> months
>> >>
>> >> Multiple selection in the Journal
>> >> http://wiki.sugarlabs.org/go/Features/Multi_selection
>> >>
>> >> Enhanced support for 3G modems
>> >> http://wiki.sugarlabs.org/go/Features/3G_Support/Database_Support
>> >>
>> >> Background customization
>> >> http://wiki.sugarlabs.org/go/Features/Background_image_on_home_view
>> >>
>> >> Multiple home views
>> >> http://wiki.sugarlabs.org/go/Features/Multiple_home_views
>> >>
>> >> Integration with web services
>> >> http://wiki.sugarlabs.org/go/Features/Web_services
>> >>
>> >> Journal comments box
>> >>
>> >> http://wiki.sugarlabs.org/go/Features/Comment_box_in_journal_detail_view
>> >>
>> >> Icon customization
>> >> http://wiki.sugarlabs.org/go/Features/Icon_Change
>> >>
>> >> 4. The project has always had a bit of an issue with submitted code
>> >> being
>> >> timely reviewed. The situation got worse in the last few months. This
>> >> is a
>> >> major blocker for contributions and we are trying to improve. Simon and
>> >> Manuel, which currently maintains all the Glucose modules alone, are
>> >> putting
>> >> together a list of "reviewers" to help them out with the task. We are
>> >> also
>> >> trying to find review tools which will allow the process to be both
>> >> trackable and visible to everyone (and hopefully a bit more pleasant
>> >> too!).
>> >> We have so far mostly experimented with a workflow based on github pull
>> >> requests.
>> >>
>> >> 5. Walter Bender landed several patches to add a comment box to journal
>> >> entries. It will be populated both by the Portfolio activity and by the
>> >> web
>> >> services integration which is being worked on. The obligatory
>> >> screenshot
>> >>
>> >> http://wiki.sugarlabs.org/images/4/4a/FB-comments.png
>> >>
>> >> 6. All in all I think we made great progress planning the next release.
>> >> But we will need everyone help to execute and make it a really good
>> >> one