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
=== modified file 'quickly/widgets/dictionary_grid.py'
--- quickly/widgets/dictionary_grid.py 2011-08-19 17:22:14 +0000
+++ quickly/widgets/dictionary_grid.py 2011-09-05 00:10:26 +0000
@@ -193,7 +193,7 @@
193 # themselves, but for now this works. 193 # themselves, but for now this works.
194194
195 for column in self.get_columns():195 for column in self.get_columns():
196 column.renderer.set_property("editable", editable)196 column.set_editable(editable)
197 self._editable = editable197 self._editable = editable
198198
199 @property199 @property
200200
=== modified file 'quickly/widgets/grid_column.py'
--- quickly/widgets/grid_column.py 2011-08-19 17:22:14 +0000
+++ quickly/widgets/grid_column.py 2011-09-05 00:10:26 +0000
@@ -151,6 +151,8 @@
151151
152 self.list_store.reorder([r[-1] for r in rows])152 self.list_store.reorder([r[-1] for r in rows])
153153
154 def set_editable(self, editable):
155 self.renderer.set_property("editable", editable)
154156
155class StringColumn( GridColumn ):157class StringColumn( GridColumn ):
156158
@@ -712,6 +714,9 @@
712 dictionary = self.list_store.get_value(iter,self.dictionary_index)714 dictionary = self.list_store.get_value(iter,self.dictionary_index)
713 dictionary[self.key] = new_val715 dictionary[self.key] = new_val
714716
717 def set_editable(self, editable):
718 self.renderer.set_property("activatable", editable)
719
715 def display_val(self, val):720 def display_val(self, val):
716 """display_val - takes a real value and returns the cooresponding721 """display_val - takes a real value and returns the cooresponding
717 display value722 display value

Subscribers

People subscribed via source and target branches

to all changes: