Merge lp:~joerlend.schinstad-deactivatedaccount/quidgets/main into lp:quidgets

Proposed by Jo-Erlend Schinstad
Status: Merged
Merge reported by: Rick Spencer
Merged at revision: not available
Proposed branch: lp:~joerlend.schinstad-deactivatedaccount/quidgets/main
Merge into: lp:quidgets
Diff against target: 35 lines (+6/-1)
2 files modified
quickly/widgets/dictionary_grid.py (+1/-1)
quickly/widgets/grid_column.py (+5/-0)
To merge this branch: bzr merge lp:~joerlend.schinstad-deactivatedaccount/quidgets/main
Reviewer Review Type Date Requested Status
Rick Spencer Approve
Review via email: mp+74032@code.launchpad.net

Description of the change

A very, very minor, but important fix.

I had a regression in the fix that made it possible to set the grid editable without resetting the grid. I had simply looped over each column, calling .set_property("editable", editable) on each. The problem is that gtk.CellRendererText doesn't support that property, so I had to fix it. It's a much better solution in any case, since we're now able to set a column editable directly by just calling column.set_editable(editable) (CheckColumn will be sett activatable).

So this fixes https://bugs.launchpad.net/quidgets/+bug/841357

To post a comment you must log in.
Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

I like the way you fixed the issue. I added a test that failed before the fix is applied and passes after the fix is applied. I like to do this with each bug fix as it helps catch regressions during future development and bug fixing.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'quickly/widgets/dictionary_grid.py'
2--- quickly/widgets/dictionary_grid.py 2011-08-19 17:22:14 +0000
3+++ quickly/widgets/dictionary_grid.py 2011-09-05 00:10:26 +0000
4@@ -193,7 +193,7 @@
5 # themselves, but for now this works.
6
7 for column in self.get_columns():
8- column.renderer.set_property("editable", editable)
9+ column.set_editable(editable)
10 self._editable = editable
11
12 @property
13
14=== modified file 'quickly/widgets/grid_column.py'
15--- quickly/widgets/grid_column.py 2011-08-19 17:22:14 +0000
16+++ quickly/widgets/grid_column.py 2011-09-05 00:10:26 +0000
17@@ -151,6 +151,8 @@
18
19 self.list_store.reorder([r[-1] for r in rows])
20
21+ def set_editable(self, editable):
22+ self.renderer.set_property("editable", editable)
23
24 class StringColumn( GridColumn ):
25
26@@ -712,6 +714,9 @@
27 dictionary = self.list_store.get_value(iter,self.dictionary_index)
28 dictionary[self.key] = new_val
29
30+ def set_editable(self, editable):
31+ self.renderer.set_property("activatable", editable)
32+
33 def display_val(self, val):
34 """display_val - takes a real value and returns the cooresponding
35 display value

Subscribers

People subscribed via source and target branches

to all changes: