Merge lp:~fraser-waters08/spud/exception-store into lp:spud

Proposed by Fraser Waters
Status: Merged
Approved by: Patrick Farrell
Approved revision: 402
Merged at revision: 406
Proposed branch: lp:~fraser-waters08/spud/exception-store
Merge into: lp:spud
Diff against target: 30 lines (+4/-2)
1 file modified
diamond/diamond/interface.py (+4/-2)
To merge this branch: bzr merge lp:~fraser-waters08/spud/exception-store
Reviewer Review Type Date Requested Status
Patrick Farrell Pending
Review via email: mp+66808@code.launchpad.net

Description of the change

Fix for bug #784638, old code was using currently selected row to save the model, which was none when the subtree was collapsed. New code keeps track of which row was actually last selected.

To post a comment you must log in.
Revision history for this message
Patrick Farrell (pefarrell) wrote :

Great, looks good to merge.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'diamond/diamond/interface.py'
--- diamond/diamond/interface.py 2011-07-04 14:49:07 +0000
+++ diamond/diamond/interface.py 2011-07-04 15:24:23 +0000
@@ -70,6 +70,7 @@
70 node_desc_link_bounds: a list of tuples corresponding to the start and end points of links in the current tree.Tree / MixedTree documentation70 node_desc_link_bounds: a list of tuples corresponding to the start and end points of links in the current tree.Tree / MixedTree documentation
71 options_tree_select_func_enabled: boolean, true if the options tree select function is enabled (used to overcome a nasty clash with the treeview clicked signal) - re-enabled on next options_tree_select_func call71 options_tree_select_func_enabled: boolean, true if the options tree select function is enabled (used to overcome a nasty clash with the treeview clicked signal) - re-enabled on next options_tree_select_func call
72 selected_node: a tree.Tree or MixedTree containing data to be displayed on the RHS72 selected_node: a tree.Tree or MixedTree containing data to be displayed on the RHS
73 selected_iter: last iter set by on_select_row
73 s: current schema74 s: current schema
74 saved: boolean, false if the current file has been edited75 saved: boolean, false if the current file has been edited
75 schemafile: the current RNG schema file76 schemafile: the current RNG schema file
@@ -1196,7 +1197,7 @@
1196 path = self.get_selected_row(self.treeview.get_selection())1197 path = self.get_selected_row(self.treeview.get_selection())
1197 if path is None:1198 if path is None:
1198 return1199 return
1199 iter = self.treestore.get_iter(path)1200 self.selected_iter = iter = self.treestore.get_iter(path)
1200 choice_or_tree = self.treestore.get_value(iter, 2)1201 choice_or_tree = self.treestore.get_value(iter, 2)
12011202
1202 active_tree = self.treestore.get_value(iter, 3)1203 active_tree = self.treestore.get_value(iter, 3)
@@ -2641,7 +2642,8 @@
2641 if isinstance(self.selected_node, MixedTree) and "shape" in self.selected_node.child.attrs.keys() and self.selected_node.child.attrs["shape"][0] is int and isinstance(self.selected_node.datatype, plist.List) and self.selected_node.datatype.cardinality == "+":2642 if isinstance(self.selected_node, MixedTree) and "shape" in self.selected_node.child.attrs.keys() and self.selected_node.child.attrs["shape"][0] is int and isinstance(self.selected_node.datatype, plist.List) and self.selected_node.datatype.cardinality == "+":
2642 self.selected_node.child.set_attr("shape", str(len(value_check.split(" "))))2643 self.selected_node.child.set_attr("shape", str(len(value_check.split(" "))))
2643 self.paint_validity()2644 self.paint_validity()
2644 iter = self.get_treeview_iter(self.treeview.get_selection())2645
2646 iter = self.selected_iter
2645 self.treestore.set_value(iter, 4, new_data)2647 self.treestore.set_value(iter, 4, new_data)
2646 self.set_saved(False)2648 self.set_saved(False)
2647 self.node_data_interacted = False2649 self.node_data_interacted = False

Subscribers

People subscribed via source and target branches