# HG changeset patch # User Thinker K.F. Li # Date 1294739957 -28800 # Node ID 6177f5d0ef0110edee675e7abd0f27b0d34f5dad # Parent bbd6bc0d079ab357e9b5ec8b599261a01b6511b8 Remove the layer when a layer group being removed. diff -r bbd6bc0d079a -r 6177f5d0ef01 pyink/consistency.py --- a/pyink/consistency.py Tue Jan 11 17:57:11 2011 +0800 +++ b/pyink/consistency.py Tue Jan 11 17:59:17 2011 +0800 @@ -83,6 +83,19 @@ pass else: # We have found the key frame. self._domview.unmark_key(layer_idx, start) + return + + # + # Remove layers + # + if child_name == 'svg:g': + try: + layer_idx = self._domview.find_layer_from_group(group_id) + except ValueError: + pass + else: # It is a layer group + self._domview.rm_layer(layer_idx) + pass pass pass diff -r bbd6bc0d079a -r 6177f5d0ef01 pyink/domview_ui.py --- a/pyink/domview_ui.py Tue Jan 11 17:57:11 2011 +0800 +++ b/pyink/domview_ui.py Tue Jan 11 17:59:17 2011 +0800 @@ -596,7 +596,7 @@ ## \brief Find the layer index associated with a given layer group. # def find_layer_from_group(self, group_id): - layer_idx = self._domview.find_layer_from_group(group_id) + layer_idx = self._dom.find_layer_of_group(group_id) if layer_idx == -1: raise ValueError, \ 'can not find the layer for group %s' % (group_id)