Merge lp:~roadmr/checkbox/checkbox-fix-pygi-misbehaviors into lp:checkbox

Proposed by Daniel Manrique
Status: Merged
Merged at revision: 928
Proposed branch: lp:~roadmr/checkbox/checkbox-fix-pygi-misbehaviors
Merge into: lp:checkbox
Diff against target: 87 lines (+22/-10)
3 files modified
checkbox_gtk/gtk_interface.py (+3/-2)
checkbox_gtk/hyper_text_view.py (+7/-7)
debian/changelog (+12/-1)
To merge this branch: bzr merge lp:~roadmr/checkbox/checkbox-fix-pygi-misbehaviors
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Review via email: mp+64465@code.launchpad.net

Description of the change

This branch fixes 3 bugs due to API-related changes on PyGi. They're not strictly GTK3-related, but have to do with the way PyGi exposes the GTK API. The buggy behavior was also present when running Checkbox trunk under Natty, but now works correctly there too. The GUI should now behave as expected in Natty and Oneiric.

To post a comment you must log in.
928. By Daniel Manrique

GTK GUI: Fix handling of mouse events in gtk_hypertext_view.py which prevented displaying the final report.

Revision history for this message
Daniel Manrique (roadmr) wrote :

I snuck in one more PyGI-related bugfix, this is for a problem with launching/displaying the report at the end of the run that I believe hadn't been reported by anyone. Well, with these changes, it will not need to be reported ;)

I chose to add them to this branch as it is where they logically belong.

Revision history for this message
Marc Tardif (cr3) wrote :

This fix seems like it was painful, thanks for solving all these bugs!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'checkbox_gtk/gtk_interface.py'
--- checkbox_gtk/gtk_interface.py 2011-06-09 20:23:11 +0000
+++ checkbox_gtk/gtk_interface.py 2011-06-15 21:41:46 +0000
@@ -128,7 +128,7 @@
128 def _get_text_view(self, name):128 def _get_text_view(self, name):
129 widget = self._get_widget(name)129 widget = self._get_widget(name)
130 buffer = widget.get_buffer()130 buffer = widget.get_buffer()
131 text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())131 text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter(), True)
132 return text132 return text
133133
134 def _set_label(self, name, label=""):134 def _set_label(self, name, label=""):
@@ -367,7 +367,8 @@
367367
368 # Set options368 # Set options
369 treestore = Gtk.TreeStore(str, bool)369 treestore = Gtk.TreeStore(str, bool)
370 treeview = Gtk.TreeView(treestore)370 treeview = Gtk.TreeView()
371 treeview.set_model(treestore)
371 treeview.set_headers_visible(False)372 treeview.set_headers_visible(False)
372 treeview.show()373 treeview.show()
373374
374375
=== modified file 'checkbox_gtk/hyper_text_view.py'
--- checkbox_gtk/hyper_text_view.py 2011-06-13 09:42:59 +0000
+++ checkbox_gtk/hyper_text_view.py 2011-06-15 21:41:46 +0000
@@ -21,7 +21,7 @@
2121
22class HyperTextView(Gtk.TextView):22class HyperTextView(Gtk.TextView):
23 __gtype_name__ = "HyperTextView"23 __gtype_name__ = "HyperTextView"
24 __gsignals__ = {"anchor-clicked": (GObject.SignalFlags.RUN_LAST, None, (str, str, int))}24 __gsignals__ = {"anchor-clicked": (GObject.SignalFlags.RUN_LAST, GObject.TYPE_NONE, (str, str, int))}
25 __gproperties__ = {25 __gproperties__ = {
26 "link": (GObject.TYPE_PYOBJECT, "link color", "link color of TextView", GObject.PARAM_READWRITE),26 "link": (GObject.TYPE_PYOBJECT, "link color", "link color of TextView", GObject.PARAM_READWRITE),
27 "active":(GObject.TYPE_PYOBJECT, "active color", "active color of TextView", GObject.PARAM_READWRITE),27 "active":(GObject.TYPE_PYOBJECT, "active color", "active color of TextView", GObject.PARAM_READWRITE),
@@ -82,7 +82,7 @@
82 if tag.get_data("is_anchor"):82 if tag.get_data("is_anchor"):
83 for t in set(self.__tags) - set([tag]):83 for t in set(self.__tags) - set([tag]):
84 self.__tag_reset(t, window)84 self.__tag_reset(t, window)
85 self.__set_anchor(window, tag, Gdk.Cursor.new(Gdk.HAND2), self.get_property("hover"))85 self.__set_anchor(window, tag, Gdk.Cursor.new(Gdk.CursorType.HAND2), self.get_property("hover"))
86 break86 break
87 else:87 else:
88 tag_table = self.get_buffer().get_tag_table()88 tag_table = self.get_buffer().get_tag_table()
@@ -90,13 +90,13 @@
9090
91 def _tag_event(self, tag, view, ev, _iter, text, anchor):91 def _tag_event(self, tag, view, ev, _iter, text, anchor):
92 _type = ev.type92 _type = ev.type
93 if _type == Gdk.MOTION_NOTIFY:93 if _type == Gdk.EventType.MOTION_NOTIFY:
94 return94 return
95 elif _type in [Gdk.EventType.BUTTON_PRESS, Gdk.BUTTON_RELEASE]:95 elif _type in [Gdk.EventType.BUTTON_PRESS, Gdk.EventType.BUTTON_RELEASE]:
96 button = ev.button96 button = ev.button
97 cursor = Gdk.Cursor.new(Gdk.HAND2)97 cursor = Gdk.Cursor.new(Gdk.CursorType.HAND2)
98 if _type == Gdk.BUTTON_RELEASE:98 if _type == Gdk.EventType.BUTTON_RELEASE:
99 self.emit("anchor-clicked", text, anchor, button)99 self.emit("anchor-clicked", text, anchor, button.button)
100 self.__set_anchor(ev.window, tag, cursor, self.get_property("hover"))100 self.__set_anchor(ev.window, tag, cursor, self.get_property("hover"))
101 elif button in [1, 2]:101 elif button in [1, 2]:
102 self.__set_anchor(ev.window, tag, cursor, self.get_property("active"))102 self.__set_anchor(ev.window, tag, cursor, self.get_property("active"))
103103
=== modified file 'debian/changelog'
--- debian/changelog 2011-06-13 14:21:56 +0000
+++ debian/changelog 2011-06-15 21:41:46 +0000
@@ -1,8 +1,19 @@
1checkbox (0.12.2) oneiric; urgency=low1checkbox (0.12.2) oneiric; urgency=low
22
3 [ Marc Tardif ]
3 * Incremented version.4 * Incremented version.
45
5 -- Marc Tardif <marc@ubuntu.com> Mon, 13 Jun 2011 10:21:23 -04006 [ Daniel Manrique ]
7 * GTK GUI: Change assignment of TreeStore model to TreeView to account for
8 pygi-related API changes. Also seems to fix lingering select/deselect all
9 buttons. (LP: #796666) (LP: #796622)
10 * GTK GUI: Fix call to Gtk buffer get_text to add now-mandatory fourth
11 parameter, keeps the GUI from misbehaving in connection to fixed bug.
12 (LP: #796827)
13 * GTK GUI: Fix handling of mouse events in gtk_hypertext_view.py which
14 prevented displaying the final report.
15
16 -- Daniel Manrique <daniel.manrique@canonical.com> Wed, 15 Jun 2011 17:37:23 -0400
617
7checkbox (0.12.1) oneiric; urgency=low18checkbox (0.12.1) oneiric; urgency=low
819

Subscribers

People subscribed via source and target branches