Re: [Sugar-devel] [PATCH v2] Free space displayed for Journal Button in Volumes Toolbar. (Ticket #2318)
On Mon, Oct 18, 2010 at 12:14:59AM +0530, Ishan Bansal wrote: Pallete added to calculate and display free journal space when we write click. Two errors. s/Pallete/Palette s/write click/right click --- a/src/jarabe/journal/volumestoolbar.py +++ b/src/jarabe/journal/volumestoolbar.py [...] @@ -207,3 +208,36 @@ class JournalButton(BaseButton): color = XoColor(client.get_string('/desktop/sugar/user/color')) self.props.xo_color = color +def create_palette(self): +palette = JournalButtonPalette(self) +return palette + +class JournalButtonPalette(Palette): +def __init__(self, mount): +label = _('Journal') +Palette.__init__(self, label) + +vbox = gtk.VBox() +self.set_content(vbox) +vbox.show() + +self._progress_bar = gtk.ProgressBar() +vbox.add(self._progress_bar) +self._progress_bar.show() + +self._free_space_label = gtk.Label() +self._free_space_label.set_alignment(0.5, 0.5) +vbox.add(self._free_space_label) +self._free_space_label.show() + +self.connect('popup', self.__popup_cb) + +def __popup_cb(self, palette): +stat = os.statvfs(env.get_profile_path()) +free_space = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL] +total_space = stat[statvfs.F_BSIZE] * stat[statvfs.F_BLOCKS] + +fraction = (total_space - free_space) / float(total_space) +self._progress_bar.props.fraction = fraction +self._free_space_label.props.label = _('%(free_space)d MB Free') % \ +{'free_space': free_space / (1024 * 1024)} An os.statvfs against get_profile_path ... this looks very familiar. It is very similar to code in src/jarabe/journal/journalactivity.py and src/jarabe/view/palettes.py The use of the gtk.ProgressBar also appears in a similar form in src/jarabe/view/palettes.py Perhaps it is time to factor rather than duplicate code. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
On Mon, Oct 18, 2010 at 06:36:16AM +0530, Anurag Chowdhury wrote: We changed the cursor in home window to a busy cursor when the shutdown menu is activated and used glib.idle_add( ) to call the shut funtion when pygtk is idle to shutdown or logout the sugar session properly , hence letting the user know the validity of the shutdown process going on in the backend. s/ , /, / s/know the/know the s/( )/() s/funtion/function The commit message is quite verbose. That may be a side effect of review comments. Here's a suggested rewrite: Show a busy cursor when shutdown, logout, or reboot options are selected. Defer the selected action to an idle task so that the cursor change is flushed to the display. --- a/src/jarabe/view/buddymenu.py +++ b/src/jarabe/view/buddymenu.py @@ -98,16 +100,28 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) shut did not need self. The rest of Sugar uses gobject.idle_add rather than glib.idle_add ... does this fix work correctly if you use gobject.idle_add? If not, then I think we (as a team) need to understand why the glib.idle_add worked correctly where gobject.idle_add did not. The code is repetitive, as I've said before, but I think I'm not getting my point across, so I'll rewrite it for you in order to demonstrate. This is untested. It locates the session manager function to be called, and passes it to the idle task. diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..df03630 100644 --- a/src/jarabe/view/buddymenu.py +++ b/src/jarabe/view/buddymenu.py @@ -21,6 +21,8 @@ from gettext import gettext as _ import gtk import gconf import dbus +import gobject +import jarabe from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -97,17 +99,26 @@ class BuddyMenu(Palette): self.menu.append(item) item.show() +def _defer_session_manager(self, action): +window = jarabe.desktop.homewindow.get_instance().get_window() +window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +gobject.idle_add(self.__session_manager_idle, action) + +def __session_manager_idle(self, action): +action() +return False + def __logout_activate_cb(self, menu_item): session_manager = get_session_manager() -session_manager.logout() +self._defer_session_manager(session_manager.logout) def __reboot_activate_cb(self, menu_item): session_manager = get_session_manager() -session_manager.reboot() +self._defer_session_manager(session_manager.reboot) def __shutdown_activate_cb(self, menu_item): session_manager = get_session_manager() -session_manager.shutdown() +self._defer_session_manager(session_manager.shutdown) def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v2 Paint] Changes made to save the last added text item. (OLPC #5917)
I want to add to the review made from James: * the text tool from Paint is in bad state. I want to change it to support text styles and the actual approach don't allow it. * there are variables with names in portuguese like janela and estadoTexto. estadoTexto means text_status :( * estadoTexto use values like 1 and 0, like you did. I agree with James, it makes the code difficult to read and is a bad practice. Then I propose: * Create the constants and replace in the use with estadoTexto. * rename estadoTexto to text_status. * put the part of Desenho.text where the text is printed in the image in a new method. At the start of OficinaActivity.write_file, verify the text_status and call the new method if necessary. Regards Gonzalo On Sun, Oct 17, 2010 at 5:47 AM, Ishan Bansal is...@seeta.in wrote: New variable text_status defined which could keep the track of the status of text being entered and save it when activity is stopped. Signed-off-by: Ishan Bansalis...@seeta.in, Anubhav Aggarwal anub...@seeta.in --- Area.py | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) v1-v2: Patch updated diff --git a/Area.py b/Area.py index 2dca7da..a2db51b 100644 --- a/Area.py +++ b/Area.py @@ -113,6 +113,8 @@ class Area(gtk.DrawingArea): self.connect(leave_notify_event, self.mouseleave) self.connect(enter_notify_event, self.mouseenter) +self.text_status = -1 + target = [('text/uri-list', 0, TARGET_URI)] self.drag_dest_set(gtk.DEST_DEFAULT_ALL, target, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE) @@ -303,6 +305,7 @@ class Area(gtk.DrawingArea): # text if self.tool['name'] == 'text': self.d.text(widget,event) +self.text_status = 0 # This fixes a bug that made the text viewer get stuck in the canvas elif self.estadoTexto is 1: @@ -473,6 +476,10 @@ class Area(gtk.DrawingArea): self.configure_line(self.line_size) self.d.polygon(widget,coords,True,self.tool['fill'],moving) +if self.tool['name'] == 'text': + if self.text_status == 0: + self.text_status = 1 + gtk.gdk.event_request_motions (event) def mouseup(self,widget,event): @@ -571,6 +578,10 @@ class Area(gtk.DrawingArea): size = self.tool['line size'] widget.queue_draw_area(self.x_cursor-size, self.y_cursor-size, size*2, size*2) +if self.tool['name'] == 'text': + if self.text_status == 1: + self.d.text(widget,event) + def mouseenter(self, widget, event): if self.tool['name'] in ['pencil','eraser','brush','rainbow']: self.drawing = False -- 1.7.0.4 ___ 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] Home button in browse - toolbar images
On 14 Oct 2010, at 23:35, Lucian Branescu wrote: On 14 October 2010 19:47, Gary Martin garycmar...@googlemail.com wrote: Hi Gonzalo, On 5 Oct 2010, at 20:32, Gonzalo Odiard wrote: Gary: Here are the screenshots. I comented a check of cairo version to add the tabs button. toolbar-browse-0.90.png and toolbar-browse-0.84.png are with the emulator at 1200x900 browse-90-in-sugar-emulator.png and browse-90-in-emulator-without-tabs.png are the worst case, sugar-emulator by default. I don't know if is a real case. I've tinkered with Browse on an XO-1 to fake the extra home and tab button so we are looking at our most likely common usage environment (as XO-1/1.5 folks upgrade Sugar). The stop button does not fall off the end in this case, though the search field is much smaller than I'd like to be honest. As an emergency stop gap before we can code the reload/stop icon to move into the URL input location (as per the clear icon in Sugar search fields), it is at least a feasible option. FWIW under Simon's 0.90 F14 XO-1 builds the add new tab icon is auto disabled (due to some other tab/api bug avoidance), so there is a at least little more space for the location field. What is the target deployment you have in mind? One of the Dextrose builds? Note: I think Lucian mentioned he might be considering making the add new tab icon into a sub toolbar reveal, so that he has space for the add, remove, next, last tab features (see Terminal for the example tab control use case). If he is really considering this soon ;) then it might be better to move the add new tab icon over to where I have placed the go-home icon, and move the go-home icon over to where the add tab icon is placed (so the primary toolbar icons with sub-toolbars are all together on the left). I'd swap them anyway, Home makes sense to be next to Back/Forward. However, I'm really not satisfied with the amount of space left for the URL bar. Yes agreed, toolbar complexity is my other worry (too many tool icons at the top level). I could maybe add reload and home in a toolbar, The feature that strikes me as most complex is the new add tab feature, I know many adults who do not understand this feature. How about we move the add tab button down into the View sub-toolbar? The other tab navigation tools could also go there in the future. Seems to be a reasonable grouping to me along with the existing Zoom out, Zoom in, Fullscreen, Show/Hide Tray view features. or add a small stop/reload button inside the URL bar (but I'm not sure such useful features should be hidden so well). I'd vote +.9 for this, I'd rather we didn't have to use another UI button design vs. nice large (finger sized) toolbar bar buttons, but Sugar does already use this design for adding the Clear (x) widget in to the right of all Search fields – and we really do need to save the space in the Browse toolbar now that some deployment folks are calling for the addition of a home button. Regards, --Gary ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH PaintActivity] Paint - Rect. Marquee icon changes erratically(OLPC #5882)
I thing is better do: if self.tool['name'] in cursors: name = cursors[self.tool['name']] cursor = gtk.gdk.cursor_new_from_name(display, name) +elif tool['name'] == 'marquee-rectangular': +cursor = gtk.gdk.Cursor(gtk.gdk.TCROSS) else: filename = os.path.join('images', tool['name'] + '.png') pixbuf = gtk.gdk.pixbuf_new_from_file(filename) Can you change it and attach the patch in the ticket? Thanks Gonzalo On Thu, Oct 14, 2010 at 4:26 PM, anub...@seeta.in wrote: From: Anubhav Aggarwal anub...@seeta.in Earlier the cursor shown on selcting using rectangular marquee, was either a rectangle with a dashed border or a cross-hairs.Now a if condition has been added . --- Area.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Area.py b/Area.py index 2dca7da..5cbee4c 100644 --- a/Area.py +++ b/Area.py @@ -1131,6 +1131,8 @@ class Area(gtk.DrawingArea): filename = os.path.join('images', tool['name'] + '.png') pixbuf = gtk.gdk.pixbuf_new_from_file(filename) cursor = gtk.gdk.Cursor(display, pixbuf, 6, 21) +if tool['name'] == 'marquee-rectangular': +cursor = gtk.gdk.Cursor(gtk.gdk.TCROSS) except gobject.GError: cursor = None -- 1.7.0.4 -- Gonzalo Odiard ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Enable save as PDF from Write. SL #1458
This patch was added to the ticket 13 months ago, but is a diff patch, no a git format-patch. I don't know how is iwikiwi, please if he/she is in the list and want to redo the patch. tell me and I will try to help to make it land in the repository. The patch is ok. I have tried it and works. It add a option to the save menu to enable save in PDF format, like the other formats enabled. Gonzalo On Thu, Oct 14, 2010 at 6:02 PM, Sascha Silbe sascha-ml-reply-to-201...@silbe.org wrote: Excerpts from godiard's message of Thu Oct 14 21:27:31 +0200 2010: From: Gonzalo Odiard godi...@sugarlabs.org This ticket have a patch writed by iwikiwi If Vamsi authored the patch, he should appear in From:. You can add yourself in Signed-Off-By: (after the patch description, like for the Reviewed-By: tag). Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ ___ 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] Home button in browse - toolbar images
On Mon, 2010-10-18 at 14:20 +0100, Gary Martin wrote: I'd swap them anyway, Home makes sense to be next to Back/Forward. However, I'm really not satisfied with the amount of space left for the URL bar. Yes agreed, toolbar complexity is my other worry (too many tool icons at the top level). FWIW, I agree too. For reference, this is what the toolbar looks like now: http://wiki.sugarlabs.org/go/File:Dextrose_tabbed_browsing.png The feature that strikes me as most complex is the new add tab feature, I know many adults who do not understand this feature. How about we move the add tab button down into the View sub-toolbar? The other tab navigation tools could also go there in the future. Seems to be a reasonable grouping to me along with the existing Zoom out, Zoom in, Fullscreen, Show/Hide Tray view features. Agreed. Alternatively, the new tab button could become a small plus on the tab bar, which could be made visible at all times. For how long would it remain invisible during a normal session? or add a small stop/reload button inside the URL bar (but I'm not sure such useful features should be hidden so well). I wonder if we could also fold the star button for bookmarks inside the omnibox, like Firefox does. I'd vote +.9 for this, I'd rather we didn't have to use another UI button design vs. nice large (finger sized) toolbar bar buttons, but Sugar does already use this design for adding the Clear (x) widget in to the right of all Search fields – and we really do need to save the space in the Browse toolbar now that some deployment folks are calling for the addition of a home button. Removing one big button from the toolbar and putting a tiny one in the URL bar *will* result in more space for the URL bar! Another good way to save space: there seems to be too much empty space on the sides of the main toolbar. Can it be reduced a little? -- // Bernie Innocenti - http://codewiz.org/ \X/ Sugar Labs - http://sugarlabs.org/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495)
Ayush, please run pylint and pep8 over your code and attach to the ticket. Thanks. Gonzalo On Sat, Oct 16, 2010 at 7:10 PM, Ayush Goyal ay...@seeta.in wrote: Signed-off-by: Ayush Goyal ay...@seeta.in --- Area.py | 40 + icons/invert-colors.svg | 387 +++ toolbox.py | 22 ++- 3 files changed, 441 insertions(+), 8 deletions(-) create mode 100644 icons/invert-colors.svg diff --git a/Area.py b/Area.py index 2dca7da..7c7f4c5 100644 --- a/Area.py +++ b/Area.py @@ -70,6 +70,7 @@ import pango from fill import * from Desenho import Desenho from urlparse import urlparse +import numpy ##Tools and events manipulation are handle with this class. @@ -833,6 +834,45 @@ class Area(gtk.DrawingArea): self.queue_draw() if not self.selmove: self.enableUndo(widget) + +def invert_colors(self,widget): +Apply invert color effect. + +@param self -- the Area object (GtkDrawingArea) +@param widget -- the Area object (GtkDrawingArea) + + + +width, height = self.window.get_size() + +if self.selmove: +size = self.pixmap_sel.get_size() +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,size[0],size[1]) + pix.get_from_drawable(self.pixmap_sel,gtk.gdk.colormap_get_system(),0,0,0,0,size[0],size[1]) +else: +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,width,height) + pix.get_from_drawable(self.pixmap,gtk.gdk.colormap_get_system(),0,0,0,0,width,height) + +pix_manip2=pix.get_pixels_array() +pix_manip=numpy.ones(pix_manip2.shape,dtype=numpy.uint8)*255 +pix_manip2=pix_manip-pix_manip2 + pix=gtk.gdk.pixbuf_new_from_array(pix_manip2,gtk.gdk.COLORSPACE_RGB,8) + + +if self.selmove: + self.pixmap_sel.draw_pixbuf(self.gc,pix,0,0,0,0,size[0],size[1],dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + + self.pixmap_temp.draw_drawable(self.gc,self.pixmap,0,0,0,0,width,height) + self.pixmap_temp.draw_drawable(self.gc,self.pixmap_sel,0,0,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection,False,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection1,False,self.orig_x-1,self.orig_y-1,size[0]+2,size[1]+2) + +else: + self.pixmap.draw_pixbuf(self.gc,pix,0,0,0,0,width,height,dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + +self.queue_draw() +if not self.selmove: +self.enableUndo(widget) def _pixbuf2Image(self, pb): change a pixbuf to RGB image diff --git a/icons/invert-colors.svg b/icons/invert-colors.svg new file mode 100644 index 000..373ca70 --- /dev/null +++ b/icons/invert-colors.svg @@ -0,0 +1,387 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +svg + xmlns:osb=http://www.openswatchbook.org/uri/2009/osb; + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + xmlns:xlink=http://www.w3.org/1999/xlink; + xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; + xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape; + enable-background=new 0 0 55 55 + height=55px + version=1.1 + viewBox=0 0 55 55 + width=55px + x=0px + xml:space=preserve + y=0px + id=svg2 + inkscape:version=0.48.0 r9654 + sodipodi:docname=invert-colors.svgmetadata + id=metadata50rdf:RDFcc:Work + rdf:about=dc:formatimage/svg+xml/dc:formatdc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; //cc:Work/rdf:RDF/metadatadefs + id=defs48inkscape:path-effect + effect=skeletal + id=path-effect5822 + is_visible=true + pattern=M 0,0 0,10 10,5 z + copytype=single_stretched + prop_scale=1 + scale_y_rel=false + spacing=0 + normal_offset=0 + tang_offset=0 + prop_units=false + vertical_pattern=false + fuse_tolerance=0 /inkscape:path-effect + effect=skeletal + id=path-effect5818 + is_visible=true + pattern=M 0,0 0,10 10,5 z + copytype=single_stretched + prop_scale=1 + scale_y_rel=false + spacing=0 + normal_offset=0 + tang_offset=0 + prop_units=false + vertical_pattern=false + fuse_tolerance=0 /linearGradient + id=linearGradient5788 + osb:paint=solidstop + style=stop-color:#00;stop-opacity:1; + offset=0 + id=stop5790 //linearGradientlinearGradient + gradientTransform=matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4) + gradientUnits=userSpaceOnUse + id=SVGID_1_-0 +
Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495)
Gonzalo, Thank you for the feedback. This mistake was identified in Ayush's patch. He has configured sugar-lint and will run pep8 over the code. I have also asked him to attach the patch at the ticket. Do you want him to open a separate ticket at Sugarlabs bug tracker, and upload the patch over there? Regards, Manu On Mon, Oct 18, 2010 at 9:14 PM, Gonzalo Odiard godi...@gmail.com wrote: Ayush, please run pylint and pep8 over your code and attach to the ticket. Thanks. Gonzalo On Sat, Oct 16, 2010 at 7:10 PM, Ayush Goyal ay...@seeta.in wrote: Signed-off-by: Ayush Goyal ay...@seeta.in --- Area.py | 40 + icons/invert-colors.svg | 387 +++ toolbox.py | 22 ++- 3 files changed, 441 insertions(+), 8 deletions(-) create mode 100644 icons/invert-colors.svg diff --git a/Area.py b/Area.py index 2dca7da..7c7f4c5 100644 --- a/Area.py +++ b/Area.py @@ -70,6 +70,7 @@ import pango from fill import * from Desenho import Desenho from urlparse import urlparse +import numpy ##Tools and events manipulation are handle with this class. @@ -833,6 +834,45 @@ class Area(gtk.DrawingArea): self.queue_draw() if not self.selmove: self.enableUndo(widget) + +def invert_colors(self,widget): +Apply invert color effect. + +@param self -- the Area object (GtkDrawingArea) +@param widget -- the Area object (GtkDrawingArea) + + + +width, height = self.window.get_size() + +if self.selmove: +size = self.pixmap_sel.get_size() +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,size[0],size[1]) + pix.get_from_drawable(self.pixmap_sel,gtk.gdk.colormap_get_system(),0,0,0,0,size[0],size[1]) +else: +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,width,height) + pix.get_from_drawable(self.pixmap,gtk.gdk.colormap_get_system(),0,0,0,0,width,height) + +pix_manip2=pix.get_pixels_array() +pix_manip=numpy.ones(pix_manip2.shape,dtype=numpy.uint8)*255 +pix_manip2=pix_manip-pix_manip2 + pix=gtk.gdk.pixbuf_new_from_array(pix_manip2,gtk.gdk.COLORSPACE_RGB,8) + + +if self.selmove: + self.pixmap_sel.draw_pixbuf(self.gc,pix,0,0,0,0,size[0],size[1],dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + + self.pixmap_temp.draw_drawable(self.gc,self.pixmap,0,0,0,0,width,height) + self.pixmap_temp.draw_drawable(self.gc,self.pixmap_sel,0,0,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection,False,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection1,False,self.orig_x-1,self.orig_y-1,size[0]+2,size[1]+2) + +else: + self.pixmap.draw_pixbuf(self.gc,pix,0,0,0,0,width,height,dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + +self.queue_draw() +if not self.selmove: +self.enableUndo(widget) def _pixbuf2Image(self, pb): change a pixbuf to RGB image diff --git a/icons/invert-colors.svg b/icons/invert-colors.svg new file mode 100644 index 000..373ca70 --- /dev/null +++ b/icons/invert-colors.svg @@ -0,0 +1,387 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +svg + xmlns:osb=http://www.openswatchbook.org/uri/2009/osb; + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + xmlns:xlink=http://www.w3.org/1999/xlink; + xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; + xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape; + enable-background=new 0 0 55 55 + height=55px + version=1.1 + viewBox=0 0 55 55 + width=55px + x=0px + xml:space=preserve + y=0px + id=svg2 + inkscape:version=0.48.0 r9654 + sodipodi:docname=invert-colors.svgmetadata + id=metadata50rdf:RDFcc:Work + rdf:about=dc:formatimage/svg+xml/dc:formatdc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; //cc:Work/rdf:RDF/metadatadefs + id=defs48inkscape:path-effect + effect=skeletal + id=path-effect5822 + is_visible=true + pattern=M 0,0 0,10 10,5 z + copytype=single_stretched + prop_scale=1 + scale_y_rel=false + spacing=0 + normal_offset=0 + tang_offset=0 + prop_units=false + vertical_pattern=false + fuse_tolerance=0 /inkscape:path-effect + effect=skeletal + id=path-effect5818 + is_visible=true + pattern=M 0,0 0,10 10,5 z + copytype=single_stretched + prop_scale=1 + scale_y_rel=false + spacing=0 + normal_offset=0 + tang_offset=0 + prop_units=false +
Re: [Sugar-devel] [PATCH v4 sugar] Disable Start menu item for entries that can't be opened(Bug#328)
On Sun, Oct 17, 2010 at 11:11:41PM +0530, Mukul Gupta wrote: The patch disables the Start and Start With menu items for files which can't be opened by any installed activity and instead replace it with a hover dropdown with a menu item 'No activity installed to start entry' Commited, thanks. --- src/jarabe/journal/palettes.py | 38 +++--- 1 files changed, 23 insertions(+), 15 deletions(-) v1-v2:Patch remade as per pep8 standards v2-v3:Revised English wording and optimised behaviour for bundles v3-v4:Revised English wordings diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py index 7c3e5ff..5005655 100644 --- a/src/jarabe/journal/palettes.py +++ b/src/jarabe/journal/palettes.py @@ -62,22 +62,30 @@ class ObjectPalette(Palette): Palette.__init__(self, primary_text=title, icon=activity_icon) -if metadata.get('activity_id', ''): -resume_label = _('Resume') -resume_with_label = _('Resume with') -else: -resume_label = _('Start') -resume_with_label = _('Start with') -menu_item = MenuItem(resume_label, 'activity-start') -menu_item.connect('activate', self.__start_activate_cb) -self.menu.append(menu_item) -menu_item.show() +if misc.get_activities(metadata) or misc.is_bundle(metadata): +if metadata.get('activity_id', ''): +resume_label = _('Resume') +resume_with_label = _('Resume with') +else: +resume_label = _('Start') +resume_with_label = _('Start with') +menu_item = MenuItem(resume_label, 'activity-start') +menu_item.connect('activate', self.__start_activate_cb) +self.menu.append(menu_item) +menu_item.show() -menu_item = MenuItem(resume_with_label, 'activity-start') -self.menu.append(menu_item) -menu_item.show() -start_with_menu = StartWithMenu(self._metadata) -menu_item.set_submenu(start_with_menu) +menu_item = MenuItem(resume_with_label, 'activity-start') +self.menu.append(menu_item) +menu_item.show() +start_with_menu = StartWithMenu(self._metadata) +menu_item.set_submenu(start_with_menu) + +else: +resume_label = _('No activity to start entry') +menu_item = MenuItem(resume_label) +menu_item.set_sensitive(False) +self.menu.append(menu_item) +menu_item.show() client = gconf.client_get_default() color = XoColor(client.get_string('/desktop/sugar/user/color')) -- 1.7.0.4 -- Aleksey ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
On Wed, Oct 06, 2010 at 04:42:41AM +0530, Anurag Chowdhury wrote: We changed the cursor in home window to a busy cursor when the shutdown menu is activated and used glib.idle_add( ) to call the shut funtion when pygtk is idle to shutdown or logout the sugar session properly , hence letting the user know the validity of the shutdown process going on in the backend. --- src/jarabe/view/buddymenu.py | 26 -- 1 files changed, 20 insertions(+), 6 deletions(-) v1 was Reviewed-By: James Cameron quozl at laptop.org v2 was Reviewed-By: Tomeu Vizosoto...@sugarlabs.org v3 was Reviewed-By: James Cameron quozl at laptop.org v3-v4 : Removed redundant function calls like glib.timeout_add() and gtk.main() diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..78cdeb4 100644 --- a/src/jarabe/view/buddymenu.py +++ b/src/jarabe/view/buddymenu.py @@ -21,6 +21,8 @@ from gettext import gettext as _ import gtk import gconf import dbus +import glib +import jarabe from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -98,16 +100,28 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() s/reboot/shutdown/ +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.3 shut method name seems to be misusing, btw what about code: def _quit(self, method): journal = jarabe.desktop.homewindow.get_instance() journal.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gobject.idle_add(method) def __logout_activate_cb(self, menu_item): self._quit(get_session_manager().logout) def __reboot_activate_cb(self, menu_item): self._quit(get_session_manager().reboot) def __shutdown_activate_cb(self, menu_item): self._quit(get_session_manager().shutdown) Also, there are several places w/ redundant spaces, use sugar-lint to fix it. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Aleksey ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [Dextrose] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
On Mon, Oct 18, 2010 at 12:43:49AM +0530, Anurag Chowdhury wrote: Team I had submitted the patch for the http://bugs.sugarlabs.org/ticket/2080 You can check the patch at http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027748.html Wish if you could review it and provide me feedback on any improvement required. Not sure if we are doing right thing by trying to fight w/ consequences, what about pulsing by alpha channel (ie w/o re-rendering svg). It might be used only on restricted systems like XO (though I don't see problems to do the same in all cases). Regards Anurag -- Aleksey ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495)
Gonzalo, Thank you for the review and feedback. Please find the revised patch attached at http://dev.laptop.org/ticket/2495. The icon developed can be found at http://seeta.in/dextrose/olpc2495/. Looking forward to your review on the revised patch. Appreciate your support. Regards, Ayush ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495)
FYI -- Forwarded message -- From: Ayush Goyal ay...@seeta.in Date: Tue, Oct 19, 2010 at 1:28 AM Subject: Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495) To: Cc: sugar-devel sugar-devel@lists.sugarlabs.org Gonzalo, Thank you for the review and feedback. Please find the revised patch attached at http://dev.laptop.org/ticket/2495. The icon developed can be found at http://seeta.in/dextrose/olpc2495/. Looking forward to your review on the revised patch. Appreciate your support. Regards, Ayush ___ On Mon, Oct 18, 2010 at 9:24 PM, Manusheel Gupta m...@seeta.in wrote: Gonzalo, Thank you for the feedback. This mistake was identified in Ayush's patch. He has configured sugar-lint and will run pep8 over the code. I have also asked him to attach the patch at the ticket. Do you want him to open a separate ticket at Sugarlabs bug tracker, and upload the patch over there? Regards, Manu On Mon, Oct 18, 2010 at 9:14 PM, Gonzalo Odiard godi...@gmail.com wrote: Ayush, please run pylint and pep8 over your code and attach to the ticket. Thanks. Gonzalo On Sat, Oct 16, 2010 at 7:10 PM, Ayush Goyal ay...@seeta.in wrote: Signed-off-by: Ayush Goyal ay...@seeta.in --- Area.py | 40 + icons/invert-colors.svg | 387 +++ toolbox.py | 22 ++- 3 files changed, 441 insertions(+), 8 deletions(-) create mode 100644 icons/invert-colors.svg diff --git a/Area.py b/Area.py index 2dca7da..7c7f4c5 100644 --- a/Area.py +++ b/Area.py @@ -70,6 +70,7 @@ import pango from fill import * from Desenho import Desenho from urlparse import urlparse +import numpy ##Tools and events manipulation are handle with this class. @@ -833,6 +834,45 @@ class Area(gtk.DrawingArea): self.queue_draw() if not self.selmove: self.enableUndo(widget) + +def invert_colors(self,widget): +Apply invert color effect. + +@param self -- the Area object (GtkDrawingArea) +@param widget -- the Area object (GtkDrawingArea) + + + +width, height = self.window.get_size() + +if self.selmove: +size = self.pixmap_sel.get_size() +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,size[0],size[1]) + pix.get_from_drawable(self.pixmap_sel,gtk.gdk.colormap_get_system(),0,0,0,0,size[0],size[1]) +else: +pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,width,height) + pix.get_from_drawable(self.pixmap,gtk.gdk.colormap_get_system(),0,0,0,0,width,height) + +pix_manip2=pix.get_pixels_array() +pix_manip=numpy.ones(pix_manip2.shape,dtype=numpy.uint8)*255 +pix_manip2=pix_manip-pix_manip2 + pix=gtk.gdk.pixbuf_new_from_array(pix_manip2,gtk.gdk.COLORSPACE_RGB,8) + + +if self.selmove: + self.pixmap_sel.draw_pixbuf(self.gc,pix,0,0,0,0,size[0],size[1],dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + + self.pixmap_temp.draw_drawable(self.gc,self.pixmap,0,0,0,0,width,height) + self.pixmap_temp.draw_drawable(self.gc,self.pixmap_sel,0,0,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection,False,self.orig_x,self.orig_y,size[0],size[1]) + self.pixmap_temp.draw_rectangle(self.gc_selection1,False,self.orig_x-1,self.orig_y-1,size[0]+2,size[1]+2) + +else: + self.pixmap.draw_pixbuf(self.gc,pix,0,0,0,0,width,height,dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0) + +self.queue_draw() +if not self.selmove: +self.enableUndo(widget) def _pixbuf2Image(self, pb): change a pixbuf to RGB image diff --git a/icons/invert-colors.svg b/icons/invert-colors.svg new file mode 100644 index 000..373ca70 --- /dev/null +++ b/icons/invert-colors.svg @@ -0,0 +1,387 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +svg + xmlns:osb=http://www.openswatchbook.org/uri/2009/osb; + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + xmlns:xlink=http://www.w3.org/1999/xlink; + xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; + xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape; + enable-background=new 0 0 55 55 + height=55px + version=1.1 + viewBox=0 0 55 55 + width=55px + x=0px + xml:space=preserve + y=0px + id=svg2 + inkscape:version=0.48.0 r9654 + sodipodi:docname=invert-colors.svgmetadata + id=metadata50rdf:RDFcc:Work + rdf:about=dc:formatimage/svg+xml/dc:formatdc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage;
Re: [Sugar-devel] [PATCH Paint Activity] Added Invert Color Effect to Paint Activity (OLPC #2495)
Ayush, Kindly maintain the same thread while sending the response. Thank you. Regards, Manu On Tue, Oct 19, 2010 at 1:28 AM, Ayush Goyal ay...@seeta.in wrote: Gonzalo, Thank you for the review and feedback. Please find the revised patch attached at http://dev.laptop.org/ticket/2495. The icon developed can be found at http://seeta.in/dextrose/olpc2495/. Looking forward to your review on the revised patch. Appreciate your support. Regards, Ayush ___ 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] [Design]: OLPC#2493 [Implement a scale in paint Activity]
Team, Kindly share your feedback on the two approaches I have arrived at for this issue. Thank you Gonzalo for your positive feedback on them. 1.Use selection tool(Marquee tool) for scale using its boundary as dimensions ,printing it out on either toolbox ,or on a temporary status bar at bottom or view it on a gtk.window instance using a scale button. 2.Implement a line scale like a line tool which will show dimensions from starting point to end-point in pixels as text at center of the line. Looking forward to your reviews. Regards, Ayush ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v2 Paint] Changes made to save the last added text item. (OLPC #5917)
On Mon, Oct 18, 2010 at 08:55:52AM -0300, Gonzalo Odiard wrote: * Create the constants and replace in the use with estadoTexto. * rename estadoTexto to text_status. * put the part of Desenho.text where the text is printed in the image in a new method. At the start of OficinaActivity.write_file, verify the text_status and call the new method if necessary. http://dev.laptop.org/ticket/5917 has another test case added that you might want to consider ... that the text entry should return to being in progress after the save. ;-) -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v5 sugar] Shutdown (and Logout) menuitems should activate
Reviewed-by: James Cameron qu...@laptop.org -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Home button in browse - toolbar images
On 18 Oct 2010, at 16:42, Bernie Innocenti ber...@codewiz.org wrote: On Mon, 2010-10-18 at 14:20 +0100, Gary Martin wrote: I'd swap them anyway, Home makes sense to be next to Back/Forward. However, I'm really not satisfied with the amount of space left for the URL bar. Yes agreed, toolbar complexity is my other worry (too many tool icons at the top level). FWIW, I agree too. For reference, this is what the toolbar looks like now: http://wiki.sugarlabs.org/go/File:Dextrose_tabbed_browsing.png The feature that strikes me as most complex is the new add tab feature, I know many adults who do not understand this feature. How about we move the add tab button down into the View sub-toolbar? The other tab navigation tools could also go there in the future. Seems to be a reasonable grouping to me along with the existing Zoom out, Zoom in, Fullscreen, Show/Hide Tray view features. Agreed. Alternatively, the new tab button could become a small plus on the tab bar, which could be made visible at all times. For how long would it remain invisible during a normal session? Hmmm -1 from me as that would require showing the tab strip at all times, even if only one tab is in use, making the default UI more complicated and eating back into canvas space. or add a small stop/reload button inside the URL bar (but I'm not sure such useful features should be hidden so well). I wonder if we could also fold the star button for bookmarks inside the omnibox, like Firefox does. Not sure I've seen that, will try and take a look. I'd vote +.9 for this, I'd rather we didn't have to use another UI button design vs. nice large (finger sized) toolbar bar buttons, but Sugar does already use this design for adding the Clear (x) widget in to the right of all Search fields – and we really do need to save the space in the Browse toolbar now that some deployment folks are calling for the addition of a home button. Removing one big button from the toolbar and putting a tiny one in the URL bar *will* result in more space for the URL bar! Another good way to save space: there seems to be too much empty space on the sides of the main toolbar. Can it be reduced a little? 1) Just because in your builds you decided to disable the screen hot corners from triggering the frame doesn't mean that it is now free space up for grabs ;) 2) Corners are used by the notification system. 3) Using that space for more buttons does not solve the feature creep, and spiral towards complexity. Regards, --Gary -- // Bernie Innocenti - http://codewiz.org/ \X/ Sugar Labs - http://sugarlabs.org/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] wordgroupz ( A vocabulary building app) ported to sugar
Thanks Gary. The icons are really good. The original wordgroupz icon was taken from openclipart.com. Instead of the random words, it would be very nice if you could put the word wordgroupz in a similar fashion. I would like to update the icon for wordgroupz. Regards, rtnpro On Sun, Oct 17, 2010 at 1:22 AM, Gary C Martin garycmar...@googlemail.com wrote: Hi Ratnadeep, On 14 Oct 2010, at 17:14, Ratnadeep Debnath wrote: I'll try and get you a quick svg activity icon, probably will be later tomorrow. Thanks Gary. I've followed the same concept as in the original GNOME icon for this application. The detail is a little on the small side, but I think it still works OK and at least has a clear shape: Here are a few renders of the SVG version, this is what the bundle icon will look like: ...and here's a couple of user identity colour activity entries: ..and the actual SVG for use is below: Hope that's of help for your Sugarizing work! Regards, --Gary Regards, rtnpro ___ 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