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/services/presence2/server_plugin.py b/services/presence2/server_plugin.py index 610bcc31..9216bd53 100644 --- a/services/presence2/server_plugin.py +++ b/services/presence2/server_plugin.py @@ -183,9 +183,6 @@ class ServerPlugin(gobject.GObject): self._conn[CONN_INTERFACE_BUDDY_INFO].connect_to_signal('ActivitiesChanged', self._activities_changed_cb) 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: 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/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: diff --git a/shell/intro/intro.py b/shell/intro/intro.py index 2e23dffa..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,40 +229,10 @@ 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() - - def _create_profile(self, pixbuf, name, color): - # Save the buddy icon - icon_path = os.path.join(env.get_profile_path(), "buddy-icon.jpg") - scaled = pixbuf.scale_simple(200, 200, gtk.gdk.INTERP_BILINEAR) - pixbuf.save(icon_path, "jpeg", {"quality":"85"}) - - cp = ConfigParser() - section = 'Buddy' - cp.add_section(section) - cp.set(section, 'NickName', name) - cp.set(section, 'Color', color.to_string()) - - secion = 'Server' - cp.add_section(section) - cp.set(section, 'Server', 'olpc.collabora.co.uk') - cp.set(Section, 'Registered', 'False') - - config_path = os.path.join(env.get_profile_path(), 'config') - f = open(config_path, 'w') - cp.write(f) - f.close() - - # Generate keypair - import commands - keypath = os.path.join(env.get_profile_path(), "owner.key") - cmd = "ssh-keygen -q -t dsa -f %s -C '' -N ''" % keypath - (s, o) = commands.getstatusoutput(cmd) - if s != 0: - logging.error("Could not generate key pair: %d" % s) + self.emit('ok', pixbuf, name, color) class IntroWindow(gtk.Window): @@ -272,10 +249,50 @@ class IntroWindow(gtk.Window): 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 + icon_path = os.path.join(env.get_profile_path(), "buddy-icon.jpg") + scaled = pixbuf.scale_simple(200, 200, gtk.gdk.INTERP_BILINEAR) + pixbuf.save(icon_path, "jpeg", {"quality":"85"}) + + cp = ConfigParser() + section = 'Buddy' + if not cp.has_section(section): + cp.add_section(section) + cp.set(section, 'NickName', name) + cp.set(section, 'Color', color.to_string()) + + secion = 'Server' + if not cp.has_section(section): + cp.add_section(section) + cp.set(section, 'Server', 'olpc.collabora.co.uk') + cp.set(section, 'Registered', 'False') + + config_path = os.path.join(env.get_profile_path(), 'config') + f = open(config_path, 'w') + cp.write(f) + f.close() + + # Generate keypair + import commands + keypath = os.path.join(env.get_profile_path(), "owner.key") + cmd = "ssh-keygen -q -t dsa -f %s -C '' -N ''" % keypath + (s, o) = commands.getstatusoutput(cmd) + if s != 0: + logging.error("Could not generate key pair: %d" % s) + + gtk.main_quit() + return False + if __name__ == "__main__": w = IntroWindow() 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/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) 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) 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 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