Support selection of the clipboard object to be pasted.
This commit is contained in:
@@ -100,7 +100,7 @@ class ClipboardDBusServiceHelper(dbus.service.Object):
|
||||
def get_object(self, object_path):
|
||||
cb_object = self._objects[str(object_path)]
|
||||
formats = cb_object.get_formats()
|
||||
format_types = []
|
||||
format_types = dbus.Array([], 's')
|
||||
|
||||
for type, format in formats.iteritems():
|
||||
format_types.append(type)
|
||||
|
||||
@@ -34,7 +34,7 @@ class TextFileType(FileType):
|
||||
def get_preview(self):
|
||||
for format, data in self._formats.iteritems():
|
||||
if format in TextFileType._types:
|
||||
text = str(data.get_data())
|
||||
text = data.get_data()
|
||||
if len(text) < 50:
|
||||
return text
|
||||
else:
|
||||
@@ -43,7 +43,7 @@ class TextFileType(FileType):
|
||||
return ''
|
||||
|
||||
def get_activity(self):
|
||||
return ''
|
||||
return 'org.laptop.AbiWordActivity'
|
||||
|
||||
def matches_mime_type(cls, mime_type):
|
||||
return mime_type in cls._types
|
||||
@@ -135,21 +135,12 @@ class MsWordFileType(FileType):
|
||||
return mime_type in cls._types
|
||||
matches_mime_type = classmethod(matches_mime_type)
|
||||
|
||||
class RtfFileType(FileType):
|
||||
class RtfFileType(TextFileType):
|
||||
|
||||
_types = set(['application/rtf', 'text/rtf'])
|
||||
|
||||
def get_name(self):
|
||||
return _('RTF file')
|
||||
|
||||
def get_icon(self):
|
||||
return 'theme:object-text'
|
||||
|
||||
def get_preview(self):
|
||||
return ''
|
||||
|
||||
def get_activity(self):
|
||||
return 'org.laptop.AbiWordActivity'
|
||||
|
||||
def matches_mime_type(cls, mime_type):
|
||||
return mime_type in cls._types
|
||||
|
||||
Reference in New Issue
Block a user