Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-06 09:33:16 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-06 09:33:16 (GMT)
commit2d9d6cf25c6fed5bf20475c2e1739a7726e3ca6f (patch)
tree3269df10f93b4dca494b42b9d62f920be251afe1
parent6a2ce2b9412ffb307ced44e3df02b0d475b3bb83 (diff)
Also catch the deprecated mime type for bundles.
-rw-r--r--shell/view/clipboardicon.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py
index 0b1f93a..1bb33f9 100644
--- a/shell/view/clipboardicon.py
+++ b/shell/view/clipboardicon.py
@@ -54,16 +54,20 @@ class ClipboardIcon(RadioToolButton):
cb_service = clipboardservice.get_instance()
cb_service.connect('object-state-changed', self._object_state_changed_cb)
obj = cb_service.get_object(self._object_id)
- formats = obj['FORMATS']
self.palette = ClipboardMenu(self._object_id, self._name, self._percent,
self._preview, self._activity,
- formats and formats[0] == 'application/vnd.olpc-sugar')
+ self._is_bundle(obj['FORMATS']))
self.palette.props.invoker = FrameWidgetInvoker(self)
self.child.connect('drag_data_get', self._drag_data_get_cb)
self.connect('notify::active', self._notify_active_cb)
+ def _is_bundle(self, formats):
+ # A bundle will have only one format.
+ return formats and formats[0] in ['application/vnd.olpc-sugar',
+ 'application/vnd.olpc-x-sugar']
+
def get_object_id(self):
return self._object_id
@@ -110,10 +114,6 @@ class ClipboardIcon(RadioToolButton):
cb_service = clipboardservice.get_instance()
obj = cb_service.get_object(self._object_id)
- if obj['FORMATS'] and obj['FORMATS'][0] == 'application/vnd.olpc-sugar':
- installable = True
- else:
- installable = False
if icon_name:
self._icon.props.icon_name = icon_name
@@ -129,7 +129,8 @@ class ClipboardIcon(RadioToolButton):
self._percent = percent
self._preview = preview
self._activity = activity
- self.palette.set_state(name, percent, preview, activity, installable)
+ self.palette.set_state(name, percent, preview, activity,
+ self._is_bundle(obj['FORMATS']))
self.props.sensitive = (percent == 100)