diff --git a/browser/sugar-browser.cpp b/browser/sugar-browser.cpp index 2cee6d26..46501831 100644 --- a/browser/sugar-browser.cpp +++ b/browser/sugar-browser.cpp @@ -690,8 +690,9 @@ sugar_browser_init(SugarBrowser *browser) G_CALLBACK(title_cb), NULL); g_signal_connect(G_OBJECT(browser), "location", G_CALLBACK(location_cb), NULL); - g_signal_connect(G_OBJECT(browser), "dom-mouse-click", +/* g_signal_connect(G_OBJECT(browser), "dom-mouse-click", G_CALLBACK(dom_mouse_click_cb), NULL); +*/ } int diff --git a/build-snapshot.sh b/build-snapshot.sh index 7376c781..9606dc00 100755 --- a/build-snapshot.sh +++ b/build-snapshot.sh @@ -1,6 +1,6 @@ VERSION=0.63 DATE=`date +%Y%m%d` -RELEASE=2.82 +RELEASE=2.87 TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2 rm sugar-$VERSION.tar.bz2 diff --git a/configure.ac b/configure.ac index 6f4f2a33..ecfb7b1c 100644 --- a/configure.ac +++ b/configure.ac @@ -57,22 +57,6 @@ AC_SUBST(MOZILLA_INCLUDE_DIR) AC_SUBST(XPIDL) AC_SUBST(MOZILLA_IDL_DIR) -PKG_CHECK_MODULES(NSPR, [nspr], - [have_nspr=true], - [ -PKG_CHECK_MODULES(NSPR, [mozilla-nspr], - [have_nspr=true], - [ -PKG_CHECK_MODULES(NSPR, [xulrunner-nspr], - [have_nspr=true], - have_nspr=false) - ]) - ]) - -if test "x$have_nspr" = xfalse; then - AC_MSG_ERROR([Could not find nspr]) -fi - else AC_MSG_ERROR([Must specify the xulrunner sdk dir (--with-libxul-sdk)]) diff --git a/services/presence/buddy.py b/services/presence/buddy.py index a1d9a437..eb072a18 100644 --- a/services/presence/buddy.py +++ b/services/presence/buddy.py @@ -450,7 +450,14 @@ class Buddy(ExportedGObject): # to avoid leaking a PropertyChanged signal before the buddy is # actually valid the first time after creation if self._valid: - self.PropertyChanged(changed_props) + dbus_changed = {} + for key, value in changed_props.items(): + if value: + dbus_changed[key] = value + else: + dbus_changed[key] = "" + self.PropertyChanged(dbus_changed) + self.emit('property-changed', changed_props) self._update_validity() @@ -514,6 +521,11 @@ class GenericOwner(Buddy): self._registered = kwargs["registered"] del kwargs["registered"] + self._ip4_addr_monitor = psutils.IP4AddressMonitor.get_instance() + self._ip4_addr_monitor.connect("address-changed", self._ip4_address_changed_cb) + if self._ip4_addr_monitor.props.address: + kwargs["ip4-address"] = self._ip4_addr_monitor.props.address + Buddy.__init__(self, bus_name, object_id, **kwargs) self._owner = True @@ -522,9 +534,6 @@ class GenericOwner(Buddy): signal_name="NameOwnerChanged", dbus_interface="org.freedesktop.DBus") - self._ip4_addr_monitor = psutils.IP4AddressMonitor.get_instance() - self._ip4_addr_monitor.connect("address-changed", self._ip4_address_changed_cb) - def _ip4_address_changed_cb(self, monitor, address): """Handle IPv4 address change, set property to generate event""" props = {_PROP_IP4_ADDRESS: address} diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py index fb370fb9..fc609f6b 100644 --- a/shell/view/clipboardicon.py +++ b/shell/view/clipboardicon.py @@ -106,16 +106,6 @@ class ClipboardIcon(CanvasIcon): else: self.props.xo_color = XoColor("#000000,#FFFFFF") - if activity and percent == 100: - # FIXME: restrict based on file type rather than activity once - # we have a better type registry - # restrict auto-open to a specific set of activities - allowed = ["org.laptop.AbiWordActivity", - "org.laptop.sugar.Xbook", - "org.vpri.EtoysActivity"] - if activity in allowed: - self._open_file() - def _open_file(self): if self._percent < 100: return diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index 421d7ba2..3dba4c71 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -28,6 +28,7 @@ import gtk, gobject from sugar.presence import presenceservice from sugar.activity.activityservice import ActivityService +from sugar.activity import bundleregistry from sugar.graphics.window import Window from sugar.graphics.toolbox import Toolbox from sugar.graphics.toolbutton import ToolButton @@ -200,13 +201,15 @@ class Activity(Window, gtk.Container): if handle.object_id: self.jobject = datastore.get(handle.object_id) + self.jobject.object_id = '' + del self.jobject['ctime'] + del self.jobject['mtime'] elif create_jobject: logging.debug('Creating a jobject.') self.jobject = datastore.create() self.jobject['title'] = '%s %s' % (get_bundle_name(), 'Activity') self.jobject['activity'] = self.get_service_name() - self.jobject['date'] = str(time.time()) - self.jobject['icon'] = '' + self.jobject['icon'] = self._get_icon() self.jobject['keep'] = '0' self.jobject['buddies'] = '' self.jobject['preview'] = '' @@ -329,6 +332,10 @@ class Activity(Window, gtk.Container): raise self.destroy() + def _get_icon(self): + registry = bundleregistry.get_registry() + return registry.get_bundle(self.get_service_name()).get_icon() + def get_bundle_name(): """Return the bundle name for the current process' bundle """ diff --git a/sugar/activity/bundle.py b/sugar/activity/bundle.py index 98b9e9ae..d3c490f5 100644 --- a/sugar/activity/bundle.py +++ b/sugar/activity/bundle.py @@ -78,10 +78,14 @@ class Bundle: if cp.has_option(section, 'class'): self._class = cp.get(section, 'class') self._exec = '%s --bundle-path="%s"' % ( - env.get_bin_path(_PYTHON_FACTORY), self.get_path()) + env.get_bin_path(_PYTHON_FACTORY), self._path) elif cp.has_option(section, 'exec'): self._class = None - self._exec = cp.get(section, 'exec') + cmdline = cp.get(section, 'exec') + cmdline = os.path.join(self._path, cmdline) + cmdline = cmdline.replace('$SUGAR_BUNDLE_PATH', self._path) + cmdline = os.path.expandvars(cmdline) + self._exec = cmdline else: self._exec = None self._valid = False diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py index 99fd230d..9d656707 100644 --- a/sugar/datastore/datastore.py +++ b/sugar/datastore/datastore.py @@ -39,6 +39,9 @@ class DSObject(gobject.GObject): self.metadata[key] = value self.emit('updated') + def __delitem__(self, key): + del self.metadata[key] + def get_metadata(self): return self._metadata diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py index 33aa9a6e..fa054915 100644 --- a/sugar/datastore/dbus_helpers.py +++ b/sugar/datastore/dbus_helpers.py @@ -40,7 +40,7 @@ def create(properties, filename): return object_id def update(uid, properties, filename, reply_handler=None, error_handler=None): - logging.debug('dbus_helpers.update') + logging.debug('dbus_helpers.update: %s, %s' % (uid, filename)) if reply_handler and error_handler: _data_store.update(uid, dbus.Dictionary(properties), filename, reply_handler=reply_handler, diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py index 14f83519..ec141d0c 100644 --- a/sugar/graphics/canvasicon.py +++ b/sugar/graphics/canvasicon.py @@ -123,7 +123,7 @@ class _IconCache: del self._icons[evict_key] def get_handle(self, name, fill_color, stroke_color): - if name == None: + if not name: return None if name[0:6] == "theme:": diff --git a/sugar/graphics/toolbox.py b/sugar/graphics/toolbox.py index 17b1b5fd..1b7121a1 100644 --- a/sugar/graphics/toolbox.py +++ b/sugar/graphics/toolbox.py @@ -34,6 +34,16 @@ class Toolbox(gtk.VBox): self._notebook.set_show_tabs(False) self.pack_start(self._notebook) self._notebook.show() + + def _toolbar_box_expose_cb(self, widget, event): + widget.style.paint_flat_box(widget.window, + gtk.STATE_NORMAL, gtk.SHADOW_NONE, + event.area, widget, 'toolbox', + widget.allocation.x, + widget.allocation.y, + widget.allocation.width, + widget.allocation.height) + return False def add_toolbar(self, name, toolbar): label = gtk.Label(name) @@ -42,7 +52,9 @@ class Toolbox(gtk.VBox): toolbar_box = gtk.HBox() toolbar_box.pack_start(toolbar, True, True, units.grid_to_pixels(1)) - + toolbar_box.set_size_request(-1, units.grid_to_pixels(1)) + toolbar_box.connect('expose-event', self._toolbar_box_expose_cb) + self._notebook.append_page(toolbar_box, label) toolbar_box.show()