From e894bb54a67431f0aba5cd7704365701639af291 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 27 Jun 2007 11:36:05 +0200 Subject: [PATCH 1/2] Added mount() and mounts() methods to datastore. --- sugar/datastore/datastore.py | 5 +++++ sugar/datastore/dbus_helpers.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py index 7f471381..5697940c 100644 --- a/sugar/datastore/datastore.py +++ b/sugar/datastore/datastore.py @@ -142,3 +142,8 @@ def find(query, sorting=None, limit=None, offset=None, reply_handler=None, return objects, total_count +def mount(uri, options): + return dbus_helpers.mount(uri, options) + +def mounts(): + return dbus_helpers.mounts() diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py index 2dfccaca..d642988b 100644 --- a/sugar/datastore/dbus_helpers.py +++ b/sugar/datastore/dbus_helpers.py @@ -59,10 +59,16 @@ def get_filename(uid): return filename def find(query, reply_handler, error_handler): - logging.debug('dbus_helpers.find') + logging.debug('dbus_helpers.find: %r' % query) if reply_handler and error_handler: return _data_store.find(query, reply_handler=reply_handler, error_handler=error_handler) else: return _data_store.find(query) +def mount(uri, options): + return _data_store.mount(uri, options) + +def mounts(): + return _data_store.mounts() + From 57714822811c0f4eb38fbd711a975d13963a7391 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 27 Jun 2007 11:36:28 +0200 Subject: [PATCH 2/2] Added palette support to toggletoolbutton.py. --- sugar/graphics/toggletoolbutton.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sugar/graphics/toggletoolbutton.py b/sugar/graphics/toggletoolbutton.py index 5a313831..3684e9ca 100644 --- a/sugar/graphics/toggletoolbutton.py +++ b/sugar/graphics/toggletoolbutton.py @@ -18,13 +18,28 @@ import gtk from sugar.graphics.icon import Icon +from sugar.graphics.palette import Palette, WidgetInvoker class ToggleToolButton(gtk.ToggleToolButton): def __init__(self, named_icon=None): gtk.ToggleToolButton.__init__(self) + self._palette = None self.set_named_icon(named_icon) def set_named_icon(self, named_icon): icon = Icon(named_icon) self.set_icon_widget(icon) icon.show() + + def get_palette(self): + return self._palette + + def set_palette(self, palette): + self._palette = palette + self._palette.props.invoker = WidgetInvoker(self.child) + + def set_tooltip(self, text): + self._palette = Palette(text) + self._palette.props.invoker = WidgetInvoker(self.child) + + palette = property(get_palette, set_palette)