Re: [Sugar-devel] F11-0.88 unmerged patches summary
I wonder about performance, as fills on the XO-1 are very slow and if the fading was very smooth it could have a negative impact on the UX. Looks smooth even on my XO-1... Nice! sugar/sl1842-journal-error-messates.patch The review has been swamped by a design discussion. It's not clear what Anish should do to pass review. Do you have a link to the controversy? I agree with Gary's proposal of using only NotifyAlert for the time being. Anish, what do you think? Its fine by me. I'll release the patch later today (NotifyAlert, 20 sec timeout, without an icon). This would be a minimum fix done with the premise that there will be a more detailed discussion on this (and the general sugar notification scheme) in the future.. -- Anish On Fri, Jul 2, 2010 at 10:35 AM, Bernie Innocenti ber...@codewiz.org wrote: El Thu, 01-07-2010 a las 15:02 +0200, Tomeu Vizoso escribió: sugar-toolkit/sl1842-notify-red-alert.patch Correct me if I'm wrong, but I think both Gary and James agreed? I wonder about performance, as fills on the XO-1 are very slow and if the fading was very smooth it could have a negative impact on the UX. Looks smooth even on my XO-1... sugar/sl1842-journal-error-messates.patch The review has been swamped by a design discussion. It's not clear what Anish should do to pass review. Do you have a link to the controversy? I agree with Gary's proposal of using only NotifyAlert for the time being. Anish, what do you think? sugar-toolkit/sl1948-Race-condition-with-name-widget-in-the-activ.patch This patch has a corner case in which it fails to update the activity name, but I think it's still a little better than the current behavior. See ticket for details. I guess you and Simon need to agree on which bad is better. It's hard to dedice which one is less incorrect. I tried to come up with a perfect fix by checking for a title change one more time from the Stop button, which sounds like a straightforward approach. However, I quickly got to a difficulty that I couldn't solve without breaking encapsulation or subverting the design: the Stop button and the TitleEntry widgets don't know about each other, but StopButton would have to peek into TitleEntry to find what the current title is. Because many activities build the activity toolbar manually, one widget at a time, there's no way to ensure that the StopButton instance will have a reference to TitleEntry instance. Perhaps Gtk offers an easy way to find other widgets by name in the widget tree of a window, but it smells like a horrible kludge. Eventually, I gave up on this approach because it seemed overly complicated for fixing this bug. You know Gtk much better than me: is it possible that there's no sure way to get notified when the user has finished editing a gtk.Entry? The editing-done signal implemented by the GtkCellEditable sounds perfect, but it only fires when the user presses enter in the widget so it's useless for us. sugar/add-font-dpi-schema.patch This is a companion patch of a fix sugar-settings-manager which has already landed in git. It's needed by xulrunner (Browse). Would be good if the commit message said why is that needed, or at least have a link to the ticket. sugar/avoid-popping-an-empty-list-in-the-software-updater.patch Works, but James Cameron's posted a better counter-patch. Merge that one. sugar/click-on-journal-icons-with-a-exclusive-time-frame.patch Requested by the Waveplace folks. Please merge. What happened to the check for activity_id? We have it in other places in the UI with the similar issue. You mean in the Activity() class of jarabe? It seems that activity_id gets initialized after the activity brings up its window, which leaves several seconds of time for a user to open two instances with a double-click. (I'm not very familiar with this code, excuse me if I'm misunderstanding the context) sugar/use-the-spanish-verb-quitar-for-unmounting-devices.patch Better-than-nothing patch, but the real fix would require a gettext kludge in the code (see http://bugs.python.org/issue2504 ) Shouldn't we make the change in Pootle? Or it will be synced automatically? Good question, I don't know if Pootle syncs bidirectionally. I would expect it to, but better ask Sayamindu. Or maybe we should go with the kludge as the real fix is most likely to not land in 2.x. Indeed. (though the bug has been moving forward a little) sugar/backup-0001-Volumes-Backup-and-Restore.patch sugar/backup-0002-Journal-XS-backup-and-restore.patch There are concerns about restore deleting new entries since the last backup. I agree, but since nobody seems to have the time to implement and test a more sophisticated procedure, at this time this is the best restore feature we have for Sugar. Do we know any other deployment willing to deploy this? The original code was contributed by
Re: [Sugar-devel] Restoring the journal from an 0.82 image
Excerpts from Luis Michelena's message of Thu Jul 01 23:50:12 + 2010: I have reflashed my XO (bettie given by Erik Garrisonhttp://www.facebook.com/profile.php?id=3802ref=searchafter his layout from olpc) with the 0.88 beta image(I have another, but has the Uruguayan ofw keys), and I'm amazed by the improvements. Thanks (on behalf of all developers) for this praise! But I'd would like to restore the 0.82 journal to the new configuration, is the journal format in 0.82 compatible with 0.88?, to try to backport the backup/restore scripts to the 0.82? The best way is to just copy the entire home directory (or at least ~/.sugar) before the first start of the new version. The old data store will be automatically detected and imported (migrated). As you have already run the new version, there are basically two options: 1. You don't care about anything you have done since you upgraded. In this case just remove everything in the new home directory and copy over the old one. 2. You want to keep the new configuration (wireless network secrets etc.) and data store entries while importing the old data store entries. You need to copy over .sugar/default/datastore from the old home directory to the new one, _without_ removing this directory in the new home directory. After copying, remove .sugar/default/datastore/version to trigger a migration of 0.82 data store entries on next start of Sugar. Sugar must NOT be running while you are doing these operations. At the moment, I'm loop(mtdblock and block2mtd ) mounting the 0.82 image, but I haven't figured out how to copy the journal. No idea why you need mtdblock and block2mtd. I use this fstab entry on my XO-1s to mount the NAND flash (all my installations are on external SD cards or use NFS root): mtd0/media/nand jffs2 defaults,noatime 0 0 Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Error messages in Sugar (was: Re: F11-0.88 unmerged patches summary)
Excerpts from Anish Mangal's message of Thu Jul 01 21:01:17 + 2010: Ok, how about a normal alert (no fancy colors), that doesn't get timed out, and displays an error icon beside the text. +1 Unlike notifications (e.g. download started/finished), error messages should never time out. The user needs to know about them, even if the error happened while transferring a large file and they went fetching a cup of tea in the meantime. Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Fwd: Statistics on each release
This could be interesting to have one day: http://people.gnome.org/~shaunm/pulse/web/ Regards, Tomeu -- Forwarded message -- From: Shaun McCance sha...@gnome.org Date: Fri, Jul 2, 2010 at 01:04 Subject: Re: Statistics on each release To: Germán Póo-Caamaño g...@gnome.org Cc: release-t...@gnome.org, GNOME Desktop Devel desktop-devel-l...@gnome.org On Thu, 2010-07-01 at 14:35 -0700, Germán Póo-Caamaño wrote: On Thu, 2010-07-01 at 14:21 -0300, Jonh Wendell wrote: Hello guys, I just read a xorg release announcement and found quite interesting their statistics not only about people but also about companies behind committers: http://lists.x.org/archives/xorg-devel/2010-July/010706.html Wouldn't be nice to have this in GNOME releases? :) Indeed. But there are some differences and it requires a bit more work. It is easier to run gitdm against Linux or Xorg or Python or OOo or whatever because there is *one* 'module' involved. But in GNOME we have dozens of modules involved, so it is required to consolidate the data. Which is what Blip (née Pulse) does: http://people.gnome.org/~shaunm/pulse/web/ It could easily generate reports like these. I know it feels kind of like vaporware, given how long I've been working on it without a deployment. But the code is pretty solid. It wouldn't take too much to get it running. -- Shaun ___ desktop-devel-list mailing list desktop-devel-l...@gnome.org http://mail.gnome.org/mailman/listinfo/desktop-devel-list ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] F11-0.88 unmerged patches summary
Excerpts from Bernie Innocenti's message of Fri Jul 02 05:05:25 + 2010: sugar-toolkit/sl1948-Race-condition-with-name-widget-in-the-activ.patch This patch has a corner case in which it fails to update the activity name, but I think it's still a little better than the current behavior. See ticket for details. [...] You know Gtk much better than me: is it possible that there's no sure way to get notified when the user has finished editing a gtk.Entry? The editing-done signal implemented by the GtkCellEditable sounds perfect, but it only fires when the user presses enter in the widget so it's useless for us. FWIW, in an unrelated project I'm using the changed signal and have not noticed any missing updates so far (except for SpinButtons which should have been fixed in GTK by now IIRC). Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] fixes sl#2062
Excerpts from Tim McNamara's message of Fri Jul 02 02:09:17 + 2010: Index: src/jarabe/desktop/favoritesview.py === --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -323,6 +323,12 @@ except RegisterError, e: alert.props.title = _('Registration Failed') alert.props.msg = _('%s') % e +except TypeError: +# raised by xmlrpclib.py when XO attempts to +# register itelf while offline: sl#2062 +alert.props.title = _('Registration Failed') +alert.props.msg = _('Please try connecting to '\ + 'the network.') else: alert.props.title = _('Registration Successful') alert.props.msg = _('You are now registered ' \ TypeError should be catched in jarabe.desktop.schoolserver.register_laptop() and rethrown as a RegisterError. Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Restoring the journal from an 0.82 image
On Fri, Jul 2, 2010 at 01:50, Luis Michelena luis.michel...@gmail.com wrote: I have reflashed my XO (bettie given by Erik Garrison after his layout from olpc) with the 0.88 beta image(I have another, but has the Uruguayan ofw keys), and I'm amazed by the improvements. But I'd would like to restore the 0.82 journal to the new configuration, is the journal format in 0.82 compatible with 0.88?, to try to backport the backup/restore scripts to the 0.82? At the moment, I'm loop(mtdblock and block2mtd ) mounting the 0.82 image, but I haven't figured out how to copy the journal. Hi Luis, if you replace ~/.sugar/default/datastore with the contents of the 0.82 journal it should update it to the new DS format on reboot. If it doesn't, it is a very important bug to report. Thanks, Tomeu Thanx, Luis ___ 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] [PATCH] Add cpu and memory resource indicator to frame
Excerpts from anishmangal2002's message of Thu Jul 01 15:03:16 + 2010: [class DeviceView(TrayIcon)] +def __init__(self): +icon_name = 'computer' + +client = gconf.client_get_default() +color = XoColor(client.get_string('/desktop/sugar/user/color')) +TrayIcon.__init__(self, icon_name=icon_name, xo_color=color) I wonder if we should make the owner color the default for a TrayIcon. (Nothing to be changed in your patch, just something for the core devs to think about) +def create_palette(self): +palette = ResourcePalette(_('System Resources')) Should Resources be lower case instead? (Question to native english speakers) +def __button_release_event_cb(self, widget, event): +return True + +def __expose_event_cb(self, *args): +pass Why do you connect these signals if you don't use them? Or is there some side effect I'm missing? [class ResourcePalette(Palette)] +def __init__(self, primary_text): [...] +gobject.timeout_add(1000, self.__timer_cb) The use of polling (i.e. a timer) seems to be necessary as /proc/stat doesn't provide a better interface. (I.e. the way you do it is fine) +def __getTimeList(self): Single underscore should suffice. No one is going to subclass this, and even then it's not something that needs protection from being overridden in the subclass. +statFile = file(/proc/stat, r) Tomeu will nag you about vs. '' ;) (always use '' unless there's an apostrophe in the string itself). +timeList = statFile.readline().split( )[2:6] +statFile.close() +for i in range(len(timeList)) : +timeList[i] = int(timeList[i]) +return timeList Personally I'd prefer: return [int(count) for count in file('/proc/stat').readline().split()[2:6]] Tomeu might disagree as he tends to consider list comprehensions (especially with more than one line) as harder to understand. Please document what exactly __get_TimeList() does, including what the returned values mean. (use a docstring) +def __timer_cb(self): +if self.updating: +# Computing CPU usage statistics If you factor this out into a separate function, you can turn this comment into a DocString and elaborate on exactly what you are computing. I didn't understand it even after looking up the syntax of /proc/stat. +self.proc_stat_new = self.__getTimeList() If you make all the other attributes private, you should make proc_stat_* private as well. You can probably even git rid of storing proc_stat_new in the instance at all - it doesn't need to be accessible across iterations (= timer callback invocations). +for i in range(len(self.proc_stat_new)) : +self.proc_stat_new[i] -= self.proc_stat_old[i] A better set of variable names might help understanding what this does and why it is necessary (/proc/stat entries are absolute times in USER_HZ units). cpu_time_counts might be a start. +cpu_free = (self.proc_stat_new[len(self.proc_stat_new) - 1] * 100.00 / +sum(self.proc_stat_new)) This equates to (iowait * 100) / (user + nice + system + idle + iowait), so it's the percentage of time spent in iowait. I don't think it's a useful figure for how busy (or idle) the CPU is. If we decide not to split up iowait (it indicates permanent storage activity, which we don't have an indicator for on XO-1) and idle, we should at least add them: cpu_times_current = [new - old for new, old in zip(cpu_time_counts_new, self._cpu_time_counts)] user, nice, system, idle, iowait = cpu_times_current cpu_free = (idle + iowait) * 100 / sum(cpu_times_current) BTW: the len(...) call is superfluous. In Python negative indices are interpreted relative to the end of the list. [...] +self.proc_stat_old = self.__getTimeList() This is a race condition (/proc/stat might have been updated since you read it). Use the old return value instead. +def __popup_cb(self, gobject): +self.updating = True + +def __popdown_cb(self, gobject): +self.updating = False Please stop the timer instead. Calculating values while we don't need them wastes energy and will prevent the CPU from entering low-power states (i.e. auto-suspend) in the future. +def __percentage_memory_available(self): + Please remove the extra empty line. +for line in file('/proc/meminfo').readlines(): You don't need readlines() here, a file is an iterator itself (and will return one line per iteration). +name, value, unit = line.split()[:3] +if 'MemTotal:' == name: total = value +elif 'MemFree:' == name: free = value +elif 'Buffers:' == name: buffers = value +elif 'Cached:' == name: cached = value +elif 'Active:' == name: break + +return 100 *
Re: [Sugar-devel] [PATCH] Add cpu and memory resource indicator to frame
On 2 July 2010 22:03, Sascha Silbe sascha-ml-ui-sugar-de...@silbe.orgwrote: +def create_palette(self): +palette = ResourcePalette(_('System Resources')) Should Resources be lower case instead? (Question to native english speakers) Title Case is often used in headings, but use of capital letters is generally frowned upon in modern English. In this context, it seems fine. System resources is unlikely to be contentious. Tim ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Error messages in Sugar (was: Re: F11-0.88 unmerged patches summary)
On Fri, Jul 2, 2010 at 3:23 AM, Sascha Silbe sascha-ml-ui-sugar-de...@silbe.org wrote: Excerpts from Anish Mangal's message of Thu Jul 01 21:01:17 + 2010: Ok, how about a normal alert (no fancy colors), that doesn't get timed out, and displays an error icon beside the text. +1 Unlike notifications (e.g. download started/finished), error messages should never time out. The user needs to know about them, even if the error happened while transferring a large file and they went fetching a cup of tea in the meantime. I am trying to envision a classroom of first graders fetching a cup of tea:) david ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Add cpu and memory resource indicator to frame
i know people don't like to think about queues, and load averages, but the unix load average numbers give a much better picture of how hard your system is being asked to work than instantaneous CPU utilization. CPU utilization makes for pretty bar graphs though, so i suppose it will always win. as an extra benefit, the 1-minute load average is pre-calculated, available with a read of a single field from /proc/loadavg. paul sascha wrote: +self.proc_stat_new = self.__getTimeList() If you make all the other attributes private, you should make proc_stat_* private as well. You can probably even git rid of storing proc_stat_new in the instance at all - it doesn't need to be accessible across iterations (= timer callback invocations). +for i in range(len(self.proc_stat_new)) : +self.proc_stat_new[i] -= self.proc_stat_old[i] A better set of variable names might help understanding what this does and why it is necessary (/proc/stat entries are absolute times in USER_HZ units). cpu_time_counts might be a start. +cpu_free = (self.proc_stat_new[len(self.proc_stat_new) - 1] * 100.00 / +sum(self.proc_stat_new)) This equates to (iowait * 100) / (user + nice + system + idle + iowait), so it's the percentage of time spent in iowait. I don't think it's a useful figure for how busy (or idle) the CPU is. If we decide not to split up iowait (it indicates permanent storage activity, which we don't have an indicator for on XO-1) and idle, we should at least add them: cpu_times_current = [new - old for new, old in zip(cpu_time_counts_new, self._cpu_time_counts)] user, nice, system, idle, iowait = cpu_times_current cpu_free = (idle + iowait) * 100 / sum(cpu_times_current) =- paul fox, p...@laptop.org ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Add cpu and memory resource indicator to frame
Excerpts from Paul Fox's message of Fri Jul 02 12:36:43 + 2010: i know people don't like to think about queues, and load averages, but the unix load average numbers give a much better picture of how hard your system is being asked to work than instantaneous CPU utilization. In my experience both numbers are useful, and neither one suffices on its own. The load is more accurate if there are lots of short-lived processes (e.g. building software), whereas iowait and idle give a clearer picture of how busy the CPU is and whether it's the CPU or the permanent storage that's slowing down the system. I have all three load figures in the status bar of my window manager, but often fire up top to look at idle and iowait. So I'm not sure what to choose for Sugar. Maybe colour-code the load in the CPU progress bar? (only half-joking) Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Add cpu and memory resource indicator to frame
This patch adds an icon to the frame, whose palette menu displays the memory and cpu resources. For computing free memory, the code reads the /proc/meminfo file (thanks quozl) and for computing cpu usage, the code reads the /proc/stat file. The palette menu entries are only updated (in one second intervals) when the palette menu is visible thus possibly saving cpu cycles. Signed-off-by: anishmangal2002 anishmangal2...@gmail.com --- extensions/deviceicon/Makefile.am |3 +- extensions/deviceicon/resources.py | 159 2 files changed, 161 insertions(+), 1 deletions(-) create mode 100644 extensions/deviceicon/resources.py diff --git a/extensions/deviceicon/Makefile.am b/extensions/deviceicon/Makefile.am index 8a2e765..038c059 100644 --- a/extensions/deviceicon/Makefile.am +++ b/extensions/deviceicon/Makefile.am @@ -5,4 +5,5 @@ sugar_PYTHON = \ battery.py \ network.py \ speaker.py \ - volume.py + volume.py \ + resources.py diff --git a/extensions/deviceicon/resources.py b/extensions/deviceicon/resources.py new file mode 100644 index 000..ab3fc08 --- /dev/null +++ b/extensions/deviceicon/resources.py @@ -0,0 +1,159 @@ +# Copyright (C) Anish Mangal anishmangal2...@gmail.com +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + +import logging +import gobject +import gtk +import gconf +import os + +from sugar.graphics.tray import TrayIcon +from sugar.graphics.xocolor import XoColor +from sugar.graphics.palette import Palette +from sugar.graphics import style +from jarabe.frame.frameinvoker import FrameWidgetInvoker + +class DeviceView(TrayIcon): + +FRAME_POSITION_RELATIVE = 500 + +def __init__(self): +icon_name = 'computer' + +client = gconf.client_get_default() +color = XoColor(client.get_string('/desktop/sugar/user/color')) +TrayIcon.__init__(self, icon_name=icon_name, xo_color=color) +self.set_palette_invoker(FrameWidgetInvoker(self)) + +def create_palette(self): +palette = ResourcePalette(_('System resources')) +palette.set_group_id('frame') +return palette + +class ResourcePalette(Palette): + +def __init__(self, primary_text): +Palette.__init__(self, label=primary_text) + +self.connect('popup', self._popup_cb) +self.connect('popdown', self._popdown_cb) + +self._popped_up = False +self._cpu_times = self._get_cpu_times_list() + +vbox = gtk.VBox() +self.set_content(vbox) + +self._cpu_text = gtk.Label() +vbox.pack_start(self._cpu_text, padding=10) +self._cpu_text.show() + +self._cpu_bar = gtk.ProgressBar() +self._cpu_bar.set_size_request( +style.zoom(style.GRID_CELL_SIZE * 4), -1) +vbox.pack_start(self._cpu_bar, padding=10) +self._cpu_bar.show() + +self._memory_text = gtk.Label() +vbox.pack_start(self._memory_text, padding=10) +self._memory_text.show() + +self._memory_bar = gtk.ProgressBar() +self._memory_bar.set_size_request( +style.zoom(style.GRID_CELL_SIZE * 4), -1) +vbox.pack_start(self._memory_bar, padding=10) +self._memory_bar.show() + +vbox.show() + +def _get_cpu_times_list(self): +Return various cpu times as read from /proc/stat + +This method returns the following cpu times as an ordered +list of numbers - [user, nice, system, idle, iowait] where, + +user: normal processes executing in user mode +nice: niced processes executing in user mode +system: processes executing in kernel mode +idle: twiddling thumbs +iowait: waiting for I/O to complete + + +return [int(count) + for count in file('/proc/stat').readline().split()[1:6]] + +def _percentage_cpu_available(self): + +Return free CPU resources as a percentage + + +_cpu_times_new = self._get_cpu_times_list() +_cpu_times_current = [(new - old) +for new, old in zip(_cpu_times_new, +self._cpu_times)] +user, nice, system, idle, iowait = _cpu_times_current +cpu_free = (idle + iowait) *
Re: [Sugar-devel] Schoolserver icon
On Tue, 29 Jun 2010 21:53:59 +0100, Gary Martin garycmar...@googlemail.com wrote: On 29 Jun 2010, at 15:39, Martin Langhoff martin.langh...@gmail.com wrote: On Mon, Jun 28, 2010 at 6:57 PM, Bernie Innocenti ber...@codewiz.org wrote: El Mon, 28-06-2010 a las 21:36 +0100, Gary Martin escribió: A joke right? Something I missed from the early days? No joke! Sugar Labs is actually a masonic lodge. Oops, now I'll have to kill you. *I actually got questions about masonic influence on our UI design.* Not kidding... Anyway - there's a nice school at the 1 minute mark in this video - http://www.dailymotion.com/video/x7ft2t_olpc-mission-video-part-1_tech Thanks for the pointer, yea that works, a little like the top right 'with bell' attempt on my last sheet. I worried that one would be seen as too church like. I think that one looks really good :) Would you mind sending me the svg version? Regards, --Gary m -- martin.langh...@gmail.com mar...@laptop.org -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Schoolserver icon
On Fri, Jul 2, 2010 at 11:10 AM, Martin Abente mabe...@paraguayeduca.org wrote: On Tue, 29 Jun 2010 21:53:59 +0100, Gary Martin garycmar...@googlemail.com wrote: On 29 Jun 2010, at 15:39, Martin Langhoff martin.langh...@gmail.com wrote: On Mon, Jun 28, 2010 at 6:57 PM, Bernie Innocenti ber...@codewiz.org wrote: El Mon, 28-06-2010 a las 21:36 +0100, Gary Martin escribió: A joke right? Something I missed from the early days? No joke! Sugar Labs is actually a masonic lodge. Oops, now I'll have to kill you. *I actually got questions about masonic influence on our UI design.* Not kidding... Anyway - there's a nice school at the 1 minute mark in this video - http://www.dailymotion.com/video/x7ft2t_olpc-mission-video-part-1_tech Thanks for the pointer, yea that works, a little like the top right 'with bell' attempt on my last sheet. I worried that one would be seen as too church like. I think that one looks really good :) Would you mind sending me the svg version? Regards, --Gary m -- martin.langh...@gmail.com mar...@laptop.org -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel I was fiddling with the icon. I took the device approach. A school server may not be at a school :-) Drew XS in some overlapping fashion, and then drew a box on it (the server). Couldn't see the S anymore, so deleted it. The result is a X peeking from behind the box. I used Comic Sans to do a rounded X. Could also be rounded like the XO icon's X. Could also have a line highlight like the XO icon, I suppose. Sameer -- Dr. Sameer Verma, Ph.D. Associate Professor, Information Systems Director, Campus Business Solutions San Francisco State University http://verma.sfsu.edu/ http://opensource.sfsu.edu/ http://cbs.sfsu.edu/ http://is.sfsu.edu/ attachment: xs-icon.pngattachment: xs-icon.svg___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [sugar-artwork] Revert to GTK_WIDGET_IS_SENSITIVE() macro
Hello, On Thu, 2010-07-01 at 07:59 -0400, Bernie Innocenti wrote: This is needed to build sugar-artwork on the older versions of GTK. When OLPC moves away from Fedora 11, we can drop backwards compatibility. Signed-off-by: Bernie Innocenti ber...@codewiz.org Sounds good. We are using some deprecated macros already anyways. Benjamin ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Journal:show error message on write failure: #1842
volumestoolbar.py now catches the IOError and ValueError exceptions and emits 'volume-error'signal. This signal is caught in journalactivity.py which displays the error as an ErrorAlert message. Signed-off-by: anishmangal2002 anishmangal2...@gmail.com --- src/jarabe/journal/journalactivity.py | 16 src/jarabe/journal/volumestoolbar.py | 22 +- 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py index 0559560..eab292b 100644 --- a/src/jarabe/journal/journalactivity.py +++ b/src/jarabe/journal/journalactivity.py @@ -27,6 +27,9 @@ import statvfs import os from sugar.graphics.window import Window +from sugar.graphics.alert import ErrorAlert +from sugar.graphics.icon import Icon + from sugar.bundle.bundle import ZipExtractException, RegistrationException from sugar import env from sugar.activity import activityfactory @@ -138,6 +141,17 @@ class JournalActivity(Window): self._critical_space_alert = None self._check_available_space() +def _alert_notify_cb(self, gobject, strerror, severity): +alert = ErrorAlert() +alert.props.title= severity +alert.props.msg = strerror +alert.connect('response', self._alert_response_cb) +self.add_alert(alert) +alert.show() + +def _alert_response_cb(self, alert, response_id): +self.remove_alert(alert) + def __realize_cb(self, window): wm.set_bundle_id(window.window, _BUNDLE_ID) activity_id = activityfactory.create_activity_id() @@ -161,6 +175,8 @@ class JournalActivity(Window): self._volumes_toolbar = VolumesToolbar() self._volumes_toolbar.connect('volume-changed', self.__volume_changed_cb) +self._volumes_toolbar.connect('volume-error', self._alert_notify_cb, + 'Error') self._main_view.pack_start(self._volumes_toolbar, expand=False) search_toolbar = self._main_toolbox.search_toolbar diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py index 74b974c..a6acebe 100644 --- a/src/jarabe/journal/volumestoolbar.py +++ b/src/jarabe/journal/volumestoolbar.py @@ -35,6 +35,9 @@ class VolumesToolbar(gtk.Toolbar): __gsignals__ = { 'volume-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, + ([str])), +'volume-error': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, ([str])) } @@ -81,6 +84,7 @@ class VolumesToolbar(gtk.Toolbar): button = VolumeButton(mount) button.props.group = self._volume_buttons[0] button.connect('toggled', self._button_toggled_cb) +button.connect('volume-error', self._volume_error_cb) position = self.get_item_index(self._volume_buttons[-1]) + 1 self.insert(button, position) button.show() @@ -90,6 +94,9 @@ class VolumesToolbar(gtk.Toolbar): if len(self.get_children()) 1: self.show() +def _volume_error_cb(self, button, strerror): +self.emit('volume-error', strerror) + def _button_toggled_cb(self, button): if button.props.active: self.emit('volume-changed', button.mount_point) @@ -123,6 +130,12 @@ class VolumesToolbar(gtk.Toolbar): button.props.active = True class BaseButton(RadioToolButton): +__gsignals__ = { +'volume-error': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + ([str])) +} + def __init__(self, mount_point): RadioToolButton.__init__(self) @@ -137,7 +150,14 @@ class BaseButton(RadioToolButton): info, timestamp): object_id = selection_data.data metadata = model.get(object_id) -model.copy(metadata, self.mount_point) +try: +model.copy(metadata, self.mount_point) +except IOError as (errno, strerror): +logging.error('BaseButton._drag_data_received_cb: IOError: %s; %s' % (errno, strerror)) +self.emit('volume-error', strerror) +except ValueError as (strerror): +logging.error('BaseButton._drag_data_received_cb: ValueError: %s' % (strerror)) +self.emit('volume-error', strerror) class VolumeButton(BaseButton): def __init__(self, mount): -- 1.7.0.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] Add ErrorAlert inherited from Alert
Adds the ErrorAlert class which is an alert inherited from the base Alert class. This is very similar to the ConfirmationAlert class with the difference being that it only displays an 'Ok' button in the Alert popup. Signed-off-by: anishmangal2002 anishmangal2...@gmail.com --- src/sugar/graphics/alert.py | 44 +++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/src/sugar/graphics/alert.py b/src/sugar/graphics/alert.py index 4441909..4dfa515 100644 --- a/src/sugar/graphics/alert.py +++ b/src/sugar/graphics/alert.py @@ -290,6 +290,50 @@ class ConfirmationAlert(Alert): self.add_button(gtk.RESPONSE_OK, _('Ok'), icon) icon.show() +class ErrorAlert(Alert): + +This is a ready-made one button (Ok) alert. + +An error alert is a nice shortcut from a standard Alert because it +comes with the 'OK' button already built-in. When clicked, the +'OK' button will emit a response with a response_id of gtk.RESPONSE_OK. + +Examples + + +.. code-block:: python + from sugar.graphics.alert import ErrorAlert + ... + Method: _alert_error, create a Error alert (with ok + button standard) +# and add it to the UI. +def _alert_error(self): +alert = ErrorAlert() +alert.props.title=_('Title of Alert Goes Here') +alert.props.msg = _('Text message of alert goes here') +alert.connect('response', self._alert_response_cb) +self.add_alert(alert) + + + Method: _alert_response_cb, called when an alert object throws a + response event. +def _alert_response_cb(self, alert, response_id): +#remove the alert from the screen, since either a response button +#was clicked or there was a timeout +self.remove_alert(alert) + +#Do any work that is specific to the response_id. +if response_id is gtk.RESPONSE_OK: +print 'Ok Button was clicked. Do any work upon ok here ...' + + + +def __init__(self, **kwargs): +Alert.__init__(self, **kwargs) + +icon = Icon(icon_name='dialog-ok') +self.add_button(gtk.RESPONSE_OK, _('Ok'), icon) +icon.show() class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem): An icon with a round border -- 1.7.0.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Add cpu and memory resource indicator to frame
On Fri, Jul 02, 2010 at 08:47:28PM +0530, anishmangal2002 wrote: +def __timer_cb(self): +# Get free CPU resources [...] +# Get free memory resources [...] +# Update CPU and Memory labels and progressbars [...] + +# Keep invoking this method if we are popped up +return self._popped_up + +def _popup_cb(self, gobject_ref): +gobject.timeout_add(1000, self.__timer_cb) +self._popped_up = True + +def _popdown_cb(self, gobject_ref): +# Kill timer if we are not popped up +self._popped_up = False I'm a bit worried about this. 0. you have a potential race that may occur if execution is stalled by system load between timeout_add and _popped_up = True, which would lead to __timer_cb being called only once, ... mostly harmless, but untidy, 1. the timeout is not removed until it is called, and a new timeout is added on every popup ... which means that if I press the frame key many times in one second there could be many timeouts scheduled and executed, and while this is also mostly harmless it is unnecessary, 2. the information on the frame is still old when popup occurs, and is not updated until one second later. Instead, I recommend this: a. save the timeout id returned by the timeout_add call, and use it in the _popdown_cb to gobject.source_remove the timer, rather than use a flag _popped_up, b. call __timer_cb once from _popup_cb, before timeout_add, Thus: def _popup_cb(self, gobject_ref): self.__timer_cb() self._timer = gobject.timeout_add(1000, self.__timer_cb) def _popdown_cb(self, gobject_ref): gobject.source_remove(self._timer) (and delete self._popped_up everywhere) -- 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] Schoolserver icon
The door and the bell could both be solid stroke-colored fills. That would give it a simpler overall shape and likely allow the bell to be more legible at the size. Eben On Fri, Jul 2, 2010 at 7:41 PM, Gary Martin garycmar...@googlemail.comwrote: Hi Martin, On 2 Jul 2010, at 19:10, Martin Abente wrote: On Tue, 29 Jun 2010 21:53:59 +0100, Gary Martin garycmar...@googlemail.com wrote: On 29 Jun 2010, at 15:39, Martin Langhoff martin.langh...@gmail.com wrote: On Mon, Jun 28, 2010 at 6:57 PM, Bernie Innocenti ber...@codewiz.org wrote: El Mon, 28-06-2010 a las 21:36 +0100, Gary Martin escribió: A joke right? Something I missed from the early days? No joke! Sugar Labs is actually a masonic lodge. Oops, now I'll have to kill you. *I actually got questions about masonic influence on our UI design.* Not kidding... Anyway - there's a nice school at the 1 minute mark in this video - http://www.dailymotion.com/video/x7ft2t_olpc-mission-video-part-1_tech Thanks for the pointer, yea that works, a little like the top right 'with bell' attempt on my last sheet. I worried that one would be seen as too church like. I think that one looks really good :) Would you mind sending me the svg version? Sure. I've attached a SVG that is a (close) reproduction of the school with bell tower as shown in the OLPC promotional video (and similar to the top right icon from my previous email set). The one major change was to make proper use of fill and stroke colour, not just a single fill silhouette. The school-server icon needs to show colour identity in the neighbourhood, just like other objects. Martin (Langhoff): Can you confirm the server does pass some unique identity that could be used to set the icon fill and stroke identity colours? Sorry I don't know enough about the registration/ident. server process. Here's what it looks like in different colours at a small (close to neighbourhood view), and a larger size: Shout if you want changes/tweaks. Hope it's of use. Regards, --Gary Regards, --Gary m -- martin.langh...@gmail.com mar...@laptop.org -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Schoolserver icon
Ah, I see now. At first glance at the previous iteration I thought that it was just the stroke of a bell shape; I didn't read the bell within the arch. I do like that idea, actually, but this version does read more clearly. It looks great! I'm not sure if this would be any better or not, but have you tried a solid stroke-color cap on the steeple? You could also widen the steeple a bit to make the bell even larger for clarity. (These are just what ifs, though, not recommendations…it already looks great.) Eben On Fri, Jul 2, 2010 at 10:02 PM, Gary Martin garycmar...@googlemail.comwrote: On 3 Jul 2010, at 01:42, Eben Eliason wrote: The door and the bell could both be solid stroke-colored fills. That would give it a simpler overall shape and likely allow the bell to be more legible at the size. Eben Thanks for the feedback, good call! Regards, --Gary On Fri, Jul 2, 2010 at 7:41 PM, Gary Martin garycmar...@googlemail.com wrote: Hi Martin, On 2 Jul 2010, at 19:10, Martin Abente wrote: On Tue, 29 Jun 2010 21:53:59 +0100, Gary Martin garycmar...@googlemail.com wrote: On 29 Jun 2010, at 15:39, Martin Langhoff martin.langh...@gmail.com wrote: On Mon, Jun 28, 2010 at 6:57 PM, Bernie Innocenti ber...@codewiz.org wrote: El Mon, 28-06-2010 a las 21:36 +0100, Gary Martin escribió: A joke right? Something I missed from the early days? No joke! Sugar Labs is actually a masonic lodge. Oops, now I'll have to kill you. *I actually got questions about masonic influence on our UI design.* Not kidding... Anyway - there's a nice school at the 1 minute mark in this video - http://www.dailymotion.com/video/x7ft2t_olpc-mission-video-part-1_tech Thanks for the pointer, yea that works, a little like the top right 'with bell' attempt on my last sheet. I worried that one would be seen as too church like. I think that one looks really good :) Would you mind sending me the svg version? Sure. I've attached a SVG that is a (close) reproduction of the school with bell tower as shown in the OLPC promotional video (and similar to the top right icon from my previous email set). The one major change was to make proper use of fill and stroke colour, not just a single fill silhouette. The school-server icon needs to show colour identity in the neighbourhood, just like other objects. Martin (Langhoff): Can you confirm the server does pass some unique identity that could be used to set the icon fill and stroke identity colours? Sorry I don't know enough about the registration/ident. server process. Here's what it looks like in different colours at a small (close to neighbourhood view), and a larger size: Shout if you want changes/tweaks. Hope it's of use. Regards, --Gary Regards, --Gary m -- martin.langh...@gmail.com mar...@laptop.org -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Clocks on XOs
Was: Subject: =?ISO-8859-1?Q?Caacup=E9?= war bullettin -- day 1 ber...@codewiz.org said: * Date not being updated One laptop booted with clock set to the Epoch. Is that one of the old XOs that had troubles with the tiny battery feeding the TOY/RTC clock when the main battery and wall power are both disconnected? I forget the details, but I think there was a problem with the battery holder. Oddly, the lease was accepted anyway. We need to figure out why the clock is not being updated from the network. NetworkManager used to call ntpdate when it setup a connection. Was that an OLPC addition? I think this area gets tangled up with security and lease checking. Do we want/need two separate modes, one for the secure case and another for developers without a school server? What are the school servers doing to keep their clocks reasonable? Why aren't we using ntp? ntp is probably overkill for XOs. Besides, who would want to give up that much ram? On top of that, ntpd doesn't get along with power saving mode. Aside from quirks like this one, is time on the XO normally good enough? -- These are my opinions, not necessarily my employer's. I hate spam. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Question about slider key codes
Thanks James for the tests! Anybody knows where is the definition of the keyboard to enable the use of Fn + slider keys? Gonzalo On Fri, Jul 2, 2010 at 2:48 AM, James Cameron qu...@laptop.org wrote: G'day, That's a good question, I confirm your observations, and I agree that it will be something between the keyboard and the kernel if you want fn to work. I've tested just now, with os205 on XO-1.5. The slider keys individually provide Pygame key events for key down and key up. Pressing slider key 1 and 4 at the same time results in four events; two for each key. This is expected. Pressing any combination of a slider key and the immediately adjacent slider key generates only two events for one key. This is odd. There is an area between key 1 and key 2 where you can press down with normal force and no events are generated. Also, pressing fn with any slider key gives no event at all. For Pygame. Also, in text console, running showkey shows events for slider keys, but no events for fn key. Slider key events stop if fn is pressed. So I guess that it isn't possible to capture events in the way Walter suggested. This is also verified using test /keyboard at the ok prompt. fn works fine, but repeated presses on the slider at various points shows the isolation behaviour; you can't press two at once easily. If you press very hard, you can get two at once. Placing an XO-1 C2 on scales, it takes 75g of downward pressure to activate single slider keys, and 850g to 1.3kg of downward pressure to activate two slider keys at once. This is an adult smallest finger. I don't think pressing two keys with one finger is practical. -- James Cameron http://quozl.linux.org.au/ -- Gonzalo Odiard Responsable de Desarrollo Sistemas Australes ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel