changeset 1534:199ba528fd4a

Only insert a link to a component to a key frame. - To check if it is a key frame, now, before inserting a link to a component. - When it is not in a key frame, it is supposed to be a "dup" group. We should not make a link there.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 30 Sep 2011 14:17:35 +0800
parents 82d3a6b5d1c4
children 9aff42a7e2b9
files pyink/comp_dock.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/comp_dock.py	Fri Sep 30 12:53:19 2011 +0800
+++ b/pyink/comp_dock.py	Fri Sep 30 14:17:35 2011 +0800
@@ -422,7 +422,22 @@
         treeview.set_cursor(path, col, True)
         pass
 
+    ## \brief To check if it is on key frame, now.
+    def _on_key_frame(self):
+        domview = self._domview_ui
+        frame_idx, scene_idx = domview.get_current_frame()
+        try:
+            left_idx, right_idx, ktype = domview.get_key(frame_idx, scene_idx)
+        except ValueError:
+            return False
+        if scene_idx == left_idx or scene_idx == right_idx:
+            return True
+        return False
+
     def on_link_component_activate(self, *args):
+        if not self._on_key_frame():
+            return
+        
         desktop = self._desktop
         
         comp_name = self._current_component()