Merge lp:~nataliabidart/ubuntu-sso-client/gtk-gi into lp:ubuntu-sso-client
- gtk-gi
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||||||
Approved revision: | 862 | ||||||||
Merged at revision: | 843 | ||||||||
Proposed branch: | lp:~nataliabidart/ubuntu-sso-client/gtk-gi | ||||||||
Merge into: | lp:ubuntu-sso-client | ||||||||
Prerequisite: | lp:~alecu/ubuntu-sso-client/use-restful-client | ||||||||
Diff against target: |
2630 lines (+720/-500) 32 files modified
data/gtk/ui.glade (+314/-180) run-tests (+13/-15) ubuntu_sso/account.py (+7/-3) ubuntu_sso/gtk/__init__.py (+1/-3) ubuntu_sso/gtk/gui.py (+90/-60) ubuntu_sso/gtk/main.py (+5/-3) ubuntu_sso/gtk/tests/__init__.py (+1/-3) ubuntu_sso/gtk/tests/test_gui.py (+76/-56) ubuntu_sso/gtk/tests/test_main.py (+4/-4) ubuntu_sso/keyring/__init__.py (+17/-9) ubuntu_sso/keyring/tests/test_common.py (+4/-5) ubuntu_sso/keyring/tests/test_linux.py (+1/-1) ubuntu_sso/logger.py (+20/-4) ubuntu_sso/main/__init__.py (+2/-2) ubuntu_sso/main/glib.py (+45/-0) ubuntu_sso/main/linux.py (+27/-22) ubuntu_sso/main/qt.py (+49/-0) ubuntu_sso/main/windows.py (+1/-1) ubuntu_sso/qt/gui.py (+2/-1) ubuntu_sso/qt/tests/login_u_p.py (+16/-5) ubuntu_sso/qt/tests/show_gui.py (+5/-6) ubuntu_sso/qt/tests/test_controllers.py (+4/-3) ubuntu_sso/qt/tests/test_enchanced_line_edit.py (+3/-2) ubuntu_sso/qt/tests/test_reset_password.py (+2/-1) ubuntu_sso/tests/__init__.py (+2/-2) ubuntu_sso/tests/bin/show_gui (+0/-58) ubuntu_sso/tests/bin/show_nm_state (+0/-41) ubuntu_sso/tests/test_account.py (+1/-1) ubuntu_sso/utils/tests/test_txsecrets.py (+3/-0) ubuntu_sso/utils/webclient/__init__.py (+2/-4) ubuntu_sso/utils/webclient/qtnetwork.py (+2/-0) ubuntu_sso/utils/webclient/tests/test_webclient.py (+1/-5) |
||||||||
To merge this branch: | bzr merge lp:~nataliabidart/ubuntu-sso-client/gtk-gi | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
dobey (community) | Approve | ||
Roberto Alsina (community) | Approve | ||
Review via email: mp+90134@code.launchpad.net |
Commit message
- Added a dedicated logger for the gui module.
- Migrated the GTK UI to use GI bindings (LP: #801111).
- Enabled libsoup backend for webclient so the GTK UI will work.
- Enabled the running of all the tests using the single command ./run-tests.
- Added an initial version of GLib and Qt mainloop integration (needed to run all the tests).
Description of the change
You need to be running latest Ubuntu One nightlies in order this branch to work.
Also, if testing IRL, please note that the captcha image will not load because of bug #921822 (the rest of the remote calls works perfectly).
Another thing to note is that the change in the .glade file is caused by the upgrade of the syntax to latest Glade version (the changes were the result of opening the file in Glade @ precise, adding the activate-link signal handler to the 2 LinkButton we have, saving, and closing the file).
dobey (dobey) wrote : | # |
I'm seeing a lot of the following error, in the GTK+ tests, though the tests still pass:
Gtk-WARNING **: Unable to show 'foo': Operation not supported
Do you know why this is happening?
dobey (dobey) wrote : | # |
There also seem to be some differences from the currently shipped version, in terms of size/layout. Is there a way to test all of the pieces without actually creating a new account? I'm not really sure how to test this IRL, beyond the simple "i already have an account" piece, without making real accounts.
Natalia Bidart (nataliabidart) wrote : | # |
> I'm seeing a lot of the following error, in the GTK+ tests, though the tests
> still pass:
>
> Gtk-WARNING **: Unable to show 'foo': Operation not supported
>
> Do you know why this is happening?
Yes. In the UI we have a couple of LinkButton's that are not meant to open any link in any browser. I added a dummy callback (on_activate_link) and I connected it with those buttons to the activate-link signal. According to the doc, if I define a handler for the activate-signal and return True, http://
Natalia Bidart (nataliabidart) wrote : | # |
> There also seem to be some differences from the currently shipped version, in
> terms of size/layout. Is there a way to test all of the pieces without
> actually creating a new account? I'm not really sure how to test this IRL,
> beyond the simple "i already have an account" piece, without making real
> accounts.
Yes, there are some size differences, but shouldn't be layout differences.
The way of test is actually creating SSO accounts... but you can do it for dummy applications and not for Ubuntu One (so your U1 metadata does not get messed up). To do so:
* in a terminal pointing to this branch run:
DEBUG=True PYTHONPATH=. bin/ubuntu-
* open d-feet and connect to the session bus, look for the com.ubuntu.sso service, and go to the CredentialsMana
'Foo', {}
or:
'Foo Bar', {'help_text': 'something for test here'}
When you execute one of the methods above, you should get a GTK window with the login or register screen in it, and you should be able to login or create a kinda dummy account.
dobey (dobey) wrote : | # |
https:/
dobey (dobey) wrote : | # |
Looks OK to me. I think we'll need a bug against python-gi for breaking ^C. I'll file it shortly. I have filed bug #925042 against ubuntu-sso-client for the label wrapping issue.
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~nataliabidart/ubuntu-sso-client/gtk-gi into lp:ubuntu-sso-client failed. Below is the output from the failed tests.
*** Running test suite for ubuntu_sso ***
ubuntu_
AccountTestCase
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
EnvironOverri
test_
test_
test_
twisted.
TestCase
runTest ... [OK]
ubuntu_
TimestampedAu
test_
ubuntu_
BasicTestCase
runTest ... [OK]
ClearCredenti
test_
test_
CredentialsAu
test_
CredentialsCa
test_
test_
test_
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~nataliabidart/ubuntu-sso-client/gtk-gi into lp:ubuntu-sso-client failed. Below is the output from the failed tests.
*** Running test suite for ubuntu_sso ***
ubuntu_
AccountTestCase
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
EnvironOverri
test_
test_
test_
twisted.
TestCase
runTest ... [OK]
ubuntu_
TimestampedAu
test_
ubuntu_
BasicTestCase
runTest ... [OK]
ClearCredenti
test_
test_
CredentialsAu
test_
CredentialsCa
test_
test_
test_
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~nataliabidart/ubuntu-sso-client/gtk-gi into lp:ubuntu-sso-client failed. Below is the output from the failed tests.
*** Running test suite for ubuntu_sso ***
xvfb-run: error: Xvfb failed to start
- 859. By Natalia Bidart
-
- Adding proper cleanup for GTK windows created during tests.
- 860. By Natalia Bidart
-
- Add cleanups calls to every created UI.
- 861. By Natalia Bidart
-
Attaching new bug number.
- 862. By Natalia Bidart
-
Merged trunk in.
Preview Diff
1 | === modified file 'data/gtk/ui.glade' | |||
2 | --- data/gtk/ui.glade 2011-09-19 13:09:46 +0000 | |||
3 | +++ data/gtk/ui.glade 2012-02-02 18:14:19 +0000 | |||
4 | @@ -1,72 +1,14 @@ | |||
5 | 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
6 | 2 | <interface> | 2 | <interface> |
7 | 3 | <requires lib="gtk+" version="2.16"/> | 3 | <requires lib="gtk+" version="2.16"/> |
8 | 4 | <!-- interface-naming-policy project-wide --> | ||
9 | 5 | <object class="GtkWindow" id="window"> | ||
10 | 6 | <property name="border_width">10</property> | ||
11 | 7 | <property name="window_position">center</property> | ||
12 | 8 | <signal name="delete_event" handler="on_close_clicked"/> | ||
13 | 9 | <child> | ||
14 | 10 | <object class="GtkVBox" id="window_vbox"> | ||
15 | 11 | <property name="visible">True</property> | ||
16 | 12 | <property name="spacing">5</property> | ||
17 | 13 | <child> | ||
18 | 14 | <object class="GtkLabel" id="header_label"> | ||
19 | 15 | <property name="visible">True</property> | ||
20 | 16 | <property name="xalign">0</property> | ||
21 | 17 | <property name="label" translatable="yes">Header Label </property> | ||
22 | 18 | <property name="wrap">True</property> | ||
23 | 19 | </object> | ||
24 | 20 | <packing> | ||
25 | 21 | <property name="expand">False</property> | ||
26 | 22 | <property name="padding">5</property> | ||
27 | 23 | <property name="position">0</property> | ||
28 | 24 | </packing> | ||
29 | 25 | </child> | ||
30 | 26 | <child> | ||
31 | 27 | <object class="GtkLabel" id="help_label"> | ||
32 | 28 | <property name="visible">True</property> | ||
33 | 29 | <property name="xalign">0</property> | ||
34 | 30 | <property name="label" translatable="yes">help label</property> | ||
35 | 31 | <property name="wrap">True</property> | ||
36 | 32 | </object> | ||
37 | 33 | <packing> | ||
38 | 34 | <property name="expand">False</property> | ||
39 | 35 | <property name="position">1</property> | ||
40 | 36 | </packing> | ||
41 | 37 | </child> | ||
42 | 38 | <child> | ||
43 | 39 | <object class="GtkLabel" id="warning_label"> | ||
44 | 40 | <property name="visible">True</property> | ||
45 | 41 | <property name="xalign">0</property> | ||
46 | 42 | <property name="label" translatable="yes">warning label</property> | ||
47 | 43 | <property name="wrap">True</property> | ||
48 | 44 | </object> | ||
49 | 45 | <packing> | ||
50 | 46 | <property name="expand">False</property> | ||
51 | 47 | <property name="position">2</property> | ||
52 | 48 | </packing> | ||
53 | 49 | </child> | ||
54 | 50 | <child> | ||
55 | 51 | <object class="GtkNotebook" id="content"> | ||
56 | 52 | <property name="visible">True</property> | ||
57 | 53 | <property name="can_focus">True</property> | ||
58 | 54 | <property name="show_tabs">False</property> | ||
59 | 55 | <property name="show_border">False</property> | ||
60 | 56 | </object> | ||
61 | 57 | <packing> | ||
62 | 58 | <property name="position">3</property> | ||
63 | 59 | </packing> | ||
64 | 60 | </child> | ||
65 | 61 | </object> | ||
66 | 62 | </child> | ||
67 | 63 | </object> | ||
68 | 64 | <object class="GtkVBox" id="enter_details_vbox"> | 4 | <object class="GtkVBox" id="enter_details_vbox"> |
69 | 65 | <property name="visible">True</property> | 5 | <property name="visible">True</property> |
70 | 6 | <property name="can_focus">False</property> | ||
71 | 66 | <property name="spacing">5</property> | 7 | <property name="spacing">5</property> |
72 | 67 | <child> | 8 | <child> |
73 | 68 | <object class="GtkHBox" id="emails_hbox"> | 9 | <object class="GtkHBox" id="emails_hbox"> |
74 | 69 | <property name="visible">True</property> | 10 | <property name="visible">True</property> |
75 | 11 | <property name="can_focus">False</property> | ||
76 | 70 | <property name="spacing">5</property> | 12 | <property name="spacing">5</property> |
77 | 71 | <property name="homogeneous">True</property> | 13 | <property name="homogeneous">True</property> |
78 | 72 | <child> | 14 | <child> |
79 | @@ -78,12 +20,14 @@ | |||
80 | 78 | </object> | 20 | </object> |
81 | 79 | <packing> | 21 | <packing> |
82 | 80 | <property name="expand">False</property> | 22 | <property name="expand">False</property> |
83 | 23 | <property name="fill">True</property> | ||
84 | 81 | <property name="position">0</property> | 24 | <property name="position">0</property> |
85 | 82 | </packing> | 25 | </packing> |
86 | 83 | </child> | 26 | </child> |
87 | 84 | <child> | 27 | <child> |
88 | 85 | <object class="GtkHBox" id="passwords_hbox"> | 28 | <object class="GtkHBox" id="passwords_hbox"> |
89 | 86 | <property name="visible">True</property> | 29 | <property name="visible">True</property> |
90 | 30 | <property name="can_focus">False</property> | ||
91 | 87 | <property name="spacing">5</property> | 31 | <property name="spacing">5</property> |
92 | 88 | <property name="homogeneous">True</property> | 32 | <property name="homogeneous">True</property> |
93 | 89 | <child> | 33 | <child> |
94 | @@ -95,38 +39,45 @@ | |||
95 | 95 | </object> | 39 | </object> |
96 | 96 | <packing> | 40 | <packing> |
97 | 97 | <property name="expand">False</property> | 41 | <property name="expand">False</property> |
98 | 42 | <property name="fill">True</property> | ||
99 | 98 | <property name="position">1</property> | 43 | <property name="position">1</property> |
100 | 99 | </packing> | 44 | </packing> |
101 | 100 | </child> | 45 | </child> |
102 | 101 | <child> | 46 | <child> |
103 | 102 | <object class="GtkLabel" id="password_help_label"> | 47 | <object class="GtkLabel" id="password_help_label"> |
104 | 103 | <property name="visible">True</property> | 48 | <property name="visible">True</property> |
105 | 49 | <property name="can_focus">False</property> | ||
106 | 104 | <property name="label">password help</property> | 50 | <property name="label">password help</property> |
107 | 105 | <property name="wrap">True</property> | 51 | <property name="wrap">True</property> |
108 | 106 | </object> | 52 | </object> |
109 | 107 | <packing> | 53 | <packing> |
110 | 108 | <property name="expand">False</property> | 54 | <property name="expand">False</property> |
111 | 55 | <property name="fill">True</property> | ||
112 | 109 | <property name="position">2</property> | 56 | <property name="position">2</property> |
113 | 110 | </packing> | 57 | </packing> |
114 | 111 | </child> | 58 | </child> |
115 | 112 | <child> | 59 | <child> |
116 | 113 | <object class="GtkAlignment" id="alignment5"> | 60 | <object class="GtkAlignment" id="alignment5"> |
117 | 114 | <property name="visible">True</property> | 61 | <property name="visible">True</property> |
118 | 62 | <property name="can_focus">False</property> | ||
119 | 115 | <property name="xscale">0</property> | 63 | <property name="xscale">0</property> |
120 | 116 | <property name="yscale">0</property> | 64 | <property name="yscale">0</property> |
121 | 117 | <child> | 65 | <child> |
122 | 118 | <object class="GtkHBox" id="hbox1"> | 66 | <object class="GtkHBox" id="hbox1"> |
123 | 119 | <property name="visible">True</property> | 67 | <property name="visible">True</property> |
124 | 68 | <property name="can_focus">False</property> | ||
125 | 120 | <child> | 69 | <child> |
126 | 121 | <object class="GtkVBox" id="captcha_vbox"> | 70 | <object class="GtkVBox" id="captcha_vbox"> |
127 | 122 | <property name="width_request">300</property> | 71 | <property name="width_request">300</property> |
128 | 123 | <property name="height_request">60</property> | 72 | <property name="height_request">60</property> |
129 | 124 | <property name="visible">True</property> | 73 | <property name="visible">True</property> |
130 | 74 | <property name="can_focus">False</property> | ||
131 | 125 | <child> | 75 | <child> |
132 | 126 | <object class="GtkEventBox" id="captcha_loading"> | 76 | <object class="GtkEventBox" id="captcha_loading"> |
133 | 127 | <property name="width_request">300</property> | 77 | <property name="width_request">300</property> |
134 | 128 | <property name="height_request">60</property> | 78 | <property name="height_request">60</property> |
135 | 129 | <property name="visible">True</property> | 79 | <property name="visible">True</property> |
136 | 80 | <property name="can_focus">False</property> | ||
137 | 130 | <child> | 81 | <child> |
138 | 131 | <placeholder/> | 82 | <placeholder/> |
139 | 132 | </child> | 83 | </child> |
140 | @@ -141,9 +92,12 @@ | |||
141 | 141 | <object class="GtkImage" id="captcha_image"> | 92 | <object class="GtkImage" id="captcha_image"> |
142 | 142 | <property name="width_request">300</property> | 93 | <property name="width_request">300</property> |
143 | 143 | <property name="visible">True</property> | 94 | <property name="visible">True</property> |
144 | 95 | <property name="can_focus">False</property> | ||
145 | 144 | <property name="stock">gtk-missing-image</property> | 96 | <property name="stock">gtk-missing-image</property> |
146 | 145 | </object> | 97 | </object> |
147 | 146 | <packing> | 98 | <packing> |
148 | 99 | <property name="expand">True</property> | ||
149 | 100 | <property name="fill">True</property> | ||
150 | 147 | <property name="position">1</property> | 101 | <property name="position">1</property> |
151 | 148 | </packing> | 102 | </packing> |
152 | 149 | </child> | 103 | </child> |
153 | @@ -157,23 +111,28 @@ | |||
154 | 157 | <child> | 111 | <child> |
155 | 158 | <object class="GtkVBox" id="vbox1"> | 112 | <object class="GtkVBox" id="vbox1"> |
156 | 159 | <property name="visible">True</property> | 113 | <property name="visible">True</property> |
157 | 114 | <property name="can_focus">False</property> | ||
158 | 160 | <child> | 115 | <child> |
159 | 161 | <object class="GtkButton" id="captcha_reload_button"> | 116 | <object class="GtkButton" id="captcha_reload_button"> |
160 | 117 | <property name="use_action_appearance">False</property> | ||
161 | 162 | <property name="visible">True</property> | 118 | <property name="visible">True</property> |
162 | 163 | <property name="can_focus">True</property> | 119 | <property name="can_focus">True</property> |
163 | 164 | <property name="receives_default">True</property> | 120 | <property name="receives_default">True</property> |
164 | 121 | <property name="use_action_appearance">False</property> | ||
165 | 165 | <property name="relief">none</property> | 122 | <property name="relief">none</property> |
166 | 166 | <property name="focus_on_click">False</property> | 123 | <property name="focus_on_click">False</property> |
168 | 167 | <signal name="clicked" handler="on_captcha_reload_button_clicked"/> | 124 | <signal name="clicked" handler="on_captcha_reload_button_clicked" swapped="no"/> |
169 | 168 | <child> | 125 | <child> |
170 | 169 | <object class="GtkImage" id="image1"> | 126 | <object class="GtkImage" id="image1"> |
171 | 170 | <property name="visible">True</property> | 127 | <property name="visible">True</property> |
172 | 128 | <property name="can_focus">False</property> | ||
173 | 171 | <property name="icon_name">reload</property> | 129 | <property name="icon_name">reload</property> |
174 | 172 | </object> | 130 | </object> |
175 | 173 | </child> | 131 | </child> |
176 | 174 | </object> | 132 | </object> |
177 | 175 | <packing> | 133 | <packing> |
178 | 176 | <property name="expand">False</property> | 134 | <property name="expand">False</property> |
179 | 135 | <property name="fill">True</property> | ||
180 | 177 | <property name="position">0</property> | 136 | <property name="position">0</property> |
181 | 178 | </packing> | 137 | </packing> |
182 | 179 | </child> | 138 | </child> |
183 | @@ -186,6 +145,7 @@ | |||
184 | 186 | </object> | 145 | </object> |
185 | 187 | <packing> | 146 | <packing> |
186 | 188 | <property name="expand">False</property> | 147 | <property name="expand">False</property> |
187 | 148 | <property name="fill">True</property> | ||
188 | 189 | <property name="position">1</property> | 149 | <property name="position">1</property> |
189 | 190 | </packing> | 150 | </packing> |
190 | 191 | </child> | 151 | </child> |
191 | @@ -194,64 +154,76 @@ | |||
192 | 194 | </object> | 154 | </object> |
193 | 195 | <packing> | 155 | <packing> |
194 | 196 | <property name="expand">False</property> | 156 | <property name="expand">False</property> |
195 | 157 | <property name="fill">True</property> | ||
196 | 197 | <property name="position">3</property> | 158 | <property name="position">3</property> |
197 | 198 | </packing> | 159 | </packing> |
198 | 199 | </child> | 160 | </child> |
199 | 200 | <child> | 161 | <child> |
200 | 201 | <object class="GtkVBox" id="captcha_solution_vbox"> | 162 | <object class="GtkVBox" id="captcha_solution_vbox"> |
201 | 202 | <property name="visible">True</property> | 163 | <property name="visible">True</property> |
202 | 164 | <property name="can_focus">False</property> | ||
203 | 203 | <child> | 165 | <child> |
204 | 204 | <placeholder/> | 166 | <placeholder/> |
205 | 205 | </child> | 167 | </child> |
206 | 206 | </object> | 168 | </object> |
207 | 207 | <packing> | 169 | <packing> |
208 | 208 | <property name="expand">False</property> | 170 | <property name="expand">False</property> |
209 | 171 | <property name="fill">True</property> | ||
210 | 209 | <property name="position">4</property> | 172 | <property name="position">4</property> |
211 | 210 | </packing> | 173 | </packing> |
212 | 211 | </child> | 174 | </child> |
213 | 212 | <child> | 175 | <child> |
214 | 213 | <object class="GtkCheckButton" id="yes_to_updates_checkbutton"> | 176 | <object class="GtkCheckButton" id="yes_to_updates_checkbutton"> |
215 | 214 | <property name="label" translatable="yes">yes to updates</property> | 177 | <property name="label" translatable="yes">yes to updates</property> |
216 | 178 | <property name="use_action_appearance">False</property> | ||
217 | 215 | <property name="visible">True</property> | 179 | <property name="visible">True</property> |
218 | 216 | <property name="can_focus">True</property> | 180 | <property name="can_focus">True</property> |
219 | 217 | <property name="receives_default">False</property> | 181 | <property name="receives_default">False</property> |
220 | 182 | <property name="use_action_appearance">False</property> | ||
221 | 218 | <property name="active">True</property> | 183 | <property name="active">True</property> |
222 | 219 | <property name="draw_indicator">True</property> | 184 | <property name="draw_indicator">True</property> |
223 | 220 | </object> | 185 | </object> |
224 | 221 | <packing> | 186 | <packing> |
225 | 222 | <property name="expand">False</property> | 187 | <property name="expand">False</property> |
226 | 188 | <property name="fill">True</property> | ||
227 | 223 | <property name="position">5</property> | 189 | <property name="position">5</property> |
228 | 224 | </packing> | 190 | </packing> |
229 | 225 | </child> | 191 | </child> |
230 | 226 | <child> | 192 | <child> |
231 | 227 | <object class="GtkVBox" id="tc_vbox"> | 193 | <object class="GtkVBox" id="tc_vbox"> |
232 | 228 | <property name="visible">True</property> | 194 | <property name="visible">True</property> |
233 | 195 | <property name="can_focus">False</property> | ||
234 | 229 | <property name="spacing">5</property> | 196 | <property name="spacing">5</property> |
235 | 230 | <child> | 197 | <child> |
236 | 231 | <object class="GtkCheckButton" id="yes_to_tc_checkbutton"> | 198 | <object class="GtkCheckButton" id="yes_to_tc_checkbutton"> |
237 | 232 | <property name="label" translatable="yes">yes to tc</property> | 199 | <property name="label" translatable="yes">yes to tc</property> |
238 | 200 | <property name="use_action_appearance">False</property> | ||
239 | 233 | <property name="visible">True</property> | 201 | <property name="visible">True</property> |
240 | 234 | <property name="can_focus">True</property> | 202 | <property name="can_focus">True</property> |
241 | 235 | <property name="receives_default">False</property> | 203 | <property name="receives_default">False</property> |
243 | 236 | <property name="active">False</property> | 204 | <property name="use_action_appearance">False</property> |
244 | 237 | <property name="draw_indicator">True</property> | 205 | <property name="draw_indicator">True</property> |
245 | 238 | </object> | 206 | </object> |
246 | 239 | <packing> | 207 | <packing> |
247 | 240 | <property name="expand">False</property> | 208 | <property name="expand">False</property> |
248 | 209 | <property name="fill">True</property> | ||
249 | 241 | <property name="position">0</property> | 210 | <property name="position">0</property> |
250 | 242 | </packing> | 211 | </packing> |
251 | 243 | </child> | 212 | </child> |
252 | 244 | <child> | 213 | <child> |
253 | 245 | <object class="GtkHButtonBox" id="hbuttonbox3"> | 214 | <object class="GtkHButtonBox" id="hbuttonbox3"> |
254 | 246 | <property name="visible">True</property> | 215 | <property name="visible">True</property> |
255 | 216 | <property name="can_focus">False</property> | ||
256 | 247 | <property name="layout_style">start</property> | 217 | <property name="layout_style">start</property> |
257 | 248 | <child> | 218 | <child> |
258 | 249 | <object class="GtkButton" id="tc_button"> | 219 | <object class="GtkButton" id="tc_button"> |
259 | 250 | <property name="label">show tc</property> | 220 | <property name="label">show tc</property> |
260 | 221 | <property name="use_action_appearance">False</property> | ||
261 | 251 | <property name="visible">True</property> | 222 | <property name="visible">True</property> |
262 | 252 | <property name="can_focus">True</property> | 223 | <property name="can_focus">True</property> |
263 | 253 | <property name="receives_default">True</property> | 224 | <property name="receives_default">True</property> |
265 | 254 | <signal name="clicked" handler="on_tc_button_clicked"/> | 225 | <property name="use_action_appearance">False</property> |
266 | 226 | <signal name="clicked" handler="on_tc_button_clicked" swapped="no"/> | ||
267 | 255 | </object> | 227 | </object> |
268 | 256 | <packing> | 228 | <packing> |
269 | 257 | <property name="expand">False</property> | 229 | <property name="expand">False</property> |
270 | @@ -262,42 +234,53 @@ | |||
271 | 262 | </object> | 234 | </object> |
272 | 263 | <packing> | 235 | <packing> |
273 | 264 | <property name="expand">False</property> | 236 | <property name="expand">False</property> |
274 | 237 | <property name="fill">True</property> | ||
275 | 265 | <property name="position">1</property> | 238 | <property name="position">1</property> |
276 | 266 | </packing> | 239 | </packing> |
277 | 267 | </child> | 240 | </child> |
278 | 268 | <child> | 241 | <child> |
279 | 269 | <object class="GtkLabel" id="tc_warning_label"> | 242 | <object class="GtkLabel" id="tc_warning_label"> |
280 | 270 | <property name="visible">True</property> | 243 | <property name="visible">True</property> |
281 | 244 | <property name="can_focus">False</property> | ||
282 | 271 | <property name="xalign">0</property> | 245 | <property name="xalign">0</property> |
283 | 272 | <property name="label">tc warning</property> | 246 | <property name="label">tc warning</property> |
284 | 273 | <property name="wrap">True</property> | 247 | <property name="wrap">True</property> |
285 | 274 | </object> | 248 | </object> |
286 | 275 | <packing> | 249 | <packing> |
287 | 250 | <property name="expand">True</property> | ||
288 | 251 | <property name="fill">True</property> | ||
289 | 276 | <property name="position">2</property> | 252 | <property name="position">2</property> |
290 | 277 | </packing> | 253 | </packing> |
291 | 278 | </child> | 254 | </child> |
292 | 279 | </object> | 255 | </object> |
293 | 280 | <packing> | 256 | <packing> |
294 | 281 | <property name="expand">False</property> | 257 | <property name="expand">False</property> |
295 | 258 | <property name="fill">True</property> | ||
296 | 282 | <property name="position">6</property> | 259 | <property name="position">6</property> |
297 | 283 | </packing> | 260 | </packing> |
298 | 284 | </child> | 261 | </child> |
299 | 285 | <child> | 262 | <child> |
300 | 286 | <object class="GtkHBox" id="hbox2"> | 263 | <object class="GtkHBox" id="hbox2"> |
301 | 287 | <property name="visible">True</property> | 264 | <property name="visible">True</property> |
302 | 265 | <property name="can_focus">False</property> | ||
303 | 288 | <property name="spacing">5</property> | 266 | <property name="spacing">5</property> |
304 | 289 | <child> | 267 | <child> |
305 | 290 | <object class="GtkHButtonBox" id="hbuttonbox9"> | 268 | <object class="GtkHButtonBox" id="hbuttonbox9"> |
306 | 291 | <property name="visible">True</property> | 269 | <property name="visible">True</property> |
307 | 270 | <property name="can_focus">False</property> | ||
308 | 292 | <property name="layout_style">start</property> | 271 | <property name="layout_style">start</property> |
309 | 293 | <child> | 272 | <child> |
310 | 294 | <object class="GtkLinkButton" id="login_button"> | 273 | <object class="GtkLinkButton" id="login_button"> |
311 | 295 | <property name="label">login button</property> | 274 | <property name="label">login button</property> |
312 | 275 | <property name="use_action_appearance">False</property> | ||
313 | 296 | <property name="visible">True</property> | 276 | <property name="visible">True</property> |
314 | 297 | <property name="can_focus">True</property> | 277 | <property name="can_focus">True</property> |
315 | 298 | <property name="receives_default">True</property> | 278 | <property name="receives_default">True</property> |
316 | 279 | <property name="use_action_appearance">False</property> | ||
317 | 299 | <property name="relief">none</property> | 280 | <property name="relief">none</property> |
319 | 300 | <signal name="clicked" handler="on_sign_in_button_clicked"/> | 281 | <property name="uri">foo</property> |
320 | 282 | <signal name="activate-link" handler="on_activate_link" swapped="no"/> | ||
321 | 283 | <signal name="clicked" handler="on_sign_in_button_clicked" swapped="no"/> | ||
322 | 301 | </object> | 284 | </object> |
323 | 302 | <packing> | 285 | <packing> |
324 | 303 | <property name="expand">False</property> | 286 | <property name="expand">False</property> |
325 | @@ -308,20 +291,24 @@ | |||
326 | 308 | </object> | 291 | </object> |
327 | 309 | <packing> | 292 | <packing> |
328 | 310 | <property name="expand">False</property> | 293 | <property name="expand">False</property> |
329 | 294 | <property name="fill">True</property> | ||
330 | 311 | <property name="position">0</property> | 295 | <property name="position">0</property> |
331 | 312 | </packing> | 296 | </packing> |
332 | 313 | </child> | 297 | </child> |
333 | 314 | <child> | 298 | <child> |
334 | 315 | <object class="GtkHButtonBox" id="hbuttonbox1"> | 299 | <object class="GtkHButtonBox" id="hbuttonbox1"> |
335 | 316 | <property name="visible">True</property> | 300 | <property name="visible">True</property> |
336 | 301 | <property name="can_focus">False</property> | ||
337 | 317 | <property name="spacing">5</property> | 302 | <property name="spacing">5</property> |
338 | 318 | <property name="layout_style">end</property> | 303 | <property name="layout_style">end</property> |
339 | 319 | <child> | 304 | <child> |
340 | 320 | <object class="GtkButton" id="join_cancel_button"> | 305 | <object class="GtkButton" id="join_cancel_button"> |
341 | 321 | <property name="label">gtk-cancel</property> | 306 | <property name="label">gtk-cancel</property> |
342 | 307 | <property name="use_action_appearance">False</property> | ||
343 | 322 | <property name="visible">True</property> | 308 | <property name="visible">True</property> |
344 | 323 | <property name="can_focus">True</property> | 309 | <property name="can_focus">True</property> |
345 | 324 | <property name="receives_default">True</property> | 310 | <property name="receives_default">True</property> |
346 | 311 | <property name="use_action_appearance">False</property> | ||
347 | 325 | <property name="use_stock">True</property> | 312 | <property name="use_stock">True</property> |
348 | 326 | </object> | 313 | </object> |
349 | 327 | <packing> | 314 | <packing> |
350 | @@ -333,11 +320,13 @@ | |||
351 | 333 | <child> | 320 | <child> |
352 | 334 | <object class="GtkButton" id="join_ok_button"> | 321 | <object class="GtkButton" id="join_ok_button"> |
353 | 335 | <property name="label">gtk-go-forward</property> | 322 | <property name="label">gtk-go-forward</property> |
354 | 323 | <property name="use_action_appearance">False</property> | ||
355 | 336 | <property name="visible">True</property> | 324 | <property name="visible">True</property> |
356 | 337 | <property name="can_focus">True</property> | 325 | <property name="can_focus">True</property> |
357 | 338 | <property name="receives_default">True</property> | 326 | <property name="receives_default">True</property> |
358 | 327 | <property name="use_action_appearance">False</property> | ||
359 | 339 | <property name="use_stock">True</property> | 328 | <property name="use_stock">True</property> |
361 | 340 | <signal name="clicked" handler="on_join_ok_button_clicked"/> | 329 | <signal name="clicked" handler="on_join_ok_button_clicked" swapped="no"/> |
362 | 341 | </object> | 330 | </object> |
363 | 342 | <packing> | 331 | <packing> |
364 | 343 | <property name="expand">False</property> | 332 | <property name="expand">False</property> |
365 | @@ -348,6 +337,7 @@ | |||
366 | 348 | </object> | 337 | </object> |
367 | 349 | <packing> | 338 | <packing> |
368 | 350 | <property name="expand">False</property> | 339 | <property name="expand">False</property> |
369 | 340 | <property name="fill">True</property> | ||
370 | 351 | <property name="pack_type">end</property> | 341 | <property name="pack_type">end</property> |
371 | 352 | <property name="position">1</property> | 342 | <property name="position">1</property> |
372 | 353 | </packing> | 343 | </packing> |
373 | @@ -355,122 +345,72 @@ | |||
374 | 355 | </object> | 345 | </object> |
375 | 356 | <packing> | 346 | <packing> |
376 | 357 | <property name="expand">False</property> | 347 | <property name="expand">False</property> |
377 | 348 | <property name="fill">True</property> | ||
378 | 358 | <property name="pack_type">end</property> | 349 | <property name="pack_type">end</property> |
379 | 359 | <property name="position">7</property> | 350 | <property name="position">7</property> |
380 | 360 | </packing> | 351 | </packing> |
381 | 361 | </child> | 352 | </child> |
382 | 362 | </object> | 353 | </object> |
479 | 363 | <object class="GtkVBox" id="processing_vbox"> | 354 | <object class="GtkVBox" id="finish_vbox"> |
480 | 364 | <property name="visible">True</property> | 355 | <property name="visible">True</property> |
481 | 365 | <property name="spacing">10</property> | 356 | <property name="can_focus">False</property> |
482 | 366 | <child> | 357 | <property name="spacing">10</property> |
483 | 367 | <placeholder/> | 358 | <child> |
484 | 368 | </child> | 359 | <object class="GtkLabel" id="finish_label"> |
485 | 369 | </object> | 360 | <property name="visible">True</property> |
486 | 370 | <object class="GtkVBox" id="verify_email_vbox"> | 361 | <property name="can_focus">False</property> |
487 | 371 | <property name="visible">True</property> | 362 | <property name="wrap">True</property> |
488 | 372 | <property name="spacing">10</property> | 363 | </object> |
489 | 373 | <child> | 364 | <packing> |
490 | 374 | <object class="GtkAlignment" id="alignment4"> | 365 | <property name="expand">True</property> |
491 | 375 | <property name="visible">True</property> | 366 | <property name="fill">True</property> |
492 | 376 | <property name="xscale">0</property> | 367 | <property name="position">0</property> |
493 | 377 | <property name="yscale">0</property> | 368 | </packing> |
494 | 378 | <child> | 369 | </child> |
495 | 379 | <object class="GtkVBox" id="verify_email_details_vbox"> | 370 | <child> |
496 | 380 | <property name="visible">True</property> | 371 | <object class="GtkHButtonBox" id="hbuttonbox8"> |
497 | 381 | <child> | 372 | <property name="visible">True</property> |
498 | 382 | <placeholder/> | 373 | <property name="can_focus">False</property> |
499 | 383 | </child> | 374 | <property name="layout_style">end</property> |
500 | 384 | </object> | 375 | <child> |
501 | 385 | </child> | 376 | <object class="GtkButton" id="finish_close_button"> |
502 | 386 | </object> | 377 | <property name="label">gtk-close</property> |
503 | 387 | <packing> | 378 | <property name="use_action_appearance">False</property> |
504 | 388 | <property name="position">0</property> | 379 | <property name="visible">True</property> |
505 | 389 | </packing> | 380 | <property name="can_focus">True</property> |
506 | 390 | </child> | 381 | <property name="receives_default">True</property> |
507 | 391 | <child> | 382 | <property name="use_action_appearance">False</property> |
508 | 392 | <object class="GtkHButtonBox" id="hbuttonbox2"> | 383 | <property name="use_stock">True</property> |
509 | 393 | <property name="visible">True</property> | 384 | <signal name="clicked" handler="on_close_clicked" swapped="no"/> |
510 | 394 | <property name="spacing">5</property> | 385 | </object> |
511 | 395 | <property name="layout_style">end</property> | 386 | <packing> |
512 | 396 | <child> | 387 | <property name="expand">False</property> |
513 | 397 | <object class="GtkButton" id="verify_token_button"> | 388 | <property name="fill">False</property> |
514 | 398 | <property name="label">gtk-ok</property> | 389 | <property name="position">0</property> |
515 | 399 | <property name="visible">True</property> | 390 | </packing> |
516 | 400 | <property name="can_focus">True</property> | 391 | </child> |
517 | 401 | <property name="receives_default">True</property> | 392 | </object> |
518 | 402 | <property name="use_stock">True</property> | 393 | <packing> |
519 | 403 | <signal name="clicked" handler="on_verify_token_button_clicked"/> | 394 | <property name="expand">False</property> |
520 | 404 | </object> | 395 | <property name="fill">True</property> |
425 | 405 | <packing> | ||
426 | 406 | <property name="expand">False</property> | ||
427 | 407 | <property name="fill">False</property> | ||
428 | 408 | <property name="position">0</property> | ||
429 | 409 | </packing> | ||
430 | 410 | </child> | ||
431 | 411 | </object> | ||
432 | 412 | <packing> | ||
433 | 413 | <property name="expand">False</property> | ||
434 | 414 | <property name="position">1</property> | ||
435 | 415 | </packing> | ||
436 | 416 | </child> | ||
437 | 417 | </object> | ||
438 | 418 | <object class="GtkVBox" id="tc_browser_vbox"> | ||
439 | 419 | <property name="visible">True</property> | ||
440 | 420 | <signal name="hide" handler="on_tc_browser_vbox_hide"/> | ||
441 | 421 | <child> | ||
442 | 422 | <object class="GtkScrolledWindow" id="tc_browser_window"> | ||
443 | 423 | <property name="visible">True</property> | ||
444 | 424 | <property name="can_focus">True</property> | ||
445 | 425 | <property name="border_width">10</property> | ||
446 | 426 | <property name="hscrollbar_policy">never</property> | ||
447 | 427 | <property name="vscrollbar_policy">automatic</property> | ||
448 | 428 | <property name="shadow_type">in</property> | ||
449 | 429 | <child> | ||
450 | 430 | <placeholder/> | ||
451 | 431 | </child> | ||
452 | 432 | </object> | ||
453 | 433 | <packing> | ||
454 | 434 | <property name="position">0</property> | ||
455 | 435 | </packing> | ||
456 | 436 | </child> | ||
457 | 437 | <child> | ||
458 | 438 | <object class="GtkHButtonBox" id="hbuttonbox4"> | ||
459 | 439 | <property name="visible">True</property> | ||
460 | 440 | <property name="layout_style">end</property> | ||
461 | 441 | <child> | ||
462 | 442 | <object class="GtkButton" id="tc_back_button"> | ||
463 | 443 | <property name="label">gtk-go-back</property> | ||
464 | 444 | <property name="visible">True</property> | ||
465 | 445 | <property name="can_focus">True</property> | ||
466 | 446 | <property name="receives_default">True</property> | ||
467 | 447 | <property name="use_stock">True</property> | ||
468 | 448 | <signal name="clicked" handler="on_tc_back_button_clicked"/> | ||
469 | 449 | </object> | ||
470 | 450 | <packing> | ||
471 | 451 | <property name="expand">False</property> | ||
472 | 452 | <property name="fill">False</property> | ||
473 | 453 | <property name="position">0</property> | ||
474 | 454 | </packing> | ||
475 | 455 | </child> | ||
476 | 456 | </object> | ||
477 | 457 | <packing> | ||
478 | 458 | <property name="expand">False</property> | ||
521 | 459 | <property name="position">1</property> | 396 | <property name="position">1</property> |
522 | 460 | </packing> | 397 | </packing> |
523 | 461 | </child> | 398 | </child> |
524 | 462 | </object> | 399 | </object> |
525 | 463 | <object class="GtkVBox" id="login_vbox"> | 400 | <object class="GtkVBox" id="login_vbox"> |
526 | 464 | <property name="visible">True</property> | 401 | <property name="visible">True</property> |
527 | 402 | <property name="can_focus">False</property> | ||
528 | 465 | <property name="spacing">10</property> | 403 | <property name="spacing">10</property> |
529 | 466 | <child> | 404 | <child> |
530 | 467 | <object class="GtkAlignment" id="alignment3"> | 405 | <object class="GtkAlignment" id="alignment3"> |
531 | 468 | <property name="visible">True</property> | 406 | <property name="visible">True</property> |
532 | 407 | <property name="can_focus">False</property> | ||
533 | 469 | <property name="xscale">0</property> | 408 | <property name="xscale">0</property> |
534 | 470 | <property name="yscale">0</property> | 409 | <property name="yscale">0</property> |
535 | 471 | <child> | 410 | <child> |
536 | 472 | <object class="GtkVBox" id="login_details_vbox"> | 411 | <object class="GtkVBox" id="login_details_vbox"> |
537 | 473 | <property name="visible">True</property> | 412 | <property name="visible">True</property> |
538 | 413 | <property name="can_focus">False</property> | ||
539 | 474 | <property name="spacing">5</property> | 414 | <property name="spacing">5</property> |
540 | 475 | <child> | 415 | <child> |
541 | 476 | <placeholder/> | 416 | <placeholder/> |
542 | @@ -482,26 +422,34 @@ | |||
543 | 482 | </child> | 422 | </child> |
544 | 483 | </object> | 423 | </object> |
545 | 484 | <packing> | 424 | <packing> |
546 | 425 | <property name="expand">True</property> | ||
547 | 426 | <property name="fill">True</property> | ||
548 | 485 | <property name="position">0</property> | 427 | <property name="position">0</property> |
549 | 486 | </packing> | 428 | </packing> |
550 | 487 | </child> | 429 | </child> |
551 | 488 | <child> | 430 | <child> |
552 | 489 | <object class="GtkHBox" id="hbox3"> | 431 | <object class="GtkHBox" id="hbox3"> |
553 | 490 | <property name="visible">True</property> | 432 | <property name="visible">True</property> |
554 | 433 | <property name="can_focus">False</property> | ||
555 | 491 | <property name="spacing">5</property> | 434 | <property name="spacing">5</property> |
556 | 492 | <child> | 435 | <child> |
557 | 493 | <object class="GtkHButtonBox" id="hbuttonbox10"> | 436 | <object class="GtkHButtonBox" id="hbuttonbox10"> |
558 | 494 | <property name="visible">True</property> | 437 | <property name="visible">True</property> |
559 | 438 | <property name="can_focus">False</property> | ||
560 | 495 | <property name="layout_style">start</property> | 439 | <property name="layout_style">start</property> |
561 | 496 | <child> | 440 | <child> |
562 | 497 | <object class="GtkLinkButton" id="forgotten_password_button"> | 441 | <object class="GtkLinkButton" id="forgotten_password_button"> |
564 | 498 | <property name="label" translatable="yes">button</property> | 442 | <property name="label" translatable="yes">forgot password button</property> |
565 | 443 | <property name="use_action_appearance">False</property> | ||
566 | 499 | <property name="visible">True</property> | 444 | <property name="visible">True</property> |
567 | 500 | <property name="can_focus">True</property> | 445 | <property name="can_focus">True</property> |
568 | 501 | <property name="receives_default">True</property> | 446 | <property name="receives_default">True</property> |
569 | 502 | <property name="has_tooltip">True</property> | 447 | <property name="has_tooltip">True</property> |
570 | 448 | <property name="use_action_appearance">False</property> | ||
571 | 503 | <property name="relief">none</property> | 449 | <property name="relief">none</property> |
573 | 504 | <signal name="clicked" handler="on_forgotten_password_button_clicked"/> | 450 | <property name="uri">foo</property> |
574 | 451 | <signal name="activate-link" handler="on_activate_link" swapped="no"/> | ||
575 | 452 | <signal name="clicked" handler="on_forgotten_password_button_clicked" swapped="no"/> | ||
576 | 505 | </object> | 453 | </object> |
577 | 506 | <packing> | 454 | <packing> |
578 | 507 | <property name="expand">False</property> | 455 | <property name="expand">False</property> |
579 | @@ -513,20 +461,24 @@ | |||
580 | 513 | </object> | 461 | </object> |
581 | 514 | <packing> | 462 | <packing> |
582 | 515 | <property name="expand">False</property> | 463 | <property name="expand">False</property> |
583 | 464 | <property name="fill">True</property> | ||
584 | 516 | <property name="position">0</property> | 465 | <property name="position">0</property> |
585 | 517 | </packing> | 466 | </packing> |
586 | 518 | </child> | 467 | </child> |
587 | 519 | <child> | 468 | <child> |
588 | 520 | <object class="GtkHButtonBox" id="hbuttonbox5"> | 469 | <object class="GtkHButtonBox" id="hbuttonbox5"> |
589 | 521 | <property name="visible">True</property> | 470 | <property name="visible">True</property> |
590 | 471 | <property name="can_focus">False</property> | ||
591 | 522 | <property name="spacing">5</property> | 472 | <property name="spacing">5</property> |
592 | 523 | <property name="layout_style">end</property> | 473 | <property name="layout_style">end</property> |
593 | 524 | <child> | 474 | <child> |
594 | 525 | <object class="GtkButton" id="login_cancel_button"> | 475 | <object class="GtkButton" id="login_cancel_button"> |
595 | 526 | <property name="label">gtk-cancel</property> | 476 | <property name="label">gtk-cancel</property> |
596 | 477 | <property name="use_action_appearance">False</property> | ||
597 | 527 | <property name="visible">True</property> | 478 | <property name="visible">True</property> |
598 | 528 | <property name="can_focus">True</property> | 479 | <property name="can_focus">True</property> |
599 | 529 | <property name="receives_default">True</property> | 480 | <property name="receives_default">True</property> |
600 | 481 | <property name="use_action_appearance">False</property> | ||
601 | 530 | <property name="use_stock">True</property> | 482 | <property name="use_stock">True</property> |
602 | 531 | </object> | 483 | </object> |
603 | 532 | <packing> | 484 | <packing> |
604 | @@ -538,11 +490,13 @@ | |||
605 | 538 | <child> | 490 | <child> |
606 | 539 | <object class="GtkButton" id="login_back_button"> | 491 | <object class="GtkButton" id="login_back_button"> |
607 | 540 | <property name="label">gtk-go-back</property> | 492 | <property name="label">gtk-go-back</property> |
608 | 493 | <property name="use_action_appearance">False</property> | ||
609 | 541 | <property name="visible">True</property> | 494 | <property name="visible">True</property> |
610 | 542 | <property name="can_focus">True</property> | 495 | <property name="can_focus">True</property> |
611 | 543 | <property name="receives_default">True</property> | 496 | <property name="receives_default">True</property> |
612 | 497 | <property name="use_action_appearance">False</property> | ||
613 | 544 | <property name="use_stock">True</property> | 498 | <property name="use_stock">True</property> |
615 | 545 | <signal name="clicked" handler="on_login_back_button_clicked"/> | 499 | <signal name="clicked" handler="on_login_back_button_clicked" swapped="no"/> |
616 | 546 | </object> | 500 | </object> |
617 | 547 | <packing> | 501 | <packing> |
618 | 548 | <property name="expand">False</property> | 502 | <property name="expand">False</property> |
619 | @@ -553,11 +507,13 @@ | |||
620 | 553 | <child> | 507 | <child> |
621 | 554 | <object class="GtkButton" id="login_ok_button"> | 508 | <object class="GtkButton" id="login_ok_button"> |
622 | 555 | <property name="label">gtk-connect</property> | 509 | <property name="label">gtk-connect</property> |
623 | 510 | <property name="use_action_appearance">False</property> | ||
624 | 556 | <property name="visible">True</property> | 511 | <property name="visible">True</property> |
625 | 557 | <property name="can_focus">True</property> | 512 | <property name="can_focus">True</property> |
626 | 558 | <property name="receives_default">True</property> | 513 | <property name="receives_default">True</property> |
627 | 514 | <property name="use_action_appearance">False</property> | ||
628 | 559 | <property name="use_stock">True</property> | 515 | <property name="use_stock">True</property> |
630 | 560 | <signal name="clicked" handler="on_login_connect_button_clicked"/> | 516 | <signal name="clicked" handler="on_login_connect_button_clicked" swapped="no"/> |
631 | 561 | </object> | 517 | </object> |
632 | 562 | <packing> | 518 | <packing> |
633 | 563 | <property name="expand">False</property> | 519 | <property name="expand">False</property> |
634 | @@ -568,6 +524,7 @@ | |||
635 | 568 | </object> | 524 | </object> |
636 | 569 | <packing> | 525 | <packing> |
637 | 570 | <property name="expand">False</property> | 526 | <property name="expand">False</property> |
638 | 527 | <property name="fill">True</property> | ||
639 | 571 | <property name="pack_type">end</property> | 528 | <property name="pack_type">end</property> |
640 | 572 | <property name="position">1</property> | 529 | <property name="position">1</property> |
641 | 573 | </packing> | 530 | </packing> |
642 | @@ -575,21 +532,33 @@ | |||
643 | 575 | </object> | 532 | </object> |
644 | 576 | <packing> | 533 | <packing> |
645 | 577 | <property name="expand">False</property> | 534 | <property name="expand">False</property> |
646 | 535 | <property name="fill">True</property> | ||
647 | 578 | <property name="position">1</property> | 536 | <property name="position">1</property> |
648 | 579 | </packing> | 537 | </packing> |
649 | 580 | </child> | 538 | </child> |
650 | 581 | </object> | 539 | </object> |
651 | 540 | <object class="GtkVBox" id="processing_vbox"> | ||
652 | 541 | <property name="visible">True</property> | ||
653 | 542 | <property name="can_focus">False</property> | ||
654 | 543 | <property name="spacing">10</property> | ||
655 | 544 | <child> | ||
656 | 545 | <placeholder/> | ||
657 | 546 | </child> | ||
658 | 547 | </object> | ||
659 | 582 | <object class="GtkVBox" id="request_password_token_vbox"> | 548 | <object class="GtkVBox" id="request_password_token_vbox"> |
660 | 583 | <property name="visible">True</property> | 549 | <property name="visible">True</property> |
661 | 550 | <property name="can_focus">False</property> | ||
662 | 584 | <property name="spacing">10</property> | 551 | <property name="spacing">10</property> |
663 | 585 | <child> | 552 | <child> |
664 | 586 | <object class="GtkAlignment" id="alignment2"> | 553 | <object class="GtkAlignment" id="alignment2"> |
665 | 587 | <property name="visible">True</property> | 554 | <property name="visible">True</property> |
666 | 555 | <property name="can_focus">False</property> | ||
667 | 588 | <property name="xscale">0</property> | 556 | <property name="xscale">0</property> |
668 | 589 | <property name="yscale">0</property> | 557 | <property name="yscale">0</property> |
669 | 590 | <child> | 558 | <child> |
670 | 591 | <object class="GtkVBox" id="request_password_token_details_vbox"> | 559 | <object class="GtkVBox" id="request_password_token_details_vbox"> |
671 | 592 | <property name="visible">True</property> | 560 | <property name="visible">True</property> |
672 | 561 | <property name="can_focus">False</property> | ||
673 | 593 | <property name="spacing">5</property> | 562 | <property name="spacing">5</property> |
674 | 594 | <child> | 563 | <child> |
675 | 595 | <placeholder/> | 564 | <placeholder/> |
676 | @@ -598,20 +567,25 @@ | |||
677 | 598 | </child> | 567 | </child> |
678 | 599 | </object> | 568 | </object> |
679 | 600 | <packing> | 569 | <packing> |
680 | 570 | <property name="expand">True</property> | ||
681 | 571 | <property name="fill">True</property> | ||
682 | 601 | <property name="position">0</property> | 572 | <property name="position">0</property> |
683 | 602 | </packing> | 573 | </packing> |
684 | 603 | </child> | 574 | </child> |
685 | 604 | <child> | 575 | <child> |
686 | 605 | <object class="GtkHButtonBox" id="hbuttonbox7"> | 576 | <object class="GtkHButtonBox" id="hbuttonbox7"> |
687 | 606 | <property name="visible">True</property> | 577 | <property name="visible">True</property> |
688 | 578 | <property name="can_focus">False</property> | ||
689 | 607 | <property name="spacing">5</property> | 579 | <property name="spacing">5</property> |
690 | 608 | <property name="layout_style">end</property> | 580 | <property name="layout_style">end</property> |
691 | 609 | <child> | 581 | <child> |
692 | 610 | <object class="GtkButton" id="request_password_token_cancel_button"> | 582 | <object class="GtkButton" id="request_password_token_cancel_button"> |
693 | 611 | <property name="label">gtk-cancel</property> | 583 | <property name="label">gtk-cancel</property> |
694 | 584 | <property name="use_action_appearance">False</property> | ||
695 | 612 | <property name="visible">True</property> | 585 | <property name="visible">True</property> |
696 | 613 | <property name="can_focus">True</property> | 586 | <property name="can_focus">True</property> |
697 | 614 | <property name="receives_default">True</property> | 587 | <property name="receives_default">True</property> |
698 | 588 | <property name="use_action_appearance">False</property> | ||
699 | 615 | <property name="use_stock">True</property> | 589 | <property name="use_stock">True</property> |
700 | 616 | </object> | 590 | </object> |
701 | 617 | <packing> | 591 | <packing> |
702 | @@ -623,11 +597,13 @@ | |||
703 | 623 | <child> | 597 | <child> |
704 | 624 | <object class="GtkButton" id="request_password_token_back_button"> | 598 | <object class="GtkButton" id="request_password_token_back_button"> |
705 | 625 | <property name="label">gtk-go-back</property> | 599 | <property name="label">gtk-go-back</property> |
706 | 600 | <property name="use_action_appearance">False</property> | ||
707 | 626 | <property name="visible">True</property> | 601 | <property name="visible">True</property> |
708 | 627 | <property name="can_focus">True</property> | 602 | <property name="can_focus">True</property> |
709 | 628 | <property name="receives_default">True</property> | 603 | <property name="receives_default">True</property> |
710 | 604 | <property name="use_action_appearance">False</property> | ||
711 | 629 | <property name="use_stock">True</property> | 605 | <property name="use_stock">True</property> |
713 | 630 | <signal name="clicked" handler="on_request_password_token_back_button_clicked"/> | 606 | <signal name="clicked" handler="on_request_password_token_back_button_clicked" swapped="no"/> |
714 | 631 | </object> | 607 | </object> |
715 | 632 | <packing> | 608 | <packing> |
716 | 633 | <property name="expand">False</property> | 609 | <property name="expand">False</property> |
717 | @@ -638,11 +614,13 @@ | |||
718 | 638 | <child> | 614 | <child> |
719 | 639 | <object class="GtkButton" id="request_password_token_ok_button"> | 615 | <object class="GtkButton" id="request_password_token_ok_button"> |
720 | 640 | <property name="label">gtk-ok</property> | 616 | <property name="label">gtk-ok</property> |
721 | 617 | <property name="use_action_appearance">False</property> | ||
722 | 641 | <property name="visible">True</property> | 618 | <property name="visible">True</property> |
723 | 642 | <property name="can_focus">True</property> | 619 | <property name="can_focus">True</property> |
724 | 643 | <property name="receives_default">True</property> | 620 | <property name="receives_default">True</property> |
725 | 621 | <property name="use_action_appearance">False</property> | ||
726 | 644 | <property name="use_stock">True</property> | 622 | <property name="use_stock">True</property> |
728 | 645 | <signal name="clicked" handler="on_request_password_token_ok_button_clicked"/> | 623 | <signal name="clicked" handler="on_request_password_token_ok_button_clicked" swapped="no"/> |
729 | 646 | </object> | 624 | </object> |
730 | 647 | <packing> | 625 | <packing> |
731 | 648 | <property name="expand">False</property> | 626 | <property name="expand">False</property> |
732 | @@ -653,35 +631,42 @@ | |||
733 | 653 | </object> | 631 | </object> |
734 | 654 | <packing> | 632 | <packing> |
735 | 655 | <property name="expand">False</property> | 633 | <property name="expand">False</property> |
736 | 634 | <property name="fill">True</property> | ||
737 | 656 | <property name="position">1</property> | 635 | <property name="position">1</property> |
738 | 657 | </packing> | 636 | </packing> |
739 | 658 | </child> | 637 | </child> |
740 | 659 | </object> | 638 | </object> |
741 | 660 | <object class="GtkVBox" id="set_new_password_vbox"> | 639 | <object class="GtkVBox" id="set_new_password_vbox"> |
742 | 661 | <property name="visible">True</property> | 640 | <property name="visible">True</property> |
743 | 641 | <property name="can_focus">False</property> | ||
744 | 662 | <property name="spacing">10</property> | 642 | <property name="spacing">10</property> |
745 | 663 | <child> | 643 | <child> |
746 | 664 | <object class="GtkVBox" id="vbox2"> | 644 | <object class="GtkVBox" id="vbox2"> |
747 | 665 | <property name="visible">True</property> | 645 | <property name="visible">True</property> |
748 | 646 | <property name="can_focus">False</property> | ||
749 | 666 | <child> | 647 | <child> |
750 | 667 | <object class="GtkLabel" id="reset_password_help_label"> | 648 | <object class="GtkLabel" id="reset_password_help_label"> |
751 | 668 | <property name="visible">True</property> | 649 | <property name="visible">True</property> |
752 | 650 | <property name="can_focus">False</property> | ||
753 | 669 | <property name="label">label</property> | 651 | <property name="label">label</property> |
754 | 670 | <property name="wrap">True</property> | 652 | <property name="wrap">True</property> |
755 | 671 | </object> | 653 | </object> |
756 | 672 | <packing> | 654 | <packing> |
757 | 673 | <property name="expand">False</property> | 655 | <property name="expand">False</property> |
758 | 656 | <property name="fill">True</property> | ||
759 | 674 | <property name="position">0</property> | 657 | <property name="position">0</property> |
760 | 675 | </packing> | 658 | </packing> |
761 | 676 | </child> | 659 | </child> |
762 | 677 | <child> | 660 | <child> |
763 | 678 | <object class="GtkAlignment" id="alignment1"> | 661 | <object class="GtkAlignment" id="alignment1"> |
764 | 679 | <property name="visible">True</property> | 662 | <property name="visible">True</property> |
765 | 663 | <property name="can_focus">False</property> | ||
766 | 680 | <property name="xscale">0</property> | 664 | <property name="xscale">0</property> |
767 | 681 | <property name="yscale">0</property> | 665 | <property name="yscale">0</property> |
768 | 682 | <child> | 666 | <child> |
769 | 683 | <object class="GtkVBox" id="set_new_password_details_vbox"> | 667 | <object class="GtkVBox" id="set_new_password_details_vbox"> |
770 | 684 | <property name="visible">True</property> | 668 | <property name="visible">True</property> |
771 | 669 | <property name="can_focus">False</property> | ||
772 | 685 | <property name="spacing">5</property> | 670 | <property name="spacing">5</property> |
773 | 686 | <child> | 671 | <child> |
774 | 687 | <placeholder/> | 672 | <placeholder/> |
775 | @@ -696,25 +681,32 @@ | |||
776 | 696 | </child> | 681 | </child> |
777 | 697 | </object> | 682 | </object> |
778 | 698 | <packing> | 683 | <packing> |
779 | 684 | <property name="expand">True</property> | ||
780 | 685 | <property name="fill">True</property> | ||
781 | 699 | <property name="position">1</property> | 686 | <property name="position">1</property> |
782 | 700 | </packing> | 687 | </packing> |
783 | 701 | </child> | 688 | </child> |
784 | 702 | </object> | 689 | </object> |
785 | 703 | <packing> | 690 | <packing> |
786 | 691 | <property name="expand">True</property> | ||
787 | 692 | <property name="fill">True</property> | ||
788 | 704 | <property name="position">0</property> | 693 | <property name="position">0</property> |
789 | 705 | </packing> | 694 | </packing> |
790 | 706 | </child> | 695 | </child> |
791 | 707 | <child> | 696 | <child> |
792 | 708 | <object class="GtkHButtonBox" id="hbuttonbox6"> | 697 | <object class="GtkHButtonBox" id="hbuttonbox6"> |
793 | 709 | <property name="visible">True</property> | 698 | <property name="visible">True</property> |
794 | 699 | <property name="can_focus">False</property> | ||
795 | 710 | <property name="spacing">5</property> | 700 | <property name="spacing">5</property> |
796 | 711 | <property name="layout_style">end</property> | 701 | <property name="layout_style">end</property> |
797 | 712 | <child> | 702 | <child> |
798 | 713 | <object class="GtkButton" id="set_new_password_cancel_button"> | 703 | <object class="GtkButton" id="set_new_password_cancel_button"> |
799 | 714 | <property name="label">gtk-cancel</property> | 704 | <property name="label">gtk-cancel</property> |
800 | 705 | <property name="use_action_appearance">False</property> | ||
801 | 715 | <property name="visible">True</property> | 706 | <property name="visible">True</property> |
802 | 716 | <property name="can_focus">True</property> | 707 | <property name="can_focus">True</property> |
803 | 717 | <property name="receives_default">True</property> | 708 | <property name="receives_default">True</property> |
804 | 709 | <property name="use_action_appearance">False</property> | ||
805 | 718 | <property name="use_stock">True</property> | 710 | <property name="use_stock">True</property> |
806 | 719 | </object> | 711 | </object> |
807 | 720 | <packing> | 712 | <packing> |
808 | @@ -726,11 +718,13 @@ | |||
809 | 726 | <child> | 718 | <child> |
810 | 727 | <object class="GtkButton" id="set_new_password_ok_button"> | 719 | <object class="GtkButton" id="set_new_password_ok_button"> |
811 | 728 | <property name="label">gtk-ok</property> | 720 | <property name="label">gtk-ok</property> |
812 | 721 | <property name="use_action_appearance">False</property> | ||
813 | 729 | <property name="visible">True</property> | 722 | <property name="visible">True</property> |
814 | 730 | <property name="can_focus">True</property> | 723 | <property name="can_focus">True</property> |
815 | 731 | <property name="receives_default">True</property> | 724 | <property name="receives_default">True</property> |
816 | 725 | <property name="use_action_appearance">False</property> | ||
817 | 732 | <property name="use_stock">True</property> | 726 | <property name="use_stock">True</property> |
819 | 733 | <signal name="clicked" handler="on_set_new_password_ok_button_clicked"/> | 727 | <signal name="clicked" handler="on_set_new_password_ok_button_clicked" swapped="no"/> |
820 | 734 | </object> | 728 | </object> |
821 | 735 | <packing> | 729 | <packing> |
822 | 736 | <property name="expand">False</property> | 730 | <property name="expand">False</property> |
823 | @@ -741,34 +735,104 @@ | |||
824 | 741 | </object> | 735 | </object> |
825 | 742 | <packing> | 736 | <packing> |
826 | 743 | <property name="expand">False</property> | 737 | <property name="expand">False</property> |
833 | 744 | <property name="position">1</property> | 738 | <property name="fill">True</property> |
834 | 745 | </packing> | 739 | <property name="position">1</property> |
835 | 746 | </child> | 740 | </packing> |
836 | 747 | </object> | 741 | </child> |
837 | 748 | <object class="GtkVBox" id="finish_vbox"> | 742 | </object> |
838 | 749 | <property name="visible">True</property> | 743 | <object class="GtkVBox" id="tc_browser_vbox"> |
839 | 744 | <property name="visible">True</property> | ||
840 | 745 | <property name="can_focus">False</property> | ||
841 | 746 | <signal name="hide" handler="on_tc_browser_vbox_hide" swapped="no"/> | ||
842 | 747 | <child> | ||
843 | 748 | <object class="GtkScrolledWindow" id="tc_browser_window"> | ||
844 | 749 | <property name="visible">True</property> | ||
845 | 750 | <property name="can_focus">True</property> | ||
846 | 751 | <property name="border_width">10</property> | ||
847 | 752 | <property name="hscrollbar_policy">never</property> | ||
848 | 753 | <property name="shadow_type">in</property> | ||
849 | 754 | <child> | ||
850 | 755 | <placeholder/> | ||
851 | 756 | </child> | ||
852 | 757 | </object> | ||
853 | 758 | <packing> | ||
854 | 759 | <property name="expand">True</property> | ||
855 | 760 | <property name="fill">True</property> | ||
856 | 761 | <property name="position">0</property> | ||
857 | 762 | </packing> | ||
858 | 763 | </child> | ||
859 | 764 | <child> | ||
860 | 765 | <object class="GtkHButtonBox" id="hbuttonbox4"> | ||
861 | 766 | <property name="visible">True</property> | ||
862 | 767 | <property name="can_focus">False</property> | ||
863 | 768 | <property name="layout_style">end</property> | ||
864 | 769 | <child> | ||
865 | 770 | <object class="GtkButton" id="tc_back_button"> | ||
866 | 771 | <property name="label">gtk-go-back</property> | ||
867 | 772 | <property name="use_action_appearance">False</property> | ||
868 | 773 | <property name="visible">True</property> | ||
869 | 774 | <property name="can_focus">True</property> | ||
870 | 775 | <property name="receives_default">True</property> | ||
871 | 776 | <property name="use_action_appearance">False</property> | ||
872 | 777 | <property name="use_stock">True</property> | ||
873 | 778 | <signal name="clicked" handler="on_tc_back_button_clicked" swapped="no"/> | ||
874 | 779 | </object> | ||
875 | 780 | <packing> | ||
876 | 781 | <property name="expand">False</property> | ||
877 | 782 | <property name="fill">False</property> | ||
878 | 783 | <property name="position">0</property> | ||
879 | 784 | </packing> | ||
880 | 785 | </child> | ||
881 | 786 | </object> | ||
882 | 787 | <packing> | ||
883 | 788 | <property name="expand">False</property> | ||
884 | 789 | <property name="fill">True</property> | ||
885 | 790 | <property name="position">1</property> | ||
886 | 791 | </packing> | ||
887 | 792 | </child> | ||
888 | 793 | </object> | ||
889 | 794 | <object class="GtkVBox" id="verify_email_vbox"> | ||
890 | 795 | <property name="visible">True</property> | ||
891 | 796 | <property name="can_focus">False</property> | ||
892 | 750 | <property name="spacing">10</property> | 797 | <property name="spacing">10</property> |
893 | 751 | <child> | 798 | <child> |
895 | 752 | <object class="GtkLabel" id="finish_label"> | 799 | <object class="GtkAlignment" id="alignment4"> |
896 | 753 | <property name="visible">True</property> | 800 | <property name="visible">True</property> |
898 | 754 | <property name="wrap">True</property> | 801 | <property name="can_focus">False</property> |
899 | 802 | <property name="xscale">0</property> | ||
900 | 803 | <property name="yscale">0</property> | ||
901 | 804 | <child> | ||
902 | 805 | <object class="GtkVBox" id="verify_email_details_vbox"> | ||
903 | 806 | <property name="visible">True</property> | ||
904 | 807 | <property name="can_focus">False</property> | ||
905 | 808 | <child> | ||
906 | 809 | <placeholder/> | ||
907 | 810 | </child> | ||
908 | 811 | </object> | ||
909 | 812 | </child> | ||
910 | 755 | </object> | 813 | </object> |
911 | 756 | <packing> | 814 | <packing> |
912 | 815 | <property name="expand">True</property> | ||
913 | 816 | <property name="fill">True</property> | ||
914 | 757 | <property name="position">0</property> | 817 | <property name="position">0</property> |
915 | 758 | </packing> | 818 | </packing> |
916 | 759 | </child> | 819 | </child> |
917 | 760 | <child> | 820 | <child> |
919 | 761 | <object class="GtkHButtonBox" id="hbuttonbox8"> | 821 | <object class="GtkHButtonBox" id="hbuttonbox2"> |
920 | 762 | <property name="visible">True</property> | 822 | <property name="visible">True</property> |
921 | 823 | <property name="can_focus">False</property> | ||
922 | 824 | <property name="spacing">5</property> | ||
923 | 763 | <property name="layout_style">end</property> | 825 | <property name="layout_style">end</property> |
924 | 764 | <child> | 826 | <child> |
927 | 765 | <object class="GtkButton" id="finish_close_button"> | 827 | <object class="GtkButton" id="verify_token_button"> |
928 | 766 | <property name="label">gtk-close</property> | 828 | <property name="label">gtk-ok</property> |
929 | 829 | <property name="use_action_appearance">False</property> | ||
930 | 767 | <property name="visible">True</property> | 830 | <property name="visible">True</property> |
931 | 768 | <property name="can_focus">True</property> | 831 | <property name="can_focus">True</property> |
932 | 769 | <property name="receives_default">True</property> | 832 | <property name="receives_default">True</property> |
933 | 833 | <property name="use_action_appearance">False</property> | ||
934 | 770 | <property name="use_stock">True</property> | 834 | <property name="use_stock">True</property> |
936 | 771 | <signal name="clicked" handler="on_close_clicked"/> | 835 | <signal name="clicked" handler="on_verify_token_button_clicked" swapped="no"/> |
937 | 772 | </object> | 836 | </object> |
938 | 773 | <packing> | 837 | <packing> |
939 | 774 | <property name="expand">False</property> | 838 | <property name="expand">False</property> |
940 | @@ -779,8 +843,78 @@ | |||
941 | 779 | </object> | 843 | </object> |
942 | 780 | <packing> | 844 | <packing> |
943 | 781 | <property name="expand">False</property> | 845 | <property name="expand">False</property> |
944 | 846 | <property name="fill">True</property> | ||
945 | 782 | <property name="position">1</property> | 847 | <property name="position">1</property> |
946 | 783 | </packing> | 848 | </packing> |
947 | 784 | </child> | 849 | </child> |
948 | 785 | </object> | 850 | </object> |
949 | 851 | <object class="GtkWindow" id="window"> | ||
950 | 852 | <property name="can_focus">False</property> | ||
951 | 853 | <property name="border_width">10</property> | ||
952 | 854 | <property name="window_position">center</property> | ||
953 | 855 | <signal name="delete-event" handler="on_close_clicked" swapped="no"/> | ||
954 | 856 | <child> | ||
955 | 857 | <object class="GtkVBox" id="window_vbox"> | ||
956 | 858 | <property name="visible">True</property> | ||
957 | 859 | <property name="can_focus">False</property> | ||
958 | 860 | <property name="spacing">5</property> | ||
959 | 861 | <child> | ||
960 | 862 | <object class="GtkLabel" id="header_label"> | ||
961 | 863 | <property name="visible">True</property> | ||
962 | 864 | <property name="can_focus">False</property> | ||
963 | 865 | <property name="xalign">0</property> | ||
964 | 866 | <property name="label" translatable="yes">Header Label </property> | ||
965 | 867 | <property name="wrap">True</property> | ||
966 | 868 | </object> | ||
967 | 869 | <packing> | ||
968 | 870 | <property name="expand">False</property> | ||
969 | 871 | <property name="fill">True</property> | ||
970 | 872 | <property name="padding">5</property> | ||
971 | 873 | <property name="position">0</property> | ||
972 | 874 | </packing> | ||
973 | 875 | </child> | ||
974 | 876 | <child> | ||
975 | 877 | <object class="GtkLabel" id="help_label"> | ||
976 | 878 | <property name="visible">True</property> | ||
977 | 879 | <property name="can_focus">False</property> | ||
978 | 880 | <property name="xalign">0</property> | ||
979 | 881 | <property name="label" translatable="yes">help label</property> | ||
980 | 882 | <property name="wrap">True</property> | ||
981 | 883 | </object> | ||
982 | 884 | <packing> | ||
983 | 885 | <property name="expand">False</property> | ||
984 | 886 | <property name="fill">True</property> | ||
985 | 887 | <property name="position">1</property> | ||
986 | 888 | </packing> | ||
987 | 889 | </child> | ||
988 | 890 | <child> | ||
989 | 891 | <object class="GtkLabel" id="warning_label"> | ||
990 | 892 | <property name="visible">True</property> | ||
991 | 893 | <property name="can_focus">False</property> | ||
992 | 894 | <property name="xalign">0</property> | ||
993 | 895 | <property name="label" translatable="yes">warning label</property> | ||
994 | 896 | <property name="wrap">True</property> | ||
995 | 897 | </object> | ||
996 | 898 | <packing> | ||
997 | 899 | <property name="expand">False</property> | ||
998 | 900 | <property name="fill">True</property> | ||
999 | 901 | <property name="position">2</property> | ||
1000 | 902 | </packing> | ||
1001 | 903 | </child> | ||
1002 | 904 | <child> | ||
1003 | 905 | <object class="GtkNotebook" id="content"> | ||
1004 | 906 | <property name="visible">True</property> | ||
1005 | 907 | <property name="can_focus">True</property> | ||
1006 | 908 | <property name="show_tabs">False</property> | ||
1007 | 909 | <property name="show_border">False</property> | ||
1008 | 910 | </object> | ||
1009 | 911 | <packing> | ||
1010 | 912 | <property name="expand">True</property> | ||
1011 | 913 | <property name="fill">True</property> | ||
1012 | 914 | <property name="position">3</property> | ||
1013 | 915 | </packing> | ||
1014 | 916 | </child> | ||
1015 | 917 | </object> | ||
1016 | 918 | </child> | ||
1017 | 919 | </object> | ||
1018 | 786 | </interface> | 920 | </interface> |
1019 | 787 | 921 | ||
1020 | === modified file 'run-tests' | |||
1021 | --- run-tests 2012-02-01 19:19:32 +0000 | |||
1022 | +++ run-tests 2012-02-02 18:14:19 +0000 | |||
1023 | @@ -22,13 +22,6 @@ | |||
1024 | 22 | 22 | ||
1025 | 23 | set -e | 23 | set -e |
1026 | 24 | 24 | ||
1027 | 25 | if [ "$1" == "-qt" ]; then | ||
1028 | 26 | USE_QT=1 | ||
1029 | 27 | shift | ||
1030 | 28 | else | ||
1031 | 29 | USE_QT=0 | ||
1032 | 30 | fi | ||
1033 | 31 | |||
1034 | 32 | if [ $# -ne 0 ]; then | 25 | if [ $# -ne 0 ]; then |
1035 | 33 | # run specific module given by the caller | 26 | # run specific module given by the caller |
1036 | 34 | MODULE="$@" | 27 | MODULE="$@" |
1037 | @@ -48,13 +41,18 @@ | |||
1038 | 48 | 41 | ||
1039 | 49 | unset GTK_MODULES | 42 | unset GTK_MODULES |
1040 | 50 | 43 | ||
1041 | 44 | echo "*** Running test suite for ""$MODULE"" ***" | ||
1042 | 45 | `which xvfb-run` u1trial --reactor=gi -p "$QT_TESTS_PATH, $GTK_TESTS_PATH" -i "test_windows.py" "$MODULE" | ||
1043 | 46 | rm -rf _trial_temp | ||
1044 | 47 | |||
1045 | 48 | echo "*** Running GTK test suite ***" | ||
1046 | 49 | `which xvfb-run` u1trial --reactor=gi --gui "$GTK_TESTS_PATH" | ||
1047 | 50 | rm -rf _trial_temp | ||
1048 | 51 | |||
1049 | 52 | echo "*** Running QT test suite ***" | ||
1050 | 51 | ./setup.py build | 53 | ./setup.py build |
1057 | 52 | echo "Running test suite for ""$MODULE" | 54 | USE_QT_MAINLOOP=True `which xvfb-run` u1trial --reactor=qt4 --gui "$QT_TESTS_PATH" |
1058 | 53 | if [ "$USE_QT" -eq 0 ]; then | 55 | rm -rf _trial_temp |
1059 | 54 | `which xvfb-run` u1trial --ignore-paths "$QT_TESTS_PATH" -i "$WINDOWS_TESTS" "$MODULE" | 56 | rm -rf build |
1060 | 55 | else | 57 | |
1055 | 56 | `which xvfb-run` u1trial --ignore-paths "$GTK_TESTS_PATH" -i "$WINDOWS_TESTS" --reactor=qt4 --gui "$MODULE" | ||
1056 | 57 | fi | ||
1061 | 58 | style_check | 58 | style_check |
1062 | 59 | rm -rf _trial_temp | ||
1063 | 60 | rm -rf build | ||
1064 | 61 | 59 | ||
1065 | === modified file 'ubuntu_sso/account.py' | |||
1066 | --- ubuntu_sso/account.py 2012-01-26 13:25:13 +0000 | |||
1067 | +++ ubuntu_sso/account.py 2012-02-02 18:14:19 +0000 | |||
1068 | @@ -16,7 +16,11 @@ | |||
1069 | 16 | # | 16 | # |
1070 | 17 | # You should have received a copy of the GNU General Public License along | 17 | # You should have received a copy of the GNU General Public License along |
1071 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
1073 | 19 | """Single Sign On account management.""" | 19 | """Single Sign On account management. |
1074 | 20 | |||
1075 | 21 | All the methods in Account expect unicode as parameters. | ||
1076 | 22 | |||
1077 | 23 | """ | ||
1078 | 20 | 24 | ||
1079 | 21 | import os | 25 | import os |
1080 | 22 | import re | 26 | import re |
1081 | @@ -188,7 +192,7 @@ | |||
1082 | 188 | try: | 192 | try: |
1083 | 189 | credentials = yield restful_client.restcall( | 193 | credentials = yield restful_client.restcall( |
1084 | 190 | u"authentications.authenticate", | 194 | u"authentications.authenticate", |
1086 | 191 | token_name=token_name.decode("utf-8")) | 195 | token_name=token_name) |
1087 | 192 | except WebClientError: | 196 | except WebClientError: |
1088 | 193 | logger.exception('login failed with:') | 197 | logger.exception('login failed with:') |
1089 | 194 | raise AuthenticationError() | 198 | raise AuthenticationError() |
1090 | @@ -218,7 +222,7 @@ | |||
1091 | 218 | 'email_token: %r, token_name: %r.', | 222 | 'email_token: %r, token_name: %r.', |
1092 | 219 | email, email_token, token_name) | 223 | email, email_token, token_name) |
1093 | 220 | credentials = yield self.login(email=email, password=password, | 224 | credentials = yield self.login(email=email, password=password, |
1095 | 221 | token_name=token_name.decode("utf-8")) | 225 | token_name=token_name) |
1096 | 222 | restful_client = restful.RestfulClient(self.service_url, | 226 | restful_client = restful.RestfulClient(self.service_url, |
1097 | 223 | oauth_credentials=credentials) | 227 | oauth_credentials=credentials) |
1098 | 224 | result = yield restful_client.restcall(u"accounts.validate_email", | 228 | result = yield restful_client.restcall(u"accounts.validate_email", |
1099 | 225 | 229 | ||
1100 | === modified file 'ubuntu_sso/gtk/__init__.py' | |||
1101 | --- ubuntu_sso/gtk/__init__.py 2010-11-19 19:53:22 +0000 | |||
1102 | +++ ubuntu_sso/gtk/__init__.py 2012-02-02 18:14:19 +0000 | |||
1103 | @@ -1,8 +1,6 @@ | |||
1104 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1105 | 2 | # | 2 | # |
1109 | 3 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | 3 | # Copyright 2009-2012 Canonical Ltd. |
1107 | 4 | # | ||
1108 | 5 | # Copyright 2009-2010 Canonical Ltd. | ||
1110 | 6 | # | 4 | # |
1111 | 7 | # This program is free software: you can redistribute it and/or modify it | 5 | # This program is free software: you can redistribute it and/or modify it |
1112 | 8 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
1113 | 9 | 7 | ||
1114 | === modified file 'ubuntu_sso/gtk/gui.py' | |||
1115 | --- ubuntu_sso/gtk/gui.py 2012-01-17 21:18:24 +0000 | |||
1116 | +++ ubuntu_sso/gtk/gui.py 2012-02-02 18:14:19 +0000 | |||
1117 | @@ -1,6 +1,6 @@ | |||
1118 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1119 | 2 | # | 2 | # |
1121 | 3 | # Copyright 2010 Canonical Ltd. | 3 | # Copyright 2010-2012 Canonical Ltd. |
1122 | 4 | # | 4 | # |
1123 | 5 | # This program is free software: you can redistribute it and/or modify it | 5 | # This program is free software: you can redistribute it and/or modify it |
1124 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
1125 | @@ -24,8 +24,10 @@ | |||
1126 | 24 | 24 | ||
1127 | 25 | from functools import wraps | 25 | from functools import wraps |
1128 | 26 | 26 | ||
1131 | 27 | import gtk | 27 | # pylint: disable=E0611,F0401 |
1132 | 28 | 28 | from gi.repository import Gdk, Gtk | |
1133 | 29 | from gi.repository.GdkX11 import X11Window | ||
1134 | 30 | # pylint: enable=E0611,F0401 | ||
1135 | 29 | from twisted.internet import defer | 31 | from twisted.internet import defer |
1136 | 30 | 32 | ||
1137 | 31 | from ubuntu_sso import ( | 33 | from ubuntu_sso import ( |
1138 | @@ -33,7 +35,7 @@ | |||
1139 | 33 | NO_OP, | 35 | NO_OP, |
1140 | 34 | utils, | 36 | utils, |
1141 | 35 | ) | 37 | ) |
1143 | 36 | from ubuntu_sso.logger import setup_logging | 38 | from ubuntu_sso.logger import setup_gui_logging |
1144 | 37 | from ubuntu_sso.utils.ui import ( | 39 | from ubuntu_sso.utils.ui import ( |
1145 | 38 | CAPTCHA_LOAD_ERROR, | 40 | CAPTCHA_LOAD_ERROR, |
1146 | 39 | CAPTCHA_RELOAD_TOOLTIP, | 41 | CAPTCHA_RELOAD_TOOLTIP, |
1147 | @@ -72,7 +74,19 @@ | |||
1148 | 72 | # pylint: disable=E1101 | 74 | # pylint: disable=E1101 |
1149 | 73 | 75 | ||
1150 | 74 | 76 | ||
1152 | 75 | logger = setup_logging('ubuntu_sso.gui') | 77 | logger = setup_gui_logging('ubuntu_sso.gui.gtk') |
1153 | 78 | |||
1154 | 79 | |||
1155 | 80 | # pylint: disable=C0103 | ||
1156 | 81 | def parse_color(color): | ||
1157 | 82 | """Parse a string color into Gdk.Color.""" | ||
1158 | 83 | c = Gdk.RGBA() | ||
1159 | 84 | result = c.parse(color) | ||
1160 | 85 | if not result: | ||
1161 | 86 | logger.warning('Could not parse color %r.', color) | ||
1162 | 87 | return c | ||
1163 | 88 | # pylint: enable=C0103 | ||
1164 | 89 | |||
1165 | 76 | 90 | ||
1166 | 77 | # To be removed when Python bindings provide these constants | 91 | # To be removed when Python bindings provide these constants |
1167 | 78 | # as per http://code.google.com/p/pywebkitgtk/issues/detail?id=44 | 92 | # as per http://code.google.com/p/pywebkitgtk/issues/detail?id=44 |
1168 | @@ -92,8 +106,8 @@ | |||
1169 | 92 | 106 | ||
1170 | 93 | DEFAULT_WIDTH = 30 | 107 | DEFAULT_WIDTH = 30 |
1171 | 94 | # To be replaced by values from the theme (LP: #616526) | 108 | # To be replaced by values from the theme (LP: #616526) |
1174 | 95 | HELP_TEXT_COLOR = gtk.gdk.Color("#bfbfbf") | 109 | HELP_TEXT_COLOR = parse_color("#bfbfbf") |
1175 | 96 | WARNING_TEXT_COLOR = gtk.gdk.Color("red") | 110 | WARNING_TEXT_COLOR = parse_color("red") |
1176 | 97 | 111 | ||
1177 | 98 | USER_CANCELLATION = 10 | 112 | USER_CANCELLATION = 10 |
1178 | 99 | LOGIN_SUCCESS = REGISTRATION_SUCCESS = 0 | 113 | LOGIN_SUCCESS = REGISTRATION_SUCCESS = 0 |
1179 | @@ -111,9 +125,12 @@ | |||
1180 | 111 | return inner | 125 | return inner |
1181 | 112 | 126 | ||
1182 | 113 | 127 | ||
1184 | 114 | class LabeledEntry(gtk.Entry): | 128 | class LabeledEntry(Gtk.Entry): |
1185 | 115 | """An entry that displays the label within itself ina grey color.""" | 129 | """An entry that displays the label within itself ina grey color.""" |
1186 | 116 | 130 | ||
1187 | 131 | # Use of super on an old style class | ||
1188 | 132 | # pylint: disable=E1002 | ||
1189 | 133 | |||
1190 | 117 | def __init__(self, label, is_password=False, *args, **kwargs): | 134 | def __init__(self, label, is_password=False, *args, **kwargs): |
1191 | 118 | self.label = label | 135 | self.label = label |
1192 | 119 | self.is_password = is_password | 136 | self.is_password = is_password |
1193 | @@ -133,7 +150,8 @@ | |||
1194 | 133 | """Clear text and restore text color.""" | 150 | """Clear text and restore text color.""" |
1195 | 134 | self.set_text(self.get_text()) | 151 | self.set_text(self.get_text()) |
1196 | 135 | 152 | ||
1198 | 136 | self.modify_text(gtk.STATE_NORMAL, None) # restore to theme's default | 153 | # restore to theme's default |
1199 | 154 | self.override_color(Gtk.StateFlags.NORMAL, None) | ||
1200 | 137 | 155 | ||
1201 | 138 | if self.is_password: | 156 | if self.is_password: |
1202 | 139 | self.set_visibility(False) | 157 | self.set_visibility(False) |
1203 | @@ -146,7 +164,7 @@ | |||
1204 | 146 | return | 164 | return |
1205 | 147 | 165 | ||
1206 | 148 | self.set_text(self.label) | 166 | self.set_text(self.label) |
1208 | 149 | self.modify_text(gtk.STATE_NORMAL, HELP_TEXT_COLOR) | 167 | self.override_color(Gtk.StateFlags.NORMAL, HELP_TEXT_COLOR) |
1209 | 150 | 168 | ||
1210 | 151 | if self.is_password: | 169 | if self.is_password: |
1211 | 152 | self.set_visibility(True) | 170 | self.set_visibility(True) |
1212 | @@ -163,7 +181,7 @@ | |||
1213 | 163 | def set_warning(self, warning_msg): | 181 | def set_warning(self, warning_msg): |
1214 | 164 | """Display warning as secondary icon, set 'warning_msg' as tooltip.""" | 182 | """Display warning as secondary icon, set 'warning_msg' as tooltip.""" |
1215 | 165 | self.warning = warning_msg | 183 | self.warning = warning_msg |
1217 | 166 | self.set_property('secondary-icon-stock', gtk.STOCK_DIALOG_WARNING) | 184 | self.set_property('secondary-icon-stock', Gtk.STOCK_DIALOG_WARNING) |
1218 | 167 | self.set_property('secondary-icon-sensitive', True) | 185 | self.set_property('secondary-icon-sensitive', True) |
1219 | 168 | self.set_property('secondary-icon-activatable', False) | 186 | self.set_property('secondary-icon-activatable', False) |
1220 | 169 | self.set_property('secondary-icon-tooltip-text', warning_msg) | 187 | self.set_property('secondary-icon-tooltip-text', warning_msg) |
1221 | @@ -185,8 +203,6 @@ | |||
1222 | 185 | logger.debug('UbuntuSSOClientGUI: app_name %r, kwargs %r.', | 203 | logger.debug('UbuntuSSOClientGUI: app_name %r, kwargs %r.', |
1223 | 186 | app_name, kwargs) | 204 | app_name, kwargs) |
1224 | 187 | 205 | ||
1225 | 188 | gtk.link_button_set_uri_hook(NO_OP) | ||
1226 | 189 | |||
1227 | 190 | self._captcha_filename = tempfile.mktemp() | 206 | self._captcha_filename = tempfile.mktemp() |
1228 | 191 | self._captcha_id = None | 207 | self._captcha_id = None |
1229 | 192 | self._signals_receivers = {} | 208 | self._signals_receivers = {} |
1230 | @@ -211,19 +227,18 @@ | |||
1231 | 211 | self.user_password = None | 227 | self.user_password = None |
1232 | 212 | 228 | ||
1233 | 213 | ui_filename = get_data_file('gtk', 'ui.glade') | 229 | ui_filename = get_data_file('gtk', 'ui.glade') |
1235 | 214 | builder = gtk.Builder() | 230 | builder = Gtk.Builder() |
1236 | 215 | builder.add_from_file(ui_filename) | 231 | builder.add_from_file(ui_filename) |
1237 | 216 | builder.connect_signals(self) | 232 | builder.connect_signals(self) |
1238 | 217 | 233 | ||
1239 | 218 | self.widgets = [] | 234 | self.widgets = [] |
1240 | 219 | self.warnings = [] | 235 | self.warnings = [] |
1241 | 220 | self.cancels = [] | 236 | self.cancels = [] |
1242 | 221 | self.labels = [] | ||
1243 | 222 | for obj in builder.get_objects(): | 237 | for obj in builder.get_objects(): |
1244 | 223 | name = getattr(obj, 'name', None) | 238 | name = getattr(obj, 'name', None) |
1246 | 224 | if name is None and isinstance(obj, gtk.Buildable): | 239 | if name is None and isinstance(obj, Gtk.Buildable): |
1247 | 225 | # work around bug lp:507739 | 240 | # work around bug lp:507739 |
1249 | 226 | name = gtk.Buildable.get_name(obj) | 241 | name = Gtk.Buildable.get_name(obj) |
1250 | 227 | if name is None: | 242 | if name is None: |
1251 | 228 | logging.warn("%s has no name (??)", obj) | 243 | logging.warn("%s has no name (??)", obj) |
1252 | 229 | else: | 244 | else: |
1253 | @@ -235,9 +250,6 @@ | |||
1254 | 235 | if 'cancel_button' in name: | 250 | if 'cancel_button' in name: |
1255 | 236 | obj.connect('clicked', self.on_close_clicked) | 251 | obj.connect('clicked', self.on_close_clicked) |
1256 | 237 | self.cancels.append(obj) | 252 | self.cancels.append(obj) |
1257 | 238 | if 'label' in name: | ||
1258 | 239 | obj.connect('size-allocate', self.on_size_allocate) | ||
1259 | 240 | self.labels.append(obj) | ||
1260 | 241 | 253 | ||
1261 | 242 | self.entries = (u'name_entry', u'email1_entry', u'email2_entry', | 254 | self.entries = (u'name_entry', u'email1_entry', u'email2_entry', |
1262 | 243 | u'password1_entry', u'password2_entry', | 255 | u'password1_entry', u'password2_entry', |
1263 | @@ -297,7 +309,10 @@ | |||
1264 | 297 | # still do everything as a standalone window. Also, | 309 | # still do everything as a standalone window. Also, |
1265 | 298 | # window_foreign_new may return None breaking set_transient_for. | 310 | # window_foreign_new may return None breaking set_transient_for. |
1266 | 299 | try: | 311 | try: |
1268 | 300 | win = gtk.gdk.window_foreign_new(window_id) | 312 | display = Gdk.Display.get_default() |
1269 | 313 | # this is not working, we need to create a XLib.window | ||
1270 | 314 | # as a second parameter to foreign_new_for_display | ||
1271 | 315 | win = X11Window.foreign_new_for_display(display, None) | ||
1272 | 301 | self.window.realize() | 316 | self.window.realize() |
1273 | 302 | self.window.window.set_transient_for(win) | 317 | self.window.window.set_transient_for(win) |
1274 | 303 | except: # pylint: disable=W0702 | 318 | except: # pylint: disable=W0702 |
1275 | @@ -366,20 +381,21 @@ | |||
1276 | 366 | 381 | ||
1277 | 367 | def _add_spinner_to_container(self, container, legend=None): | 382 | def _add_spinner_to_container(self, container, legend=None): |
1278 | 368 | """Add a spinner to 'container'.""" | 383 | """Add a spinner to 'container'.""" |
1280 | 369 | spinner = gtk.Spinner() | 384 | spinner = Gtk.Spinner() |
1281 | 370 | spinner.start() | 385 | spinner.start() |
1282 | 371 | 386 | ||
1284 | 372 | label = gtk.Label() | 387 | label = Gtk.Label() |
1285 | 373 | if legend: | 388 | if legend: |
1286 | 374 | label.set_text(legend) | 389 | label.set_text(legend) |
1287 | 375 | else: | 390 | else: |
1288 | 376 | label.set_text(LOADING) | 391 | label.set_text(LOADING) |
1289 | 377 | 392 | ||
1293 | 378 | hbox = gtk.HBox(spacing=5) | 393 | hbox = Gtk.HBox(spacing=5) |
1294 | 379 | hbox.pack_start(spinner, expand=False) | 394 | hbox.pack_start(spinner, expand=False, fill=True, padding=0) |
1295 | 380 | hbox.pack_start(label, expand=False) | 395 | hbox.pack_start(label, expand=False, fill=True, padding=0) |
1296 | 381 | 396 | ||
1298 | 382 | alignment = gtk.Alignment(xalign=0.5, yalign=0.5) | 397 | alignment = Gtk.Alignment(xalign=0.5, yalign=0.5, |
1299 | 398 | xscale=0, yscale=0) | ||
1300 | 383 | alignment.add(hbox) | 399 | alignment.add(hbox) |
1301 | 384 | alignment.show_all() | 400 | alignment.show_all() |
1302 | 385 | 401 | ||
1303 | @@ -394,7 +410,7 @@ | |||
1304 | 394 | def _set_warning_message(self, widget, message): | 410 | def _set_warning_message(self, widget, message): |
1305 | 395 | """Set 'message' as text for 'widget'.""" | 411 | """Set 'message' as text for 'widget'.""" |
1306 | 396 | widget.set_text(message) | 412 | widget.set_text(message) |
1308 | 397 | widget.modify_fg(gtk.STATE_NORMAL, WARNING_TEXT_COLOR) | 413 | widget.override_color(Gtk.StateFlags.NORMAL, WARNING_TEXT_COLOR) |
1309 | 398 | widget.show() | 414 | widget.show() |
1310 | 399 | 415 | ||
1311 | 400 | def _clear_warnings(self): | 416 | def _clear_warnings(self): |
1312 | @@ -433,7 +449,7 @@ | |||
1313 | 433 | 449 | ||
1314 | 434 | def _append_page(self, page): | 450 | def _append_page(self, page): |
1315 | 435 | """Append 'page' to the 'window'.""" | 451 | """Append 'page' to the 'window'.""" |
1317 | 436 | self.content.append_page(page) | 452 | self.content.append_page(page, None) |
1318 | 437 | 453 | ||
1319 | 438 | def _set_header(self, header): | 454 | def _set_header(self, header): |
1320 | 439 | """Set 'header' as the window title and header.""" | 455 | """Set 'header' as the window title and header.""" |
1321 | @@ -472,8 +488,8 @@ | |||
1322 | 472 | """Present a spinner to the user while the captcha is downloaded.""" | 488 | """Present a spinner to the user while the captcha is downloaded.""" |
1323 | 473 | self.captcha_image.hide() | 489 | self.captcha_image.hide() |
1324 | 474 | self._add_spinner_to_container(self.captcha_loading) | 490 | self._add_spinner_to_container(self.captcha_loading) |
1327 | 475 | white = gtk.gdk.Color('white') | 491 | self.captcha_loading.override_background_color(Gtk.StateFlags.NORMAL, |
1328 | 476 | self.captcha_loading.modify_bg(gtk.STATE_NORMAL, white) | 492 | parse_color('white')) |
1329 | 477 | self.captcha_loading.show_all() | 493 | self.captcha_loading.show_all() |
1330 | 478 | self.join_ok_button.set_sensitive(False) | 494 | self.join_ok_button.set_sensitive(False) |
1331 | 479 | 495 | ||
1332 | @@ -490,20 +506,26 @@ | |||
1333 | 490 | self.enter_details_vbox.header = JOIN_HEADER_LABEL % d | 506 | self.enter_details_vbox.header = JOIN_HEADER_LABEL % d |
1334 | 491 | self.enter_details_vbox.help_text = self.help_text | 507 | self.enter_details_vbox.help_text = self.help_text |
1335 | 492 | self.enter_details_vbox.default_widget = self.join_ok_button | 508 | self.enter_details_vbox.default_widget = self.join_ok_button |
1337 | 493 | self.join_ok_button.set_flags(gtk.CAN_DEFAULT) | 509 | self.join_ok_button.set_can_default(True) |
1338 | 494 | 510 | ||
1340 | 495 | self.enter_details_vbox.pack_start(self.name_entry, expand=False) | 511 | self.enter_details_vbox.pack_start(self.name_entry, |
1341 | 512 | expand=False, fill=True, padding=0) | ||
1342 | 496 | self.enter_details_vbox.reorder_child(self.name_entry, 0) | 513 | self.enter_details_vbox.reorder_child(self.name_entry, 0) |
1343 | 497 | entry = self.captcha_solution_entry | 514 | entry = self.captcha_solution_entry |
1345 | 498 | self.captcha_solution_vbox.pack_start(entry, expand=False) | 515 | self.captcha_solution_vbox.pack_start(entry, |
1346 | 516 | expand=False, fill=True, padding=0) | ||
1347 | 499 | msg = CAPTCHA_RELOAD_TOOLTIP | 517 | msg = CAPTCHA_RELOAD_TOOLTIP |
1348 | 500 | self.captcha_reload_button.set_tooltip_text(msg) | 518 | self.captcha_reload_button.set_tooltip_text(msg) |
1349 | 501 | 519 | ||
1352 | 502 | self.emails_hbox.pack_start(self.email1_entry, expand=False) | 520 | self.emails_hbox.pack_start(self.email1_entry, |
1353 | 503 | self.emails_hbox.pack_start(self.email2_entry, expand=False) | 521 | expand=False, fill=True, padding=0) |
1354 | 522 | self.emails_hbox.pack_start(self.email2_entry, | ||
1355 | 523 | expand=False, fill=True, padding=0) | ||
1356 | 504 | 524 | ||
1359 | 505 | self.passwords_hbox.pack_start(self.password1_entry, expand=False) | 525 | self.passwords_hbox.pack_start(self.password1_entry, |
1360 | 506 | self.passwords_hbox.pack_start(self.password2_entry, expand=False) | 526 | expand=False, fill=True, padding=0) |
1361 | 527 | self.passwords_hbox.pack_start(self.password2_entry, | ||
1362 | 528 | expand=False, fill=True, padding=0) | ||
1363 | 507 | help_msg = '<small>%s</small>' % PASSWORD_HELP | 529 | help_msg = '<small>%s</small>' % PASSWORD_HELP |
1364 | 508 | self.password_help_label.set_markup(help_msg) | 530 | self.password_help_label.set_markup(help_msg) |
1365 | 509 | 531 | ||
1366 | @@ -519,7 +541,7 @@ | |||
1367 | 519 | self.yes_to_tc_checkbutton.set_label(msg) | 541 | self.yes_to_tc_checkbutton.set_label(msg) |
1368 | 520 | self.tc_button.set_label(TC_BUTTON) | 542 | self.tc_button.set_label(TC_BUTTON) |
1369 | 521 | else: | 543 | else: |
1371 | 522 | self.tc_vbox.hide_all() | 544 | self.tc_vbox.hide() |
1372 | 523 | self.login_button.set_label(LOGIN_BUTTON_LABEL) | 545 | self.login_button.set_label(LOGIN_BUTTON_LABEL) |
1373 | 524 | 546 | ||
1374 | 525 | return self.enter_details_vbox | 547 | return self.enter_details_vbox |
1375 | @@ -528,7 +550,7 @@ | |||
1376 | 528 | """Build the Terms & Conditions page.""" | 550 | """Build the Terms & Conditions page.""" |
1377 | 529 | self.tc_browser_vbox.help_text = '' | 551 | self.tc_browser_vbox.help_text = '' |
1378 | 530 | self.tc_browser_vbox.default_widget = self.tc_back_button | 552 | self.tc_browser_vbox.default_widget = self.tc_back_button |
1380 | 531 | self.tc_browser_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 553 | self.tc_browser_vbox.default_widget.set_can_default(True) |
1381 | 532 | return self.tc_browser_vbox | 554 | return self.tc_browser_vbox |
1382 | 533 | 555 | ||
1383 | 534 | def _build_processing_page(self): | 556 | def _build_processing_page(self): |
1384 | @@ -541,17 +563,16 @@ | |||
1385 | 541 | def _build_verify_email_page(self): | 563 | def _build_verify_email_page(self): |
1386 | 542 | """Build the verify email page.""" | 564 | """Build the verify email page.""" |
1387 | 543 | self.verify_email_vbox.default_widget = self.verify_token_button | 565 | self.verify_email_vbox.default_widget = self.verify_token_button |
1389 | 544 | self.verify_email_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 566 | self.verify_email_vbox.default_widget.set_can_default(True) |
1390 | 545 | 567 | ||
1391 | 546 | self.verify_email_details_vbox.pack_start(self.email_token_entry, | 568 | self.verify_email_details_vbox.pack_start(self.email_token_entry, |
1394 | 547 | expand=False) | 569 | expand=False, fill=True, padding=0) |
1393 | 548 | |||
1395 | 549 | return self.verify_email_vbox | 570 | return self.verify_email_vbox |
1396 | 550 | 571 | ||
1397 | 551 | def _build_finish_page(self): | 572 | def _build_finish_page(self): |
1398 | 552 | """Build the success page.""" | 573 | """Build the success page.""" |
1399 | 553 | self.finish_vbox.default_widget = self.finish_close_button | 574 | self.finish_vbox.default_widget = self.finish_close_button |
1401 | 554 | self.finish_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 575 | self.finish_vbox.default_widget.set_can_default(True) |
1402 | 555 | self.finish_vbox.label = self.finish_label | 576 | self.finish_vbox.label = self.finish_label |
1403 | 556 | return self.finish_vbox | 577 | return self.finish_vbox |
1404 | 557 | 578 | ||
1405 | @@ -561,11 +582,13 @@ | |||
1406 | 561 | self.login_vbox.header = LOGIN_HEADER_LABEL % d | 582 | self.login_vbox.header = LOGIN_HEADER_LABEL % d |
1407 | 562 | self.login_vbox.help_text = CONNECT_HELP_LABEL % d | 583 | self.login_vbox.help_text = CONNECT_HELP_LABEL % d |
1408 | 563 | self.login_vbox.default_widget = self.login_ok_button | 584 | self.login_vbox.default_widget = self.login_ok_button |
1410 | 564 | self.login_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 585 | self.login_vbox.default_widget.set_can_default(True) |
1411 | 565 | 586 | ||
1413 | 566 | self.login_details_vbox.pack_start(self.login_email_entry) | 587 | self.login_details_vbox.pack_start(self.login_email_entry, |
1414 | 588 | expand=True, fill=True, padding=0) | ||
1415 | 567 | self.login_details_vbox.reorder_child(self.login_email_entry, 0) | 589 | self.login_details_vbox.reorder_child(self.login_email_entry, 0) |
1417 | 568 | self.login_details_vbox.pack_start(self.login_password_entry) | 590 | self.login_details_vbox.pack_start(self.login_password_entry, |
1418 | 591 | expand=True, fill=True, padding=0) | ||
1419 | 569 | self.login_details_vbox.reorder_child(self.login_password_entry, 1) | 592 | self.login_details_vbox.reorder_child(self.login_password_entry, 1) |
1420 | 570 | 593 | ||
1421 | 571 | msg = FORGOTTEN_PASSWORD_BUTTON | 594 | msg = FORGOTTEN_PASSWORD_BUTTON |
1422 | @@ -580,12 +603,12 @@ | |||
1423 | 580 | text = REQUEST_PASSWORD_TOKEN_LABEL % {'app_name': self.app_label} | 603 | text = REQUEST_PASSWORD_TOKEN_LABEL % {'app_name': self.app_label} |
1424 | 581 | self.request_password_token_vbox.help_text = text | 604 | self.request_password_token_vbox.help_text = text |
1425 | 582 | btn = self.request_password_token_ok_button | 605 | btn = self.request_password_token_ok_button |
1427 | 583 | btn.set_flags(gtk.CAN_DEFAULT) | 606 | btn.set_can_default(True) |
1428 | 584 | self.request_password_token_vbox.default_widget = btn | 607 | self.request_password_token_vbox.default_widget = btn |
1429 | 585 | 608 | ||
1430 | 586 | entry = self.reset_email_entry | 609 | entry = self.reset_email_entry |
1431 | 587 | self.request_password_token_details_vbox.pack_start(entry, | 610 | self.request_password_token_details_vbox.pack_start(entry, |
1433 | 588 | expand=False) | 611 | expand=False, fill=True, padding=0) |
1434 | 589 | cb = self.on_reset_email_entry_changed | 612 | cb = self.on_reset_email_entry_changed |
1435 | 590 | self.reset_email_entry.connect('changed', cb) | 613 | self.reset_email_entry.connect('changed', cb) |
1436 | 591 | self.request_password_token_ok_button.set_label(NEXT) | 614 | self.request_password_token_ok_button.set_label(NEXT) |
1437 | @@ -598,13 +621,14 @@ | |||
1438 | 598 | self.set_new_password_vbox.header = RESET_PASSWORD | 621 | self.set_new_password_vbox.header = RESET_PASSWORD |
1439 | 599 | self.set_new_password_vbox.help_text = SET_NEW_PASSWORD_LABEL | 622 | self.set_new_password_vbox.help_text = SET_NEW_PASSWORD_LABEL |
1440 | 600 | btn = self.set_new_password_ok_button | 623 | btn = self.set_new_password_ok_button |
1442 | 601 | btn.set_flags(gtk.CAN_DEFAULT) | 624 | btn.set_can_default(True) |
1443 | 602 | self.set_new_password_vbox.default_widget = btn | 625 | self.set_new_password_vbox.default_widget = btn |
1444 | 603 | 626 | ||
1445 | 604 | for entry in (self.reset_code_entry, | 627 | for entry in (self.reset_code_entry, |
1446 | 605 | self.reset_password1_entry, | 628 | self.reset_password1_entry, |
1447 | 606 | self.reset_password2_entry): | 629 | self.reset_password2_entry): |
1449 | 607 | self.set_new_password_details_vbox.pack_start(entry, expand=False) | 630 | self.set_new_password_details_vbox.pack_start(entry, |
1450 | 631 | expand=False, fill=True, padding=0) | ||
1451 | 608 | 632 | ||
1452 | 609 | cb = self.on_set_new_password_entries_changed | 633 | cb = self.on_set_new_password_entries_changed |
1453 | 610 | self.reset_code_entry.connect('changed', cb) | 634 | self.reset_code_entry.connect('changed', cb) |
1454 | @@ -645,6 +669,11 @@ | |||
1455 | 645 | 669 | ||
1456 | 646 | # GTK callbacks | 670 | # GTK callbacks |
1457 | 647 | 671 | ||
1458 | 672 | def destroy(self): | ||
1459 | 673 | """Destroy this UI.""" | ||
1460 | 674 | self.window.hide() | ||
1461 | 675 | self.window.destroy() | ||
1462 | 676 | |||
1463 | 648 | def connect(self, signal_name, handler, *args, **kwargs): | 677 | def connect(self, signal_name, handler, *args, **kwargs): |
1464 | 649 | """Connect 'signal_name' with 'handler'.""" | 678 | """Connect 'signal_name' with 'handler'.""" |
1465 | 650 | logger.debug('connect: signal %r, handler %r, args %r, kwargs, %r', | 679 | logger.debug('connect: signal %r, handler %r, args %r, kwargs, %r', |
1466 | @@ -661,9 +690,9 @@ | |||
1467 | 661 | self._done = True | 690 | self._done = True |
1468 | 662 | self._set_current_page(self.error_vbox) | 691 | self._set_current_page(self.error_vbox) |
1469 | 663 | 692 | ||
1473 | 664 | def on_size_allocate(self, widget, allocation): | 693 | def on_activate_link(self, button): |
1474 | 665 | """The widget can re rezised, embrase it!.""" | 694 | """Do nothing, used for LinkButtons that are used as regular ones.""" |
1475 | 666 | widget.set_size_request(allocation.width - 2, -1) | 695 | return True |
1476 | 667 | 696 | ||
1477 | 668 | def on_close_clicked(self, *args, **kwargs): | 697 | def on_close_clicked(self, *args, **kwargs): |
1478 | 669 | """Call self.close_callback if defined.""" | 698 | """Call self.close_callback if defined.""" |
1479 | @@ -678,8 +707,8 @@ | |||
1480 | 678 | self.window.hide() | 707 | self.window.hide() |
1481 | 679 | 708 | ||
1482 | 680 | # process any pending events before callbacking with result | 709 | # process any pending events before callbacking with result |
1485 | 681 | while gtk.events_pending(): | 710 | while Gtk.events_pending(): |
1486 | 682 | gtk.main_iteration() | 711 | Gtk.main_iteration() |
1487 | 683 | 712 | ||
1488 | 684 | return_code = LOGIN_SUCCESS | 713 | return_code = LOGIN_SUCCESS |
1489 | 685 | if not self._done: | 714 | if not self._done: |
1490 | @@ -751,8 +780,9 @@ | |||
1491 | 751 | ' name %r, captcha_id %r and captcha_solution %r.', email1, | 780 | ' name %r, captcha_id %r and captcha_solution %r.', email1, |
1492 | 752 | name, self._captcha_id, captcha_solution) | 781 | name, self._captcha_id, captcha_solution) |
1493 | 753 | f = self.backend.register_user | 782 | f = self.backend.register_user |
1496 | 754 | f(self.app_name, email1, password1, name, | 783 | f(unicode(self.app_name), email1.decode('utf8'), |
1497 | 755 | self._captcha_id, captcha_solution, | 784 | password1.decode('utf8'), name.decode('utf8'), |
1498 | 785 | unicode(self._captcha_id), captcha_solution.decode('utf8'), | ||
1499 | 756 | reply_handler=NO_OP, error_handler=NO_OP) | 786 | reply_handler=NO_OP, error_handler=NO_OP) |
1500 | 757 | 787 | ||
1501 | 758 | def on_verify_token_button_clicked(self, *args, **kwargs): | 788 | def on_verify_token_button_clicked(self, *args, **kwargs): |
1502 | @@ -902,8 +932,8 @@ | |||
1503 | 902 | def on_tc_button_clicked(self, *args, **kwargs): | 932 | def on_tc_button_clicked(self, *args, **kwargs): |
1504 | 903 | """The T&C button was clicked, create the browser and load terms.""" | 933 | """The T&C button was clicked, create the browser and load terms.""" |
1505 | 904 | # delay the import of webkit to be able to build without it | 934 | # delay the import of webkit to be able to build without it |
1508 | 905 | import webkit | 935 | from gi.repository import WebKit # pylint: disable=E0611 |
1509 | 906 | browser = webkit.WebView() | 936 | browser = WebKit.WebView() |
1510 | 907 | 937 | ||
1511 | 908 | # The signal WebKitWebView::load-finished is deprecated and should not | 938 | # The signal WebKitWebView::load-finished is deprecated and should not |
1512 | 909 | # be used in newly-written code. Use the "load-status" property | 939 | # be used in newly-written code. Use the "load-status" property |
1513 | 910 | 940 | ||
1514 | === modified file 'ubuntu_sso/gtk/main.py' | |||
1515 | --- ubuntu_sso/gtk/main.py 2012-01-16 21:10:12 +0000 | |||
1516 | +++ ubuntu_sso/gtk/main.py 2012-02-02 18:14:19 +0000 | |||
1517 | @@ -18,7 +18,9 @@ | |||
1518 | 18 | 18 | ||
1519 | 19 | import argparse | 19 | import argparse |
1520 | 20 | 20 | ||
1522 | 21 | import gtk | 21 | # pylint: disable=E0611 |
1523 | 22 | from gi.repository import Gtk | ||
1524 | 23 | # pylint: enable=E0611 | ||
1525 | 22 | 24 | ||
1526 | 23 | from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI | 25 | from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI |
1527 | 24 | 26 | ||
1528 | @@ -45,5 +47,5 @@ | |||
1529 | 45 | 47 | ||
1530 | 46 | def main(**kwargs): | 48 | def main(**kwargs): |
1531 | 47 | """Start the GTK mainloop and open the main window.""" | 49 | """Start the GTK mainloop and open the main window.""" |
1534 | 48 | UbuntuSSOClientGUI(close_callback=gtk.main_quit, **kwargs) | 50 | UbuntuSSOClientGUI(close_callback=Gtk.main_quit, **kwargs) |
1535 | 49 | gtk.main() | 51 | Gtk.main() |
1536 | 50 | 52 | ||
1537 | === modified file 'ubuntu_sso/gtk/tests/__init__.py' | |||
1538 | --- ubuntu_sso/gtk/tests/__init__.py 2010-11-19 19:53:22 +0000 | |||
1539 | +++ ubuntu_sso/gtk/tests/__init__.py 2012-02-02 18:14:19 +0000 | |||
1540 | @@ -1,8 +1,6 @@ | |||
1541 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1542 | 2 | # | 2 | # |
1546 | 3 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | 3 | # Copyright 2009-2012 Canonical Ltd. |
1544 | 4 | # | ||
1545 | 5 | # Copyright 2009 Canonical Ltd. | ||
1547 | 6 | # | 4 | # |
1548 | 7 | # This program is free software: you can redistribute it and/or modify it | 5 | # This program is free software: you can redistribute it and/or modify it |
1549 | 8 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
1550 | 9 | 7 | ||
1551 | === modified file 'ubuntu_sso/gtk/tests/test_gui.py' | |||
1552 | --- ubuntu_sso/gtk/tests/test_gui.py 2012-01-17 21:18:24 +0000 | |||
1553 | +++ ubuntu_sso/gtk/tests/test_gui.py 2012-02-02 18:14:19 +0000 | |||
1554 | @@ -21,8 +21,9 @@ | |||
1555 | 21 | 21 | ||
1556 | 22 | from collections import defaultdict | 22 | from collections import defaultdict |
1557 | 23 | 23 | ||
1560 | 24 | import gtk | 24 | # pylint: disable=E0611 |
1561 | 25 | import webkit | 25 | from gi.repository import Gdk, Gtk, WebKit |
1562 | 26 | # pylint: enable=E0611 | ||
1563 | 26 | 27 | ||
1564 | 27 | from twisted.internet import defer | 28 | from twisted.internet import defer |
1565 | 28 | from twisted.trial.unittest import TestCase | 29 | from twisted.trial.unittest import TestCase |
1566 | @@ -42,6 +43,9 @@ | |||
1567 | 42 | # Instance of 'UbuntuSSOClientGUI' has no 'yyy' member | 43 | # Instance of 'UbuntuSSOClientGUI' has no 'yyy' member |
1568 | 43 | # pylint: disable=E1101,E1103 | 44 | # pylint: disable=E1101,E1103 |
1569 | 44 | 45 | ||
1570 | 46 | # Use of super on an old style class | ||
1571 | 47 | # pylint: disable=E1002 | ||
1572 | 48 | |||
1573 | 45 | 49 | ||
1574 | 46 | class FakedSSOBackend(object): | 50 | class FakedSSOBackend(object): |
1575 | 47 | """Fake a SSO Backend.""" | 51 | """Fake a SSO Backend.""" |
1576 | @@ -99,7 +103,7 @@ | |||
1577 | 99 | self[prop_name] = newval | 103 | self[prop_name] = newval |
1578 | 100 | 104 | ||
1579 | 101 | 105 | ||
1581 | 102 | class FakedEmbeddedBrowser(gtk.TextView): | 106 | class FakedEmbeddedBrowser(Gtk.TextView): |
1582 | 103 | """Faked an embedded browser.""" | 107 | """Faked an embedded browser.""" |
1583 | 104 | 108 | ||
1584 | 105 | def __init__(self): | 109 | def __init__(self): |
1585 | @@ -156,6 +160,14 @@ | |||
1586 | 156 | """Set _called to True.""" | 160 | """Set _called to True.""" |
1587 | 157 | self._called = (args, kwargs) | 161 | self._called = (args, kwargs) |
1588 | 158 | 162 | ||
1589 | 163 | def assert_color_equal(self, rgba_color, gdk_color): | ||
1590 | 164 | """Check that 'rgba_color' is the same as 'gdk_color'.""" | ||
1591 | 165 | tmp = Gdk.RGBA() | ||
1592 | 166 | assert tmp.parse(gdk_color.to_string()) | ||
1593 | 167 | |||
1594 | 168 | msg = 'Text color must be "%s" (got "%s" instead).' | ||
1595 | 169 | self.assertEqual(rgba_color, tmp, msg % (rgba_color, tmp)) | ||
1596 | 170 | |||
1597 | 159 | 171 | ||
1598 | 160 | class LabeledEntryTestCase(BasicTestCase): | 172 | class LabeledEntryTestCase(BasicTestCase): |
1599 | 161 | """Test suite for the labeled entry.""" | 173 | """Test suite for the labeled entry.""" |
1600 | @@ -168,9 +180,11 @@ | |||
1601 | 168 | self.entry = gui.LabeledEntry(label=self.label) | 180 | self.entry = gui.LabeledEntry(label=self.label) |
1602 | 169 | 181 | ||
1603 | 170 | # we need a window to be able to realize ourselves | 182 | # we need a window to be able to realize ourselves |
1605 | 171 | window = gtk.Window() | 183 | window = Gtk.Window() |
1606 | 172 | window.add(self.entry) | 184 | window.add(self.entry) |
1607 | 173 | window.show_all() | 185 | window.show_all() |
1608 | 186 | self.addCleanup(window.hide) | ||
1609 | 187 | self.addCleanup(window.destroy) | ||
1610 | 174 | 188 | ||
1611 | 175 | def grab_focus(self, focus_in=True): | 189 | def grab_focus(self, focus_in=True): |
1612 | 176 | """Grab focus on widget, if None use self.entry.""" | 190 | """Grab focus on widget, if None use self.entry.""" |
1613 | @@ -188,10 +202,9 @@ | |||
1614 | 188 | self.assertEqual(expected, actual, msg % (expected, actual)) | 202 | self.assertEqual(expected, actual, msg % (expected, actual)) |
1615 | 189 | 203 | ||
1616 | 190 | # text color is correct | 204 | # text color is correct |
1617 | 191 | msg = 'Text color must be "%s" (got "%s" instead).' | ||
1618 | 192 | expected = gui.HELP_TEXT_COLOR | 205 | expected = gui.HELP_TEXT_COLOR |
1621 | 193 | actual = self.entry.style.text[gtk.STATE_NORMAL] | 206 | actual = self.entry.get_style().text[Gtk.StateFlags.NORMAL] |
1622 | 194 | self.assertEqual(expected, actual, msg % (expected, actual)) | 207 | self.assert_color_equal(expected, actual) |
1623 | 195 | 208 | ||
1624 | 196 | def test_initial_text(self): | 209 | def test_initial_text(self): |
1625 | 197 | """Entry have the correct text at startup.""" | 210 | """Entry have the correct text at startup.""" |
1626 | @@ -218,11 +231,11 @@ | |||
1627 | 218 | 231 | ||
1628 | 219 | def test_text_defaults_to_theme_color_when_focus_in(self): | 232 | def test_text_defaults_to_theme_color_when_focus_in(self): |
1629 | 220 | """Entry restore its text color when focused in.""" | 233 | """Entry restore its text color when focused in.""" |
1631 | 221 | self.patch(self.entry, 'modify_text', self._set_called) | 234 | self.patch(self.entry, 'override_color', self._set_called) |
1632 | 222 | 235 | ||
1633 | 223 | self.grab_focus() | 236 | self.grab_focus() |
1634 | 224 | 237 | ||
1636 | 225 | self.assertEqual(((gtk.STATE_NORMAL, None), {}), self._called, | 238 | self.assertEqual(((Gtk.StateFlags.NORMAL, None), {}), self._called, |
1637 | 226 | 'Entry text color must be restore on focus in.') | 239 | 'Entry text color must be restore on focus in.') |
1638 | 227 | 240 | ||
1639 | 228 | def test_refill_entry_on_focus_out_if_no_input(self): | 241 | def test_refill_entry_on_focus_out_if_no_input(self): |
1640 | @@ -305,7 +318,7 @@ | |||
1641 | 305 | self.entry.set_warning(msg) | 318 | self.entry.set_warning(msg) |
1642 | 306 | self.assertEqual(self.entry.warning, msg) | 319 | self.assertEqual(self.entry.warning, msg) |
1643 | 307 | self.assertEqual(self.entry.get_property('secondary-icon-stock'), | 320 | self.assertEqual(self.entry.get_property('secondary-icon-stock'), |
1645 | 308 | gtk.STOCK_DIALOG_WARNING) | 321 | Gtk.STOCK_DIALOG_WARNING) |
1646 | 309 | self.assertEqual(self.entry.get_property('secondary-icon-sensitive'), | 322 | self.assertEqual(self.entry.get_property('secondary-icon-sensitive'), |
1647 | 310 | True) | 323 | True) |
1648 | 311 | self.assertEqual(self.entry.get_property('secondary-icon-activatable'), | 324 | self.assertEqual(self.entry.get_property('secondary-icon-activatable'), |
1649 | @@ -371,6 +384,7 @@ | |||
1650 | 371 | 'tc_browser', 'login', 'request_password_token', | 384 | 'tc_browser', 'login', 'request_password_token', |
1651 | 372 | 'set_new_password') | 385 | 'set_new_password') |
1652 | 373 | self.ui = self.gui_class(**self.kwargs) | 386 | self.ui = self.gui_class(**self.kwargs) |
1653 | 387 | self.addCleanup(self.ui.destroy) | ||
1654 | 374 | self.error = {'message': UNKNOWN_ERROR} | 388 | self.error = {'message': UNKNOWN_ERROR} |
1655 | 375 | 389 | ||
1656 | 376 | def assert_entries_are_packed_to_ui(self, container_name, entries): | 390 | def assert_entries_are_packed_to_ui(self, container_name, entries): |
1657 | @@ -405,8 +419,8 @@ | |||
1658 | 405 | 419 | ||
1659 | 406 | # content color is correct | 420 | # content color is correct |
1660 | 407 | expected = gui.WARNING_TEXT_COLOR | 421 | expected = gui.WARNING_TEXT_COLOR |
1663 | 408 | actual = label.style.fg[gtk.STATE_NORMAL] | 422 | actual = label.get_style().fg[Gtk.StateFlags.NORMAL] |
1664 | 409 | self.assertEqual(expected, actual) # until realized this will fail | 423 | self.assert_color_equal(expected, actual) |
1665 | 410 | 424 | ||
1666 | 411 | def assert_correct_entry_warning(self, entry, message): | 425 | def assert_correct_entry_warning(self, entry, message): |
1667 | 412 | """Check that a warning is shown displaying 'message'.""" | 426 | """Check that a warning is shown displaying 'message'.""" |
1668 | @@ -533,16 +547,6 @@ | |||
1669 | 533 | entry = getattr(self.ui, name) | 547 | entry = getattr(self.ui, name) |
1670 | 534 | self.assertTrue(entry.get_activates_default(), msg % (name,)) | 548 | self.assertTrue(entry.get_activates_default(), msg % (name,)) |
1671 | 535 | 549 | ||
1672 | 536 | def test_label_size_allocated_is_connected(self): | ||
1673 | 537 | """Labels have the size-allocate signal connected.""" | ||
1674 | 538 | msg = 'Label %r must have size-allocate connected.' | ||
1675 | 539 | labels = [i for i in self.ui.widgets if 'label' in i] | ||
1676 | 540 | for label in labels: | ||
1677 | 541 | widget = getattr(self.ui, label) | ||
1678 | 542 | widget.emit('size-allocate', gtk.gdk.Rectangle(1, 2, 3, 4)) | ||
1679 | 543 | self.assertEqual(widget.get_size_request(), (3 - 2, -1), | ||
1680 | 544 | msg % (label,)) | ||
1681 | 545 | |||
1682 | 546 | def test_password_fields_are_password(self): | 550 | def test_password_fields_are_password(self): |
1683 | 547 | """Password fields have the is_password flag set.""" | 551 | """Password fields have the is_password flag set.""" |
1684 | 548 | msg = '"%s" should be a password LabeledEntry instance.' | 552 | msg = '"%s" should be a password LabeledEntry instance.' |
1685 | @@ -573,28 +577,6 @@ | |||
1686 | 573 | """Main window has the proper icon.""" | 577 | """Main window has the proper icon.""" |
1687 | 574 | self.assertEqual('ubuntu-logo', self.ui.window.get_icon_name()) | 578 | self.assertEqual('ubuntu-logo', self.ui.window.get_icon_name()) |
1688 | 575 | 579 | ||
1689 | 576 | def test_transient_window_is_none_if_window_id_is_zero(self): | ||
1690 | 577 | """The transient window is correct.""" | ||
1691 | 578 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
1692 | 579 | self.gui_class(window_id=0, **self.kwargs) | ||
1693 | 580 | self.assertFalse(self._called, 'set_transient_for must not be called.') | ||
1694 | 581 | |||
1695 | 582 | def test_transient_window_is_correct(self): | ||
1696 | 583 | """The transient window is correct.""" | ||
1697 | 584 | xid = 5 | ||
1698 | 585 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
1699 | 586 | self.gui_class(window_id=xid, **self.kwargs) | ||
1700 | 587 | self.assertTrue(self.memento.check(logging.ERROR, 'set_transient_for')) | ||
1701 | 588 | self.assertTrue(self.memento.check(logging.ERROR, str(xid))) | ||
1702 | 589 | self.assertEqual(self._called, ((xid,), {})) | ||
1703 | 590 | |||
1704 | 591 | def test_transient_window_accepts_negative_id(self): | ||
1705 | 592 | """The transient window accepts a negative window id.""" | ||
1706 | 593 | xid = -5 | ||
1707 | 594 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
1708 | 595 | self.gui_class(window_id=xid, **self.kwargs) | ||
1709 | 596 | self.assertEqual(self._called, ((xid,), {})) | ||
1710 | 597 | |||
1711 | 598 | def test_finish_success_shows_success_page(self): | 580 | def test_finish_success_shows_success_page(self): |
1712 | 599 | """When calling 'finish_success' the success page is shown.""" | 581 | """When calling 'finish_success' the success page is shown.""" |
1713 | 600 | self.ui.finish_success() | 582 | self.ui.finish_success() |
1714 | @@ -611,6 +593,42 @@ | |||
1715 | 611 | self.assertEqual(gui.ERROR, self.ui.finish_vbox.label.get_text()) | 593 | self.assertEqual(gui.ERROR, self.ui.finish_vbox.label.get_text()) |
1716 | 612 | 594 | ||
1717 | 613 | 595 | ||
1718 | 596 | class SetTransientForTestCase(UbuntuSSOClientTestCase): | ||
1719 | 597 | """Test suite for setting the window as transient for another one.""" | ||
1720 | 598 | |||
1721 | 599 | def test_transient_window_is_none_if_window_id_is_zero(self): | ||
1722 | 600 | """The transient window is correct.""" | ||
1723 | 601 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
1724 | 602 | ui = self.gui_class(window_id=0, **self.kwargs) | ||
1725 | 603 | self.addCleanup(ui.destroy) | ||
1726 | 604 | |||
1727 | 605 | self.assertFalse(self._called, 'set_transient_for must not be called.') | ||
1728 | 606 | |||
1729 | 607 | def test_transient_window_is_correct(self): | ||
1730 | 608 | """The transient window is correct.""" | ||
1731 | 609 | xid = 5 | ||
1732 | 610 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
1733 | 611 | ui = self.gui_class(window_id=xid, **self.kwargs) | ||
1734 | 612 | self.addCleanup(ui.destroy) | ||
1735 | 613 | |||
1736 | 614 | self.assertTrue(self.memento.check(logging.ERROR, 'set_transient_for')) | ||
1737 | 615 | self.assertTrue(self.memento.check(logging.ERROR, str(xid))) | ||
1738 | 616 | self.assertEqual(self._called, ((xid,), {})) | ||
1739 | 617 | |||
1740 | 618 | def test_transient_window_accepts_negative_id(self): | ||
1741 | 619 | """The transient window accepts a negative window id.""" | ||
1742 | 620 | xid = -5 | ||
1743 | 621 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
1744 | 622 | ui = self.gui_class(window_id=xid, **self.kwargs) | ||
1745 | 623 | self.addCleanup(ui.destroy) | ||
1746 | 624 | |||
1747 | 625 | self.assertEqual(self._called, ((xid,), {})) | ||
1748 | 626 | |||
1749 | 627 | |||
1750 | 628 | SetTransientForTestCase.skip = "Apparently, so far we can't use XLib " \ | ||
1751 | 629 | "dynamic bindings to complete the call to X11Window.foreign_new_for_display." | ||
1752 | 630 | |||
1753 | 631 | |||
1754 | 614 | class EnterDetailsTestCase(UbuntuSSOClientTestCase): | 632 | class EnterDetailsTestCase(UbuntuSSOClientTestCase): |
1755 | 615 | """Test suite for the user registration (enter details page).""" | 633 | """Test suite for the user registration (enter details page).""" |
1756 | 616 | 634 | ||
1757 | @@ -695,8 +713,8 @@ | |||
1758 | 695 | 'processing_vbox must have two children.') | 713 | 'processing_vbox must have two children.') |
1759 | 696 | 714 | ||
1760 | 697 | spinner, label = box.get_children() | 715 | spinner, label = box.get_children() |
1763 | 698 | self.assertIsInstance(spinner, gtk.Spinner) | 716 | self.assertIsInstance(spinner, Gtk.Spinner) |
1764 | 699 | self.assertIsInstance(label, gtk.Label) | 717 | self.assertIsInstance(label, Gtk.Label) |
1765 | 700 | 718 | ||
1766 | 701 | self.assertTrue(spinner.get_property('visible'), | 719 | self.assertTrue(spinner.get_property('visible'), |
1767 | 702 | 'the processing spinner should be visible.') | 720 | 'the processing spinner should be visible.') |
1768 | @@ -715,6 +733,8 @@ | |||
1769 | 715 | def test_captcha_filename_is_different_each_time(self): | 733 | def test_captcha_filename_is_different_each_time(self): |
1770 | 716 | """The captcha image is different each time.""" | 734 | """The captcha image is different each time.""" |
1771 | 717 | ui = self.gui_class(**self.kwargs) | 735 | ui = self.gui_class(**self.kwargs) |
1772 | 736 | self.addCleanup(ui.destroy) | ||
1773 | 737 | |||
1774 | 718 | self.assertNotEqual(self.ui._captcha_filename, ui._captcha_filename) | 738 | self.assertNotEqual(self.ui._captcha_filename, ui._captcha_filename) |
1775 | 719 | 739 | ||
1776 | 720 | def test_captcha_image_is_removed_when_exiting(self): | 740 | def test_captcha_image_is_removed_when_exiting(self): |
1777 | @@ -736,8 +756,8 @@ | |||
1778 | 736 | 'captcha_loading must have two children.') | 756 | 'captcha_loading must have two children.') |
1779 | 737 | 757 | ||
1780 | 738 | spinner, label = box.get_children() | 758 | spinner, label = box.get_children() |
1783 | 739 | self.assertIsInstance(spinner, gtk.Spinner) | 759 | self.assertIsInstance(spinner, Gtk.Spinner) |
1784 | 740 | self.assertIsInstance(label, gtk.Label) | 760 | self.assertIsInstance(label, Gtk.Label) |
1785 | 741 | 761 | ||
1786 | 742 | self.assertTrue(spinner.get_property('visible'), | 762 | self.assertTrue(spinner.get_property('visible'), |
1787 | 743 | 'the captcha_loading spinner should be visible.') | 763 | 'the captcha_loading spinner should be visible.') |
1788 | @@ -872,7 +892,7 @@ | |||
1789 | 872 | @defer.inlineCallbacks | 892 | @defer.inlineCallbacks |
1790 | 873 | def setUp(self): | 893 | def setUp(self): |
1791 | 874 | yield super(TermsAndConditionsBrowserTestCase, self).setUp() | 894 | yield super(TermsAndConditionsBrowserTestCase, self).setUp() |
1793 | 875 | self.patch(webkit, 'WebView', FakedEmbeddedBrowser) | 895 | self.patch(WebKit, 'WebView', FakedEmbeddedBrowser) |
1794 | 876 | 896 | ||
1795 | 877 | self.ui.tc_button.clicked() | 897 | self.ui.tc_button.clicked() |
1796 | 878 | self.addCleanup(self.ui.tc_browser_vbox.hide) | 898 | self.addCleanup(self.ui.tc_browser_vbox.hide) |
1797 | @@ -968,10 +988,10 @@ | |||
1798 | 968 | 988 | ||
1799 | 969 | def test_navigation_requested_succeeds_for_no_clicking(self): | 989 | def test_navigation_requested_succeeds_for_no_clicking(self): |
1800 | 970 | """The navigation request succeeds when user hasn't clicked a link.""" | 990 | """The navigation request succeeds when user hasn't clicked a link.""" |
1802 | 971 | action = webkit.WebNavigationAction() | 991 | action = WebKit.WebNavigationAction() |
1803 | 972 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_OTHER) | 992 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_OTHER) |
1804 | 973 | 993 | ||
1806 | 974 | decision = webkit.WebPolicyDecision() | 994 | decision = WebKit.WebPolicyDecision() |
1807 | 975 | decision.use = self._set_called | 995 | decision.use = self._set_called |
1808 | 976 | 996 | ||
1809 | 977 | kwargs = dict(browser=self.browser, frame=None, request=None, | 997 | kwargs = dict(browser=self.browser, frame=None, request=None, |
1810 | @@ -981,10 +1001,10 @@ | |||
1811 | 981 | 1001 | ||
1812 | 982 | def test_navigation_requested_ignores_clicked_links(self): | 1002 | def test_navigation_requested_ignores_clicked_links(self): |
1813 | 983 | """The navigation request is ignored if a link was clicked.""" | 1003 | """The navigation request is ignored if a link was clicked.""" |
1815 | 984 | action = webkit.WebNavigationAction() | 1004 | action = WebKit.WebNavigationAction() |
1816 | 985 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) | 1005 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) |
1817 | 986 | 1006 | ||
1819 | 987 | decision = webkit.WebPolicyDecision() | 1007 | decision = WebKit.WebPolicyDecision() |
1820 | 988 | decision.ignore = self._set_called | 1008 | decision.ignore = self._set_called |
1821 | 989 | 1009 | ||
1822 | 990 | self.patch(gui.webbrowser, 'open', lambda *args, **kwargs: None) | 1010 | self.patch(gui.webbrowser, 'open', lambda *args, **kwargs: None) |
1823 | @@ -1007,11 +1027,11 @@ | |||
1824 | 1007 | 1027 | ||
1825 | 1008 | """ | 1028 | """ |
1826 | 1009 | url = 'http://something.com/yadda' | 1029 | url = 'http://something.com/yadda' |
1828 | 1010 | action = webkit.WebNavigationAction() | 1030 | action = WebKit.WebNavigationAction() |
1829 | 1011 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) | 1031 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) |
1830 | 1012 | action.set_original_uri(url) | 1032 | action.set_original_uri(url) |
1831 | 1013 | 1033 | ||
1833 | 1014 | decision = webkit.WebPolicyDecision() | 1034 | decision = WebKit.WebPolicyDecision() |
1834 | 1015 | decision.ignore = gui.NO_OP | 1035 | decision.ignore = gui.NO_OP |
1835 | 1016 | 1036 | ||
1836 | 1017 | self.patch(gui.webbrowser, 'open', self._set_called) | 1037 | self.patch(gui.webbrowser, 'open', self._set_called) |
1837 | @@ -2081,7 +2101,7 @@ | |||
1838 | 2081 | 2101 | ||
1839 | 2082 | def test_closing_main_window(self): | 2102 | def test_closing_main_window(self): |
1840 | 2083 | """When closing the main window, USER_CANCELLATION is called.""" | 2103 | """When closing the main window, USER_CANCELLATION is called.""" |
1842 | 2084 | self.ui.window.emit('delete-event', gtk.gdk.Event(gtk.gdk.DELETE)) | 2104 | self.ui.window.emit('delete-event', Gdk.Event()) |
1843 | 2085 | self.assertEqual(self._called, ((gui.USER_CANCELLATION,), {})) | 2105 | self.assertEqual(self._called, ((gui.USER_CANCELLATION,), {})) |
1844 | 2086 | 2106 | ||
1845 | 2087 | def test_every_cancel_calls_proper_callback(self): | 2107 | def test_every_cancel_calls_proper_callback(self): |
1846 | 2088 | 2108 | ||
1847 | === modified file 'ubuntu_sso/gtk/tests/test_main.py' | |||
1848 | --- ubuntu_sso/gtk/tests/test_main.py 2012-01-18 12:37:00 +0000 | |||
1849 | +++ ubuntu_sso/gtk/tests/test_main.py 2012-02-02 18:14:19 +0000 | |||
1850 | @@ -73,14 +73,14 @@ | |||
1851 | 73 | called = [] | 73 | called = [] |
1852 | 74 | self.patch(main, 'UbuntuSSOClientGUI', | 74 | self.patch(main, 'UbuntuSSOClientGUI', |
1853 | 75 | lambda **kw: called.append(('GUI', kw))) | 75 | lambda **kw: called.append(('GUI', kw))) |
1856 | 76 | self.patch(main.gtk, 'main', | 76 | self.patch(main.Gtk, 'main', |
1857 | 77 | lambda: called.append('gtk.main')) | 77 | lambda: called.append('main')) |
1858 | 78 | 78 | ||
1859 | 79 | kwargs = dict(foo='foo', bar='bar', baz='yadda', yadda=0) | 79 | kwargs = dict(foo='foo', bar='bar', baz='yadda', yadda=0) |
1860 | 80 | main.main(**kwargs) | 80 | main.main(**kwargs) |
1861 | 81 | 81 | ||
1864 | 82 | kwargs['close_callback'] = main.gtk.main_quit | 82 | kwargs['close_callback'] = main.Gtk.main_quit |
1865 | 83 | self.assertEqual(called, [('GUI', kwargs), 'gtk.main']) | 83 | self.assertEqual(called, [('GUI', kwargs), 'main']) |
1866 | 84 | 84 | ||
1867 | 85 | def test_parse_args_app_name_is_required(self): | 85 | def test_parse_args_app_name_is_required(self): |
1868 | 86 | """If no app_name, show help and exit.""" | 86 | """If no app_name, show help and exit.""" |
1869 | 87 | 87 | ||
1870 | === modified file 'ubuntu_sso/keyring/__init__.py' | |||
1871 | --- ubuntu_sso/keyring/__init__.py 2011-10-17 18:24:55 +0000 | |||
1872 | +++ ubuntu_sso/keyring/__init__.py 2012-02-02 18:14:19 +0000 | |||
1873 | @@ -29,8 +29,8 @@ | |||
1874 | 29 | 29 | ||
1875 | 30 | logger = setup_logging("ubuntu_sso.keyring") | 30 | logger = setup_logging("ubuntu_sso.keyring") |
1876 | 31 | 31 | ||
1879 | 32 | TOKEN_SEPARATOR = ' @ ' | 32 | TOKEN_SEPARATOR = u' @ ' |
1880 | 33 | SEPARATOR_REPLACEMENT = ' AT ' | 33 | SEPARATOR_REPLACEMENT = u' AT ' |
1881 | 34 | 34 | ||
1882 | 35 | U1_APP_NAME = "Ubuntu One" | 35 | U1_APP_NAME = "Ubuntu One" |
1883 | 36 | U1_KEY_NAME = "UbuntuOne token for https://ubuntuone.com" | 36 | U1_KEY_NAME = "UbuntuOne token for https://ubuntuone.com" |
1884 | @@ -41,26 +41,34 @@ | |||
1885 | 41 | 41 | ||
1886 | 42 | 42 | ||
1887 | 43 | def gethostname(): | 43 | def gethostname(): |
1889 | 44 | """Get the hostname, encoded in utf-8.""" | 44 | """Get the hostname, return the name as unicode.""" |
1890 | 45 | sys_encoding = sys.getfilesystemencoding() | 45 | sys_encoding = sys.getfilesystemencoding() |
1891 | 46 | hostname = socket.gethostname().decode(sys_encoding) | 46 | hostname = socket.gethostname().decode(sys_encoding) |
1893 | 47 | return hostname.encode("utf-8") | 47 | return hostname |
1894 | 48 | 48 | ||
1895 | 49 | 49 | ||
1896 | 50 | def get_old_token_name(app_name): | 50 | def get_old_token_name(app_name): |
1898 | 51 | """Build the token name (old style).""" | 51 | """Build the token name (old style). Return an unicode.""" |
1899 | 52 | quoted_app_name = urllib.quote(app_name) | 52 | quoted_app_name = urllib.quote(app_name) |
1900 | 53 | computer_name = gethostname() | 53 | computer_name = gethostname() |
1901 | 54 | quoted_computer_name = urllib.quote(computer_name) | 54 | quoted_computer_name = urllib.quote(computer_name) |
1903 | 55 | return "%s - %s" % (quoted_app_name, quoted_computer_name) | 55 | |
1904 | 56 | assert isinstance(computer_name, unicode) | ||
1905 | 57 | assert isinstance(quoted_computer_name, unicode) | ||
1906 | 58 | |||
1907 | 59 | return u"%s - %s" % (quoted_app_name, quoted_computer_name) | ||
1908 | 56 | 60 | ||
1909 | 57 | 61 | ||
1910 | 58 | def get_token_name(app_name): | 62 | def get_token_name(app_name): |
1913 | 59 | """Build the token name.""" | 63 | """Build the token name.. Return an unicode.""" |
1914 | 60 | computer_name = gethostname().decode("utf-8") | 64 | computer_name = gethostname() |
1915 | 61 | computer_name = computer_name.replace(TOKEN_SEPARATOR, | 65 | computer_name = computer_name.replace(TOKEN_SEPARATOR, |
1916 | 62 | SEPARATOR_REPLACEMENT) | 66 | SEPARATOR_REPLACEMENT) |
1918 | 63 | return TOKEN_SEPARATOR.join((app_name, computer_name)).encode("utf-8") | 67 | |
1919 | 68 | assert isinstance(computer_name, unicode) | ||
1920 | 69 | assert isinstance(computer_name, unicode) | ||
1921 | 70 | |||
1922 | 71 | return TOKEN_SEPARATOR.join((app_name, computer_name)) | ||
1923 | 64 | 72 | ||
1924 | 65 | 73 | ||
1925 | 66 | @inlineCallbacks | 74 | @inlineCallbacks |
1926 | 67 | 75 | ||
1927 | === modified file 'ubuntu_sso/keyring/tests/test_common.py' | |||
1928 | --- ubuntu_sso/keyring/tests/test_common.py 2011-10-28 10:41:18 +0000 | |||
1929 | +++ ubuntu_sso/keyring/tests/test_common.py 2012-02-02 18:14:19 +0000 | |||
1930 | @@ -38,10 +38,9 @@ | |||
1931 | 38 | """The fs encoding is used to decode the name returned by socket.""" | 38 | """The fs encoding is used to decode the name returned by socket.""" |
1932 | 39 | fake_hostname = u"Привет-ПК" | 39 | fake_hostname = u"Привет-ПК" |
1933 | 40 | hostname_koi8r = fake_hostname.encode("koi8-r") | 40 | hostname_koi8r = fake_hostname.encode("koi8-r") |
1934 | 41 | hostname_utf8 = fake_hostname.encode("utf-8") | ||
1935 | 42 | self.patch(keyring.socket, "gethostname", lambda: hostname_koi8r) | 41 | self.patch(keyring.socket, "gethostname", lambda: hostname_koi8r) |
1936 | 43 | self.patch(keyring.sys, "getfilesystemencoding", lambda: "koi8-r") | 42 | self.patch(keyring.sys, "getfilesystemencoding", lambda: "koi8-r") |
1938 | 44 | self.assertEqual(keyring.gethostname(), hostname_utf8) | 43 | self.assertEqual(keyring.gethostname(), fake_hostname) |
1939 | 45 | 44 | ||
1940 | 46 | 45 | ||
1941 | 47 | class TestTokenNameBuilder(TestCase): | 46 | class TestTokenNameBuilder(TestCase): |
1942 | @@ -78,12 +77,12 @@ | |||
1943 | 78 | """A token name with unicode in the app name.""" | 77 | """A token name with unicode in the app name.""" |
1944 | 79 | sample_app_name = u"Ubuntu 四百六十九" | 78 | sample_app_name = u"Ubuntu 四百六十九" |
1945 | 80 | sample_hostname = "Darkstar" | 79 | sample_hostname = "Darkstar" |
1947 | 81 | expected_result = u"Ubuntu 四百六十九 @ Darkstar".encode("utf-8") | 80 | expected_result = u"Ubuntu 四百六十九 @ Darkstar" |
1948 | 82 | self.check_build(sample_app_name, sample_hostname, expected_result) | 81 | self.check_build(sample_app_name, sample_hostname, expected_result) |
1949 | 83 | 82 | ||
1950 | 84 | def test_get_utf8_hostname_token_name(self): | 83 | def test_get_utf8_hostname_token_name(self): |
1951 | 85 | """A token name with utf8 in the host name.""" | 84 | """A token name with utf8 in the host name.""" |
1952 | 86 | sample_app_name = u"Ubuntu Eleven" | 85 | sample_app_name = u"Ubuntu Eleven" |
1955 | 87 | sample_hostname = u"Привет-ПК".encode("utf-8") | 86 | sample_hostname = u"Привет-ПК" |
1956 | 88 | expected_result = u"Ubuntu Eleven @ Привет-ПК".encode("utf-8") | 87 | expected_result = u"Ubuntu Eleven @ Привет-ПК" |
1957 | 89 | self.check_build(sample_app_name, sample_hostname, expected_result) | 88 | self.check_build(sample_app_name, sample_hostname, expected_result) |
1958 | 90 | 89 | ||
1959 | === modified file 'ubuntu_sso/keyring/tests/test_linux.py' | |||
1960 | --- ubuntu_sso/keyring/tests/test_linux.py 2011-10-28 10:41:18 +0000 | |||
1961 | +++ ubuntu_sso/keyring/tests/test_linux.py 2012-02-02 18:14:19 +0000 | |||
1962 | @@ -121,7 +121,7 @@ | |||
1963 | 121 | self.mock_service = None | 121 | self.mock_service = None |
1964 | 122 | self.service = self.patch(keyring, "SecretService", | 122 | self.service = self.patch(keyring, "SecretService", |
1965 | 123 | self.get_mock_service) | 123 | self.get_mock_service) |
1967 | 124 | self.patch(common_keyring, "gethostname", lambda: "darkstar") | 124 | self.patch(common_keyring, "gethostname", lambda: u"darkstar") |
1968 | 125 | 125 | ||
1969 | 126 | def get_mock_service(self): | 126 | def get_mock_service(self): |
1970 | 127 | """Create only one instance of the mock service per test.""" | 127 | """Create only one instance of the mock service per test.""" |
1971 | 128 | 128 | ||
1972 | === modified file 'ubuntu_sso/logger.py' | |||
1973 | --- ubuntu_sso/logger.py 2012-01-10 18:25:01 +0000 | |||
1974 | +++ ubuntu_sso/logger.py 2012-02-02 18:14:19 +0000 | |||
1975 | @@ -42,20 +42,31 @@ | |||
1976 | 42 | LOG_LEVEL = logging.INFO | 42 | LOG_LEVEL = logging.INFO |
1977 | 43 | 43 | ||
1978 | 44 | LOG_PATH = os.path.join(LOGFOLDER, 'sso-client.log') | 44 | LOG_PATH = os.path.join(LOGFOLDER, 'sso-client.log') |
1979 | 45 | FMT = "%(asctime)s:%(msecs)s - %(name)s - %(levelname)s - %(message)s" | ||
1980 | 46 | |||
1981 | 45 | MAIN_HANDLER = RotatingFileHandler(unicode_path(LOG_PATH), | 47 | MAIN_HANDLER = RotatingFileHandler(unicode_path(LOG_PATH), |
1982 | 46 | maxBytes=1048576, | 48 | maxBytes=1048576, |
1983 | 47 | backupCount=5) | 49 | backupCount=5) |
1984 | 48 | MAIN_HANDLER.setLevel(LOG_LEVEL) | 50 | MAIN_HANDLER.setLevel(LOG_LEVEL) |
1985 | 49 | FMT = "%(asctime)s:%(msecs)s - %(name)s - %(levelname)s - %(message)s" | ||
1986 | 50 | MAIN_HANDLER.setFormatter(logging.Formatter(fmt=FMT)) | 51 | MAIN_HANDLER.setFormatter(logging.Formatter(fmt=FMT)) |
1987 | 51 | 52 | ||
1990 | 52 | 53 | GUI_LOG_PATH = os.path.join(LOGFOLDER, 'sso-client-gui.log') | |
1991 | 53 | def setup_logging(log_domain): | 54 | GUI_HANDLER = RotatingFileHandler(unicode_path(GUI_LOG_PATH), |
1992 | 55 | maxBytes=1048576, | ||
1993 | 56 | backupCount=5) | ||
1994 | 57 | GUI_HANDLER.setLevel(LOG_LEVEL) | ||
1995 | 58 | GUI_HANDLER.setFormatter(logging.Formatter(fmt=FMT)) | ||
1996 | 59 | |||
1997 | 60 | |||
1998 | 61 | def setup_logging(log_domain, handler=None): | ||
1999 | 54 | """Create basic logger to set filename.""" | 62 | """Create basic logger to set filename.""" |
2000 | 63 | if handler is None: | ||
2001 | 64 | handler = MAIN_HANDLER | ||
2002 | 65 | |||
2003 | 55 | logger = logging.getLogger(log_domain) | 66 | logger = logging.getLogger(log_domain) |
2004 | 56 | logger.propagate = False | 67 | logger.propagate = False |
2005 | 57 | logger.setLevel(LOG_LEVEL) | 68 | logger.setLevel(LOG_LEVEL) |
2007 | 58 | logger.addHandler(MAIN_HANDLER) | 69 | logger.addHandler(handler) |
2008 | 59 | if os.environ.get('DEBUG'): | 70 | if os.environ.get('DEBUG'): |
2009 | 60 | debug_handler = logging.StreamHandler(sys.stderr) | 71 | debug_handler = logging.StreamHandler(sys.stderr) |
2010 | 61 | debug_handler.setFormatter(logging.Formatter(fmt=FMT)) | 72 | debug_handler.setFormatter(logging.Formatter(fmt=FMT)) |
2011 | @@ -64,6 +75,11 @@ | |||
2012 | 64 | return logger | 75 | return logger |
2013 | 65 | 76 | ||
2014 | 66 | 77 | ||
2015 | 78 | def setup_gui_logging(log_domain): | ||
2016 | 79 | """Create basic logger to set filename.""" | ||
2017 | 80 | return setup_logging(log_domain, GUI_HANDLER) | ||
2018 | 81 | |||
2019 | 82 | |||
2020 | 67 | def log_call(log_func): | 83 | def log_call(log_func): |
2021 | 68 | """Decorator to log, using 'log_func', calls to functions.""" | 84 | """Decorator to log, using 'log_func', calls to functions.""" |
2022 | 69 | 85 | ||
2023 | 70 | 86 | ||
2024 | === modified file 'ubuntu_sso/main/__init__.py' | |||
2025 | --- ubuntu_sso/main/__init__.py 2012-01-20 18:08:04 +0000 | |||
2026 | +++ ubuntu_sso/main/__init__.py 2012-02-02 18:14:19 +0000 | |||
2027 | @@ -486,8 +486,8 @@ | |||
2028 | 486 | def main(): | 486 | def main(): |
2029 | 487 | """Run the backend service.""" | 487 | """Run the backend service.""" |
2030 | 488 | logger.info('Setting up Ubuntu SSO service.') | 488 | logger.info('Setting up Ubuntu SSO service.') |
2032 | 489 | source.start_setup() | 489 | loop = source.start_setup() |
2033 | 490 | service = UbuntuSSOService() | 490 | service = UbuntuSSOService() |
2034 | 491 | d = service.start() | 491 | d = service.start() |
2036 | 492 | d.addBoth(source.finish_setup) | 492 | d.addBoth(source.finish_setup, loop) |
2037 | 493 | source.main() | 493 | source.main() |
2038 | 494 | 494 | ||
2039 | === added file 'ubuntu_sso/main/glib.py' | |||
2040 | --- ubuntu_sso/main/glib.py 1970-01-01 00:00:00 +0000 | |||
2041 | +++ ubuntu_sso/main/glib.py 2012-02-02 18:14:19 +0000 | |||
2042 | @@ -0,0 +1,45 @@ | |||
2043 | 1 | # -*- coding: utf-8 -*- | ||
2044 | 2 | # | ||
2045 | 3 | # Copyright 2012 Canonical Ltd. | ||
2046 | 4 | # | ||
2047 | 5 | # This program is free software: you can redistribute it and/or modify it | ||
2048 | 6 | # under the terms of the GNU General Public License version 3, as published | ||
2049 | 7 | # by the Free Software Foundation. | ||
2050 | 8 | # | ||
2051 | 9 | # This program is distributed in the hope that it will be useful, but | ||
2052 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2053 | 11 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2054 | 12 | # PURPOSE. See the GNU General Public License for more details. | ||
2055 | 13 | # | ||
2056 | 14 | # You should have received a copy of the GNU General Public License along | ||
2057 | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2058 | 16 | |||
2059 | 17 | """GLib main loop runner.""" | ||
2060 | 18 | |||
2061 | 19 | # pylint: disable=E0611,F0401 | ||
2062 | 20 | |||
2063 | 21 | from gi.repository import GLib, Gdk, Gtk | ||
2064 | 22 | |||
2065 | 23 | |||
2066 | 24 | def timeout_func(*a, **kw): | ||
2067 | 25 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2068 | 26 | return GLib.timeout_add(*a, **kw) | ||
2069 | 27 | |||
2070 | 28 | |||
2071 | 29 | def shutdown_func(*a, **kw): | ||
2072 | 30 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2073 | 31 | Gtk.main_quit() | ||
2074 | 32 | |||
2075 | 33 | |||
2076 | 34 | def run_func(loop): | ||
2077 | 35 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2078 | 36 | Gtk.main() | ||
2079 | 37 | |||
2080 | 38 | |||
2081 | 39 | def start_setup(): | ||
2082 | 40 | """Setup the env to run the service.""" | ||
2083 | 41 | import dbus.mainloop.glib # pylint: disable=W0621 | ||
2084 | 42 | |||
2085 | 43 | dbus.mainloop.glib.threads_init() | ||
2086 | 44 | Gdk.threads_init() | ||
2087 | 45 | dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | ||
2088 | 0 | 46 | ||
2089 | === modified file 'ubuntu_sso/main/linux.py' | |||
2090 | --- ubuntu_sso/main/linux.py 2012-01-26 17:21:32 +0000 | |||
2091 | +++ ubuntu_sso/main/linux.py 2012-02-02 18:14:19 +0000 | |||
2092 | @@ -25,12 +25,12 @@ | |||
2093 | 25 | 25 | ||
2094 | 26 | """ | 26 | """ |
2095 | 27 | 27 | ||
2096 | 28 | import os | ||
2097 | 29 | import signal | ||
2098 | 28 | import threading | 30 | import threading |
2099 | 29 | import signal | ||
2100 | 30 | 31 | ||
2102 | 31 | import dbus.mainloop.glib | 32 | import dbus |
2103 | 32 | import dbus.service | 33 | import dbus.service |
2104 | 33 | import gtk | ||
2105 | 34 | 34 | ||
2106 | 35 | from twisted.internet import defer | 35 | from twisted.internet import defer |
2107 | 36 | 36 | ||
2108 | @@ -68,8 +68,8 @@ | |||
2109 | 68 | class SSOLoginProxy(dbus.service.Object): | 68 | class SSOLoginProxy(dbus.service.Object): |
2110 | 69 | """Login thru the Single Sign On service.""" | 69 | """Login thru the Single Sign On service.""" |
2111 | 70 | 70 | ||
2114 | 71 | # Operator not preceded by a space (fails with dbus decorators) | 71 | # Use of super on an old style class |
2115 | 72 | # pylint: disable=C0322 | 72 | # pylint: disable=E1002 |
2116 | 73 | 73 | ||
2117 | 74 | def __init__(self, root, *args, **kwargs): | 74 | def __init__(self, root, *args, **kwargs): |
2118 | 75 | """Initiate the Login object.""" | 75 | """Initiate the Login object.""" |
2119 | @@ -77,6 +77,9 @@ | |||
2120 | 77 | super(SSOLoginProxy, self).__init__(*args, **kwargs) | 77 | super(SSOLoginProxy, self).__init__(*args, **kwargs) |
2121 | 78 | self.root = root | 78 | self.root = root |
2122 | 79 | 79 | ||
2123 | 80 | # Operator not preceded by a space (fails with dbus decorators) | ||
2124 | 81 | # pylint: disable=C0322 | ||
2125 | 82 | |||
2126 | 80 | # generate_capcha signals | 83 | # generate_capcha signals |
2127 | 81 | @dbus.service.signal(DBUS_IFACE_USER_NAME, signature="ss") | 84 | @dbus.service.signal(DBUS_IFACE_USER_NAME, signature="ss") |
2128 | 82 | def CaptchaGenerated(self, app_name, result): | 85 | def CaptchaGenerated(self, app_name, result): |
2129 | @@ -202,6 +205,9 @@ | |||
2130 | 202 | 205 | ||
2131 | 203 | """ | 206 | """ |
2132 | 204 | 207 | ||
2133 | 208 | # Use of super on an old style class | ||
2134 | 209 | # pylint: disable=E1002 | ||
2135 | 210 | |||
2136 | 205 | def __init__(self, root, *args, **kwargs): | 211 | def __init__(self, root, *args, **kwargs): |
2137 | 206 | # pylint: disable=E1002 | 212 | # pylint: disable=E1002 |
2138 | 207 | super(CredentialsManagementProxy, self).__init__(*args, **kwargs) | 213 | super(CredentialsManagementProxy, self).__init__(*args, **kwargs) |
2139 | @@ -433,39 +439,38 @@ | |||
2140 | 433 | return defer.succeed(result) | 439 | return defer.succeed(result) |
2141 | 434 | 440 | ||
2142 | 435 | 441 | ||
2143 | 442 | if os.environ.get('USE_QT_MAINLOOP'): | ||
2144 | 443 | from ubuntu_sso.main import qt | ||
2145 | 444 | source = qt | ||
2146 | 445 | else: | ||
2147 | 446 | from ubuntu_sso.main import glib | ||
2148 | 447 | source = glib | ||
2149 | 448 | |||
2150 | 449 | |||
2151 | 450 | timeout_func = source.timeout_func | ||
2152 | 451 | shutdown_func = source.shutdown_func | ||
2153 | 452 | start_setup = source.start_setup | ||
2154 | 453 | |||
2155 | 454 | |||
2156 | 436 | def sighup_handler(*a, **kw): | 455 | def sighup_handler(*a, **kw): |
2157 | 437 | """Stop the service.""" | 456 | """Stop the service.""" |
2158 | 438 | # This handler may be called in any thread, so is not thread safe. | 457 | # This handler may be called in any thread, so is not thread safe. |
2159 | 439 | # See the link below for info: | 458 | # See the link below for info: |
2160 | 440 | # www.listware.net/201004/gtk-devel-list/115067-unix-signals-in-glib.html | 459 | # www.listware.net/201004/gtk-devel-list/115067-unix-signals-in-glib.html |
2161 | 441 | # | ||
2162 | 442 | # gtk.main_quit and the logger methods are safe to be called from any | ||
2163 | 443 | # thread. Just don't call other random stuff here. | ||
2164 | 444 | logger.info("Stoping Ubuntu SSO service since SIGHUP was received.") | 460 | logger.info("Stoping Ubuntu SSO service since SIGHUP was received.") |
2166 | 445 | gtk.main_quit() | 461 | shutdown_func() |
2167 | 446 | 462 | ||
2168 | 447 | 463 | ||
2169 | 448 | class AlreadyStartedError(Exception): | 464 | class AlreadyStartedError(Exception): |
2170 | 449 | """The backend service has already been started.""" | 465 | """The backend service has already been started.""" |
2171 | 450 | 466 | ||
2172 | 451 | 467 | ||
2185 | 452 | timeout_func = gtk.timeout_add | 468 | def finish_setup(result, loop): |
2174 | 453 | shutdown_func = gtk.main_quit | ||
2175 | 454 | |||
2176 | 455 | |||
2177 | 456 | def start_setup(): | ||
2178 | 457 | """Setup the env to run the service.""" | ||
2179 | 458 | dbus.mainloop.glib.threads_init() | ||
2180 | 459 | gtk.gdk.threads_init() | ||
2181 | 460 | dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | ||
2182 | 461 | |||
2183 | 462 | |||
2184 | 463 | def finish_setup(result): | ||
2186 | 464 | """Run the specific mainloop only if no failure ocurred.""" | 469 | """Run the specific mainloop only if no failure ocurred.""" |
2187 | 465 | if result is None: # no failure ocurred, start the service | 470 | if result is None: # no failure ocurred, start the service |
2188 | 466 | logger.debug("Hooking up SIGHUP with handler %r.", sighup_handler) | 471 | logger.debug("Hooking up SIGHUP with handler %r.", sighup_handler) |
2189 | 467 | signal.signal(signal.SIGHUP, sighup_handler) | 472 | signal.signal(signal.SIGHUP, sighup_handler) |
2191 | 468 | gtk.main() | 473 | source.run_func(loop) |
2192 | 469 | 474 | ||
2193 | 470 | 475 | ||
2194 | 471 | def main(): | 476 | def main(): |
2195 | 472 | 477 | ||
2196 | === added file 'ubuntu_sso/main/qt.py' | |||
2197 | --- ubuntu_sso/main/qt.py 1970-01-01 00:00:00 +0000 | |||
2198 | +++ ubuntu_sso/main/qt.py 2012-02-02 18:14:19 +0000 | |||
2199 | @@ -0,0 +1,49 @@ | |||
2200 | 1 | # -*- coding: utf-8 -*- | ||
2201 | 2 | # | ||
2202 | 3 | # Copyright 2012 Canonical Ltd. | ||
2203 | 4 | # | ||
2204 | 5 | # This program is free software: you can redistribute it and/or modify it | ||
2205 | 6 | # under the terms of the GNU General Public License version 3, as published | ||
2206 | 7 | # by the Free Software Foundation. | ||
2207 | 8 | # | ||
2208 | 9 | # This program is distributed in the hope that it will be useful, but | ||
2209 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2210 | 11 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2211 | 12 | # PURPOSE. See the GNU General Public License for more details. | ||
2212 | 13 | # | ||
2213 | 14 | # You should have received a copy of the GNU General Public License along | ||
2214 | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2215 | 16 | |||
2216 | 17 | """Qt main loop runner.""" | ||
2217 | 18 | |||
2218 | 19 | # pylint: disable=E0611,F0401 | ||
2219 | 20 | |||
2220 | 21 | import sys | ||
2221 | 22 | |||
2222 | 23 | from PyQt4 import QtCore | ||
2223 | 24 | |||
2224 | 25 | |||
2225 | 26 | def timeout_func(*a, **kw): | ||
2226 | 27 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2227 | 28 | # use a QTimer to simulate a looping call | ||
2228 | 29 | |||
2229 | 30 | |||
2230 | 31 | def shutdown_func(*a, **kw): | ||
2231 | 32 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2232 | 33 | QtCore.QCoreApplication.instance().exit() | ||
2233 | 34 | |||
2234 | 35 | |||
2235 | 36 | def start_setup(): | ||
2236 | 37 | """Setup the env to run the service.""" | ||
2237 | 38 | import dbus.mainloop.qt # pylint: disable=W0621 | ||
2238 | 39 | |||
2239 | 40 | # this has to be created before calling dbus.mainloop.qt.DBusQtMainLoop | ||
2240 | 41 | loop = QtCore.QCoreApplication(sys.argv) | ||
2241 | 42 | dbus.mainloop.qt.DBusQtMainLoop(set_as_default=True) | ||
2242 | 43 | |||
2243 | 44 | return loop | ||
2244 | 45 | |||
2245 | 46 | |||
2246 | 47 | def run_func(loop): | ||
2247 | 48 | """Delay import of dynamic bindings to avoid crashes.""" | ||
2248 | 49 | loop.exec_() | ||
2249 | 0 | 50 | ||
2250 | === modified file 'ubuntu_sso/main/windows.py' | |||
2251 | --- ubuntu_sso/main/windows.py 2012-01-10 20:47:06 +0000 | |||
2252 | +++ ubuntu_sso/main/windows.py 2012-02-02 18:14:19 +0000 | |||
2253 | @@ -411,7 +411,7 @@ | |||
2254 | 411 | # pylint: disable=E1101 | 411 | # pylint: disable=E1101 |
2255 | 412 | 412 | ||
2256 | 413 | 413 | ||
2258 | 414 | def finish_setup(result): | 414 | def finish_setup(result, loop): |
2259 | 415 | """Stop the reactor if a failure ocurred.""" | 415 | """Stop the reactor if a failure ocurred.""" |
2260 | 416 | if isinstance(result, Failure): | 416 | if isinstance(result, Failure): |
2261 | 417 | reactor.stop() | 417 | reactor.stop() |
2262 | 418 | 418 | ||
2263 | === modified file 'ubuntu_sso/qt/gui.py' | |||
2264 | --- ubuntu_sso/qt/gui.py 2012-02-01 19:19:32 +0000 | |||
2265 | +++ ubuntu_sso/qt/gui.py 2012-02-02 18:14:19 +0000 | |||
2266 | @@ -1,5 +1,4 @@ | |||
2267 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2268 | 2 | # Author: Manuel de la Pena <manuel@canonical.com> | ||
2269 | 3 | # | 2 | # |
2270 | 4 | # Copyright 2011 Canonical Ltd. | 3 | # Copyright 2011 Canonical Ltd. |
2271 | 5 | # | 4 | # |
2272 | @@ -18,6 +17,8 @@ | |||
2273 | 18 | 17 | ||
2274 | 19 | import gettext | 18 | import gettext |
2275 | 20 | 19 | ||
2276 | 20 | # pylint: disable=F0401,E0611 | ||
2277 | 21 | |||
2278 | 21 | from PyQt4.QtCore import pyqtSignal, Qt, SIGNAL | 22 | from PyQt4.QtCore import pyqtSignal, Qt, SIGNAL |
2279 | 22 | from PyQt4.QtGui import ( | 23 | from PyQt4.QtGui import ( |
2280 | 23 | QApplication, | 24 | QApplication, |
2281 | 24 | 25 | ||
2282 | === modified file 'ubuntu_sso/qt/tests/login_u_p.py' | |||
2283 | --- ubuntu_sso/qt/tests/login_u_p.py 2012-01-10 18:14:09 +0000 | |||
2284 | +++ ubuntu_sso/qt/tests/login_u_p.py 2012-02-02 18:14:19 +0000 | |||
2285 | @@ -17,10 +17,11 @@ | |||
2286 | 17 | 17 | ||
2287 | 18 | import sys | 18 | import sys |
2288 | 19 | 19 | ||
2289 | 20 | # pylint: disable=E1101,F0401,E0611 | ||
2290 | 21 | |||
2291 | 20 | if sys.platform != 'win32': | 22 | if sys.platform != 'win32': |
2295 | 21 | # pylint: disable=F0401 | 23 | from twisted.internet import gireactor |
2296 | 22 | from twisted.internet import glib2reactor | 24 | gireactor.install() |
2294 | 23 | glib2reactor.install() | ||
2297 | 24 | 25 | ||
2298 | 25 | from dbus.mainloop.glib import DBusGMainLoop | 26 | from dbus.mainloop.glib import DBusGMainLoop |
2299 | 26 | DBusGMainLoop(set_as_default=True) | 27 | DBusGMainLoop(set_as_default=True) |
2300 | @@ -29,8 +30,6 @@ | |||
2301 | 29 | 30 | ||
2302 | 30 | from ubuntu_sso.main import get_sso_client | 31 | from ubuntu_sso.main import get_sso_client |
2303 | 31 | 32 | ||
2304 | 32 | # pylint: disable=E1101 | ||
2305 | 33 | |||
2306 | 34 | 33 | ||
2307 | 35 | @defer.inlineCallbacks | 34 | @defer.inlineCallbacks |
2308 | 36 | def main(): | 35 | def main(): |
2309 | @@ -48,7 +47,19 @@ | |||
2310 | 48 | client.cred_manager.connect_to_signal('AuthorizationDenied', found) | 47 | client.cred_manager.connect_to_signal('AuthorizationDenied', found) |
2311 | 49 | client.cred_manager.connect_to_signal('CredentialsError', found) | 48 | client.cred_manager.connect_to_signal('CredentialsError', found) |
2312 | 50 | 49 | ||
2313 | 50 | # use the following to trigger a CredentialsError (AuthenticationError) | ||
2314 | 51 | args = dict(email='xyz@canonical.com', password='ABC') | 51 | args = dict(email='xyz@canonical.com', password='ABC') |
2315 | 52 | |||
2316 | 53 | # use the following to trigger a CredentialsError (UserNotValidated) | ||
2317 | 54 | args = dict(email='a@example.com', password='1234567U') | ||
2318 | 55 | |||
2319 | 56 | # remove prior credentials | ||
2320 | 57 | cleared = defer.Deferred() | ||
2321 | 58 | client.cred_manager.connect_to_signal('CredentialsCleared', | ||
2322 | 59 | cleared.callback) | ||
2323 | 60 | yield client.cred_manager.clear_credentials('SUPER', {}) | ||
2324 | 61 | yield cleared | ||
2325 | 62 | |||
2326 | 52 | yield client.cred_manager.login_email_password('SUPER', args) | 63 | yield client.cred_manager.login_email_password('SUPER', args) |
2327 | 53 | print "called ok" | 64 | print "called ok" |
2328 | 54 | yield d | 65 | yield d |
2329 | 55 | 66 | ||
2330 | === modified file 'ubuntu_sso/qt/tests/show_gui.py' | |||
2331 | --- ubuntu_sso/qt/tests/show_gui.py 2012-01-10 18:14:09 +0000 | |||
2332 | +++ ubuntu_sso/qt/tests/show_gui.py 2012-02-02 18:14:19 +0000 | |||
2333 | @@ -17,10 +17,11 @@ | |||
2334 | 17 | 17 | ||
2335 | 18 | import sys | 18 | import sys |
2336 | 19 | 19 | ||
2337 | 20 | # pylint: disable=E1101,F0401,E0611 | ||
2338 | 21 | |||
2339 | 20 | if sys.platform != 'win32': | 22 | if sys.platform != 'win32': |
2343 | 21 | # pylint: disable=F0401 | 23 | from twisted.internet import gireactor |
2344 | 22 | from twisted.internet import glib2reactor | 24 | gireactor.install() |
2342 | 23 | glib2reactor.install() | ||
2345 | 24 | 25 | ||
2346 | 25 | from dbus.mainloop.glib import DBusGMainLoop | 26 | from dbus.mainloop.glib import DBusGMainLoop |
2347 | 26 | DBusGMainLoop(set_as_default=True) | 27 | DBusGMainLoop(set_as_default=True) |
2348 | @@ -35,8 +36,6 @@ | |||
2349 | 35 | UI_MODULE_KEY, | 36 | UI_MODULE_KEY, |
2350 | 36 | ) | 37 | ) |
2351 | 37 | 38 | ||
2352 | 38 | # pylint: disable=E1101 | ||
2353 | 39 | |||
2354 | 40 | 39 | ||
2355 | 41 | @defer.inlineCallbacks | 40 | @defer.inlineCallbacks |
2356 | 42 | def main(): | 41 | def main(): |
2357 | @@ -54,7 +53,7 @@ | |||
2358 | 54 | client.cred_manager.connect_to_signal('AuthorizationDenied', found) | 53 | client.cred_manager.connect_to_signal('AuthorizationDenied', found) |
2359 | 55 | client.cred_manager.connect_to_signal('CredentialsError', found) | 54 | client.cred_manager.connect_to_signal('CredentialsError', found) |
2360 | 56 | 55 | ||
2362 | 57 | yield client.cred_manager.login('Ubuntu One', | 56 | yield client.cred_manager.login('Ubuntu Two', |
2363 | 58 | { | 57 | { |
2364 | 59 | TC_URL_KEY: 'http://www.google.com', | 58 | TC_URL_KEY: 'http://www.google.com', |
2365 | 60 | HELP_TEXT_KEY: 'This is a test.', | 59 | HELP_TEXT_KEY: 'This is a test.', |
2366 | 61 | 60 | ||
2367 | === modified file 'ubuntu_sso/qt/tests/test_controllers.py' | |||
2368 | --- ubuntu_sso/qt/tests/test_controllers.py 2012-02-01 19:19:32 +0000 | |||
2369 | +++ ubuntu_sso/qt/tests/test_controllers.py 2012-02-02 18:14:19 +0000 | |||
2370 | @@ -23,15 +23,16 @@ | |||
2371 | 23 | 23 | ||
2372 | 24 | from twisted.internet import defer | 24 | from twisted.internet import defer |
2373 | 25 | 25 | ||
2374 | 26 | # pylint: disable=F0401,E0611 | ||
2375 | 27 | |||
2376 | 28 | from PyQt4.QtCore import QString, SIGNAL | ||
2377 | 26 | from PyQt4.QtGui import QCheckBox, QLabel, QLineEdit, QWizard | 29 | from PyQt4.QtGui import QCheckBox, QLabel, QLineEdit, QWizard |
2378 | 27 | from PyQt4.QtCore import QString, SIGNAL | ||
2379 | 28 | 30 | ||
2380 | 29 | # pylint: disable=F0401 | ||
2381 | 30 | try: | 31 | try: |
2382 | 31 | from PIL import Image | 32 | from PIL import Image |
2383 | 32 | except ImportError: | 33 | except ImportError: |
2384 | 33 | import Image | 34 | import Image |
2386 | 34 | # pylint: enable=F0401 | 35 | # pylint: enable=F0401,E0611 |
2387 | 35 | 36 | ||
2388 | 36 | from ubuntu_sso.qt.controllers import ( | 37 | from ubuntu_sso.qt.controllers import ( |
2389 | 37 | BackendController, | 38 | BackendController, |
2390 | 38 | 39 | ||
2391 | === modified file 'ubuntu_sso/qt/tests/test_enchanced_line_edit.py' | |||
2392 | --- ubuntu_sso/qt/tests/test_enchanced_line_edit.py 2011-10-28 10:41:18 +0000 | |||
2393 | +++ ubuntu_sso/qt/tests/test_enchanced_line_edit.py 2012-02-02 18:14:19 +0000 | |||
2394 | @@ -20,8 +20,9 @@ | |||
2395 | 20 | 20 | ||
2396 | 21 | from twisted.trial.unittest import TestCase | 21 | from twisted.trial.unittest import TestCase |
2397 | 22 | 22 | ||
2400 | 23 | from PyQt4 import QtGui | 23 | # pylint: disable=E1101 |
2401 | 24 | from PyQt4 import QtCore | 24 | |
2402 | 25 | from PyQt4 import QtGui, QtCore | ||
2403 | 25 | 26 | ||
2404 | 26 | from ubuntu_sso.qt.gui import EnhancedLineEdit | 27 | from ubuntu_sso.qt.gui import EnhancedLineEdit |
2405 | 27 | 28 | ||
2406 | 28 | 29 | ||
2407 | === modified file 'ubuntu_sso/qt/tests/test_reset_password.py' | |||
2408 | --- ubuntu_sso/qt/tests/test_reset_password.py 2012-02-01 19:19:32 +0000 | |||
2409 | +++ ubuntu_sso/qt/tests/test_reset_password.py 2012-02-02 18:14:19 +0000 | |||
2410 | @@ -1,5 +1,4 @@ | |||
2411 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2412 | 2 | # Author: Manuel de la Pena <manuel@canonical.com> | ||
2413 | 3 | # | 2 | # |
2414 | 4 | # Copyright 2011 Canonical Ltd. | 3 | # Copyright 2011 Canonical Ltd. |
2415 | 5 | # | 4 | # |
2416 | @@ -16,6 +15,8 @@ | |||
2417 | 16 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
2418 | 17 | """Test the Reset Password Page.""" | 16 | """Test the Reset Password Page.""" |
2419 | 18 | 17 | ||
2420 | 18 | # pylint: disable=F0401,E0611,E1101 | ||
2421 | 19 | |||
2422 | 19 | from PyQt4 import QtGui, QtCore | 20 | from PyQt4 import QtGui, QtCore |
2423 | 20 | from twisted.internet import defer | 21 | from twisted.internet import defer |
2424 | 21 | from twisted.trial.unittest import TestCase | 22 | from twisted.trial.unittest import TestCase |
2425 | 22 | 23 | ||
2426 | === modified file 'ubuntu_sso/tests/__init__.py' | |||
2427 | --- ubuntu_sso/tests/__init__.py 2012-01-10 18:14:09 +0000 | |||
2428 | +++ ubuntu_sso/tests/__init__.py 2012-02-02 18:14:19 +0000 | |||
2429 | @@ -27,10 +27,10 @@ | |||
2430 | 27 | from ubuntu_sso.keyring import get_token_name | 27 | from ubuntu_sso.keyring import get_token_name |
2431 | 28 | 28 | ||
2432 | 29 | APP_NAME = u'The Super App!' | 29 | APP_NAME = u'The Super App!' |
2434 | 30 | CAPTCHA_ID = u'test' | 30 | CAPTCHA_ID = u'test ñiña' |
2435 | 31 | CAPTCHA_PATH = os.path.abspath(os.path.join(os.curdir, 'ubuntu_sso', 'tests', | 31 | CAPTCHA_PATH = os.path.abspath(os.path.join(os.curdir, 'ubuntu_sso', 'tests', |
2436 | 32 | 'files', 'captcha.png')) | 32 | 'files', 'captcha.png')) |
2438 | 33 | CAPTCHA_SOLUTION = u'william Byrd' | 33 | CAPTCHA_SOLUTION = u'william Byrd ñandú' |
2439 | 34 | EMAIL = u'test@example.com' | 34 | EMAIL = u'test@example.com' |
2440 | 35 | EMAIL_TOKEN = u'B2Pgtf' | 35 | EMAIL_TOKEN = u'B2Pgtf' |
2441 | 36 | GTK_GUI_CLASS = 'UbuntuSSOClientGUI' | 36 | GTK_GUI_CLASS = 'UbuntuSSOClientGUI' |
2442 | 37 | 37 | ||
2443 | === removed directory 'ubuntu_sso/tests/bin' | |||
2444 | === removed file 'ubuntu_sso/tests/bin/show_gui' | |||
2445 | --- ubuntu_sso/tests/bin/show_gui 2010-12-20 14:29:18 +0000 | |||
2446 | +++ ubuntu_sso/tests/bin/show_gui 1970-01-01 00:00:00 +0000 | |||
2447 | @@ -1,58 +0,0 @@ | |||
2448 | 1 | #!/usr/bin/python | ||
2449 | 2 | |||
2450 | 3 | # ubuntu-sso-login-gui - GUI for registration and login for Ubuntu SSO | ||
2451 | 4 | # | ||
2452 | 5 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | ||
2453 | 6 | # | ||
2454 | 7 | # Copyright 2010 Canonical Ltd. | ||
2455 | 8 | # | ||
2456 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
2457 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
2458 | 11 | # by the Free Software Foundation. | ||
2459 | 12 | # | ||
2460 | 13 | # This program is distributed in the hope that it will be useful, but | ||
2461 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2462 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2463 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
2464 | 17 | # | ||
2465 | 18 | # You should have received a copy of the GNU General Public License along | ||
2466 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2467 | 20 | """Script to run the Ubuntu SSO client GUI.""" | ||
2468 | 21 | |||
2469 | 22 | import gtk | ||
2470 | 23 | import sys | ||
2471 | 24 | |||
2472 | 25 | from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI | ||
2473 | 26 | |||
2474 | 27 | |||
2475 | 28 | APP_NAME = 'Ubuntu' | ||
2476 | 29 | TC_URL = 'http://one.ubuntu.com/terms' | ||
2477 | 30 | HELP_TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' \ | ||
2478 | 31 | 'Nam sed lorem nibh. Suspendisse gravida nulla non nunc suscipit' \ | ||
2479 | 32 | ' pulvinar tempus ut augue.' | ||
2480 | 33 | |||
2481 | 34 | |||
2482 | 35 | if __name__ == '__main__': | ||
2483 | 36 | |||
2484 | 37 | # pylint: disable=C0103, E1101 | ||
2485 | 38 | |||
2486 | 39 | tc_url = TC_URL | ||
2487 | 40 | login_only = False | ||
2488 | 41 | xid = 0 | ||
2489 | 42 | |||
2490 | 43 | if '--login' in sys.argv: | ||
2491 | 44 | login_only = True | ||
2492 | 45 | tc_url = None | ||
2493 | 46 | |||
2494 | 47 | if '--with-parent-window' in sys.argv: | ||
2495 | 48 | win = gtk.Window() | ||
2496 | 49 | win.set_title(APP_NAME) | ||
2497 | 50 | win.set_position(gtk.WIN_POS_CENTER) | ||
2498 | 51 | win.set_size_request(800, 600) | ||
2499 | 52 | win.show() | ||
2500 | 53 | xid = win.window.xid | ||
2501 | 54 | |||
2502 | 55 | UbuntuSSOClientGUI(close_callback=lambda *args, **kwargs: gtk.main_quit(), | ||
2503 | 56 | app_name=APP_NAME, tc_url=tc_url, help_text=HELP_TEXT, | ||
2504 | 57 | window_id=xid, login_only=login_only) | ||
2505 | 58 | gtk.main() | ||
2506 | 59 | 0 | ||
2507 | === removed file 'ubuntu_sso/tests/bin/show_nm_state' | |||
2508 | --- ubuntu_sso/tests/bin/show_nm_state 2011-02-24 02:46:19 +0000 | |||
2509 | +++ ubuntu_sso/tests/bin/show_nm_state 1970-01-01 00:00:00 +0000 | |||
2510 | @@ -1,41 +0,0 @@ | |||
2511 | 1 | #!/usr/bin/python | ||
2512 | 2 | |||
2513 | 3 | # show_nm_state - Show the state of the NetworkManager daemon | ||
2514 | 4 | # | ||
2515 | 5 | # Author: Alejandro J. Cura <alecu@canonical.com> | ||
2516 | 6 | # | ||
2517 | 7 | # Copyright 2010 Canonical Ltd. | ||
2518 | 8 | # | ||
2519 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
2520 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
2521 | 11 | # by the Free Software Foundation. | ||
2522 | 12 | # | ||
2523 | 13 | # This program is distributed in the hope that it will be useful, but | ||
2524 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2525 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2526 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
2527 | 17 | # | ||
2528 | 18 | # You should have received a copy of the GNU General Public License along | ||
2529 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2530 | 20 | """A test program that just shows the network state.""" | ||
2531 | 21 | |||
2532 | 22 | import gobject | ||
2533 | 23 | |||
2534 | 24 | from dbus.mainloop.glib import DBusGMainLoop | ||
2535 | 25 | |||
2536 | 26 | from ubuntu_sso.networkstate.linux import NetworkManagerState, NM_STATE_NAMES | ||
2537 | 27 | |||
2538 | 28 | DBusGMainLoop(set_as_default=True) | ||
2539 | 29 | |||
2540 | 30 | |||
2541 | 31 | def got_state(state): | ||
2542 | 32 | """Called when the network state is found.""" | ||
2543 | 33 | try: | ||
2544 | 34 | print NM_STATE_NAMES[state] | ||
2545 | 35 | finally: | ||
2546 | 36 | gobject.MainLoop().quit() | ||
2547 | 37 | |||
2548 | 38 | # pylint: disable=C0103 | ||
2549 | 39 | nms = NetworkManagerState(got_state) | ||
2550 | 40 | nms.find_online_state() | ||
2551 | 41 | gobject.MainLoop().run() | ||
2552 | 42 | 0 | ||
2553 | === modified file 'ubuntu_sso/tests/test_account.py' | |||
2554 | --- ubuntu_sso/tests/test_account.py 2012-01-26 13:25:13 +0000 | |||
2555 | +++ ubuntu_sso/tests/test_account.py 2012-02-02 18:14:19 +0000 | |||
2556 | @@ -325,7 +325,7 @@ | |||
2557 | 325 | def test_login_if_http_error(self): | 325 | def test_login_if_http_error(self): |
2558 | 326 | """Proper error is raised if authentication fails.""" | 326 | """Proper error is raised if authentication fails.""" |
2559 | 327 | # use an invalid token name | 327 | # use an invalid token name |
2561 | 328 | self.login_kwargs['token_name'] = (APP_NAME * 2).encode("utf-8") | 328 | self.login_kwargs['token_name'] = APP_NAME * 2 |
2562 | 329 | d = self.processor.login(**self.login_kwargs) | 329 | d = self.processor.login(**self.login_kwargs) |
2563 | 330 | yield self.assertFailure(d, AuthenticationError) | 330 | yield self.assertFailure(d, AuthenticationError) |
2564 | 331 | 331 | ||
2565 | 332 | 332 | ||
2566 | === modified file 'ubuntu_sso/utils/tests/test_txsecrets.py' | |||
2567 | --- ubuntu_sso/utils/tests/test_txsecrets.py 2012-01-26 17:21:32 +0000 | |||
2568 | +++ ubuntu_sso/utils/tests/test_txsecrets.py 2012-02-02 18:14:19 +0000 | |||
2569 | @@ -36,6 +36,9 @@ | |||
2570 | 36 | # pylint complains when things are a little too dynamic | 36 | # pylint complains when things are a little too dynamic |
2571 | 37 | # pylint: disable=E1101 | 37 | # pylint: disable=E1101 |
2572 | 38 | 38 | ||
2573 | 39 | # Use of super on an old style class | ||
2574 | 40 | # pylint: disable=E1002 | ||
2575 | 41 | |||
2576 | 39 | 42 | ||
2577 | 40 | ERROR_CREATE_BUT_LOCKED = "Cannot create an item in a locked collection" | 43 | ERROR_CREATE_BUT_LOCKED = "Cannot create an item in a locked collection" |
2578 | 41 | PROMPT_BASE_PATH = "/org/freedesktop/secrets/prompt" | 44 | PROMPT_BASE_PATH = "/org/freedesktop/secrets/prompt" |
2579 | 42 | 45 | ||
2580 | === modified file 'ubuntu_sso/utils/webclient/__init__.py' | |||
2581 | --- ubuntu_sso/utils/webclient/__init__.py 2012-01-19 21:41:43 +0000 | |||
2582 | +++ ubuntu_sso/utils/webclient/__init__.py 2012-02-02 18:14:19 +0000 | |||
2583 | @@ -35,10 +35,8 @@ | |||
2584 | 35 | if is_qt4reactor_installed(): | 35 | if is_qt4reactor_installed(): |
2585 | 36 | from ubuntu_sso.utils.webclient import qtnetwork as web_module | 36 | from ubuntu_sso.utils.webclient import qtnetwork as web_module |
2586 | 37 | else: | 37 | else: |
2591 | 38 | # the libsoup backend depends on the twisted + GI bug | 38 | from ubuntu_sso.utils.webclient import libsoup as web_module |
2592 | 39 | # meanwhile, use the txweb sample client | 39 | #from ubuntu_sso.utils.webclient import txweb as web_module |
2589 | 40 | #from ubuntu_sso.utils.webclient import libsoup as web_module | ||
2590 | 41 | from ubuntu_sso.utils.webclient import txweb as web_module | ||
2593 | 42 | return web_module | 40 | return web_module |
2594 | 43 | 41 | ||
2595 | 44 | 42 | ||
2596 | 45 | 43 | ||
2597 | === modified file 'ubuntu_sso/utils/webclient/qtnetwork.py' | |||
2598 | --- ubuntu_sso/utils/webclient/qtnetwork.py 2012-01-25 15:02:50 +0000 | |||
2599 | +++ ubuntu_sso/utils/webclient/qtnetwork.py 2012-02-02 18:14:19 +0000 | |||
2600 | @@ -17,11 +17,13 @@ | |||
2601 | 17 | 17 | ||
2602 | 18 | import sys | 18 | import sys |
2603 | 19 | 19 | ||
2604 | 20 | # pylint: disable=E0611 | ||
2605 | 20 | from PyQt4.QtCore import ( | 21 | from PyQt4.QtCore import ( |
2606 | 21 | QBuffer, | 22 | QBuffer, |
2607 | 22 | QCoreApplication, | 23 | QCoreApplication, |
2608 | 23 | QUrl, | 24 | QUrl, |
2609 | 24 | ) | 25 | ) |
2610 | 26 | # pylint: enable=E0611 | ||
2611 | 25 | from PyQt4.QtNetwork import ( | 27 | from PyQt4.QtNetwork import ( |
2612 | 26 | QNetworkAccessManager, | 28 | QNetworkAccessManager, |
2613 | 27 | QNetworkProxy, | 29 | QNetworkProxy, |
2614 | 28 | 30 | ||
2615 | === modified file 'ubuntu_sso/utils/webclient/tests/test_webclient.py' | |||
2616 | --- ubuntu_sso/utils/webclient/tests/test_webclient.py 2012-01-27 20:12:10 +0000 | |||
2617 | +++ ubuntu_sso/utils/webclient/tests/test_webclient.py 2012-02-02 18:14:19 +0000 | |||
2618 | @@ -255,11 +255,7 @@ | |||
2619 | 255 | """Test the module name for the libsoup case.""" | 255 | """Test the module name for the libsoup case.""" |
2620 | 256 | self.patch(webclient, "is_qt4reactor_installed", lambda: False) | 256 | self.patch(webclient, "is_qt4reactor_installed", lambda: False) |
2621 | 257 | module = webclient.webclient_module() | 257 | module = webclient.webclient_module() |
2627 | 258 | # pylint: disable=W0511 | 258 | self.assert_module_name(module, "libsoup") |
2623 | 259 | # TODO: the libsoup backend depends on the twisted + GI bug | ||
2624 | 260 | # meanwhile, use the test txweb client | ||
2625 | 261 | #self.assert_module_name(module, "libsoup") | ||
2626 | 262 | self.assert_module_name(module, "txweb") | ||
2628 | 263 | 259 | ||
2629 | 264 | 260 | ||
2630 | 265 | class WebClientTestCase(TestCase): | 261 | class WebClientTestCase(TestCase): |
+1