Re: [Sugar-devel] Gst1.0 plugins in sugar-build
On 3 October 2012 23:21, Manuel Kaufmann wrote: > On Wed, Oct 3, 2012 at 6:08 PM, Peter Robinson wrote: >> The advantage of gstreamer is you can add extra codecs easily by just >> installing packages and without recompiling anything and the >> functionality should just work without any changes in the application >> so I'm not sure why it's a needed requirement. > > That's why I wasn't sure. This library is not a dependency but > gstreamer 1.0 is not as well and it's inside sugar-build. That's why I > was asking. Hi, I think in general it's fine to add dependencies so that more plugins are built. Though only if these dependencies are available in Fedora (which doesn't seem to be the case here). Thanks ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH gst-plugins-espeak] Setup the plugin metadata
Right, so can we tag and cut a release then? Peter On Sat, Sep 29, 2012 at 9:49 AM, Daniel Narvaez wrote: > Yup, just tested and it seems to work fine. > > > On Friday, 28 September 2012, Aleksey Lim wrote: >> >> On Fri, Sep 28, 2012 at 07:54:09AM +0200, Daniel Narvaez wrote: >> > On Thursday, 27 September 2012, Aleksey Lim wrote: >> > >> > > On Tue, Sep 25, 2012 at 10:57:48AM +0200, Daniel Narvaez wrote: >> > > > Work around https://bugzilla.gnome.org/show_bug.cgi?id=684765 >> > > >> > > Thanks for the hint. >> > > >> > > >> > > http://git.sugarlabs.org/gst-plugins-espeak/mainline/commit/890c514d7c630923908e1fcb3387ff3d35897547 >> > > >> > >> > Cool! Can we do a release of the current master? I would like to get it >> > in >> > Fedora as soon as possible so that we get more testing. Thanks! >> >> Does it work as assumed after compilig in f18? >> I tested with recent git and it works for me. >> >> -- >> Aleksey > > > > -- > Daniel Narvaez > > > ___ > 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] [ASLO] Release Image Viewer-50
On 10/04/2012 05:05 AM, Manuel Quiñones wrote: 2012/10/3 Agustin Zubiaga Sanchez : I fixed a bug in the objectchooser [1] And I have ported the setup.py to gtk3 [2] This changes are important, I have to release a new version? Yes Agus, please. Thanks, (if not done yet) Can Agus get a shell account so he can upload the tarballs for imageviewer? Thanks, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
Hi Agus, I noticed a difference between the gtk2 and the gtk3 version. If you close the file picker in the gtk3 version the activity is also closed. Is that intentional? (I'm asking mostly because it breaks the UI tests, but there is probably also the problem of consistency with other activities like read and jukebox). ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
From: Gonzalo Odiard The change is done in the favorites view and in the list view Signed-off-by: Gonzalo Odiard --- src/jarabe/desktop/activitieslist.py | 1 + src/jarabe/desktop/favoriteslayout.py | 6 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py index 1b5ddd7..3b07e87 100644 --- a/src/jarabe/desktop/activitieslist.py +++ b/src/jarabe/desktop/activitieslist.py @@ -179,6 +179,7 @@ class ListModel(Gtk.TreeModelSort): self._model = Gtk.ListStore(str, bool, str, str, str, str, int, str) self._model_filter = self._model.filter_new() Gtk.TreeModelSort.__init__(self, model=self._model_filter) +self.set_sort_column_id(ListModel.COLUMN_TITLE, Gtk.SortType.ASCENDING) GObject.idle_add(self.__connect_to_bundle_registry_cb) diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index a367ab6..eb5deef 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -387,11 +387,7 @@ class RingLayout(ViewLayout): child.size_allocate(child_allocation) def compare_activities(self, icon_a, icon_b): -if hasattr(icon_a, 'installation_time') and \ -hasattr(icon_b, 'installation_time'): -return int(icon_b.installation_time - icon_a.installation_time) -else: -return 0 +return cmp(icon_a.get_activity_name(), icon_b.get_activity_name()) _SUNFLOWER_CONSTANT = style.STANDARD_ICON_SIZE * .75 -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
Yes, It's intentional because If you not open any image it instance will be unusable. Is that ok? Regards, aguz 2012/10/4 Daniel Narvaez > Hi Agus, > > I noticed a difference between the gtk2 and the gtk3 version. If you > close the file picker in the gtk3 version the activity is also closed. > Is that intentional? (I'm asking mostly because it breaks the UI > tests, but there is probably also the problem of consistency with > other activities like read and jukebox). > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [ASLO] Release Image Viewer-51
Activity Homepage: http://activities.sugarlabs.org/addon/4032 Sugar Platform: 0.98 - 0.98 Download Now: http://activities.sugarlabs.org/downloads/file/28258/image_viewer-51.xo Release notes: - Fix objectchooser bug - Port setup.py to Gtk3 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] Sort the activities in the home in alphabetic order
Thanks pushed as: d6e3fe411ee22dc4308cd06f54e2b5e0bd1d27ab And added to the notes: http://wiki.sugarlabs.org/go/0.98/Notes#Alphabetical_ordering_in_the_Home_View Regards, Simon On 10/04/2012 02:06 PM, godi...@sugarlabs.org wrote: From: Gonzalo Odiard The change is done in the favorites view and in the list view Signed-off-by: Gonzalo Odiard --- src/jarabe/desktop/activitieslist.py | 1 + src/jarabe/desktop/favoriteslayout.py | 6 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py index 1b5ddd7..3b07e87 100644 --- a/src/jarabe/desktop/activitieslist.py +++ b/src/jarabe/desktop/activitieslist.py @@ -179,6 +179,7 @@ class ListModel(Gtk.TreeModelSort): self._model = Gtk.ListStore(str, bool, str, str, str, str, int, str) self._model_filter = self._model.filter_new() Gtk.TreeModelSort.__init__(self, model=self._model_filter) +self.set_sort_column_id(ListModel.COLUMN_TITLE, Gtk.SortType.ASCENDING) GObject.idle_add(self.__connect_to_bundle_registry_cb) diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index a367ab6..eb5deef 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -387,11 +387,7 @@ class RingLayout(ViewLayout): child.size_allocate(child_allocation) def compare_activities(self, icon_a, icon_b): -if hasattr(icon_a, 'installation_time') and \ -hasattr(icon_b, 'installation_time'): -return int(icon_b.installation_time - icon_a.installation_time) -else: -return 0 +return cmp(icon_a.get_activity_name(), icon_b.get_activity_name()) _SUNFLOWER_CONSTANT = style.STANDARD_ICON_SIZE * .75 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 8:06 AM, wrote: > The change is done in the favorites view and in the list view What was the sorting before in the fav view? More importantly -- Is this sorting over the English names, or the localized names? I am not sure what we would desire, but I'll note that if it's localized names, then every language will have a diffent home view icon order. I tend to believe that a stable ordering is preferrable... but I understand other factors may apply... cheers, m -- martin.langh...@gmail.com mar...@laptop.org -- Software Architect - OLPC - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
2012/10/4 Agustin Zubiaga Sanchez : > Yes, It's intentional because If you not open any image it instance will be > unusable. > Is that ok? Interesting issue. ImageViewer doesn't have a way to open an image after you close the object chooser. I think we should add a message with a '+' button at the center of the canvas that opens the object chooser. Exactly like this proposal for Jukebox: http://bugs.sugarlabs.org/attachment/ticket/3714/Jukebox_playlist_functional_and_informational.png The message string can be something like "No image" "+ add image" -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 11:28 AM, Martin Langhoff wrote: > On Thu, Oct 4, 2012 at 8:06 AM, wrote: > > The change is done in the favorites view and in the list view > > What was the sorting before in the fav view? > Before was sorted by installation time. > > More importantly -- Is this sorting over the English names, or the > localized names? I am not sure what we would desire, but I'll note > that if it's localized names, then every language will have a diffent > home view icon order. > > We are sorting by localized name. It's true than the order will be different if you use a different language, but we think is better for the users. Gonzalo > I tend to believe that a stable ordering is preferrable... but I > understand other factors may apply... > > cheers, > > > > m > -- > martin.langh...@gmail.com > mar...@laptop.org -- Software Architect - OLPC > - ask interesting questions > - don't get distracted with shiny stuff - working code first > - http://wiki.laptop.org/go/User:Martinlanghoff > -- Gonzalo Odiard SugarLabs Argentina ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On 10/04/2012 04:28 PM, Martin Langhoff wrote: On Thu, Oct 4, 2012 at 8:06 AM, wrote: The change is done in the favorites view and in the list view What was the sorting before in the fav view? Based on Installation time. So the ordering changed when installing new activities or if you hacked on the machines and the directory date changed... More importantly -- Is this sorting over the English names, or the localized names? I am not sure what we would desire, but I'll note that if it's localized names, then every language will have a diffent home view icon order. It is over the English names, I think... Gonzalo? I tend to believe that a stable ordering is preferrable... but I understand other factors may apply... cheers, m ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
> > More importantly -- Is this sorting over the English names, or the >> localized names? I am not sure what we would desire, but I'll note >> that if it's localized names, then every language will have a diffent >> home view icon order. >> > > It is over the English names, I think... Gonzalo? > > No. Read my previous mail. We are using the same strings displayed in the UI, then are localized names. Alzheimer is German too, right? :) Gonzalo ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 10:33 AM, Gonzalo Odiard wrote: > We are sorting by localized name. > It's true than the order will be different if you use a different language, > but we think is better for the users. Less consistency in icon location better? How? I agree alphabetical is better for list view. Fav view, otoh, _any_ order is ok as long as it is stable... no? m -- martin.langh...@gmail.com mar...@laptop.org -- Software Architect - OLPC - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 12:00 PM, Martin Langhoff wrote: > On Thu, Oct 4, 2012 at 10:33 AM, Gonzalo Odiard > wrote: > > We are sorting by localized name. > > It's true than the order will be different if you use a different > language, > > but we think is better for the users. > > Less consistency in icon location better? How? > You have less consistency only if you change the language. 99.9% of our users will not do it, and will prefer have a consistent order = alphabetic. "Navegar" is after "Medir", does not have sense have it sorted as "Browse" Have sense use the same order in the listview and in the favorites view too. Gonzalo > I agree alphabetical is better for list view. Fav view, otoh, _any_ > order is ok as long as it is stable... no? > > > > m > -- > martin.langh...@gmail.com > mar...@laptop.org -- Software Architect - OLPC > - ask interesting questions > - don't get distracted with shiny stuff - working code first > - http://wiki.laptop.org/go/User:Martinlanghoff > -- Gonzalo Odiard SugarLabs Argentina ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [ASLO] Release Distance-34
On Fri, Sep 28, 2012 at 5:23 AM, Peter Robinson wrote: > On Wed, Sep 26, 2012 at 6:24 PM, Gonzalo Odiard > wrote: > > Please, remember add summary information in the activity.info file. > > And to release a tar file! > > summary + tarball should be in for next releases. Thanks > > > Gonzalo > > > > > > On Wed, Sep 26, 2012 at 2:03 PM, Sugar Labs Activities > > wrote: > >> > >> Activity Homepage: > >> http://activities.sugarlabs.org/addon/4264 > >> > >> Sugar Platform: > >> 0.96 - 0.98 > >> > >> Download Now: > >> http://activities.sugarlabs.org/downloads/file/28237/distance-34.xo > >> > >> Release notes: > >> *Change _shared_activity by shared_activity > >> (fdane...@activitycentral.com), enabling sharing. > >> > >> > >> > >> Sugar Labs Activities > >> http://activities.sugarlabs.org > >> > >> ___ > >> Sugar-devel mailing list > >> Sugar-devel@lists.sugarlabs.org > >> http://lists.sugarlabs.org/listinfo/sugar-devel > > > > > > > > ___ > > Sugar-devel mailing list > > Sugar-devel@lists.sugarlabs.org > > http://lists.sugarlabs.org/listinfo/sugar-devel > > > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH shell] Fix drag and drop in favourites view and grid intersections - SL #3960
This fixes the unported API for drag-and-drop in favourites view. And in the grid, it fixes the collision detection, in GTK+3 we need to use Gdk.Rectangle objects instead of tuples with the rectangle definition. Signed-off-by: Manuel Quiñones --- src/jarabe/desktop/favoriteslayout.py | 3 +++ src/jarabe/desktop/favoritesview.py | 14 +- src/jarabe/desktop/grid.py| 25 - 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index eb5deef..c2bf8f5 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -124,6 +124,9 @@ class ViewLayout(Layout): def allocate_children(self, allocation, children): pass +def move_icon(self, child, x, y, allocation): +pass + def move(self, child, x, y, allocation=None): self._grid.move(child, x / _CELL_SIZE, y / _CELL_SIZE, locked=True) child_request = child.size_request() diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index 17d014e..cfe18eb 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -24,6 +24,7 @@ from gi.repository import GConf import glib from gi.repository import Gtk from gi.repository import Gdk +from gi.repository import GdkPixbuf from sugar3.graphics import style from sugar3.graphics.icon import Icon @@ -208,7 +209,9 @@ class FavoritesView(ViewContainer): int(x), int(y)): self._dragging = True -context_ = widget.drag_begin([_ICON_DND_TARGET], +target_entry = Gtk.TargetEntry.new(*_ICON_DND_TARGET) +target_list = Gtk.TargetList.new([target_entry]) +context_ = widget.drag_begin(target_list, Gdk.DragAction.MOVE, 1, event) @@ -219,18 +222,19 @@ class FavoritesView(ViewContainer): self._hot_x = pixbuf.props.width / 2 self._hot_y = pixbuf.props.height / 2 -context.set_icon_pixbuf(pixbuf, self._hot_x, self._hot_y) +Gtk.drag_set_icon_pixbuf(context, pixbuf, self._hot_x, self._hot_y) def __drag_motion_cb(self, widget, context, x, y, time): if self._last_clicked_icon is not None: -context.drag_status(context.suggested_action, time) +Gdk.drag_status(context, context.get_suggested_action(), time) return True else: return False def __drag_drop_cb(self, widget, context, x, y, time): if self._last_clicked_icon is not None: -self.drag_get_data(context, _ICON_DND_TARGET[0]) +target = Gdk.Atom.intern_static_string(_ICON_DND_TARGET[0]) +self.drag_get_data(context, target, time) self._layout.move_icon(self._last_clicked_icon, x - self._hot_x, y - self._hot_y, self.get_allocation()) @@ -249,7 +253,7 @@ class FavoritesView(ViewContainer): def __drag_data_received_cb(self, widget, context, x, y, selection_data, info, time): -context.drop_finish(success=True, time=time) +Gdk.drop_finish(context, success=True, time_=time) def __connect_to_bundle_registry_cb(self): registry = bundleregistry.get_registry() diff --git a/src/jarabe/desktop/grid.py b/src/jarabe/desktop/grid.py index 851c23e..9d6d820 100644 --- a/src/jarabe/desktop/grid.py +++ b/src/jarabe/desktop/grid.py @@ -114,39 +114,45 @@ class Grid(SugarExt.Grid): new_rects = [] +def _create_rectangle(x, y, width, height): +rect = Gdk.Rectangle() +rect.x, rect.y = x, y +rect.width, rect.height = width, height +return rect + # Get rects right, left, bottom and top if (rect.x + rect.width < self.width - 1): -new_rects.append((rect.x + 1, rect.y, +new_rects.append(_create_rectangle(rect.x + 1, rect.y, rect.width, rect.height)) if (rect.x - 1 > 0): -new_rects.append((rect.x - 1, rect.y, +new_rects.append(_create_rectangle(rect.x - 1, rect.y, rect.width, rect.height)) if (rect.y + rect.height < self.height - 1): -new_rects.append((rect.x, rect.y + 1, +new_rects.append(_create_rectangle(rect.x, rect.y + 1, rect.width, rect.height)) if (rect.y - 1 > 0): -new_rects.append((rect.x, rect.y - 1, +new_rects.append(_create_rectangle(rect.x, rect.y - 1, re
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 11:25 AM, Gonzalo Odiard wrote: > You have less consistency only if you change the language. I generally agree. My only worry is that documentation screenshots will be all over the place. > Have sense use the same order in the listview and in the favorites view too. yeah... ok. m -- martin.langh...@gmail.com mar...@laptop.org -- Software Architect - OLPC - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
2012/10/4 Gonzalo Odiard : > > > On Thu, Oct 4, 2012 at 12:00 PM, Martin Langhoff > wrote: >> >> On Thu, Oct 4, 2012 at 10:33 AM, Gonzalo Odiard >> wrote: >> > We are sorting by localized name. >> > It's true than the order will be different if you use a different >> > language, >> > but we think is better for the users. >> >> Less consistency in icon location better? How? > > > You have less consistency only if you change the language. > 99.9% of our users will not do it, > and will prefer have a consistent order = alphabetic. > > "Navegar" is after "Medir", does not have sense have it sorted as "Browse" > > Have sense use the same order in the listview and in the favorites view too. In internal discussions with Gary and Simon I gave +1 for alphabetic ordering in list view, and -1 for favs view. My cons were: 1. inconsistency between languages for first boot layout, 2. icons displacement while switching language 3. I like how new added activities appear right at the top of the buddy icon head. I think alpha ordering have no sense in only-icons views. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
On 4 Oct 2012, at 15:29, Manuel Quiñones wrote: > 2012/10/4 Agustin Zubiaga Sanchez : >> Yes, It's intentional because If you not open any image it instance will be >> unusable. >> Is that ok? > > Interesting issue. ImageViewer doesn't have a way to open an image > after you close the object chooser. I think we should add a message > with a '+' button at the center of the canvas that opens the object > chooser. Exactly like this proposal for Jukebox: > > http://bugs.sugarlabs.org/attachment/ticket/3714/Jukebox_playlist_functional_and_informational.png > > The message string can be something like "No image" "+ add image" +1 Nice solution :) /me wonders if he dare mention this to Gonzalo as a solution for the same issue in Read --Gary > -- > .. manuq .. > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Patch to update sugar's deps
Hi All, Updating the core sugar shell's rpm spec and I discovered I needed to update the deps for the spec, only to discover that I needed to update them in configure.ac too This appears to work but I'm not sure if there was other deps that we need to do with introspection at all. Peter --- sugar-0.97.5/configure.ac.orig 2012-10-04 17:54:00.546283114 +0100 +++ sugar-0.97.5/configure.ac 2012-10-04 17:56:09.605058723 +0100 @@ -14,7 +14,7 @@ AM_PATH_PYTHON -PKG_CHECK_MODULES(SHELL, pygtk-2.0 gtk+-2.0 gconf-2.0) +PKG_CHECK_MODULES(SHELL, gtk+-3.0 >= 3.6 gconf-2.0) # Setup GETTEXT # ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v2 artwork] Style activities in home view for tap - click and hover feedback
For hover, change the previous outline to a background fill. For tap - click, add a grey background fill. This change is consistent with the style of buttons in toolbars, which have subtle hover feedback, and more visible background change for tap - click feedback. For choosing the grey tones, Gary used the 'strive for at least two Munsell steps' guideline as per the HIG. Assuming our current white zoom view canvas backrounds, and 50% grey for activities without Journal entries (the 50% grey is 3 too bright for a strict two Munsell gap, but close enough). This gives good visibility for both hover, press, and enough contrast during a press on a 50% grey. Also, make the corners a bit more round. Signed-off-by: Manuel Quiñones --- gtk3/theme/gtk-widgets.css.em | 18 ++ gtk3/theme/gtk.css| 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em index b9a39d5..58cf450 100644 --- a/gtk3/theme/gtk-widgets.css.em +++ b/gtk3/theme/gtk-widgets.css.em @@ -687,13 +687,23 @@ SugarFrameWindow { /* Sugar Favorite Activity icon */ -SugarFavoriteActivityIcon:prelight { -border-color: @selection_grey; -border-radius: $(2 * thickness)px; -border-width: $(thickness)px; +SugarFavoriteActivityIcon { +border-color: transparent; +border-radius: $(4 * thickness)px; +border-width: 2px; border-style: solid; } +SugarFavoriteActivityIcon:prelight { +border-color: @zoom_views_prelight; +background-color: @zoom_views_prelight; +} + +SugarFavoriteActivityIcon:active { +border-color: @zoom_views_active; +background-color: @zoom_views_active; +} + /* Text cursor handles */ .cursor-handle.top, diff --git a/gtk3/theme/gtk.css b/gtk3/theme/gtk.css index 8b55cc6..9be9b8f 100644 --- a/gtk3/theme/gtk.css +++ b/gtk3/theme/gtk.css @@ -9,6 +9,8 @@ @define-color row_even #E5E5E5; @define-color row_odd #D5D5D5; @define-color white #FF; +@define-color zoom_views_prelight #E8E8E8; +@define-color zoom_views_active #B3B3B3; /* Default color scheme */ @define-color base_color #ff; -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
If we are taking this approach, it would be nice to just restore the previous behaviour as a first step, so that buildbot goes back green. On Thursday, 4 October 2012, Gary Martin wrote: > > On 4 Oct 2012, at 15:29, Manuel Quiñones > > wrote: > > > 2012/10/4 Agustin Zubiaga Sanchez >: > >> Yes, It's intentional because If you not open any image it instance > will be > >> unusable. > >> Is that ok? > > > > Interesting issue. ImageViewer doesn't have a way to open an image > > after you close the object chooser. I think we should add a message > > with a '+' button at the center of the canvas that opens the object > > chooser. Exactly like this proposal for Jukebox: > > > > > http://bugs.sugarlabs.org/attachment/ticket/3714/Jukebox_playlist_functional_and_informational.png > > > > The message string can be something like "No image" "+ add image" > > +1 > > Nice solution :) > > /me wonders if he dare mention this to Gonzalo as a solution for the same > issue in Read > > --Gary > > > -- > > .. manuq .. > > ___ > > 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] ImageViewer (gtk3) traceback
2012/10/4 Daniel Narvaez : > If we are taking this approach, it would be nice to just restore the > previous behaviour as a first step, so that buildbot goes back green. Yes! +1 Thanks for letting us know, buildbot! -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 1/8] Use a notebook in the visualization area
Previously an empty widget and a videowidget were packed and removed from a container, but there are problems with the video widget not ready when the player want start at times. Signed-off-by: Gonzalo Odiard Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index aebbc98..5132c68 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -150,8 +150,8 @@ class JukeboxActivity(activity.Activity): self._empty_widget = Gtk.Label(label="") self._empty_widget.show() self.videowidget = VideoWidget() -self._switch_canvas(show_video=False) self.set_canvas(self.canvas) +self._init_view_area() self.show_all() self.canvas.connect('size-allocate', self.__size_allocate_cb) @@ -165,6 +165,18 @@ class JukeboxActivity(activity.Activity): self.uri = handle.uri GObject.idle_add(self._start, self.uri, handle.title) +def _init_view_area(self): +""" +Use a notebook with two pages, one empty an another +with the videowidget +""" +self.view_area = Gtk.Notebook() +self.view_area.set_show_tabs(False) +self.view_area.append_page(self._empty_widget, None) +self.view_area.append_page(self.videowidget, None) +self.canvas.pack_end(self.view_area, expand=True, + fill=True, padding=0) + def _switch_canvas(self, show_video): """Show or hide the video visualization in the canvas. @@ -173,11 +185,9 @@ class JukeboxActivity(activity.Activity): """ if show_video: -self.canvas.remove(self._empty_widget) -self.canvas.pack_end(self.videowidget, True, True, 0) +self.view_area.set_current_page(1) else: -self.canvas.pack_end(self._empty_widget, True, True, 0) -self.canvas.remove(self.videowidget) +self.view_area.set_current_page(0) self.canvas.queue_draw() def __get_tags_cb(self, tags_reader, order, tags): @@ -288,10 +298,7 @@ class JukeboxActivity(activity.Activity): self.player.stop() self.player.set_uri(None) self.control.set_disabled() -self.canvas.remove(self.videowidget) -text = Gtk.Label("Error: %s - %s" % (message, detail)) -text.show_all() -self.canvas.add(text) +self._show_error_alert("Error: %s - %s" % (message, detail)) def _player_new_tag_cb(self, widget, tag, value): if not tag in [gst.TAG_TITLE, gst.TAG_ARTIST, gst.TAG_ALBUM]: -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 2/8] Remove "capsfilter" filter because of performance
Without this filter the performance to reproduce videos is great and in audio files the visualization performance is improved as well. The only consequense is the text (artist, track, etc) is rendered without antialiasing. Signed-off-by: Gonzalo Odiard Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 5132c68..45bb333 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -754,22 +754,6 @@ class GstPlayer(GObject.GObject): self.bin.add_pad(ghostpad) videoscale.set_property("method", 0) -caps_string = "video/x-raw-yuv, " -r = self.videowidget.get_allocation() -if r.width > 500 and r.height > 500: -# Sigh... xvimagesink on the XOs will scale the video to fit -# but ximagesink in Xephyr does not. So we live with unscaled -# video in Xephyr so that the XO can work right. -w = 480 -h = float(w) / float(float(r.width) / float(r.height)) -caps_string += "width=%d, height=%d" % (w, h) -else: -caps_string += "width=480, height=360" -caps = gst.Caps(caps_string) -self.filter = gst.element_factory_make("capsfilter", "filter") -self.bin.add(self.filter) -self.filter.set_property("caps", caps) - textoverlay = gst.element_factory_make('textoverlay') self.overlay = textoverlay self.bin.add(textoverlay) @@ -777,8 +761,7 @@ class GstPlayer(GObject.GObject): self.bin.add(conv) videosink = gst.element_factory_make('autovideosink') self.bin.add(videosink) -gst.element_link_many(videoscale, self.filter, textoverlay, conv, -videosink) +gst.element_link_many(videoscale, textoverlay, conv, videosink) self.player.set_property("video-sink", self.bin) def set_overlay(self, title, artist, album): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 5/8] Use 'playbin2' instead of 'playbin'
'playbin' is obsolete and not should be used. I was told in #gstreamer (irc.freenode.net) that 'playbin' is no longer supported, that has some bugs and shouldn't be used anymore. It should be changed by 'playbin2' I had to set some flags as well to keep showing the 'vis-plugin' with 'playbin2' player. Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 11e1331..5c02d23 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -698,7 +698,13 @@ class GstPlayer(GObject.GObject): self.playing = False self.error = False -self.player = gst.element_factory_make("playbin", "player") +self.player = gst.element_factory_make("playbin2", "player") + +# Set the proper flags to render the vis-plugin +GST_PLAY_FLAG_VIS = 1 << 3 +GST_PLAY_FLAG_TEXT = 1 << 2 +self.player.props.flags |= GST_PLAY_FLAG_VIS +self.player.props.flags |= GST_PLAY_FLAG_TEXT r = gst.registry_get_default() l = [x for x in r.get_feature_list(gst.ElementFactory) -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 3/8] Stop the player when the user is reproducing a video and switch to another activity.
Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 45bb333..97c2de4 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -101,6 +101,11 @@ class JukeboxActivity(activity.Activity): self.connect("key_press_event", self._key_press_event_cb) +# We want to be notified when the activity gets the focus or +# loses it. When it is not active, we don't need to keep +# reproducing the video +self.connect("notify::active", self._notify_active_cb) + # FIXME: this is related with shared activity and it doesn't work # if handle.uri: # pass @@ -126,7 +131,6 @@ class JukeboxActivity(activity.Activity): self.playflag = False self.tags = {} self.only_audio = False -self.got_stream_info = False self.tag_reader = TagReader() self.tag_reader.connect('get-tags', self.__get_tags_cb) @@ -165,6 +169,17 @@ class JukeboxActivity(activity.Activity): self.uri = handle.uri GObject.idle_add(self._start, self.uri, handle.title) +def _notify_active_cb(self, widget, event): +"""Sugar notify us that the activity is becoming active or inactive. +When we are inactive, we stop the player if it is reproducing +a video. +""" +if self.player is not None and not self.only_audio: +if not self.player.is_playing() and self.props.active: +self.player.play() +if self.player.is_playing() and not self.props.active: +self.player.pause() + def _init_view_area(self): """ Use a notebook with two pages, one empty an another @@ -319,7 +334,7 @@ class JukeboxActivity(activity.Activity): self.tags[gst.TAG_ARTIST], album) def _player_stream_info_cb(self, widget, stream_info): -if not len(stream_info) or self.got_stream_info: +if not len(stream_info): return GST_STREAM_TYPE_UNKNOWN = 0 @@ -332,7 +347,6 @@ class JukeboxActivity(activity.Activity): if item.props.type == GST_STREAM_TYPE_VIDEO: only_audio = False self.only_audio = only_audio -self.got_stream_info = True self._update_overlay() def _joined_cb(self, activity): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 4/8] Create GstPlayer just once
Instanciating GstPlayer when Jukebox is launched and changing its uri when a new stream is played. This allow us to change between different streams in the playlist without having many memory issues regarding video playing in HD. To change the stream being played in the GstPlayer instance we firstly set the state of it to STATE_PAUSED, then to STATE_NULL and finally we change the uri. When this process finishes we change the state again to STATE_PLAYING. Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 97c2de4..11e1331 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -169,12 +169,20 @@ class JukeboxActivity(activity.Activity): self.uri = handle.uri GObject.idle_add(self._start, self.uri, handle.title) +# Create the player just once +logging.debug('Instantiating GstPlayer') +self.player = GstPlayer(self.videowidget) +self.player.connect("eos", self._player_eos_cb) +self.player.connect("error", self._player_error_cb) +self.player.connect("tag", self._player_new_tag_cb) +self.player.connect("stream-info", self._player_stream_info_cb) + def _notify_active_cb(self, widget, event): """Sugar notify us that the activity is becoming active or inactive. When we are inactive, we stop the player if it is reproducing a video. """ -if self.player is not None and not self.only_audio: +if self.player.player.props.uri is not None and not self.only_audio: if not self.player.is_playing() and self.props.active: self.player.play() if self.player.is_playing() and not self.props.active: @@ -269,12 +277,6 @@ class JukeboxActivity(activity.Activity): def play(self, media_index): self._switch_canvas(show_video=True) self.currentplaying = media_index -self.player.stop() -self.player = GstPlayer(self.videowidget) -self.player.connect("eos", self._player_eos_cb) -self.player.connect("error", self._player_error_cb) -self.player.connect("tag", self._player_new_tag_cb) -self.player.connect("stream-info", self._player_stream_info_cb) url = self.playlist[self.currentplaying]['url'] error = None if url.startswith('journal://'): @@ -289,7 +291,7 @@ class JukeboxActivity(activity.Activity): if error is None: self.player.set_uri(url) -self.play_toggled() +self.player.play() else: self.control.set_disabled() self._show_error_alert(error) @@ -517,16 +519,6 @@ class JukeboxActivity(activity.Activity): if not error: self.tag_reader.set_file(url, len(self.playlist) - 1) -if not self.player: -# lazy init the player so that videowidget is realized -# and has a valid widget allocation -self._switch_canvas(show_video=True) -self.player = GstPlayer(self.videowidget) -self.player.connect("eos", self._player_eos_cb) -self.player.connect("error", self._player_error_cb) -self.player.connect("tag", self._player_new_tag_cb) -self.player.connect("stream-info", self._player_stream_info_cb) - self.playlist_widget.update(self.playlist) try: @@ -538,6 +530,7 @@ class JukeboxActivity(activity.Activity): url = 'file://' + jobject.file_path self.player.set_uri(url) +self.player.play() self.currentplaying = 0 self.play_toggled() self.show_all() @@ -728,6 +721,8 @@ class GstPlayer(GObject.GObject): bus.connect('message', self.on_message) def set_uri(self, uri): +self.player.set_state(gst.STATE_PAUSED) +self.player.set_state(gst.STATE_NULL) self.player.set_property('uri', uri) def on_sync_message(self, bus, message): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 7/8] Do not pause the stream after adding a new one
After the user adds the first stream to the playlist it is played immediately and when a new stream is added, the first one is kept playing. Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index ea66d34..1ad5ff1 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -459,7 +459,7 @@ class JukeboxActivity(activity.Activity): self.playlist_widget.update(self.playlist) try: -if not self.currentplaying: +if self.currentplaying is None: logging.info("Playing: " + self.playlist[0]['url']) url = self.playlist[0]['url'] if url.startswith('journal://'): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH Jukebox 6/8] Tag reader feature removed
I removed it because of performance. Jukebox was working too slow when it was reproducing a video and it had to read the tag of the media added to the playlist. So, we decided to remove this feature by the moment. Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 119 + 1 file changed, 1 insertion(+), 118 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 5c02d23..ea66d34 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -129,11 +129,6 @@ class JukeboxActivity(activity.Activity): self.playpath = None self.currentplaying = None self.playflag = False -self.tags = {} -self.only_audio = False - -self.tag_reader = TagReader() -self.tag_reader.connect('get-tags', self.__get_tags_cb) self.p_position = gst.CLOCK_TIME_NONE self.p_duration = gst.CLOCK_TIME_NONE @@ -174,15 +169,13 @@ class JukeboxActivity(activity.Activity): self.player = GstPlayer(self.videowidget) self.player.connect("eos", self._player_eos_cb) self.player.connect("error", self._player_error_cb) -self.player.connect("tag", self._player_new_tag_cb) -self.player.connect("stream-info", self._player_stream_info_cb) def _notify_active_cb(self, widget, event): """Sugar notify us that the activity is becoming active or inactive. When we are inactive, we stop the player if it is reproducing a video. """ -if self.player.player.props.uri is not None and not self.only_audio: +if self.player.player.props.uri is not None: if not self.player.is_playing() and self.props.active: self.player.play() if self.player.is_playing() and not self.props.active: @@ -213,10 +206,6 @@ class JukeboxActivity(activity.Activity): self.view_area.set_current_page(0) self.canvas.queue_draw() -def __get_tags_cb(self, tags_reader, order, tags): -self.playlist[order]['title'] = tags['title'] -self.playlist_widget.update(self.playlist) - def __size_allocate_cb(self, widget, allocation): canvas_size = self.canvas.get_allocation() playlist_width = int(canvas_size.width * PLAYLIST_WIDTH_PROP) @@ -317,40 +306,6 @@ class JukeboxActivity(activity.Activity): self.control.set_disabled() self._show_error_alert("Error: %s - %s" % (message, detail)) -def _player_new_tag_cb(self, widget, tag, value): -if not tag in [gst.TAG_TITLE, gst.TAG_ARTIST, gst.TAG_ALBUM]: -return -self.tags[tag] = value -self._update_overlay() - -def _update_overlay(self): -if self.only_audio == False: -return -if not gst.TAG_TITLE in self.tags or \ -not gst.TAG_ARTIST in self.tags: -return -album = None -if gst.TAG_ALBUM in self.tags: -album = self.tags[gst.TAG_ALBUM] -self.player.set_overlay(self.tags[gst.TAG_TITLE], -self.tags[gst.TAG_ARTIST], album) - -def _player_stream_info_cb(self, widget, stream_info): -if not len(stream_info): -return - -GST_STREAM_TYPE_UNKNOWN = 0 -GST_STREAM_TYPE_AUDIO = 1 -GST_STREAM_TYPE_VIDEO = 2 -GST_STREAM_TYPE_TEXT = 3 - -only_audio = True -for item in stream_info: -if item.props.type == GST_STREAM_TYPE_VIDEO: -only_audio = False -self.only_audio = only_audio -self._update_overlay() - def _joined_cb(self, activity): logging.debug("someone joined") pass @@ -500,24 +455,6 @@ class JukeboxActivity(activity.Activity): else: uri = "file://" + urllib.quote(os.path.abspath(uri)) self.playlist.append({'url': uri, 'title': title}) -if uri.endswith(title) or title is None or title == '' or \ -object_id is not None: -error = False -logging.error('Try get a better title reading tags') -# TODO: unify this code -url = self.playlist[len(self.playlist) - 1]['url'] -if url.find('home') > 0: -url = url[len("journal://"):] -url = 'file://' + url -elif url.startswith('journal://'): -try: -jobject = datastore.get(url[len("journal://"):]) -url = 'file://' + jobject.file_path -except: -error = True -# jobject.destroy() ?? -if not error: -self.tag_reader.set_file(url, len(self.playlist) - 1) self.playlist_widget.update(self.playlist) @@ -642,54 +579,11 @@ class JukeboxActivity(activity.Activity): self.canvas.queue_draw() -class TagReader(GObject.GObject): - -__gsignals__ = { -'get-tags':
[Sugar-devel] [PATCH Jukebox 8/8] Port gst 0.10 to Gst 1.0
Useful guide: * https://wiki.ubuntu.com/Novacut/GStreamer1.0 Signed-off-by: Manuel Kaufmann --- jukeboxactivity.py | 180 ++--- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 1ad5ff1..48a5aa8 100644 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -40,15 +40,23 @@ from sugar3.graphics.alert import ErrorAlert import gi gi.require_version('Gtk', '3.0') +gi.require_version('Gst', '1.0') from gi.repository import GObject from gi.repository import Gdk - -import pygst -pygst.require('0.10') -import gst -import gst.interfaces from gi.repository import Gtk +from gi.repository import Gst + +# Needed for window.get_xid(), xvimagesink.set_window_handle(), +# respectively: +from gi.repository import GdkX11, GstVideo + +# Avoid "Fatal Python error: GC object already tracked" +# http://stackoverflow.com/questions/7496629/gstreamer-appsrc-causes-random-crashes +GObject.threads_init() + +# Initialize GStreamer +Gst.init(None) import urllib from ControlToolbar import Control, ViewToolbar @@ -130,9 +138,6 @@ class JukeboxActivity(activity.Activity): self.currentplaying = None self.playflag = False -self.p_position = gst.CLOCK_TIME_NONE -self.p_duration = gst.CLOCK_TIME_NONE - # README: I changed this because I was getting an error when I # tried to modify self.bin with something different than # Gtk.Bin @@ -169,6 +174,8 @@ class JukeboxActivity(activity.Activity): self.player = GstPlayer(self.videowidget) self.player.connect("eos", self._player_eos_cb) self.player.connect("error", self._player_error_cb) +self.p_position = Gst.CLOCK_TIME_NONE +self.p_duration = Gst.CLOCK_TIME_NONE def _notify_active_cb(self, widget, event): """Sugar notify us that the activity is becoming active or inactive. @@ -524,7 +531,7 @@ class JukeboxActivity(activity.Activity): real = long(scale.get_value() * self.p_duration / 100) # in ns self.player.seek(real) # allow for a preroll -self.player.get_state(timeout=50 * gst.MSECOND) # 50 ms +self.player.get_state(timeout=50 * Gst.MSECOND) # 50 ms def scale_button_release_cb(self, widget, event): # see seek.cstop_seek @@ -546,8 +553,13 @@ class JukeboxActivity(activity.Activity): self.update_scale_cb) def update_scale_cb(self): -self.p_position, self.p_duration = self.player.query_position() -if self.p_position != gst.CLOCK_TIME_NONE: +success, self.p_position, self.p_duration = \ +self.player.query_position() + +if not success: +return True + +if self.p_position != Gst.CLOCK_TIME_NONE: value = self.p_position * 100.0 / self.p_duration self.control.adjustment.set_value(value) @@ -558,7 +570,7 @@ class JukeboxActivity(activity.Activity): # FIXME: this should be updated just once when the file starts # the first time -if self.p_duration != gst.CLOCK_TIME_NONE: +if self.p_duration != Gst.CLOCK_TIME_NONE: seconds = self.p_duration * 10 ** -9 time = '%2d:%02d' % (int(seconds / 60), int(seconds % 60)) self.control.total_time_label.set_text(time) @@ -592,7 +604,22 @@ class GstPlayer(GObject.GObject): self.playing = False self.error = False -self.player = gst.element_factory_make("playbin2", "player") +# Create GStreamer pipeline +self.pipeline = Gst.Pipeline() +# Create bus to get events from GStreamer pipeline +self.bus = self.pipeline.get_bus() +self.bus.add_signal_watch() + +self.bus.connect('message::eos', self.__on_eos_message) +self.bus.connect('message::error', self.__on_error_message) + +# This is needed to make the video output in our DrawingArea +self.bus.enable_sync_message_emission() +self.bus.connect('sync-message::element', self.__on_sync_message) + +# Create GStreamer elements +self.player = Gst.ElementFactory.make('playbin', None) +self.pipeline.add(self.player) # Set the proper flags to render the vis-plugin GST_PLAY_FLAG_VIS = 1 << 3 @@ -600,12 +627,12 @@ class GstPlayer(GObject.GObject): self.player.props.flags |= GST_PLAY_FLAG_VIS self.player.props.flags |= GST_PLAY_FLAG_TEXT -r = gst.registry_get_default() -l = [x for x in r.get_feature_list(gst.ElementFactory) -if (gst.ElementFactory.get_klass(x) == "Visualization")] +r = Gst.Registry.get() +l = [x for x in r.get_feature_list(Gst.ElementFactory) + if (x.get_metadata('klass') == "Visualization")] if len(l): e = l.pop() # take latest plugin in the list -vis_plug = gst.element_fa
Re: [Sugar-devel] ImageViewer (gtk3) traceback
On Thu, Oct 4, 2012 at 1:54 PM, Gary Martin wrote: > /me wonders if he dare mention this to Gonzalo as a solution for the same > issue in Read Maybe we can design a widget for this and include it in sugar-toolkit-gtk3 so we will have more consistency between activities. What do you think? -- 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] Jukebox patches
Great work. Gonzalo On Thu, Oct 4, 2012 at 2:37 PM, Manuel Kaufmann wrote: > Hello people, > > I've just sent 8 patches to the sugar-devel mailing list for Jukebox. > Seven of them are those ones that were applied to the "sugar-0.98" > (gtk2) branch that I ported to the "master" branch. The last one is > the port of gstreamer from 0.10 to 1.0. > > Yesterday I was working a lot on Jukebox itself, removing some old > code, rewriting some other functions and doing some bugfixing as well. > I'm preparing some patches that I will be sending later. > > 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] Jukebox patches
Hello people, I've just sent 8 patches to the sugar-devel mailing list for Jukebox. Seven of them are those ones that were applied to the "sugar-0.98" (gtk2) branch that I ported to the "master" branch. The last one is the port of gstreamer from 0.10 to 1.0. Yesterday I was working a lot on Jukebox itself, removing some old code, rewriting some other functions and doing some bugfixing as well. I'm preparing some patches that I will be sending later. 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
Re: [Sugar-devel] ImageViewer (gtk3) traceback
2012/10/4 Manuel Kaufmann : > On Thu, Oct 4, 2012 at 1:54 PM, Gary Martin > wrote: >> /me wonders if he dare mention this to Gonzalo as a solution for the same >> issue in Read > > Maybe we can design a widget for this and include it in > sugar-toolkit-gtk3 so we will have more consistency between > activities. What do you think? Yes, I'm sure we will get that generalized at one point, there's also duplicated code for the same in the Journal and home list view when there are not matches. Just not this cycle. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [ASLO] Release Analyze Journal-2
Activity Homepage: http://activities.sugarlabs.org/addon/4545 Sugar Platform: 0.86 - 0.98 Download Now: http://activities.sugarlabs.org/downloads/file/28257/analyze_journal-2.xo Release notes: 2 ENHANCEMENTS: * New translations * Journal chart * Turtle chart 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] Sort the activities in the home in alphabetic order
On 4 Oct 2012, at 16:48, Manuel Quiñones wrote: > 2012/10/4 Gonzalo Odiard : >> >> >> On Thu, Oct 4, 2012 at 12:00 PM, Martin Langhoff >> wrote: >>> >>> On Thu, Oct 4, 2012 at 10:33 AM, Gonzalo Odiard >>> wrote: We are sorting by localized name. It's true than the order will be different if you use a different language, but we think is better for the users. >>> >>> Less consistency in icon location better? How? >> >> >> You have less consistency only if you change the language. >> 99.9% of our users will not do it, >> and will prefer have a consistent order = alphabetic. >> >> "Navegar" is after "Medir", does not have sense have it sorted as "Browse" >> >> Have sense use the same order in the listview and in the favorites view too. > > In internal discussions with Gary and Simon I gave +1 for alphabetic > ordering in list view, and -1 for favs view. My cons were: 1. > inconsistency between languages for first boot layout, 2. icons > displacement while switching language 3. I like how new added > activities appear right at the top of the buddy icon head. I think > alpha ordering have no sense in only-icons views. I'm still +1 for localised alphabetical ordering. Installation date ordering (e.g. modification date of Activity) is rather arbitrary and unstable, you have no idea where anything will be, and they keep changing over time. Alphabetical sorting on the localised names provides a stable, understandable sort order for both list and favourite views (unless you are frequently switching between locales, a minority edge case). For newly added activities, they will first appear as grey stroke icons, so unless you've not been not using your favourite Activities, the new one should be reasonably obvious, and we have a nice search feature if you have a large number installed. Regarding screenshots for documentation (mentioned by Martin), I would argue this is a relatively minor case, less than the previous date sort case where documentation screen shots, over time, have icons in seemingly arbitrary positions as the documentation authors update to different activity versions. Martin, could you clarify this example a little more, did you have some specific documentation task in mind? Regards, --Gary > -- > .. manuq .. > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [ASLO] Release Pippy-50
Activity Homepage: http://activities.sugarlabs.org/addon/4041 Sugar Platform: 0.96 - 0.98 Download Now: http://activities.sugarlabs.org/downloads/file/28259/pippy-50.xo Release notes: * Initial GTK3 version (Flavio Danesse fdane...@activitycentral.com, Rafael Ortiz raf...@activitycentral.com ) . == Sources == * http://download.sugarlabs.org/sources/sucrose/fructose/Pippy/Pippy-50.tar.bz2 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] Sort the activities in the home in alphabetic order
2012/10/4 Gary Martin : > On 4 Oct 2012, at 16:48, Manuel Quiñones wrote: > >> 2012/10/4 Gonzalo Odiard : >>> >>> >>> On Thu, Oct 4, 2012 at 12:00 PM, Martin Langhoff >>> wrote: On Thu, Oct 4, 2012 at 10:33 AM, Gonzalo Odiard wrote: > We are sorting by localized name. > It's true than the order will be different if you use a different > language, > but we think is better for the users. Less consistency in icon location better? How? >>> >>> >>> You have less consistency only if you change the language. >>> 99.9% of our users will not do it, >>> and will prefer have a consistent order = alphabetic. >>> >>> "Navegar" is after "Medir", does not have sense have it sorted as "Browse" >>> >>> Have sense use the same order in the listview and in the favorites view too. >> >> In internal discussions with Gary and Simon I gave +1 for alphabetic >> ordering in list view, and -1 for favs view. My cons were: 1. >> inconsistency between languages for first boot layout, 2. icons >> displacement while switching language 3. I like how new added >> activities appear right at the top of the buddy icon head. I think >> alpha ordering have no sense in only-icons views. > > I'm still +1 for localised alphabetical ordering. > > Installation date ordering (e.g. modification date of Activity) is rather > arbitrary and unstable, you have no idea where anything will be, and they > keep changing over time. Alphabetical sorting on the localised names provides > a stable, understandable sort order for both list and favourite views (unless > you are frequently switching between locales, a minority edge case). For > newly added activities, they will first appear as grey stroke icons, so > unless you've not been not using your favourite Activities, the new one > should be reasonably obvious, and we have a nice search feature if you have a > large number installed. > > Regarding screenshots for documentation (mentioned by Martin), I would argue > this is a relatively minor case, less than the previous date sort case where > documentation screen shots, over time, have icons in seemingly arbitrary > positions as the documentation authors update to different activity versions. > Martin, could you clarify this example a little more, did you have some > specific documentation task in mind? OK Gary. Regarding easy location of new added activities, I remember someone mentioned an animated appearence as alternative. Of course not for this cycle. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [DESIGN] Proposal: Contol-Panel packaging
On Fri, Jul 27, 2012 at 2:51 AM, Jerry Vonau wrote: > Hi All: > > I would like to propose a feature for discussion and inclusion in the > 0.98 cycle is packaging all control-panel applets as rpms. As this > discussion does not impact the UI and more of a packaging issue I'm an > not creating a Features page. The discussion can take place here on the > mailing-list. > > The reasoning is that it should make it easier for downstream users of > sugar to exclude applets that don't apply to their use case without > having to patch them out. For example OLPC removes via their .spec file, > the keyboard and updater applets from their builds and uses their own > version of an updater supplied as an rpm. > > Dextrose is using this idea to now to partly split up the what is > available to install at rpm generation time[1]. I have found this useful > from a deployment perspective by being able to exclude applets that are > unwanted or need further development from the final image. > > The current code base and workflow would not be changed, except a > revised sugar.spec file would generate more that just the sugar rpm when > run, like how it is done now for sugar-emulator. Deployment level users > of sugar would then need to state which applets to include in their > image at image creation time. This will allow development of applets to > evolve without having to reinstall all of sugar in the field for a > change to an applet. > > Any XO specific user tool like "About my Computer" and "Power" should > not really be part of sugar but should be available to install on demand > like OLPC's sugar-update-control and olpc-switch-desktop that are added > to OLPC's sugar installation. SoaS might benefit from not shipping all > the applets, omitting the ones that apply to XO hardware. > > This change might help development of new features in the control-panel > area that later be incorporated into sugar once proven to work. > > Feedback and comments welcome, I've pushed this and it will appear in the next build, feedback welcome. I've left the AboutComputer and AboutMe built in and all the rest are sub packages. There's a meta-package called sugar-cp-all which pulls all the Control Panels packages in as well. Sorry about the delay. Peter ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [DESIGN] Proposal: Contol-Panel packaging
On Thu, 2012-10-04 at 21:29 +0100, Peter Robinson wrote: > On Fri, Jul 27, 2012 at 2:51 AM, Jerry Vonau wrote: > > Hi All: > > > > I would like to propose a feature for discussion and inclusion in the > > 0.98 cycle is packaging all control-panel applets as rpms. As this > > discussion does not impact the UI and more of a packaging issue I'm an > > not creating a Features page. The discussion can take place here on the > > mailing-list. > > Feedback and comments welcome, > > I've pushed this and it will appear in the next build, feedback welcome. > > I've left the AboutComputer and AboutMe built in and all the rest are > sub packages. There's a meta-package called sugar-cp-all which pulls > all the Control Panels packages in as well. > > Sorry about the delay. Thank you very much, reviewing now. Jerry ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Patches to add launch-times to metadata
Attached are the patches needed to add a list of the launch times to the metadata. Are the same patches sent by Walter, tested and formatted ready to be applied. Just for compatibility, the same change in sugar-toolkit-gtk3 can be applied in gtk. Gonzalo 0001-Avoid-indexing-launch-times-property.patch Description: Binary data 0001-Add-in-the-metadata-info-about-every-startup-time.patch Description: Binary data 0001-Backport-add-launch-times-info-to-metadata.patch Description: Binary data ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
+1 for all. Daniel, I have to discard the close, when the user don't choose any image? Regards, aguz 2012/10/4 Manuel Quiñones > 2012/10/4 Manuel Kaufmann : > > On Thu, Oct 4, 2012 at 1:54 PM, Gary Martin > wrote: > >> /me wonders if he dare mention this to Gonzalo as a solution for the > same issue in Read > > > > Maybe we can design a widget for this and include it in > > sugar-toolkit-gtk3 so we will have more consistency between > > activities. What do you think? > > Yes, I'm sure we will get that generalized at one point, there's also > duplicated code for the same in the Journal and home list view when > there are not matches. Just not this cycle. > > -- > .. manuq .. > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
2012/10/4 Agustin Zubiaga Sanchez : > +1 for all. > Daniel, I have to discard the close, when the user don't choose any image? Yes just revert that change as it was before, then you can add the message in the empty canvas in another commit. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
On Thu, Oct 4, 2012 at 3:15 PM, Gary Martin wrote: > Martin, could you clarify this example a little more, > did you have some specific documentation task in mind? I want to clarify that I see this patch as a big improvement, even with localized sorting. +100. We often prepare some screenshots for documentation (or the Sugar documentation sprint does). Because Sugar is icon-oriented (and light on strings) in the UI those screenshots are used and reused in documentation most of the time. In my experience, most local documentation efforts are a very quick "remix" of existing documentation. First-time deployments don't even have XOs in advance for the documentation team to get screenshots. If they have XOs, they often lack the expertise (they are first-time deployments, after all!). Gonzalo has seen this first-hand. With the proposed patch + non-localized strings for fav view sorting the home view remains (mostly) stable across all languages. Yes, it changes if you add/remove/replace activities, but only slightly. The relative position of activity icons remains mostly stable. With the proposed patch sorting on localized strings for fav view, each lang "randomizes" the sorting. Not so good, in my book, but not the end of the world either. Couple more notes - I completely support localized names sorting for list view. - For fav view the "best" sorting would be a fixed, OS build-time configurable sorting to group/order activities. cheers, martin - who worries too much about a sorting scheme kids immediately disable using the "wherever I want it to be" view. -- martin.langh...@gmail.com mar...@laptop.org -- Software Architect - OLPC - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Call to Activities Maintainers! Summary info
2012/9/25 Gonzalo Odiard : > Hi Activities maintainers, > In the next Sugar version, a summary will be displayed in the activities > list, > instead of the installation time. I'm sad hearing that. Sugar gave children the possibility/need to explore and discover the aim and functionality of each activity. (Tested by myself.) I think this is a really well planned thing in Sugar. Is really needed a summary in this educational environment? Cheers, Daniel Francis. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ImageViewer (gtk3) traceback
Well, I reversed this change [1] I will add the message in the empty canvas. [1] git.sugarlabs.org/imageviewer/mainline/commit/2269f7a8 Regards, aguz 2012/10/4 Manuel Quiñones > 2012/10/4 Agustin Zubiaga Sanchez : > > +1 for all. > > Daniel, I have to discard the close, when the user don't choose any > image? > > Yes just revert that change as it was before, then you can add the > message in the empty canvas in another commit. > > > -- > .. manuq .. > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Sort the activities in the home in alphabetic order
Guys, The favorites view, will change in every xo: * Because the user select/deselect activities as favorite. * Because the user add/remove activities. The best we can do is provide a coherent order. Alphabetical using the localized numbers and the same order than in the list view, is the best in my opinion. I can't see the value of have a screenshot with the icons in the same order than a documentation. Specially when we can't achieve have a updated documentation since Sugar 0.82 ... :/ Gonzalo On Thu, Oct 4, 2012 at 10:50 PM, Martin Langhoff wrote: > On Thu, Oct 4, 2012 at 3:15 PM, Gary Martin > wrote: > > Martin, could you clarify this example a little more, > > did you have some specific documentation task in mind? > > I want to clarify that I see this patch as a big improvement, even > with localized sorting. +100. > > We often prepare some screenshots for documentation (or the Sugar > documentation sprint does). Because Sugar is icon-oriented (and light > on strings) in the UI those screenshots are used and reused in > documentation most of the time. > > In my experience, most local documentation efforts are a very quick > "remix" of existing documentation. First-time deployments don't even > have XOs in advance for the documentation team to get screenshots. If > they have XOs, they often lack the expertise (they are first-time > deployments, after all!). Gonzalo has seen this first-hand. > > With the proposed patch + non-localized strings for fav view sorting > the home view remains (mostly) stable across all languages. Yes, it > changes if you add/remove/replace activities, but only slightly. The > relative position of activity icons remains mostly stable. > > With the proposed patch sorting on localized strings for fav view, > each lang "randomizes" the sorting. Not so good, in my book, but not > the end of the world either. > > Couple more notes > > - I completely support localized names sorting for list view. > > - For fav view the "best" sorting would be a fixed, OS build-time > configurable sorting to group/order activities. > > cheers, > > > > martin - who worries too much about a sorting scheme kids immediately > disable using the "wherever I want it to be" view. > -- > martin.langh...@gmail.com > mar...@laptop.org -- Software Architect - OLPC > - ask interesting questions > - don't get distracted with shiny stuff - working code first > - http://wiki.laptop.org/go/User:Martinlanghoff > -- Gonzalo Odiard SugarLabs Argentina ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH shell 1/3] Get back spacing between activity icon and hover border
size_request is deprecated and get_preferred_size should be used instead. We override the methods of EventIcon get_preferred_width and get_preferred_height because they are simpler to use from python, no need to make a requisition object, just return integers. Signed-off-by: Manuel Quiñones --- src/jarabe/desktop/favoriteslayout.py | 7 --- src/jarabe/desktop/favoritesview.py | 13 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index c2bf8f5..e9f614e 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -380,13 +380,14 @@ class RingLayout(ViewLayout): x, y = self._calculate_position(radius, icon_size, n, len(children), allocation.width, allocation.height) -child.size_request() child.set_size(icon_size) +new_width = child.get_preferred_width()[0] +new_height = child.get_preferred_height()[0] child_allocation = Gdk.Rectangle() child_allocation.x = allocation.x + x child_allocation.y = allocation.y + y -child_allocation.width = icon_size -child_allocation.height = icon_size +child_allocation.width = new_width +child_allocation.height = new_height child.size_allocate(child_allocation) def compare_activities(self, icon_a, icon_b): diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index cfe18eb..b727e0e 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -447,10 +447,15 @@ class ActivityIcon(EventIcon): allocation.width, allocation.height) -def do_size_request(self, req): -EventIcon.do_size_request(self, req) -req.height += ActivityIcon._BORDER_WIDTH * 2 -req.width += ActivityIcon._BORDER_WIDTH * 2 +def do_get_preferred_width(self): +width = EventIcon.do_get_preferred_width(self)[0] +width += ActivityIcon._BORDER_WIDTH * 2 +return (width, width) + +def do_get_preferred_height(self): +height = EventIcon.do_get_preferred_height(self)[0] +height += ActivityIcon._BORDER_WIDTH * 2 +return (height, height) def __button_release_event_cb(self, icon, event): self._activate() -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH shell 2/3] Home view: add active state to activity icons for tap and click feedback
- Set the activity icon state to 'active' when it is pressed. This state can then be styled in the theme. - Set the activity icon state to 'prelight' when its palette pops up. - Add a background render to the draw method to make the background of the icon styleable. We have to connect to the palette invoker 'right-click' event and reset the state in the palette 'popdown' event because the invoker captures the mouse events and does not propagate them. See documentation in popup method of _PaletteMenuWidget in toolkit palettewindow.py for reference. Signed-off-by: Manuel Quiñones --- src/jarabe/desktop/favoritesview.py | 48 + 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index b727e0e..4600341 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -361,8 +361,14 @@ class ActivityIcon(EventIcon): self._journal_entries = [] self._resume_mode = True +self._prelight_state = False +self._active_state = False + self.connect('enter-notify-event', self.__enter_notify_event_cb) self.connect('leave-notify-event', self.__leave_notify_event_cb) +self.connect('button-press-event', self.__button_press_event_cb) +self.palette_invoker.connect('right-click', + self.__invoker_right_click_cb) self.connect_after('button-release-event', self.__button_release_event_cb) @@ -424,6 +430,8 @@ class ActivityIcon(EventIcon): palette = FavoritePalette(self._activity_info, self._journal_entries) palette.connect('activate', self.__palette_activate_cb) palette.connect('entry-activate', self.__palette_entry_activate_cb) +palette.connect('popup', self.__palette_popup_cb) +palette.connect('popdown', self.__palette_popdown_cb) return palette def __palette_activate_cb(self, palette): @@ -432,21 +440,47 @@ class ActivityIcon(EventIcon): def __palette_entry_activate_cb(self, palette, metadata): self._resume(metadata) +def __palette_popup_cb(self, palette): +self._prelight_state = Gtk.StateFlags.PRELIGHT +self._active_state = False +self._update_states() + +def __palette_popdown_cb(self, palette): +self._prelight_state = False +self._active_state = False +self._update_states() + def __enter_notify_event_cb(self, icon, event): -self.set_state(Gtk.StateFlags.PRELIGHT) +self._prelight_state = Gtk.StateFlags.PRELIGHT +self._update_states() def __leave_notify_event_cb(self, icon, event): -self.set_state(Gtk.StateFlags.NORMAL) +if self.palette.is_up(): +return +self._prelight_state = False +self._update_states() -def do_draw(self, cr): -EventIcon.do_draw(self, cr) +def __button_press_event_cb(self, icon, event): +self._active_state = Gtk.StateFlags.ACTIVE +self._update_states() +def _update_states(self): +state = self._active_state if self._active_state \ +else self._prelight_state +self.set_state(state) + +def do_draw(self, cr): allocation = self.get_allocation() context = self.get_style_context() +Gtk.render_background(context, cr, 0, 0, + allocation.width, + allocation.height) Gtk.render_frame(context, cr, 0, 0, allocation.width, allocation.height) +EventIcon.do_draw(self, cr) + def do_get_preferred_width(self): width = EventIcon.do_get_preferred_width(self)[0] width += ActivityIcon._BORDER_WIDTH * 2 @@ -457,7 +491,13 @@ class ActivityIcon(EventIcon): height += ActivityIcon._BORDER_WIDTH * 2 return (height, height) +def __invoker_right_click_cb(self, invoker): +self._active_state = False +self._update_states() + def __button_release_event_cb(self, icon, event): +self._active_state = False +self._update_states() self._activate() def _resume(self, journal_entry): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH shell 3/3] Home favorites view: enlarge the size of the button to improve touch interaction
Note that this does not change the size of the icon inside the button, but the area around. The zone to tap - click is enlarged, and so it is the feedback you see while hovering or performing a tap or click. Signed-off-by: Manuel Quiñones --- src/jarabe/desktop/favoritesview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index 4600341..aae745a 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -350,7 +350,7 @@ class FavoritesView(ViewContainer): class ActivityIcon(EventIcon): __gtype_name__ = 'SugarFavoriteActivityIcon' -_BORDER_WIDTH = style.zoom(3) +_BORDER_WIDTH = style.zoom(9) _MAX_RESUME_ENTRIES = 5 def __init__(self, activity_info): -- 1.7.11.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Call to Activities Maintainers! Summary info
> From: fran...@sugarlabs.org > Date: Thu, 4 Oct 2012 23:16:22 -0300 > To: gonz...@laptop.org > CC: sugar-devel@lists.sugarlabs.org; alsr...@activitycentral.org; > walter.ben...@gmail.com; ma...@laptop.org > Subject: Re: [Sugar-devel] Call to Activities Maintainers! Summary info > > 2012/9/25 Gonzalo Odiard : > > Hi Activities maintainers, > > In the next Sugar version, a summary will be displayed in the activities > > list, > > instead of the installation time. > > I'm sad hearing that. > Sugar gave children the possibility/need to explore and discover the > aim and functionality of each activity. (Tested by myself.) I think > this is a really well planned thing in Sugar. > Is really needed a summary in this educational environment? I think that a minimal description is good. And remeber: the "summary" only is visiblein the "view list", if you don't go there, you no see that.. > > Cheers, > Daniel Francis. > ___ > 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] Call to Activities Maintainers! Summary info
On Thu, Oct 4, 2012 at 10:16 PM, S. Daniel Francis wrote: > 2012/9/25 Gonzalo Odiard : >> Hi Activities maintainers, >> In the next Sugar version, a summary will be displayed in the activities >> list, >> instead of the installation time. > > I'm sad hearing that. > Sugar gave children the possibility/need to explore and discover the > aim and functionality of each activity. (Tested by myself.) I think > this is a really well planned thing in Sugar. > Is really needed a summary in this educational environment? Please take a look at the summaries already available. They really are minimal hints and should do nothing to diminish the joy of discovery. cjl ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel