From aeb162ae0860703aebfa79db4bb1d0a7fca71c34 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Feb 2007 13:19:04 -0500 Subject: [PATCH 1/8] Remove a bit of debugging code --- services/presence2/server_plugin.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/services/presence2/server_plugin.py b/services/presence2/server_plugin.py index 0cce49cc..fbc737ed 100644 --- a/services/presence2/server_plugin.py +++ b/services/presence2/server_plugin.py @@ -187,9 +187,6 @@ class ServerPlugin(gobject.GObject): # window.show_all() def _status_changed_cb(self, state, reason): - gobject.idle_add(self._status_changed_cb2, state, reason) - - def _status_changed_cb2(self, state, reason): if state == CONNECTION_STATUS_CONNECTING: print 'connecting: %r' % reason elif state == CONNECTION_STATUS_CONNECTED: From f3cedf1bca4bdaccc4a68f508c2b0a818424ee68 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Feb 2007 14:45:06 -0500 Subject: [PATCH 2/8] Don't create already existing config sections --- shell/intro/intro.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/intro/intro.py b/shell/intro/intro.py index 2e23dffa..66f4b84c 100644 --- a/shell/intro/intro.py +++ b/shell/intro/intro.py @@ -235,12 +235,14 @@ class IntroBox(hippo.CanvasBox, hippo.CanvasItem): cp = ConfigParser() section = 'Buddy' - cp.add_section(section) + if not cp.has_section(section): + cp.add_section(section) cp.set(section, 'NickName', name) cp.set(section, 'Color', color.to_string()) secion = 'Server' - cp.add_section(section) + if not cp.has_section(section): + cp.add_section(section) cp.set(section, 'Server', 'olpc.collabora.co.uk') cp.set(Section, 'Registered', 'False') From f5051b7c14cdd7990387cb3aaa98119fe522c5fe Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Feb 2007 15:02:42 -0500 Subject: [PATCH 3/8] Add get_color() function --- shell/intro/colorpicker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/intro/colorpicker.py b/shell/intro/colorpicker.py index 84641244..008acbe4 100644 --- a/shell/intro/colorpicker.py +++ b/shell/intro/colorpicker.py @@ -117,19 +117,19 @@ class ColorPicker(hippo.CanvasBox, hippo.CanvasItem): stroke_color=color.HTMLColor(self._fg_hex), fill_color=color.HTMLColor(self._bg_hex)) self._set_random_colors() - self._emit_color() self._xo.connect('activated', self._xo_activated_cb) self.append(self._xo) def _xo_activated_cb(self, item): self._set_random_colors() - self._emit_color() - - def _emit_color(self): xo_color = XoColor('%s,%s' % (self._xo.props.stroke_color.get_html(), self._xo.props.fill_color.get_html())) self.emit('color', xo_color) + def get_color(self): + return XoColor('%s,%s' % (self._xo.props.stroke_color.get_html(), + self._xo.props.fill_color.get_html())) + def _update_xo_hex(self, fg=None, bg=None): """set the colors of the XO man""" if fg: From 8a53a31c49f0a8fd04631273aae80634a15f2431 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Feb 2007 15:03:25 -0500 Subject: [PATCH 4/8] Have IntroWindow handle profile creation so it can hide itself before generating keys --- shell/intro/intro.py | 57 ++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/shell/intro/intro.py b/shell/intro/intro.py index 66f4b84c..327f0527 100644 --- a/shell/intro/intro.py +++ b/shell/intro/intro.py @@ -185,6 +185,8 @@ class ColorBox(hippo.CanvasBox, hippo.CanvasItem): self._cp.connect('color', self._new_color_cb) self.append(self._cp) + self._color = self._cp.get_color() + def _new_color_cb(self, widget, color): self._color = color @@ -194,6 +196,11 @@ class ColorBox(hippo.CanvasBox, hippo.CanvasItem): class IntroBox(hippo.CanvasBox, hippo.CanvasItem): __gtype_name__ = 'SugarIntroBox' + __gsignals__ = { + 'ok': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT])) + } + def __init__(self, **kwargs): hippo.CanvasBox.__init__(self, **kwargs) self._pixbuf = None @@ -222,10 +229,34 @@ class IntroBox(hippo.CanvasBox, hippo.CanvasItem): color = self._color_box.get_color() if not pixbuf or not name or not color: + print "not one of pixbuf(%r), name(%r), or color(%r)" return - self._create_profile(pixbuf, name, color) - gtk.main_quit() + self.emit('ok', pixbuf, name, color) + + +class IntroWindow(gtk.Window): + def __init__(self): + gtk.Window.__init__(self) + self.set_default_size(gtk.gdk.screen_width(), + gtk.gdk.screen_height()) + self.realize() + self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP) + + self._canvas = hippo.Canvas() + self._intro_box = IntroBox(background_color=0x000000ff, + yalign=hippo.ALIGNMENT_START, + padding_top=units.grid_to_pixels(2), + padding_left=units.grid_to_pixels(3), + padding_right=units.grid_to_pixels(3)) + self._intro_box.connect('ok', self._ok_cb) + self._canvas.set_root(self._intro_box) + self.add(self._canvas) + self._canvas.show() + + def _ok_cb(self, widget, pixbuf, name, color): + self.hide() + gobject.idle_add(self._create_profile, pixbuf, name, color) def _create_profile(self, pixbuf, name, color): # Save the buddy icon @@ -244,7 +275,7 @@ class IntroBox(hippo.CanvasBox, hippo.CanvasItem): if not cp.has_section(section): cp.add_section(section) cp.set(section, 'Server', 'olpc.collabora.co.uk') - cp.set(Section, 'Registered', 'False') + cp.set(section, 'Registered', 'False') config_path = os.path.join(env.get_profile_path(), 'config') f = open(config_path, 'w') @@ -259,24 +290,8 @@ class IntroBox(hippo.CanvasBox, hippo.CanvasItem): if s != 0: logging.error("Could not generate key pair: %d" % s) - -class IntroWindow(gtk.Window): - def __init__(self): - gtk.Window.__init__(self) - self.set_default_size(gtk.gdk.screen_width(), - gtk.gdk.screen_height()) - self.realize() - self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP) - - self._canvas = hippo.Canvas() - self._intro_box = IntroBox(background_color=0x000000ff, - yalign=hippo.ALIGNMENT_START, - padding_top=units.grid_to_pixels(2), - padding_left=units.grid_to_pixels(3), - padding_right=units.grid_to_pixels(3)) - self._canvas.set_root(self._intro_box) - self.add(self._canvas) - self._canvas.show() + gtk.main_quit() + return False if __name__ == "__main__": From 8a9232234b654c8acfe6a415c1e7cb254647080b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 27 Feb 2007 22:21:55 +0100 Subject: [PATCH 5/8] Fix distcheck --- po/POTFILES.in | 1 - shell/hardware/Makefile.am | 2 ++ tools/build-snapshot.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 1f37e708..5e41f05d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,2 +1 @@ -services/nm/nmclient.py sugar/chat/ChatEditor.py diff --git a/shell/hardware/Makefile.am b/shell/hardware/Makefile.am index 2fad769c..a3339a6c 100644 --- a/shell/hardware/Makefile.am +++ b/shell/hardware/Makefile.am @@ -8,3 +8,5 @@ sugar_PYTHON = \ dbusservicedir = $(sysconfdir)/dbus-1/system.d/ dbusservice_DATA = NetworkManagerInfo.conf + +EXTRA_DIST = $(dbusservice_DATA) diff --git a/tools/build-snapshot.sh b/tools/build-snapshot.sh index aaca040e..1fe49888 100755 --- a/tools/build-snapshot.sh +++ b/tools/build-snapshot.sh @@ -1,6 +1,6 @@ VERSION=0.63 DATE=`date +%Y%m%d` -RELEASE=2.22 +RELEASE=2.23 TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2 rm sugar-$VERSION.tar.bz2 From f09a63930f6470c737f7c606116a5ce7f6265f63 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 27 Feb 2007 22:35:28 +0100 Subject: [PATCH 6/8] Fix stroke/fill on ZoomBox icons. --- shell/view/frame/ZoomBox.py | 17 +++++++++++++---- sugar/graphics/button.py | 7 ++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/shell/view/frame/ZoomBox.py b/shell/view/frame/ZoomBox.py index 2ba46b8e..231f1883 100644 --- a/shell/view/frame/ZoomBox.py +++ b/shell/view/frame/ZoomBox.py @@ -20,6 +20,7 @@ from gettext import gettext as _ import hippo from sugar.graphics.menu import Menu, MenuItem +from sugar.graphics import color from sugar.graphics.iconbutton import IconButton import sugar @@ -79,19 +80,27 @@ class ZoomBox(hippo.CanvasBox): self._popup_context = popup_context self._activity_icon = None - icon = IconButton(icon_name='theme:stock-zoom-mesh') + icon = IconButton(icon_name='theme:stock-zoom-mesh', + stroke_color=color.BLACK, + fill_color=color.WHITE) icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_MESH) self.append(icon) - icon = IconButton(icon_name='theme:stock-zoom-friends') + icon = IconButton(icon_name='theme:stock-zoom-friends', + stroke_color=color.BLACK, + fill_color=color.WHITE) icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_FRIENDS) self.append(icon) - icon = IconButton(icon_name='theme:stock-zoom-home') + icon = IconButton(icon_name='theme:stock-zoom-home', + stroke_color=color.BLACK, + fill_color=color.WHITE) icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_HOME) self.append(icon) - icon = IconButton(icon_name='theme:stock-zoom-activity') + icon = IconButton(icon_name='theme:stock-zoom-activity', + stroke_color=color.BLACK, + fill_color=color.WHITE) icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_ACTIVITY) self.append(icon) diff --git a/sugar/graphics/button.py b/sugar/graphics/button.py index 44193273..7b487ae1 100644 --- a/sugar/graphics/button.py +++ b/sugar/graphics/button.py @@ -47,7 +47,8 @@ class Button(hippo.CanvasBox, hippo.CanvasItem): self._round_box.props.background_color = color.BLACK.get_int() self._round_box.props.padding_top = units.points_to_pixels(1) self._round_box.props.padding_bottom = units.points_to_pixels(1) - + self._round_box.props.spacing = units.points_to_pixels(3) + self._text_box = hippo.CanvasText() self._text_box.props.font_desc = font.DEFAULT.get_pango_desc() self._text_box.props.color = color.BUTTON_NORMAL.get_int() @@ -87,8 +88,8 @@ class Button(hippo.CanvasBox, hippo.CanvasItem): else: self._icon = CanvasIcon(icon_name=value, scale=units.SMALL_ICON_SCALE, - fill_color=color.WHITE, - stroke_color=color.BLACK) + fill_color=color.BLACK, + stroke_color=color.WHITE) # Insert icon on the label's left self._round_box.remove_all() self._round_box.append(self._icon) From a6a8ad5677f01b082821afafab68431474386fff Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 27 Feb 2007 23:05:34 +0100 Subject: [PATCH 7/8] IconButton hover fix. --- sugar/graphics/iconbutton.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sugar/graphics/iconbutton.py b/sugar/graphics/iconbutton.py index cc70341f..a58300b0 100644 --- a/sugar/graphics/iconbutton.py +++ b/sugar/graphics/iconbutton.py @@ -102,9 +102,7 @@ class IconButton(CanvasIcon): def prelight(self, enter): if enter: if self._active: - self.props.fill_color = color.BLACK self.props.background_color = color.BLACK.get_int() else: if self._active: - self.props.fill_color = self._normal_fill_color self.props.background_color = self._normal_background_color From 5f288b68c9e34960d82958faf4a1b7482cdfe769 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 27 Feb 2007 23:19:02 +0100 Subject: [PATCH 8/8] Typo --- sugar/activity/activityfactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index bcf70b2b..5c0e69db 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -99,4 +99,4 @@ def create_with_uri(service_name, uri): """Create a new activity and pass the uri as handle.""" activity_handle = ActivityHandle(_find_activity_id()) activity_handle.uri = uri - return ActivityCreationHandler(service_name, handle) + return ActivityCreationHandler(service_name, activity_handle)