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
1=== modified file 'diamond/diamond/interface.py'
2--- diamond/diamond/interface.py 2011-07-04 14:49:07 +0000
3+++ diamond/diamond/interface.py 2011-07-04 15:24:23 +0000
4@@ -70,6 +70,7 @@
5 node_desc_link_bounds: a list of tuples corresponding to the start and end points of links in the current tree.Tree / MixedTree documentation
6 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
7 selected_node: a tree.Tree or MixedTree containing data to be displayed on the RHS
8+ selected_iter: last iter set by on_select_row
9 s: current schema
10 saved: boolean, false if the current file has been edited
11 schemafile: the current RNG schema file
12@@ -1196,7 +1197,7 @@
13 path = self.get_selected_row(self.treeview.get_selection())
14 if path is None:
15 return
16- iter = self.treestore.get_iter(path)
17+ self.selected_iter = iter = self.treestore.get_iter(path)
18 choice_or_tree = self.treestore.get_value(iter, 2)
19
20 active_tree = self.treestore.get_value(iter, 3)
21@@ -2641,7 +2642,8 @@
22 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 == "+":
23 self.selected_node.child.set_attr("shape", str(len(value_check.split(" "))))
24 self.paint_validity()
25- iter = self.get_treeview_iter(self.treeview.get_selection())
26+
27+ iter = self.selected_iter
28 self.treestore.set_value(iter, 4, new_data)
29 self.set_saved(False)
30 self.node_data_interacted = False

Subscribers

People subscribed via source and target branches