changeset 1333:3cbc1ab15541

Implement the function to create a link to a component. - It creates a svg:use for a component in the component list. - The svg:use node is inserted into current layer.
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 31 Jan 2011 18:19:23 +0800
parents a0d3a4f8e99d
children 38403fdb0c6c
files pyink/comp_dock.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/comp_dock.py	Mon Jan 31 16:42:15 2011 +0800
+++ b/pyink/comp_dock.py	Mon Jan 31 18:19:23 2011 +0800
@@ -234,7 +234,7 @@
                 pass
             return tl_name
 
-        if self._current_component() == 'main':
+        if self._domview_ui.get_current_component() == 'main':
             return
 
         tl_name = _make_timeline_name()
@@ -313,6 +313,13 @@
         pass
 
     def on_link_component_activate(self, *args):
+        desktop = self._desktop
+        
+        comp_name = self._current_component()
+        cur_layer_group_sp = desktop.currentLayer()
+        cur_layer_group = cur_layer_group_sp.repr
+        
+        self._domview_ui.link_to_component(comp_name, cur_layer_group)
         pass
     
     def on_switch_component_activate(self, *args):