Merge lp:~nataliabidart/ubuntu-sso-client/tweaks into lp:ubuntu-sso-client

Proposed by Natalia Bidart on 2010-08-26
Status: Merged
Approved by: Natalia Bidart on 2010-08-26
Approved revision: 600
Merged at revision: 598
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/tweaks
Merge into: lp:ubuntu-sso-client
Diff against target: 134 lines (+35/-6)
2 files modified
ubuntu_sso/gui.py (+15/-6)
ubuntu_sso/tests/test_gui.py (+20/-0)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/tweaks
Reviewer Review Type Date Requested Status
Vincenzo Di Somma (community) Approve on 2010-08-26
John Lenton 2010-08-26 Approve on 2010-08-26
Review via email: mp+33821@code.launchpad.net

Commit message

* Customize "help_text" for the login only dialog (LP: #624097).
* Label areas are as wide as the parent window (LP: #616551).

Description of the change

* Customize "help_text" for the login only dialog (LP: #624097).
* Label areas are as wide as the parent window (LP: #616551).

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

To test the former, run:

DEBUG=1 PYTHONPATH=. ./bin/ubuntu-sso-login --login

Natalia Bidart (nataliabidart) wrote :

> To test the former, run:
>
> DEBUG=1 PYTHONPATH=. ./bin/ubuntu-sso-login --login

You'll get to see the "Lorem Ipsum" text under the header instead of the "To connect this computer to..." (this last message is seen when you click on "login" from the registration page).

John Lenton (chipaca) :
review: Approve
600. By Natalia Bidart on 2010-08-26

Attaching bug #.

Vincenzo Di Somma (vds) :
review: Approve
Natalia Bidart (nataliabidart) wrote :

> To test the former, run:
>
> DEBUG=1 PYTHONPATH=. ./bin/ubuntu-sso-login --login

I meant: DEBUG=1 PYTHONPATH=. ./bin/ubuntu-sso-login-gui --login

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/gui.py'
2--- ubuntu_sso/gui.py 2010-08-26 13:43:31 +0000
3+++ ubuntu_sso/gui.py 2010-08-26 19:03:41 +0000
4@@ -168,6 +168,7 @@
5 self.warning = warning_msg
6 self.set_property('secondary-icon-stock', gtk.STOCK_DIALOG_WARNING)
7 self.set_property('secondary-icon-sensitive', True)
8+ self.set_property('secondary-icon-activatable', False)
9 self.set_property('secondary-icon-tooltip-text', warning_msg)
10
11 def clear_warning(self):
12@@ -175,6 +176,7 @@
13 self.warning = None
14 self.set_property('secondary-icon-stock', None)
15 self.set_property('secondary-icon-sensitive', False)
16+ self.set_property('secondary-icon-activatable', False)
17 self.set_property('secondary-icon-tooltip-text', None)
18
19
20@@ -259,6 +261,7 @@
21 self.widgets = []
22 self.warnings = []
23 self.cancels = []
24+ self.labels = []
25 for obj in builder.get_objects():
26 name = getattr(obj, 'name', None)
27 if name is None and isinstance(obj, gtk.Buildable):
28@@ -275,6 +278,8 @@
29 if 'cancel_button' in name:
30 obj.connect('clicked', self.on_close_clicked)
31 self.cancels.append(obj)
32+ if 'label' in name:
33+ self.labels.append(obj)
34
35 self.entries = ('name_entry', 'email1_entry', 'email2_entry',
36 'password1_entry', 'password2_entry',
37@@ -292,8 +297,6 @@
38 assert getattr(self, name) is not None
39
40 self.window.set_icon_name('ubuntu-logo')
41- self.captcha_reload_button.set_tooltip_text(
42- self.CAPTCHA_RELOAD_TOOLTIP)
43
44 self.bus = dbus.SessionBus()
45 self.bus.add_signal_receiver = self._log(self.bus.add_signal_receiver)
46@@ -323,9 +326,14 @@
47 self._append_page(self._build_verify_email_page())
48 self.login_button.grab_focus()
49 self._set_current_page(self.enter_details_vbox)
50+ self.window.set_size_request(550, 600)
51+ size_req = (self.window.get_size_request()[0], -1)
52+ for label in self.labels:
53+ label.set_size_request(*size_req)
54 else:
55 self.login_back_button.hide()
56 self.login_ok_button.grab_focus()
57+ self.login_vbox.help_text = help_text
58 self._set_current_page(self.login_vbox)
59
60 self._setup_signals()
61@@ -488,10 +496,11 @@
62
63 self.enter_details_vbox.pack_start(self.name_entry, expand=False)
64 self.enter_details_vbox.reorder_child(self.name_entry, 0)
65- self.captcha_solution_vbox.pack_start(self.captcha_solution_entry,
66- expand=False)
67- self.captcha_solution_vbox.reorder_child(self.captcha_solution_entry,
68- 0)
69+ entry = self.captcha_solution_entry
70+ self.captcha_solution_vbox.pack_start(entry, expand=False)
71+ self.captcha_solution_vbox.reorder_child(entry, 0)
72+ msg = self.CAPTCHA_RELOAD_TOOLTIP
73+ self.captcha_reload_button.set_tooltip_text(msg)
74
75 self.emails_hbox.pack_start(self.email1_entry)
76 self.emails_hbox.pack_start(self.email2_entry)
77
78=== modified file 'ubuntu_sso/tests/test_gui.py'
79--- ubuntu_sso/tests/test_gui.py 2010-08-26 00:56:39 +0000
80+++ ubuntu_sso/tests/test_gui.py 2010-08-26 19:03:41 +0000
81@@ -269,6 +269,8 @@
82 None)
83 self.assertEqual(self.entry.get_property('secondary-icon-sensitive'),
84 False)
85+ self.assertEqual(self.entry.get_property('secondary-icon-activatable'),
86+ False)
87 prop = self.entry.get_property('secondary-icon-tooltip-text')
88 self.assertEqual(prop, None)
89
90@@ -281,6 +283,8 @@
91 gtk.STOCK_DIALOG_WARNING)
92 self.assertEqual(self.entry.get_property('secondary-icon-sensitive'),
93 True)
94+ self.assertEqual(self.entry.get_property('secondary-icon-activatable'),
95+ False)
96 prop = self.entry.get_property('secondary-icon-tooltip-text')
97 self.assertEqual(prop, msg)
98
99@@ -292,6 +296,8 @@
100 None)
101 self.assertEqual(self.entry.get_property('secondary-icon-sensitive'),
102 False)
103+ self.assertEqual(self.entry.get_property('secondary-icon-activatable'),
104+ False)
105 prop = self.entry.get_property('secondary-icon-tooltip-text')
106 self.assertEqual(prop, None)
107
108@@ -533,6 +539,16 @@
109 # text content is correct
110 self.assertEqual(expected, actual, msg % (name, expected, actual))
111
112+ def test_initial_size_for_labels(self):
113+ """Labels have the correct width."""
114+ expected = (self.ui.window.get_size_request()[0], -1)
115+ msg = 'Label %r must have size request %s (got %s instead).'
116+ labels = [i for i in self.ui.widgets if 'label' in i]
117+ for label in labels:
118+ widget = getattr(self.ui, label)
119+ actual = widget.get_size_request()
120+ self.assertEqual(expected, actual, msg % (label, expected, actual))
121+
122 def test_password_fields_are_password(self):
123 msg = '"%s" should be a password LabeledEntry instance.'
124 passwords = filter(lambda name: 'password' in name,
125@@ -1408,6 +1424,10 @@
126 """The login_ok_button has the focus."""
127 self.assertTrue(self.ui.login_ok_button.is_focus())
128
129+ def test_help_text_is_used(self):
130+ """The passed help_text is used."""
131+ self.assertEqual(self.ui.help_label.get_text(), HELP_TEXT)
132+
133
134 class SignalsTestCase(UbuntuSSOClientTestCase):
135

Subscribers

People subscribed via source and target branches