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
1=== modified file 'checkbox_gtk/gtk_interface.py'
2--- checkbox_gtk/gtk_interface.py 2011-06-09 20:23:11 +0000
3+++ checkbox_gtk/gtk_interface.py 2011-06-15 21:41:46 +0000
4@@ -128,7 +128,7 @@
5 def _get_text_view(self, name):
6 widget = self._get_widget(name)
7 buffer = widget.get_buffer()
8- text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())
9+ text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter(), True)
10 return text
11
12 def _set_label(self, name, label=""):
13@@ -367,7 +367,8 @@
14
15 # Set options
16 treestore = Gtk.TreeStore(str, bool)
17- treeview = Gtk.TreeView(treestore)
18+ treeview = Gtk.TreeView()
19+ treeview.set_model(treestore)
20 treeview.set_headers_visible(False)
21 treeview.show()
22
23
24=== modified file 'checkbox_gtk/hyper_text_view.py'
25--- checkbox_gtk/hyper_text_view.py 2011-06-13 09:42:59 +0000
26+++ checkbox_gtk/hyper_text_view.py 2011-06-15 21:41:46 +0000
27@@ -21,7 +21,7 @@
28
29 class HyperTextView(Gtk.TextView):
30 __gtype_name__ = "HyperTextView"
31- __gsignals__ = {"anchor-clicked": (GObject.SignalFlags.RUN_LAST, None, (str, str, int))}
32+ __gsignals__ = {"anchor-clicked": (GObject.SignalFlags.RUN_LAST, GObject.TYPE_NONE, (str, str, int))}
33 __gproperties__ = {
34 "link": (GObject.TYPE_PYOBJECT, "link color", "link color of TextView", GObject.PARAM_READWRITE),
35 "active":(GObject.TYPE_PYOBJECT, "active color", "active color of TextView", GObject.PARAM_READWRITE),
36@@ -82,7 +82,7 @@
37 if tag.get_data("is_anchor"):
38 for t in set(self.__tags) - set([tag]):
39 self.__tag_reset(t, window)
40- self.__set_anchor(window, tag, Gdk.Cursor.new(Gdk.HAND2), self.get_property("hover"))
41+ self.__set_anchor(window, tag, Gdk.Cursor.new(Gdk.CursorType.HAND2), self.get_property("hover"))
42 break
43 else:
44 tag_table = self.get_buffer().get_tag_table()
45@@ -90,13 +90,13 @@
46
47 def _tag_event(self, tag, view, ev, _iter, text, anchor):
48 _type = ev.type
49- if _type == Gdk.MOTION_NOTIFY:
50+ if _type == Gdk.EventType.MOTION_NOTIFY:
51 return
52- elif _type in [Gdk.EventType.BUTTON_PRESS, Gdk.BUTTON_RELEASE]:
53+ elif _type in [Gdk.EventType.BUTTON_PRESS, Gdk.EventType.BUTTON_RELEASE]:
54 button = ev.button
55- cursor = Gdk.Cursor.new(Gdk.HAND2)
56- if _type == Gdk.BUTTON_RELEASE:
57- self.emit("anchor-clicked", text, anchor, button)
58+ cursor = Gdk.Cursor.new(Gdk.CursorType.HAND2)
59+ if _type == Gdk.EventType.BUTTON_RELEASE:
60+ self.emit("anchor-clicked", text, anchor, button.button)
61 self.__set_anchor(ev.window, tag, cursor, self.get_property("hover"))
62 elif button in [1, 2]:
63 self.__set_anchor(ev.window, tag, cursor, self.get_property("active"))
64
65=== modified file 'debian/changelog'
66--- debian/changelog 2011-06-13 14:21:56 +0000
67+++ debian/changelog 2011-06-15 21:41:46 +0000
68@@ -1,8 +1,19 @@
69 checkbox (0.12.2) oneiric; urgency=low
70
71+ [ Marc Tardif ]
72 * Incremented version.
73
74- -- Marc Tardif <marc@ubuntu.com> Mon, 13 Jun 2011 10:21:23 -0400
75+ [ Daniel Manrique ]
76+ * GTK GUI: Change assignment of TreeStore model to TreeView to account for
77+ pygi-related API changes. Also seems to fix lingering select/deselect all
78+ buttons. (LP: #796666) (LP: #796622)
79+ * GTK GUI: Fix call to Gtk buffer get_text to add now-mandatory fourth
80+ parameter, keeps the GUI from misbehaving in connection to fixed bug.
81+ (LP: #796827)
82+ * GTK GUI: Fix handling of mouse events in gtk_hypertext_view.py which
83+ prevented displaying the final report.
84+
85+ -- Daniel Manrique <daniel.manrique@canonical.com> Wed, 15 Jun 2011 17:37:23 -0400
86
87 checkbox (0.12.1) oneiric; urgency=low
88

Subscribers

People subscribed via source and target branches