Re: [Sugar-devel] Localisation of Socialcalc activity in different languages
Thanks , everyone for your valuable pointers on the topic and I have gathered enough data from your pointers to proceed on the localization of socialcalc activity. Regards, Anurag Chowdhury Research Engineer SEETA On Tue, Jan 31, 2012 at 11:04 AM, sankarshan foss.mailingli...@gmail.comwrote: On Tue, Jan 31, 2012 at 7:35 AM, David Mason dama...@redhat.com wrote: You could also consider having your project added to Zanata (see www.zanata.org), which will allow you to enter translations in the web interface and will generate po files for you automatically. Indeed. Using a Translation Content Management system would make it simple and more convenient to handle the updates to the translatable strings. -- sankarshan mukhopadhyay http://sankarshan.randomink.org/blog ___ 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] Localisation of Socialcalc activity in different languages
Hi all, I am working on the localisation of the socialcalc activity on sugar in different languages for which I am in need of some pointers as follows: 1) After making the translations of the string in msgid to the required language (starting with bengali) as portrayed below #: /home/olpc/Activities/SocialCalcActivity.activity/localized_strings_file.py: msgid Recalculation #--- in english msgstr Nuevo cálculo#---in desired language(spanish here) above is a snippet from the es.po file used in spanish localisation of socialcalc activity. What should be the next step following the creation of bn.po file (for bengali) also I would need a detailed pointer on creation of .po files. Regards Anurag Chowdhury Research Engineer SEETA . ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Errors while running sugar emulator
I feel you should try running sugar in Ubuntu's latest version i.e. 10.10 Maverick to get the latest setup running on your system also as a beginner (which I am only assuming , correct me otherwise.) you can also try running sugar on fedora which as per my experience has a better support for sugar and related components ,you can install fedora even on virtualization , presently I have sugar running perfectly on both ubuntu 10.10 and fedora 13 (both natively installed) on my system . I hope you can get it running . Regards, Anurag Research Engineer SEETA On Sun, Jan 2, 2011 at 11:50 AM, akshit chhabra chhabra@gmail.com wrote: I have installed sugar in Karmic 9.10 but is not able to run it due to some errors The error log can be viewed here: http://pastebin.com/ATWzX5PF Please suggest an alternate solution.I want to start working on activities. Akshit Chhabra Delhi College Of Engineering ___ 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] [Dextrose] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
Yes , I tried this solution on my end once as per Alsroot's suggesstion of implementing alpha pulsing instead of the present scenario but that did not solve the problem much as you may have noted due to the main problem lying in the rendering time of the startup frame of the animation. On Thu, Dec 2, 2010 at 10:22 AM, Gonzalo Odiard gonz...@laptop.org wrote: On Sun, Oct 31, 2010 at 3:44 AM, Martin Dengler mar...@martindengler.com wrote: On Sat, Oct 30, 2010 at 12:09:53AM +0530, Anurag Chowdhury wrote: Uptill now what we have gathered from this issue is: 1) We can improve this issue by using a cache system or cairo operation: I think the problem is the code is rendering the svg icon every time the color is changed. There are not cache or cairo operation used to avoid this. Gonzalo -- I think that we all seem to agree upon this point that using a cache to store the once rendered frames and then reuse them later in the animation to improve the performance of the system. This is already done. The cache is not used if the colors change, right? I have implemented a pulsing icon using alpha. Is a poof of concept patch (does not remove the unused properties), but now does not render the icon every time. I profiled with cProfile using the Martin instructions, and I think the graphic show a improvement, but I didn't see a big reduction in the startup time in the activities. (I didn't tested it in XO 1.0) Patches and profile graphics can be downloaded from http://dev.laptop.org/~gonzalo/alpha-pulsingicon/ Gonzalo ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [Dextrose] Report on Sl# 2080 , Pulsing icon delayed by 5 seconds or so.
I again tried the patch on my XO-1.5 build-0.88.1 but with no improvement. I made and saved the changed as written in your patch in the pulsingicon.py file and restarted the sugar session to let the changes take place but it didnt offer any changes for the good. I hope we can test your patch on more XO devices to verify if its a device specific problem. On Fri, Nov 5, 2010 at 11:42 PM, Martin Dengler mar...@martindengler.com wrote: On Fri, Nov 05, 2010 at 10:59:05PM +0530, Anurag Chowdhury wrote: Then I may have misinterpreted Gary's comment.I apologize in that case. But when I tested Martin's patch on my XO-1.5 , 0.88.1 build , upon starting an activity the pulsing icon animation was replaced by a static grayscale svg icon of the activity ,whose screenshots I have placed at http://wiki.sugarlabs.org/go/Pulsing_icon_delayed_by_5_seconds. To reach to the above results I applied the changes suggested at http://www.martindengler.com/tmp/sl.o-2080/pulsingicon.py-set-new-colors-in-one-go-to-avoid-multiple-calls-to-SVG-rendering.patch Please let me know if I needed to add any more changes to get the patch working because the sole application of this patch doesn't produce the said changes at my end. I just tried it on 0.88-1 in the emulator and it worked fine. At least one other person tried it on HEAD (as I did before) and it worked fine. Can you try it again please, or let me know how you're applying the patch? Martin ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Report on Sl# 2080 , Pulsing icon delayed by 5 seconds or so.
Hello I have prepared a detailed report on the issue SL # 2080, Pulsing icon delayed by 5 seconds or so , and have made it online at http://wiki.sugarlabs.org/go/Pulsing_icon_delayed_by_5_seconds . The report includes detailed analysis and developments on the issue till date and various proposed fixes and their end results. I hope the report will help us better to monitor the issue. Any feedback is appreciated. Regards, --Anurag Research Engineer SEETA ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Report on Sl# 2080 , Pulsing icon delayed by 5 seconds or so.
Sure , we can work to get a combined patch but your patch still disables the animation in most of the icons and we can check the real deal only after we can see the animation because thats the real part where all the system resources go and lead to that delay. We should first try to get that part working and then run fresh tests to check the improvements. On the other hand my patch my patch also gives a near 50% reduction in delay with the animation playing but the community still hasn't reached on a consensus regarding the issue so I guess we need to reach on a common point of approval , then only we can get any working patch accepted and move on to other issues. Regards Anurag On Fri, Nov 5, 2010 at 4:05 PM, Martin Dengler mar...@martindengler.com wrote: On Fri, Nov 05, 2010 at 02:24:58PM +0530, Anurag Chowdhury wrote: Hello I have prepared a detailed report on the issue SL # 2080, Pulsing icon delayed by 5 seconds or so , and have made it online at http://wiki.sugarlabs.org/go/Pulsing_icon_delayed_by_5_seconds . Thanks for that. Next time, could you link to the SL bug in the wiki page and the wiki page in the SL bug? I have done this for you. Any feedback is appreciated. Again, thanks for this summary. I think the thing to do is merge my patch for #2080 and then address the other issues. I'll do that soon. Regards, --Anurag Martin ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Report on Sl# 2080 , Pulsing icon delayed by 5 seconds or so.
On Fri, Nov 5, 2010 at 6:53 PM, Martin Dengler mar...@martindengler.com wrote: On Fri, Nov 05, 2010 at 06:05:16PM +0530, Anurag Chowdhury wrote: Sure , we can work to get a combined patch but your patch still disables the animation in most of the icons I think you're talking about something else than my patch. No animation is disabled. Not sure what's wrong but the patch you linked to[1] in your wiki page clearly does nothing like disabling any animation. Well, I actually didn't meant that. I was talking about the change noticed by Gary (and me too) i.e. after the application of the patch we don't get to see the pulsing icon animation in most of the icons , all we see is only the grayscale svg icon , this anomaly is also linked with the complexity of the icons i.e. more complex icons don't show up the animation while the simpler ones do. Regards Anurag Martin 1. http://www.martindengler.com/tmp/sl.o-2080/pulsingicon.py-set-new-colors-in-one-go-to-avoid-multiple-calls-to-SVG-rendering.patch ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [Dextrose] Report on Sl# 2080 , Pulsing icon delayed by 5 seconds or so.
Then I may have misinterpreted Gary's comment.I apologize in that case. But when I tested Martin's patch on my XO-1.5 , 0.88.1 build , upon starting an activity the pulsing icon animation was replaced by a static grayscale svg icon of the activity ,whose screenshots I have placed at http://wiki.sugarlabs.org/go/Pulsing_icon_delayed_by_5_seconds. To reach to the above results I applied the changes suggested at http://www.martindengler.com/tmp/sl.o-2080/pulsingicon.py-set-new-colors-in-one-go-to-avoid-multiple-calls-to-SVG-rendering.patch Please let me know if I needed to add any more changes to get the patch working because the sole application of this patch doesn't produce the said changes at my end. Also I would wish to ask for Gary's experience after he applied my patch which I think he once referred to in the previous issue thread. I worked on the pointers provided there by Gary and would love further suggestions. On Fri, Nov 5, 2010 at 10:09 PM, Gary Martin garycmar...@googlemail.com wrote: Hi Anurag, On 5 Nov 2010, at 16:19, Anurag Chowdhury anu...@seeta.in wrote: On Fri, Nov 5, 2010 at 6:53 PM, Martin Dengler mar...@martindengler.com wrote: On Fri, Nov 05, 2010 at 06:05:16PM +0530, Anurag Chowdhury wrote: Sure , we can work to get a combined patch but your patch still disables the animation in most of the icons I think you're talking about something else than my patch. No animation is disabled. Not sure what's wrong but the patch you linked to[1] in your wiki page clearly does nothing like disabling any animation. Well, I actually didn't meant that. I was talking about the change noticed by Gary Hmmm, no, with Martin's below linked patch pulse colour animation is good. The only extra thing I noted in my email was that the 1sec zoom effect is still not showing for anything by very simple icons (Log icon is simple enough, Distance is not), however the zoom effect is not showing with your 'skip the first update' approach either. Fixing zoom efficiency should be looked at as a separate issue. --Gary (and me too) i.e. after the application of the patch we don't get to see the pulsing icon animation in most of the icons , all we see is only the grayscale svg icon , this anomaly is also linked with the complexity of the icons i.e. more complex icons don't show up the animation while the simpler ones do. Regards Anurag Martin 1. http://www.martindengler.com/tmp/sl.o-2080/pulsingicon.py-set-new-colors-in-one-go-to-avoid-multiple-calls-to-SVG-rendering.patch ___ Dextrose mailing list dextr...@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/dextrose ___ 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
Since , now we all seem to reach on a common proposal of agreement for the above issue . And since Gary has confirmed a noticeable improvement in the reduction of the delay time due to the changes applied by the v5 patch and some more tweaks discussed in the thread , so I think we can move to make a revised patch for this issue which can improve the situation for now and if we are still required to change the animation as the final solution we can later reopen the ticket as an enhancement request. On Sun, Oct 31, 2010 at 12:19 PM, Martin Dengler mar...@martindengler.com wrote: On Fri, Oct 29, 2010 at 05:51:35PM -0400, Martin Langhoff wrote: The same (potentially complex) SVG is being rendered in 2 tones, many times. This is nonsense. Render it once to a B/W grayscale raster. Then use/abuse whatever cairo bitblit blend operators. [...] Maybe I am making wild assumptions about the bitblt ops you have available... You've exceeded my knowledge of cairo :). Sounds like a promising thing to investigate m Martin ___ 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
I have attached the pulsingicon.py file in which I placed the benchmark script to test the time taken by update function everytime it is called. I used the time.time() function to measure the time taken to process the update step. And If you may compare the odd steps of both logs i.e the numbers in the lines having seconds taken to update frame appearing at the odd steps (3rd ,5th ,7th.entries) and similarily compare the even steps you may find the average time taken on XO-1.5 to run the update function was nearly 50% faster. On Thu, Oct 28, 2010 at 3:01 PM, Martin Dengler mar...@martindengler.com wrote: On Wed, Oct 27, 2010 at 11:15:01PM +0530, Anurag Chowdhury wrote: I carried out the same benchmark test, which I earlier conducted on an XO-1.5 , on a X0-1 . Please tell us what the test is/was. How many times did you run it? How did you make sure nothing else interfered with the system cpu and memory while you were running it? And I have attached the log files obtained in both the cases. [...] the consecutive times taken for the rendering of the frames on the XO-1 were much larger as compared to that on a XO-1.5. I compared the means and standard deviations for the numbers in the lines having seconds taken to update frame and I don't understand how you came to that very much larger conclusion: $ (~/src/stddev.py ~/tmp/xo15 ; ~/src/stddev.py ~/tmp/xo10) | \ ~/tmp/compare_means.py for 'seconds taken to update frame': XO 1.0 mean was 0.021002, XO 1.5 mean was 0.014994 ...change in speed was -28.605292% You can find the data from your logs (I had to remove some numbers that were split across the stderr output that was mixed in with your logging) and the scripts mentioned at: http://www.martindengler.com/tmp/sl.o-2080 Please, can you do more than wave your hands to help us understand the effect of what you've done? You want to affect a key part of the system for a lot of people. It's a bit frustrating to hear talk of very much larger speed without actually knowing how and what you're measuring. Regards, --Anurag Martin pulsingicon.py Description: Binary data ___ 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
Certainly that seems to me as a possible reason behind this issue , but in the present state we need to decide exactly on what future we want for this pulsing icon i.e. keep it , improve it or replace it. On Fri, Oct 29, 2010 at 12:14 AM, Gonzalo Odiard gonz...@laptop.org wrote: I think the problem is the code is rendering the svg icon every time the color is changed. There are not cache or cairo operation used to avoid this. Gonzalo ___ 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 Thu, Oct 28, 2010 at 11:12 PM, Martin Dengler mar...@martindengler.com wrote: I'm sorry to harp on this, but I hope you can see it actually takes quite some effort to communicate this stuff well... On Thu, Oct 28, 2010 at 09:27:18PM +0530, Anurag Chowdhury wrote: I have attached the pulsingicon.py file Thanks - very useful to understand what you're timing. in which I placed the benchmark script which benchmark script?! Another file you should include. No , Its just my lingo . I meant no other file and benchmark script only meant the time.time() function used to get time taken to update frame. to test the time taken by update function everytime it is called. I used the time.time() function to measure the time taken to process the update step. There is a better way: use cProfile and gprof2dot.py. You will get graphs (and of course the raw data) like this: Thanks and I appreciate the pointers., but I did it this way as I wanted it simple and to the point. :) http://www.martindengler.com/tmp/sl.o-2080/pulsingicon.py-stats-graph.png ...and then you could show us before and after your change on the XO 1.0 and XO 1.5. Normally the relative time is most interesting, but since we are also interested in the absolute running time I patched gprof2dot.py to show that, and you can see the total time (in seconds) consumed by each graph node and its subtree as the second-to-last number shown in the node. You can find the pulsingicon.py changes and the instructions I used to make that in: http://www.martindengler.com/tmp/sl.o-2080/README.txt And If you may compare the odd steps of both logs i.e the numbers in the lines having seconds taken to update frame appearing at the odd steps (3rd ,5th ,7th.entries) and similarily compare the even steps you may find the average time taken on XO-1.5 to run the update function was nearly 50% faster. Odd steps? Even steps? Sounds scary. Why? Sorry for the confusion. What I meant to say by frames renders at odd steps was 1st frame, 3rd frame , 5th frame.so on, similarily for even frames. Martin ___ 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
Sure, I would certainly do a similar benchmark test on an XO-1 also . I am presently waiting for the developers' key of my XO-1 to flash it into the latest build of dextrose, then I will run the benchmark test and will post the results asap. On Tue, Oct 26, 2010 at 6:59 PM, Martin Dengler mar...@martindengler.comwrote: On Tue, Oct 26, 2010 at 05:41:58PM +0530, Anurag Chowdhury wrote: The conclusion of XO-1.5 being nearly 2.5 times faster than the XO-1 could be verified by comparing their hardware specifications. at http://en.wikipedia.org/wiki/OLPC_XO-1 (For XO-1) and http://wiki.laptop.org/go/Hardware_specification_1.5 (For XO-1.5) .Also we can see the test results of James'(quozl) at http://bugs.sugarlabs.org/ticket/245 which suggests that XO-1.5 is atleast twice as fast as XO-1. Those conclusions are oversimplified - in general they might be useful but you are talking about a very specific, very large and subtle set of operations with a very specific set of interacting hardware and software components, the software ones of which change a lot from release to release. Much more compelling for a problem that has been with us for a while, has been a moving target in software terms, and many people have looked at, would be just to test your change on an XO-1 and report back. If you don't have one - and even if you do - others will be interested in testing your changes on an XO-1, too. Please can you provide an easy way for people with an XO-1 and a well-supported release to objectively gather the speedup of your patch? Or at least some numbers of your own? Martin ___ 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
The present issue has two possible scenarios of solving it 1) Optimise the present pulsing icon animation to reduce the delay : Thats what I have worked towards till now in my patches. 2)Replace the present pulsing icon animation with a better and faster animation: Thats what I think everyone agrees to be the best solution of the issue right now. If we're still taking about the v5 patch that was posted to the list, I don't understand how this change is supposed to fix the bug: +if self._count 2: + self.update() +self._count = self._count + 1 The animation of the pulsing icon is basically constituted by filling the raw svg icon with colours based on a sinusoidal function and it is this sinusoidal filling of the colour that brings about the pulsing effect , so if we dont fill the icon with colour then the icon wont pulse and would render and appear as a raw svg icon only which undoubtedly will take lower system resources to get rendered than the animation. Skipping the first frame of the animation unconditionally is wrong and isn't the same thing of skipping frames dynamically, based on the time elapsed to render the previous frame. I feel like we're trying a number of random tweaks without addressing the root cause of the problem. The first frame of the animation is not being skipped but its just not being filled with colour so as to make the pulsing icon animation start earlier and I hope we both agree on the fact that the delay is caused due to the time taken for the rendering of the zoom in and zoom out animation for the first frame. So if the load of processing the first frame would have been reduced somehow then the animation would start earlier and this approach was confirmed by positive log results upon benchmarking the whole scenario before and after the fix. Perhaps Anurag could work on a fix in team with other Seeta developers? -- // 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
[Sugar-devel] [PATCH v2 PaintActivity] New suggestion for arrow drawing in Paint
In the paint activity's shape tool we were able to make only horizontal arrows, so now we have modified the arrow tool which will now make arrows in all directions. --- Desenho.py | 27 ++- 1 files changed, 18 insertions(+), 9 deletions(-) v1-v2 :Removed the vertical-arrow tool and modified the arrow tool to enable drawing arrows in all directions. diff --git a/Desenho.py b/Desenho.py index 3be1910..5057a27 100644 --- a/Desenho.py +++ b/Desenho.py @@ -294,18 +294,27 @@ class Desenho: x = coords[0] - widget.oldx y = coords[1] - widget.oldy -points = [(widget.oldx, widget.oldy),\ -(widget.oldx + int(x / 6), widget.oldy + y), \ -(widget.oldx + int(x / 6), widget.oldy + int(y / 3)), \ -(widget.oldx + x, widget.oldy + int(y / 3)), \ -(widget.oldx + x, widget.oldy - int(y / 3)), \ -(widget.oldx + int(x / 6), widget.oldy - int(y / 3)),\ -(widget.oldx + int(x / 6), widget.oldy - y)] +A = math.atan2(y,x) +dA = 2*math.pi/2 +r = math.hypot(y,x) +m = math.sin(A) +p = [(widget.oldx,widget.oldy),\ +(widget.oldx+int(r*math.cos(A)),widget.oldy+int(r*math.sin(A))),\ +(widget.oldx+int(0.74*r*math.cos(A+dA/6)),\ + widget.oldy+int(0.74*r*math.sin(A+dA/6)))] +p.append((widget.oldx,widget.oldy)) +p.append((widget.oldx+int(0.74*r*math.cos(A+dA/6)),\ + widget.oldy+int(0.74*r*math.sin(A+dA/6 +p.append((widget.oldx+int(2*r*math.cos(A+dA/6+dA/20)),\ + widget.oldy+int(2*r*math.sin(A+dA/6+dA/20 +p.append((widget.oldx+int(2*r*math.cos(A+dA/6-dA/20+dA/6)),\ + widget.oldy+int(2*r*math.sin(A+dA/6-dA/20+dA/6 +p.append((widget.oldx+int(0.74*r*math.cos(A+dA/6+dA/6)),\ + widget.oldy+int(0.74*r*math.sin(A+dA/6+dA/6 +p.append((widget.oldx,widget.oldy)) +p.append((widget.oldx+int(0.74*r*math.cos(A+dA/6+dA/6)),\ + widget.oldy+int(0.74*r*math.sin(A+dA/6+dA/6 +p.append((widget.oldx+int(r*math.cos(A+dA/2)),\ + widget.oldy+int(r*math.sin(A+dA/2 pixmap.draw_drawable(widget.gc, widget.pixmap, 0, 0, 0, 0, width, height) +tp = tuple(p) if fill == True: -pixmap.draw_polygon(widget.gc, True, points) -pixmap.draw_polygon(widget.gc_line, False, points) +pixmap.draw_polygon(widget.gc, True, tp) +pixmap.draw_polygon(widget.gc_line, False, tp) widget.queue_draw() def parallelogram(self, widget, coords, temp, fill): -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v3 PaintActivity] New suggestion for arrow drawing in Paint
In the paint activity's shape tool we were able to make only horizontal arrows, so now we have modified the arrow tool which will now make arrows in all directions. --- Desenho.py | 31 ++- 1 files changed, 22 insertions(+), 9 deletions(-) v1-v2 :Removed the vertical-arrow tool and modified the arrow tool to enable drawing arrows in all directions. v2-v3 :Fixed the error of two extra lines when made the arrow with a different colour border diff --git a/Desenho.py b/Desenho.py index 3be1910..1b16ccd 100644 --- a/Desenho.py +++ b/Desenho.py @@ -294,18 +294,31 @@ class Desenho: x = coords[0] - widget.oldx y = coords[1] - widget.oldy -points = [(widget.oldx, widget.oldy),\ -(widget.oldx + int(x / 6), widget.oldy + y), \ -(widget.oldx + int(x / 6), widget.oldy + int(y / 3)), \ -(widget.oldx + x, widget.oldy + int(y / 3)), \ -(widget.oldx + x, widget.oldy - int(y / 3)), \ -(widget.oldx + int(x / 6), widget.oldy - int(y / 3)),\ -(widget.oldx + int(x / 6), widget.oldy - y)] +A = math.atan2(y, x) +dA = 2 * math.pi / 2 +r = math.hypot(y, x) +m = math.sin(A) +p = [(widget.oldx, widget.oldy)] +p.append((widget.oldx + int(r * math.cos(A)),\ + widget.oldy + int(r * math.sin(A +p.append((widget.oldx + int(0.74 * r * math.cos(A + dA / 6)),\ + widget.oldy + int(0.74 * r * math.sin(A + dA / 6 +p.append((widget.oldx + int(2 * r * math.cos(A + dA / 6 + dA / 20)),\ + widget.oldy + int(2 * r * math.sin(A + dA / 6 + dA / 20 +p.append((widget.oldx +\ + int(2 * r * math.cos(A + dA / 6 - dA / 20 + dA / 6)),\ + widget.oldy +\ + int(2 * r * math.sin(A + dA / 6 - dA / 20 + dA / 6 +p.append((widget.oldx + int(0.74 * r * math.cos(A + dA / 6 + dA / 6)),\ + widget.oldy + int(0.74 * r * math.sin(A + dA / 6 + dA / 6 +p.append((widget.oldx + int(r * math.cos(A + dA / 2)),\ + widget.oldy + int(r * math.sin(A + dA / 2 pixmap.draw_drawable(widget.gc, widget.pixmap, 0, 0, 0, 0, width, height) +tp = tuple(p) if fill == True: -pixmap.draw_polygon(widget.gc, True, points) -pixmap.draw_polygon(widget.gc_line, False, points) +pixmap.draw_polygon(widget.gc, True, tp) +pixmap.draw_polygon(widget.gc_line, False, tp) widget.queue_draw() def parallelogram(self, widget, coords, temp, fill): -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [Dextrose] Request to review documentation required for SL #2372
Two screenshots were taken from camera as the screen shots of those two screens coudnt be saved as just after taking those two screenshots the journal gets restored and we lose our previous data of the journal which includes those two screenshots. Also It was not possible to take screenshots of the in-progress operation as the backup and restore operation completes in very few sceonds so I coudnt capture such a near instantaneous operation. Restore from school server was not documented as we coudnt generate that situation at our workplace. On Wed, Oct 20, 2010 at 3:46 AM, Bernie Innocenti ber...@codewiz.orgwrote: On Tue, 2010-10-19 at 21:19 +0530, Anurag Chowdhury wrote: Team, Wish if you could review documentation in reference to SL #2372 at http://wiki.sugarlabs.org/go/Dextrose/Resources/Journal-restore. * Why were two of the screenshots taken with a camera? * The screenshot of in-progress operation is missing. * Restore from schoolserver isn't documented Also note that we had already documented the backup and restore procedures here (although briefly): http://wiki.sugarlabs.org/go/Features/Backup_and_Restore#User_Experience -- // 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] Request to review solution for SL #2464
Gary, I have updated the version of paint package from 28 to 29, and have uploaded Paint xo bundle at http://bugs.sugarlabs.org/ticket/2464 Kindly review it. Regards, Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] New suggestion for arrow drawing in Paint activity.olpc4170
In the paint activity's shape tool we were able to make only horizontal arrows, so now we have added a new tool which makes vertical arrows. --- Area.py|8 Desenho.py | 31 +++ toolbox.py | 21 + 3 files changed, 60 insertions(+), 0 deletions(-) diff --git a/Area.py b/Area.py index 2dca7da..56c4267 100644 --- a/Area.py +++ b/Area.py @@ -438,6 +438,10 @@ class Area(gtk.DrawingArea): elif self.tool['name'] == 'arrow': self.configure_line(self.line_size) self.d.arrow(widget,coords,True,self.tool['fill']) + +elif self.tool['name'] == 'vertical arrow': +self.d.arrow_vertical(widget,coords,False,\ +self.tool['fill']) +self.enableUndo(widget) elif self.tool['name'] == 'parallelogram': self.configure_line(self.line_size) @@ -541,6 +545,10 @@ class Area(gtk.DrawingArea): elif self.tool['name'] == 'arrow': self.d.arrow(widget,coords,False,self.tool['fill']) self.enableUndo(widget) + +elif self.tool['name'] == 'vertical arrow': +self.d.arrow_vertical(widget,coords,False,self.tool['fill']) +self.enableUndo(widget) elif self.tool['name'] == 'parallelogram': self.d.parallelogram(widget,coords,False,self.tool['fill']) diff --git a/Desenho.py b/Desenho.py index c9a134b..e90a45c 100644 --- a/Desenho.py +++ b/Desenho.py @@ -298,6 +298,37 @@ class Desenho: pixmap.draw_polygon(widget.gc_line,False,points) widget.queue_draw() +def arrow_vertical(self, widget, coords, temp, fill): +Draw a arrow. + +@param self -- Desenho.Desenho instance +@param widget -- Area object (GtkDrawingArea) +@param coords -- Two value tuple +@param temp -- switch between pixmap and pixmap_temp +@param fill -- Fill object + + +if temp == True: +pixmap = widget.pixmap_temp +else: +pixmap = widget.pixmap +width, height = widget.window.get_size() + +x = widget.oldx - coords[0] +y = widget.oldy - coords[1] +points = [(widget.oldx,widget.oldy),\ +(widget.oldx+x,widget.oldy-int(y/6)),\ +(widget.oldx+int(x/2),widget.oldy-int(y/6)),\ +(widget.oldx+int(x/2),widget.oldy-y),\ +(widget.oldx-int(x/2),widget.oldy-y),\ +(widget.oldx-int(x/2),widget.oldy-int(y/6)),\ +(widget.oldx-x,widget.oldy-int(y/6))] +pixmap.draw_drawable(widget.gc,widget.pixmap,0,0,0,0,width,height) +if fill == True: +pixmap.draw_polygon(widget.gc,True,points) +pixmap.draw_polygon(widget.gc_line,False,points) +widget.queue_draw() + def parallelogram(self, widget, coords, temp, fill): Draw a parallelogram. diff --git a/toolbox.py b/toolbox.py index 299181b..520e5f0 100644 --- a/toolbox.py +++ b/toolbox.py @@ -613,6 +613,15 @@ class ShapesToolbar(gtk.Toolbar): 'fill' : True, 'vertices' : 5 } +_SHAPE_ARROW_VERTICAL= { +'name' : 'vertical arrow', +'line size' : 5, +'fill color': None, +'stroke color' : None, +'line shape': 'circle', +'fill' : True, +'vertices' : 5 +} _SHAPE_CURVE = { 'name' : 'curve', 'line size' : 2, @@ -795,6 +804,13 @@ class ShapesToolbar(gtk.Toolbar): self._configure_palette_shape_arrow() except: logging.debug('Could not create palette for Shape Arrow') + +self._shape_arrow_vertical = DrawToolButton\ +('tool-shape-arrow-vertical',activity.tool_group,_('Arrow-Vertical')) +self.insert(self._shape_arrow_vertical, -1) +try: +self._configure_palette_shape_arrow_vertical() +except: +logging.debug('Could not create palette for Shape Vertical Arrow') self._shape_star = DrawToolButton('tool-shape-star', activity.tool_group,_('Star')) self.insert(self._shape_star, -1) @@ -819,6 +835,7 @@ class ShapesToolbar(gtk.Toolbar): self._shape_arrow.connect('clicked', self.set_tool, self._SHAPE_ARROW) +self._shape_arrow_vertical.connect('clicked', self.set_tool,\ +self._SHAPE_ARROW_VERTICAL) self._shape_ellipse.connect('clicked', self.set_tool, self._SHAPE_ELLIPSE) self._shape_freeform.connect('clicked', self.set_tool, self._SHAPE_FREEFORM) self._shape_heart.connect('clicked', self.set_tool, self._SHAPE_HEART) @@ -908,6 +925,10 @@ class ShapesToolbar(gtk.Toolbar): logging.debug('Creating palette to shape arrow') self._create_simple_palette(self._shape_arrow, self._SHAPE_ARROW) +def
Re: [Sugar-devel] [PATCH v5 sugar] Shutdown (and Logout) menuitems should activate
Daniel, My apologies. Thank you for reminding me about it. I am adding James and Aleksey as co-authors on this patch. Regards, Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v5 sugar] Shutdown(and Logout) menuitems should activate
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. Co-Authored-By:James Cameron qu...@laptop.org Co-Authored-By:Aleksey Lim alsr...@member.fsf.org --- src/jarabe/view/buddymenu.py | 18 -- 1 files changed, 12 insertions(+), 6 deletions(-) v1-v2: Corrected the window of operation v2-v3: Added the busycursor in the desktop window v3-v4: Removed redundant function calls like glib.timeout_add() v4-v5: Opimised the code by removing repetitive redundant code snips. Reviewed-By: James Cameron qu...@laptop.org diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..2f3b1e0 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 @@ -31,7 +33,9 @@ from jarabe.model import friends from jarabe.model.session import get_session_manager from jarabe.controlpanel.gui import ControlPanel + class BuddyMenu(Palette): + def __init__(self, buddy): self._buddy = buddy @@ -97,17 +101,19 @@ class BuddyMenu(Palette): self.menu.append(item) item.show() +def _quit(self, action): +journal = jarabe.desktop.homewindow.get_instance() +journal.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +gobject.idle_add(action) + def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +self._quit(get_session_manager().logout) def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() +self._quit(get_session_manager().reboot) def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +self._quit(get_session_manager().shutdown) def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Request to review solution for SL #2371
Team, Wish if you could review documentation in reference to SL #2371 at http://wiki.sugarlabs.org/go/Dextrose/Resources/Journal-backup. Thank you. Appreciate your support. Regards, Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Request to review documentation required for SL #2372
Team, Wish if you could review documentation in reference to SL #2372 at http://wiki.sugarlabs.org/go/Dextrose/Resources/Journal-restore. Thank you. Appreciate your support. Regards, Anurag ___ 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
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. Regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
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-v2 : Corrected the window of operation v2-v3 : Added the busycursor in the desktop window 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() +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 ___ 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
Team I had submitted the patch for the http://bugs.sugarlabs.org/ticket/2151 You can check the patch at http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027992.html Wish if you could review it and provide me feedback on any improvement required. Regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
When we click on the icon of an activity we see a pulsing icon of that activity before the activity starts and usually there is a time delay between the clicking of the icon and appearance of the pulsing icon , where tha amount of delay differs by the complexity of the icon i.e. more complex the icon is larger is the delay. So In order to minimise the delay we replaced the animation with its raw svg image for the first frame of rendering only there by reducing the rendering timeof the first frame and hence reducing the delay and from the second frame onwards the svg image will be converted into the pulsing icon animation. To stop the pulsing icon from animating for the first frame we stopped the call to the update function for first two times only, as every frame has two update calls associated with it, once the update that preceeds the frame and the other that follows it. --- src/jarabe/view/pulsingicon.py |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) v1-v2 corrected layout according to pep-8 format v2-v3 removed increment operation of variable i in the for loop v3-v4 added the concept of frame skipping v4-v5 changed the first frame of the animation to static svg icon diff --git a/src/jarabe/view/pulsingicon.py b/src/jarabe/view/pulsingicon.py index 43ec358..70040a6 100644 --- a/src/jarabe/view/pulsingicon.py +++ b/src/jarabe/view/pulsingicon.py @@ -30,7 +30,7 @@ class Pulser(object): self._icon = icon self._level = 0 self._phase = 0 - +self._count = 1 def start(self, restart=False): if restart: self._phase = 0 @@ -79,8 +79,9 @@ class Pulser(object): def __pulse_cb(self): self._phase += _STEP self._level = (math.sin(self._phase) + 1) / 2 -self.update() - +if self._count 2: + self.update() +self._count = self._count + 1 return True class PulsingIcon(Icon): -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Patches Review required for SL2151 : Shutdown and Logout menu items should activate the busy cursor (or provide some other visual feedback)
Team, I have submitted a revised patch for SL # 2151 : Shutdown and Logout menu items should activate the busy cursor (or provide some other visual feedback) at http://patchwork.sugarlabs.org/patch/290/ . I would like get this patch reviewed for any errors or improvements so that i can update my next version of the patch. Regards, Anurag Research Engineer SEETA ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
Daniel, Thank you for reviewing the patch. Appreciate it. Wish to inform you that I did try the profiler, and displayed the time slice intervals between rendering of consecutive frames. I did find significant change in the rendering time of first frame. Raw svg icon with colour is timely filled using a sine function, which control its timing, and is updated on every frame of animation. Since, we have a 400 Mhz capacity processor in an XO-1, this has considerable processing lead times associated for completion of the rendering job. My earlier idea of frame dropping is a technique, which can smoothen an already started animation, but does not speed up the start-up. Regards, Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Bug update on ticket no 2080 (Pulsing icon delayed by 5 seconds)
Team, Wish to share on the observations that I gathered on the basis of my discussion with Bernie last evening. It seems that the delay that occurs before the start of the pulsing icon is due to the zoom animation failing to render . We arrived at the idea of using a technique commonly applied in video games i.e. Frame Dropping, where we drop frames in order to maintain the frame rate. Using this idea, I have prepared a patch for SL 2080, and have tried it on my XO-1.5, where it seems to work better. I have tried to skip the animation to the last frame if the fps drops below the defaults fps of 20 , for a smooth animation to occur. Wish if the patch could be reviewed on an XO-1. If I am making mistakes or missing on any key aspect, please share feedback bluntly. Appreciate your support. Thank you. Regards, Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
When we click on the icon of an activity we see a pulsing icon of that activity before the activity starts and usually there is a time delay between the clicking of the icon and appearance of the pulsing icon , where tha amount of delay differs by the complexity of the icon i.e. more complex the icon is larger is the delay. So here we tried to reduce that delay if not completely obliterate it , by making the duration of the first 5 pulses larger and during these 5 times the icon will only be zoomed in and not zoomed out so as to reduce the frame calculation load on the processor, Hence reducing the delay. --- src/sugar/graphics/animator.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) v1-v2 corrected layout according to pep-8 format v2-v3 removed increment operation of variable i in the for loop v3-v4 added the concept of frame skipping diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py index 8fb298b..e3a3503 100644 --- a/src/sugar/graphics/animator.py +++ b/src/sugar/graphics/animator.py @@ -136,7 +136,7 @@ class Animation(object): start = self.start change = self.end - self.start -if t == duration: +if fps 20: # last frame frame = self.end else: -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Bug update on ticket no 2080 (Pulsing icon delayed by 5 seconds)
Daniel, Bernie and James, Appreciate your pointers. Indeed very helpful. Thank you. I tried to reduce the processing load just before the rendering of the first frame in this workflow, and looked for the processor intensive parts (intensive calculations or long recursive function calls) where any possible reduction in the processing may speed up the loading of the pulsing icon. I studied the files as pointed by Bernie (thank you for the explanation) and found the animation aspect to be constituted of only two frames - EASE_IN and EASE_OUT, which take place in an ordered repetitive manner. I was unable to arrive at a solution that was specific to the first frame with the documentation and explanations available. Wish if you could share pointers and strategy on how processor load could be lowered with emphasis on first frame. I suspect that it should lie in jarabe.view.launcher where the animation starts, but have been unable to arrive at an approach for it. Looking forward to your feedback. In reference to the questions on the patch submitted, I tried to reduce the delay by reducing the frame computation of the first five frames. Apologies that I did not consider the processing load that is encountered before the startup of the first frame of the animation of the pulsing icon. Appreciate your support and feedback. Regards Anurag Research Engineer SEETA ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v3 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
When we click on the icon of an activity we see a pulsing icon of that activity before the activity starts and usually there is a time delay between the clicking of the icon and appearance of the pulsing icon , where tha amount of delay differs by the complexity of the icon i.e. more complex the icon is larger is the delay. So here we tried to reduce that delay if not completely obliterate it , by making the duration of the first 5 pulses larger and during these 5 times the icon will only be zoomed in and not zoomed out so as to reduce the frame calculation load on the processor, Hence reducing the delay. --- src/sugar/graphics/animator.py |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) v1-v2 corrected layout according to pep-8 format v2-v3 removed increment operation of variable i in the for loop diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py index 8fb298b..14e45e1 100644 --- a/src/sugar/graphics/animator.py +++ b/src/sugar/graphics/animator.py @@ -140,6 +140,9 @@ class Animation(object): # last frame frame = self.end else: +for i in range(5): +easing = EASE_IN_EXPO +duration = duration * 100 if easing == EASE_OUT_EXPO: frame = change * (-pow(2, -10 * t / duration) + 1) + start elif easing == EASE_IN_EXPO: -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v3 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
When we click on the icon of an activity we see a pulsing icon of that activity before the activity starts and usually there is a time delay between the clicking of the icon and appearance of the pulsing icon , where tha amount of delay differs by the complexity of the icon i.e. more complex the icon is larger is the delay. So here we tried to reduce that delay if not completely obliterate it , by making the duration of the first 5 pulses larger and during these 5 times the icon will only be zoomed in and not zoomed out so as to reduce the frame calculation load on the processor, Hence reducing the delay. --- src/sugar/graphics/animator.py |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) v1 was Reviewed-By: Simon Schampijer simon at schampijer.de v2 was Reviewed-By: Sascha Silbe silbe at sugarlabs.org v2-v3 Corrected Range parameter in the for loop and reformatted the code according to pep-8 diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py index 8fb298b..3121e6e 100644 --- a/src/sugar/graphics/animator.py +++ b/src/sugar/graphics/animator.py @@ -25,7 +25,7 @@ import gobject EASE_OUT_EXPO = 0 EASE_IN_EXPO = 1 - +i = 1 class Animator(gobject.GObject): @@ -140,6 +140,10 @@ class Animation(object): # last frame frame = self.end else: +for i in range(0, 5): +easing = EASE_IN_EXPO +duration = duration * 100 +i = i + 1 if easing == EASE_OUT_EXPO: frame = change * (-pow(2, -10 * t / duration) + 1) + start elif easing == EASE_IN_EXPO: -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v3 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
Sorry , in that case , as I misunderstood the meaning of the tag Reviewed-by and will keep this fact in my mind while making future patches and will certainly remove your name from the reviewed by tag of this patch in its next version. Once again my apologies for the matter. Regards Anurag On Thu, Oct 7, 2010 at 10:17 PM, Sascha Silbe sascha-ml-reply-to-201...@silbe.org wrote: Excerpts from Anurag Chowdhury's message of Fri Oct 08 00:06:02 +0200 2010: v2 was Reviewed-By: Sascha Silbe silbe at sugarlabs.org No, I certainly did NOT give my Reviewed-By on this code. As I already told Ishan [2]: I reviewed it, but since there were things I wanted to be changed, I did not grant my Reviewed-By: tag. The meaning of that tag is that I reviewed the patch _and_ believe it to be fit for inclusion, standing with my reputation behind that judgement (see [1], section 14). Sascha [1] http://www.kernel.org/doc/Documentation/SubmittingPatches [2] https://lists.sugarlabs.org/archive/sugar-devel/2010-September/027376.html -- 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
[Sugar-devel] [PATCH] Pulsing icon delayed by 5 seconds or so SL#2080
When we click on the icon of an activity we see a pulsing icon of that activity before the activity starts and usually there is a time delay between the clicking of the icon and appearance of the pulsing icon , where tha amount of delay differs by the complexity of the icon i.e. more complex the icon is larger is the delay. So here we tried to reduce that delay if not completely obliterate it , by making the duration of the first 5 pulses larger and during these 5 times the icon will only be zoomed in and not zoomed out so as to reducethe frame calculation load on the processor, Hence reducing the delay. --- src/sugar/graphics/animator.py |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py index 8fb298b..2bec8ff 100644 --- a/src/sugar/graphics/animator.py +++ b/src/sugar/graphics/animator.py @@ -25,7 +25,7 @@ import gobject EASE_OUT_EXPO = 0 EASE_IN_EXPO = 1 - +i=1 class Animator(gobject.GObject): @@ -140,6 +140,10 @@ class Animation(object): # last frame frame = self.end else: +for i in range(0,5): + easing = EASE_IN_EXPO + duration = duration*100 + i=i+1 if easing == EASE_OUT_EXPO: frame = change * (-pow(2, -10 * t / duration) + 1) + start elif easing == EASE_IN_EXPO: -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
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() +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 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] need documentation, both in-activity and on the wiki (Ticket #2371)
Hi I had made the documentation for the Bug #2371 and provided the upload link details at *http://bugs.sugarlabs.org/ticket/2371* Please review the document and provide suggestions on any change required. regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] need documentation, both in-activity and on the wiki (Ticket #2372)
Hi I had made the documentation for the Bug #2372 and provided the upload link details at *http://bugs.sugarlabs.org/ticket/2372* Please review the document and provide suggestions on any change required. regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Shutdown and Logout menu items should activate the busy cursor (or provide some other visual feedback) (Ticket #2151)
Hi I had made the Patch for the Bug #2151 *http://patchwork.sugarlabs.org/patch/281/* Please review the Patch and provide suggestions on any change required. regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Pointers required for SL#1742 (after adding a friend the palette doesn't change) ,
What I figured out for this bug is that the bug could be solved only if the shell service has a D-Bus API for buddies. Untill then even the present scenario of one time update during system restart has also been applied through a hack place in sync_friends () in the jarabe.model.friends.pymodule this bug will get wrapped itself when the said api for shell service will get designed then even this sync_friends function would be removed. But I would need some pointers on how to create this dbus api for the present scenario and how will that work through the process to solve this defect. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v3 sugar] Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use).
We changed the cursor in homewindow to a busy cursor when the shutdown menu is activated and used glib.idle_add( ) to break out of the infinite gtk.main() loop to shutdown the system when the processor is idle and untill that time it will show a busy cursor ,hence letting the user know the validity of the shutdown process going on in the backend. --- src/jarabe/view/buddymenu.py | 42 ++ 1 files changed, 34 insertions(+), 8 deletions(-) v1 was Reviewed-By: James Cameron quozl at laptop.org v2 was Reviewed-By: Tomeu Vizosoto...@sugarlabs.org v2-v3 Added detailed description for the bug solution diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..7135d9e 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 jarabe +import glib from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -98,16 +100,40 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() - -def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() + +def __shutdown_activate_cb(self, menu_item): +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.shutdown() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v2 sugar] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
Hello Tomeu , I actually worked upon your suggestion quoted in http://lists.sugarlabs.org/archive/sugar-devel/2010-September/026741.html to solve this bug. Actually I changed the cursor in homewindow this time and used glib.idle_add( ) to break out of the infinite gtk.main() loop to shutdown the system when the processor is idle and untill that time it will show a busy cursor which i think will be the proper method to shutdown while providing a visual confirmation of the process. Please let me know if adding this information in description would be sufficient. If required, I can add more information.Also I will resubmit a new patch which will be more descriptive than this one. Regards, Anurag On Mon, Sep 27, 2010 at 7:21 PM, Tomeu Vizoso to...@sugarlabs.org wrote: On Sat, Sep 25, 2010 at 23:29, Anurag Chowdhury anu...@seeta.in wrote: Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use). Hi Anurag, could you explain what you have changed since the last revision and why? With the information you have made available I would have to guess too much. Thanks, Tomeu --- src/jarabe/view/buddymenu.py | 42 ++ 1 files changed, 34 insertions(+), 8 deletions(-) v1 was Reviewed-By: James Cameron quozl at laptop.org v1-v2: Set the cursor in its appropriate window diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..7135d9e 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 jarabe +import glib from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -98,16 +100,40 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def update_cur(window): + window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() - -def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +def update_cur(window): + window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() + +def __shutdown_activate_cb(self, menu_item): +def update_cur(window): + window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.shutdown() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.2 ___ 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] (no subject)
Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use). changelog: http://lists.sugarlabs.org/archive/sugar-devel/2010-September/026741.html http://lists.sugarlabs.org/archive/sugar-devel/2010-September/026981.html --- src/jarabe/view/buddymenu.py | 42 ++ 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..7135d9e 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 jarabe +import glib from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -98,16 +100,40 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() - -def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() + +def __shutdown_activate_cb(self, menu_item): +def update_cur(window): +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +return False +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.shutdown() +window = jarabe.desktop.homewindow.get_instance() +glib.timeout_add(3, update_cur, window) +glib.idle_add(shut,self,menu_item) +gtk.main() def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.2 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use). --- buddymenu.py |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/buddymenu.py b/buddymenu.py index 0ba6cc1..aaaf608 100644 --- a/buddymenu.py +++ b/buddymenu.py @@ -98,14 +98,17 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): +self.window.get_window(set_cursor (gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.logout() def __reboot_activate_cb(self, menu_item): +self.window.get_window(set_cursor (gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.reboot() def __shutdown_activate_cb(self, menu_item): +self.window.get_window(set_cursor (gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.shutdown() -- 1.7.2.2 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use). --- src/jarabe/view/buddymenu.py |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..6a60c71 100644 --- a/src/jarabe/view/buddymenu.py +++ b/src/jarabe/view/buddymenu.py @@ -98,14 +98,17 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): +self.window.get_window(set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.logout() def __reboot_activate_cb(self, menu_item): +self.window.get_window(set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.reboot() def __shutdown_activate_cb(self, menu_item): +self.window.get_window(set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH))) session_manager = get_session_manager() session_manager.shutdown() -- 1.7.2.2 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
Shutdown (and Logout) menu items should activate the buzzy cursor (or provide some other visual feedback, perhaps dimming/locking the UI from use). --- buddymenu.py |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/buddymenu.py b/buddymenu.py index 0ba6cc1..4e7f501 100644 --- a/buddymenu.py +++ b/buddymenu.py @@ -98,14 +98,17 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): +self.window.set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH) ) # newline session_manager = get_session_manager() session_manager.logout() def __reboot_activate_cb(self, menu_item): +self.window.set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH) ) # newline session_manager = get_session_manager() session_manager.reboot() def __shutdown_activate_cb(self, menu_item): +self.window.set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH) ) # newline session_manager = get_session_manager() session_manager.shutdown() -- 1.7.2.2 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel