Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~cr3/checkbox/411526 | ||||
Merge into: | lp:checkbox | ||||
Diff against target: |
88 lines (+39/-3) 3 files modified
checkbox_gtk/gtk_interface.py (+2/-2) debian/changelog (+1/-0) gtk/checkbox-gtk.glade (+36/-1) |
||||
To merge this branch: | bzr merge lp:~cr3/checkbox/411526 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Javier Collado (community) | Approve | ||
Marc Tardif (community) | Needs Information | ||
Review via email: mp+14481@code.launchpad.net |
Commit message
Description of the change
Javier Collado (javier.collado) wrote : | # |
Hello,
The change looks fine, the only thing that I'd change is the expand property for the upper part of the dialog to false since it takes half the available space otherwise (I don't know why, but it still takes more space than strictly needed).
Regarding the horizontal scrollbar. I tried to use a really long test suite description and it wasn't wrapped to the next line, but it was just partially displayed. In this case I believe it's much better to have a scrollbar that it's displayed only when needed than not having it at all, right?
=== modified file 'gtk/checkbox-
--- gtk/checkbox-
+++ gtk/checkbox-
@@ -211,7 +211,7 @@
</widget>
<packing>
<property name="padding"
- <property name="expand"
+ <property name="expand"
<property name="fill"
</packing>
</child>
@@ -220,7 +220,7 @@
<widget class="
<property name="visible"
<property name="can_
- <property name="hscrollba
+ <property name="hscrollba
<property name="vscrollba
<property name="shadow_
<property name="window_
Best regards,
Javier
P.S. I'm still wondering which editor and/or config do you use. I wasn't able to save any change with glade (neither v2 nor v3) without completely changing the whole file.
Javier Collado (javier.collado) wrote : | # |
Hello,
One more comment, I don't really like the way the suite description text is changed by the capitalize string method because some acronyms (USB, LED, CD/DVD) look weird (Usb, Led, Cd/dvd). If the aim is just to uppercase the first letter in the string, then I'd suggest this change:
=== modified file 'checkbox_
--- checkbox_
+++ checkbox_
@@ -265,7 +265,7 @@
vbox = self._get_
for option in options:
- label = "_%s" % option.capitalize()
+ label = "_%s" % (option[
Best regards,
Javier
Marc Tardif (cr3) wrote : | # |
* Javier Collado <email address hidden> [2009-11-06 08:32 -0000]:
> - <property name="expand"
> + <property name="expand"
Agreed.
> - <property name="hscrollba
> + <property name="hscrollba
I still don't agree that checkboxes should require horizontal scrolling.
However, you are absolutely correct that hiding the description is even
worse. So, the solution is quite simple actually:
+ radio_button.
The tricky part about this fix is that GtkCheckButton and GtkRadioButton
can only be passed a string as argument, rather than a Label object on
which we could call set_line_wrap. However, the former two classes in
fact generate a Label object internally accessible as a child, hence
the above fix.
> P.S. I'm still wondering which editor and/or config do you use. I
> wasn't able to save any change with glade (neither v2 nor v3) without
> completely changing the whole file.
Vim all the way. Unfortunately, glade doesn't support custom types.
Fortunately, the glade XML syntax is rather simple to grock.
Marc Tardif (cr3) wrote : | # |
I have just pushed the following diff to the trunk in response to your review, what do you think?
=== modified file 'checkbox_
--- checkbox_
+++ checkbox_
@@ -265,13 +265,14 @@
vbox = self._get_
for option in options:
- label = "_%s" % option.capitalize()
- radio_button = gtk.CheckButton
- radio_button.show()
- option_
- vbox.pack_
+ label = "_%s%s" % (option[0].upper(), option[1:])
+ check_button = gtk.CheckButton
+ check_button.
+ check_button.show()
+ option_
+ vbox.pack_
if option in default:
- radio_button.
+ check_button.
@@ -296,8 +297,9 @@
vbox = self._get_
for option in options:
- label = "_%s" % option.capitalize()
+ label = "_%s%s" % (option[0].upper(), option[1:])
+ radio_button.
=== modified file 'gtk/checkbox-
--- gtk/checkbox-
+++ gtk/checkbox-
@@ -211,7 +211,7 @@
- <property name="expand"
+ <property name="expand"
Javier Collado (javier.collado) wrote : | # |
Hello,
I tested the set_line_wrap method on the child label and the result was positive. Nice trick.
The label doesn't resize itself when the window is resized, but there isn't a real need now to resize the window or have a horizontal scrollbar.
Best regards,
Javier
Javier Collado (javier.collado) wrote : | # |
I agree with the diff. Also the change from radio_button to checkbox_button
makes the code clearer. Thanks.
Marc Tardif wrote:
> I have just pushed the following diff to the trunk in response to your review, what do you think?
>
> === modified file 'checkbox_
> --- checkbox_
> +++ checkbox_
> @@ -265,13 +265,14 @@
> option_table = {}
> vbox = self._get_
> for option in options:
> - label = "_%s" % option.capitalize()
> - radio_button = gtk.CheckButton
> - radio_button.show()
> - option_
> - vbox.pack_
> + label = "_%s%s" % (option[0].upper(), option[1:])
> + check_button = gtk.CheckButton
> + check_button.
> + check_button.show()
> + option_
> + vbox.pack_
> if option in default:
> - radio_button.
> + check_button.
>
> self._set_
>
> @@ -296,8 +297,9 @@
> option_table = {}
> vbox = self._get_
> for option in options:
> - label = "_%s" % option.capitalize()
> + label = "_%s%s" % (option[0].upper(), option[1:])
> radio_button = gtk.RadioButton
> + radio_button.
> radio_button.show()
> option_
> vbox.pack_
>
> === modified file 'gtk/checkbox-
> --- gtk/checkbox-
> +++ gtk/checkbox-
> @@ -211,7 +211,7 @@
> </widget>
> <packing>
> <property name="padding"
> - <property name="expand"
> + <property name="expand"
> <property name="fill"
> </packing>
> </child>
>
Preview Diff
1 | === modified file 'checkbox_gtk/gtk_interface.py' |
2 | --- checkbox_gtk/gtk_interface.py 2009-10-12 15:46:11 +0000 |
3 | +++ checkbox_gtk/gtk_interface.py 2009-11-05 19:40:28 +0000 |
4 | @@ -263,7 +263,7 @@ |
5 | |
6 | # Set options |
7 | option_table = {} |
8 | - vbox = self._get_widget("vbox_options") |
9 | + vbox = self._get_widget("vbox_options_list") |
10 | for option in options: |
11 | label = "_%s" % option.capitalize() |
12 | radio_button = gtk.CheckButton(label) |
13 | @@ -294,7 +294,7 @@ |
14 | # Set options |
15 | option_group = None |
16 | option_table = {} |
17 | - vbox = self._get_widget("vbox_options") |
18 | + vbox = self._get_widget("vbox_options_list") |
19 | for option in options: |
20 | label = "_%s" % option.capitalize() |
21 | radio_button = gtk.RadioButton(option_group, label) |
22 | |
23 | === modified file 'debian/changelog' |
24 | --- debian/changelog 2009-11-05 00:40:06 +0000 |
25 | +++ debian/changelog 2009-11-05 19:40:28 +0000 |
26 | @@ -3,6 +3,7 @@ |
27 | * Fixed strings in fingerprint and modem tests (LP: #457759) |
28 | * Fixed client side validation of Launchpad form (LP: #438671) |
29 | * Added support for apport default configuration (LP: #465447) |
30 | + * Added support for scrolled options list (LP: #411526) |
31 | * Added support for armv7l processor |
32 | |
33 | -- Marc Tardif <marc@ubuntu.com> Wed, 04 Nov 2009 19:36:09 -0400 |
34 | |
35 | === modified file 'gtk/checkbox-gtk.glade' |
36 | --- gtk/checkbox-gtk.glade 2009-07-22 18:02:57 +0000 |
37 | +++ gtk/checkbox-gtk.glade 2009-11-05 19:40:28 +0000 |
38 | @@ -181,7 +181,7 @@ |
39 | <property name="spacing">0</property> |
40 | |
41 | <child> |
42 | - <widget class="GtkScrolledWindow" id="scrolledwindow_options"> |
43 | + <widget class="GtkScrolledWindow" id="scrolledwindow_options_text"> |
44 | <property name="visible">True</property> |
45 | <property name="can_focus">True</property> |
46 | <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> |
47 | @@ -215,6 +215,41 @@ |
48 | <property name="fill">True</property> |
49 | </packing> |
50 | </child> |
51 | + |
52 | + <child> |
53 | + <widget class="GtkScrolledWindow" id="scrolledwindow_options_list"> |
54 | + <property name="visible">True</property> |
55 | + <property name="can_focus">True</property> |
56 | + <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> |
57 | + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> |
58 | + <property name="shadow_type">GTK_SHADOW_NONE</property> |
59 | + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> |
60 | + |
61 | + <child> |
62 | + <widget class="GtkViewport" id="viewport_options_list"> |
63 | + <property name="visible">True</property> |
64 | + <property name="shadow_type">GTK_SHADOW_IN</property> |
65 | + |
66 | + <child> |
67 | + <widget class="GtkVBox" id="vbox_options_list"> |
68 | + <property name="visible">True</property> |
69 | + <property name="homogeneous">False</property> |
70 | + <property name="spacing">0</property> |
71 | + |
72 | + <child> |
73 | + <placeholder/> |
74 | + </child> |
75 | + </widget> |
76 | + </child> |
77 | + </widget> |
78 | + </child> |
79 | + </widget> |
80 | + <packing> |
81 | + <property name="padding">0</property> |
82 | + <property name="expand">True</property> |
83 | + <property name="fill">True</property> |
84 | + </packing> |
85 | + </child> |
86 | </widget> |
87 | <packing> |
88 | <property name="tab_expand">False</property> |
This branch was merged by accident. Javier, I would still appreciate your review.