# HG changeset patch # User Thinker K.F. Li # Date 1297206428 -28800 # Node ID 8f1f8ef5c9ea43b4f25181fae59196a632460a23 # Parent c2fbae4f0adc9379cb383de993b78a2bd408f744 Hide scene groups of old timeline when switching to a new timeline. diff -r c2fbae4f0adc -r 8f1f8ef5c9ea pyink/domview.py --- a/pyink/domview.py Tue Feb 08 13:35:21 2011 +0800 +++ b/pyink/domview.py Wed Feb 09 07:07:08 2011 +0800 @@ -532,8 +532,28 @@ def get_current_component(self): return self._cur_comp.name() + + ## \brief Hide scene groups of current timeline. + # + # This method all scene groups of current timeline invisible. + # + def _hide_current_timeline(self): + tl = self._cur_timeline + scenes_node = tl.scenes_node + for child in scenes_node.childList(): + if child.name() != 'ns0:scene': + continue + gid = child.getAttribute('ref') + group = self._domview.get_node(gid) + group.setAttribute('style', 'display: none') + pass + pass def switch_timeline(self, timeline_name): + if self._cur_timeline: + self._hide_current_timeline() + pass + tl = self._cur_comp.get_timeline(timeline_name) self._cur_timeline = tl self._domview._scenes_node = tl.scenes_node # of class domview