# HG changeset patch # User Thinker K.F. Li # Date 1296469163 -28800 # Node ID 3cbc1ab15541f033d14aba54d250e23f06017e18 # Parent a0d3a4f8e99d2d3806095e7589ff568671d14f56 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. diff -r a0d3a4f8e99d -r 3cbc1ab15541 pyink/comp_dock.py --- 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):