Added icon, title and preview for clipboard objects. Also allow for opening docs and rtfs from the web.

This commit is contained in:
Tomeu Vizoso
2007-01-05 21:13:46 +01:00
parent 74e407f9ff
commit f50d9f5f9a
11 changed files with 308 additions and 64 deletions
+9 -6
View File
@@ -88,9 +88,10 @@ class ClipboardBox(hippo.CanvasBox):
del self._icons[object_id]
logging.debug('ClipboardBox: ' + object_id + ' was deleted.')
def _object_state_changed_cb(self, cb_service, object_id, percent):
def _object_state_changed_cb(self, cb_service, object_id, name, percent,
icon_name, preview):
icon = self._icons[object_id]
icon.set_percent(percent)
icon.set_state(name, percent, icon_name, preview)
logging.debug('ClipboardBox: ' + object_id + ' state was changed.')
def drag_motion_cb(self, widget, context, x, y, time):
@@ -104,13 +105,13 @@ class ClipboardBox(hippo.CanvasBox):
self._context_map.add_context(context, object_id, len(context.targets))
cb_service = clipboardservice.get_instance()
cb_service.add_object(object_id, "name")
cb_service.add_object(object_id, name="")
for target in context.targets:
if str(target) not in ('TIMESTAMP', 'TARGETS', 'MULTIPLE'):
widget.drag_get_data(context, target, time)
cb_service.set_object_state(object_id, percent = 100)
cb_service.set_object_percent(object_id, percent = 100)
return True
@@ -186,9 +187,11 @@ class ClipboardBox(hippo.CanvasBox):
def _get_targets_for_dnd(self, object_id):
cb_service = clipboardservice.get_instance()
format_types = cb_service.get_object_format_types(object_id)
targets = []
(name, percent, icon, preview, format_types) = \
cb_service.get_object(object_id)
targets = []
for format_type in format_types:
targets.append((format_type, 0, 0))
+1 -1
View File
@@ -45,7 +45,7 @@ class ClipboardPanelWindow(PanelWindow):
cb_service = clipboardservice.get_instance()
cb_service.add_object(key, "name")
cb_service.set_object_state(key, percent = 100)
cb_service.set_object_percent(key, percent = 100)
targets = clipboard.wait_for_targets()
for target in targets: