From 544a400afca2493577909884881d87f4f4a10a10 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 21 Aug 2007 16:59:32 +0200 Subject: [PATCH] Updated to use application/vnd.olpc-sugar instead of application/vnd.olpc-x-sugar. --- shell/view/clipboardicon.py | 6 +++--- sugar/datastore/datastore.py | 3 ++- sugar/graphics/objectchooser.py | 5 +---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py index c9d910a2..5f4c47e6 100644 --- a/shell/view/clipboardicon.py +++ b/shell/view/clipboardicon.py @@ -54,7 +54,7 @@ class ClipboardIcon(CanvasIcon): self.palette = ClipboardMenu(self._object_id, self._name, self._percent, self._preview, self._activity, - formats and formats[0] == 'application/vnd.olpc-x-sugar') + formats and formats[0] == 'application/vnd.olpc-sugar') def do_set_property(self, pspec, value): if pspec.name == 'selected': @@ -80,7 +80,7 @@ class ClipboardIcon(CanvasIcon): def set_state(self, name, percent, icon_name, preview, activity): cb_service = clipboardservice.get_instance() obj = cb_service.get_object(self._object_id) - if obj['FORMATS'] and obj['FORMATS'][0] == 'application/vnd.olpc-x-sugar': + if obj['FORMATS'] and obj['FORMATS'][0] == 'application/vnd.olpc-sugar': installable = True else: installable = False @@ -88,7 +88,7 @@ class ClipboardIcon(CanvasIcon): if icon_name: self.props.icon_name = icon_name else: - self.props.icon_name = 'theme:unknown-object' + self.props.icon_name = 'theme:application-octet-stream' self._name = name self._percent = percent diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py index 0dbe35bd..7af2e939 100644 --- a/sugar/datastore/datastore.py +++ b/sugar/datastore/datastore.py @@ -116,7 +116,8 @@ class DSObject(object): return activities def is_bundle(self): - return self.metadata['mime_type'] == 'application/vnd.olpc-x-sugar' + return self.metadata['mime_type'] in ['application/vnd.olpc-x-sugar', + 'application/vnd.olpc-sugar'] def resume(self, service_name=None): if self.is_bundle(): diff --git a/sugar/graphics/objectchooser.py b/sugar/graphics/objectchooser.py index 46739f69..f9290630 100644 --- a/sugar/graphics/objectchooser.py +++ b/sugar/graphics/objectchooser.py @@ -133,7 +133,7 @@ class CollapsedEntry(CanvasRoundBox): if self._icon_name: return self._icon_name - if self._is_bundle(): + if self.jobject.is_bundle(): bundle = Bundle(self.jobject.file_path) self._icon_name = bundle.get_icon() @@ -159,9 +159,6 @@ class CollapsedEntry(CanvasRoundBox): ti = time.strptime(self.jobject.metadata['mtime'], "%Y-%m-%dT%H:%M:%S") return str(Date(time.mktime(ti))) - def _is_bundle(self): - return self.jobject.metadata['mime_type'] == 'application/vnd.olpc-x-sugar' - def _format_title(self): return '"%s"' % self.jobject.metadata['title']