Merge type definitions from the old registry.

This commit is contained in:
Marco Pesenti Gritti 2007-04-11 16:33:13 +02:00
parent fcb57779a2
commit 57e9789b8a

View File

@ -25,14 +25,30 @@ _text_type = {
'type_id' : 'Text', 'type_id' : 'Text',
'name' : _('Text'), 'name' : _('Text'),
'icon' : 'theme:object-text', 'icon' : 'theme:object-text',
'formats' : [ 'text/plain', 'application/pdf' ] 'formats' : [ 'text/plain',
'application/pdf',
'application/x-pdf',
'application/msword',
'application/rtf',
'text/rtf',
'application/x-abiword',
'application/vnd.oasis.opendocument.text']
} }
_image_type = { _image_type = {
'type_id' : 'Image', 'type_id' : 'Image',
'name' : _('Image'), 'name' : _('Image'),
'icon' : 'theme:object-image', 'icon' : 'theme:object-image',
'formats' : [ 'image/jpeg', 'image/gif', 'image/png' ] 'formats' : [ 'image/jpeg',
'image/gif',
'image/png',
'image/tiff' ]
}
_other_type = {
'type_id' : 'Other',
'name' : _('Other'),
'formats' : []
} }
class _RootNode(_TypeNode): class _RootNode(_TypeNode):
@ -61,8 +77,10 @@ class _TypeNode(list):
class TypeRegistry(object): class TypeRegistry(object):
def __init__(self): def __init__(self):
self._tree = _RootNode() self._tree = _RootNode()
self._tree.append_primitive(_image_type) self._tree.append_primitive(_image_type)
self._tree.append_primitive(_text_type) self._tree.append_primitive(_text_type)
self._tree.append_primitive(_other_type)
self._bundle_registry = bundleregistry.get_registry() self._bundle_registry = bundleregistry.get_registry()
for bundle in self._bundle_registry: for bundle in self._bundle_registry: