Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-18 11:56:11 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-18 11:56:11 (GMT)
commit440baae7d96503e5ddd1606f36e847b4d13b5a6f (patch)
tree8731de888028dd480dbe8a40eb0a77db9d34289e /shell
parent3fd29884f952ea96fcc003b9611c83612759a64b (diff)
Show and hide the frame when an object is added to the clipboard.
Diffstat (limited to 'shell')
-rw-r--r--shell/view/frame/frame.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/view/frame/frame.py b/shell/view/frame/frame.py
index aedc56d..9474808 100644
--- a/shell/view/frame/frame.py
+++ b/shell/view/frame/frame.py
@@ -30,6 +30,7 @@ from view.frame.framepopupcontext import FramePopupContext
from model.ShellModel import ShellModel
from sugar.graphics import animator
from sugar.graphics import units
+from sugar.clipboard import clipboardservice
MODE_NONE = 0
MODE_MOUSE = 1
@@ -156,6 +157,9 @@ class Frame(object):
screen = gtk.gdk.screen_get_default()
screen.connect('size-changed', self._size_changed_cb)
+ cb_service = clipboardservice.get_instance()
+ cb_service.connect_after('object-added', self._clipboard_object_added_cb)
+
self._key_listener = _KeyListener(self)
self._mouse_listener = _MouseListener(self)
@@ -297,7 +301,12 @@ class Frame(object):
def _size_changed_cb(self, screen):
self._update_position()
-
+
+ def _clipboard_object_added_cb(self, cb_service, object_id, name):
+ if not self.visible:
+ self.show()
+ gobject.timeout_add(2000, lambda: self.hide())
+
def _popup_context_activated_cb(self, popup_context):
self._mouse_listener.mouse_enter()