Merge lp:~nataliabidart/ubuntu-sso-client/stable-3-0-update-2.99.4 into lp:ubuntu-sso-client/stable-3-0
- stable-3-0-update-2.99.4
- Merge into stable-3-0
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 825 |
Merged at revision: | 824 |
Proposed branch: | lp:~nataliabidart/ubuntu-sso-client/stable-3-0-update-2.99.4 |
Merge into: | lp:ubuntu-sso-client/stable-3-0 |
Diff against target: |
18990 lines (+9079/-5903) 104 files modified
.bzrignore (+4/-11) bin/ubuntu-sso-login-gtk (+2/-1) bin/ubuntu-sso-login-qt (+32/-0) bin/ubuntu-sso-proxy-creds-qt (+33/-0) data/gtk/ui.glade (+314/-180) data/qt/choose_sign_in.ui (+105/-61) data/qt/loadingoverlay.ui (+103/-0) data/qt/network_detection.ui (+142/-0) data/qt/proxy_credentials_dialog.ui (+316/-0) data/qt/setup_account.ui (+640/-253) run-tests (+23/-19) setup.py (+29/-14) ubuntu_sso/__init__.py (+10/-6) ubuntu_sso/account.py (+95/-76) ubuntu_sso/constants.py.in (+28/-0) ubuntu_sso/credentials.py (+91/-203) ubuntu_sso/gtk/__init__.py (+1/-3) ubuntu_sso/gtk/gui.py (+134/-86) ubuntu_sso/gtk/main.py (+5/-25) ubuntu_sso/gtk/tests/__init__.py (+1/-3) ubuntu_sso/gtk/tests/test_gui.py (+110/-110) ubuntu_sso/gtk/tests/test_main.py (+39/-0) 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 (+22/-6) ubuntu_sso/main/__init__.py (+80/-67) ubuntu_sso/main/glib.py (+45/-0) ubuntu_sso/main/linux.py (+43/-38) ubuntu_sso/main/qt.py (+49/-0) ubuntu_sso/main/tests/__init__.py (+8/-3) ubuntu_sso/main/tests/test_clients.py (+8/-24) ubuntu_sso/main/tests/test_common.py (+274/-176) ubuntu_sso/main/windows.py (+21/-18) ubuntu_sso/qt/__init__.py (+59/-1) ubuntu_sso/qt/common.py (+7/-9) ubuntu_sso/qt/controllers.py (+0/-980) ubuntu_sso/qt/current_user_sign_in_page.py (+170/-0) ubuntu_sso/qt/email_verification_page.py (+140/-0) ubuntu_sso/qt/enhanced_check_box.py (+50/-0) ubuntu_sso/qt/error_page.py (+29/-0) ubuntu_sso/qt/forgotten_password_page.py (+182/-0) ubuntu_sso/qt/gui.py (+70/-397) ubuntu_sso/qt/loadingoverlay.py (+123/-0) ubuntu_sso/qt/main.py (+31/-0) ubuntu_sso/qt/network_detection_page.py (+79/-0) ubuntu_sso/qt/proxy_dialog.py (+155/-0) ubuntu_sso/qt/reset_password_page.py (+200/-0) ubuntu_sso/qt/setup_account_page.py (+524/-0) ubuntu_sso/qt/sign_in_page.py (+99/-0) ubuntu_sso/qt/success_page.py (+30/-0) ubuntu_sso/qt/tests/__init__.py (+294/-5) ubuntu_sso/qt/tests/login_u_p.py (+16/-5) ubuntu_sso/qt/tests/show_gui.py (+14/-13) ubuntu_sso/qt/tests/test_controllers.py (+0/-2113) ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+244/-0) ubuntu_sso/qt/tests/test_email_verification.py (+211/-0) ubuntu_sso/qt/tests/test_enchanced_line_edit.py (+3/-2) ubuntu_sso/qt/tests/test_enhanced_check_box.py (+49/-0) ubuntu_sso/qt/tests/test_forgotten_password.py (+239/-0) ubuntu_sso/qt/tests/test_loadingoverlay.py (+36/-0) ubuntu_sso/qt/tests/test_main.py (+42/-0) ubuntu_sso/qt/tests/test_network_detection.py (+95/-0) ubuntu_sso/qt/tests/test_proxy_dialog.py (+338/-0) ubuntu_sso/qt/tests/test_qt_views.py (+15/-101) ubuntu_sso/qt/tests/test_reset_password.py (+12/-6) ubuntu_sso/qt/tests/test_setup_account.py (+385/-0) ubuntu_sso/qt/tests/test_sign_in_page.py (+69/-0) ubuntu_sso/qt/tests/test_ubuntu_sso_wizard.py (+94/-0) ubuntu_sso/qt/ubuntu_sso_wizard.py (+367/-0) ubuntu_sso/qt/ui/__init__.py (+17/-0) ubuntu_sso/tests/__init__.py (+4/-4) ubuntu_sso/tests/bin/show_gui (+0/-58) ubuntu_sso/tests/bin/show_nm_state (+0/-41) ubuntu_sso/tests/test_account.py (+162/-134) ubuntu_sso/tests/test_credentials.py (+181/-401) ubuntu_sso/utils/__init__.py (+100/-4) ubuntu_sso/utils/ipc.py (+12/-6) ubuntu_sso/utils/runner/__init__.py (+99/-0) ubuntu_sso/utils/runner/glib.py (+76/-0) ubuntu_sso/utils/runner/qt.py (+71/-0) ubuntu_sso/utils/runner/tests/__init__.py (+17/-0) ubuntu_sso/utils/runner/tests/test_qt.py (+136/-0) ubuntu_sso/utils/runner/tests/test_runner.py (+81/-0) ubuntu_sso/utils/runner/tx.py (+93/-0) ubuntu_sso/utils/tcpactivation.py (+1/-3) ubuntu_sso/utils/tests/test_common.py (+209/-6) ubuntu_sso/utils/tests/test_ipc.py (+4/-3) ubuntu_sso/utils/tests/test_parse_args.py (+9/-18) ubuntu_sso/utils/tests/test_txsecrets.py (+3/-0) ubuntu_sso/utils/ui.py (+63/-38) ubuntu_sso/utils/webclient/__init__.py (+2/-4) ubuntu_sso/utils/webclient/common.py (+34/-7) ubuntu_sso/utils/webclient/gsettings.py (+19/-4) ubuntu_sso/utils/webclient/libsoup.py (+2/-1) ubuntu_sso/utils/webclient/qtnetwork.py (+5/-0) ubuntu_sso/utils/webclient/restful.py (+6/-1) ubuntu_sso/utils/webclient/tests/__init__.py (+60/-0) ubuntu_sso/utils/webclient/tests/test_gsettings.py (+108/-0) ubuntu_sso/utils/webclient/tests/test_restful.py (+16/-2) ubuntu_sso/utils/webclient/tests/test_timestamp.py (+16/-32) ubuntu_sso/utils/webclient/tests/test_webclient.py (+145/-94) ubuntu_sso/utils/webclient/timestamp.py (+16/-10) ubuntu_sso/utils/webclient/txweb.py (+12/-2) |
To merge this branch: | bzr merge lp:~nataliabidart/ubuntu-sso-client/stable-3-0-update-2.99.4 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roberto Alsina (community) | Approve | ||
Review via email: mp+93089@code.launchpad.net |
Commit message
- Updating from trunk up to revno 874:
[ Alejandro J. Cura <email address hidden> ]
- Use parameters set in the url for the OAuth signature (LP: #927664).
- libsoup bindings need flattening to work around nul bytes in content
(LP: #921822).
- Replace urllib2.Request with common web-client (LP: #884972).
- Replace urllib2.urlopen with common web-client (LP: #884975).
- Fix tests failing in sso with test_webclient (LP: #920591).
[ Diego Sarmentero <email address hidden> ]
- Fixed: Qt UI: after clicking on "I've forgotten my password",
and entering an email, nothing happens (LP: #931577).
- Fixed: Qt UI must return ubuntu_
ubuntu_
- Fixed: Qt UI: congratulations page is empty (LP: #930720).
- Fixed: Qt UI: "I've forgotten my password" button can not be
clicked (LP: #930722)
- Fixed: Qt UI must return ubuntu_
ubuntu_
- Fixed: Qt UI: when calling login or validate_email,
should pass the ping_url (LP: #930724).
- Added signals for the different pages, letting the wizard decide
what to do in each case.
- Refactor the pages and controller in sso (LP: #929686).
- Migrate SSO Pages from the Wizard to SSO (LP: #925531).
[ Manuel de la Pena <email address hidden> ]
- Adds the code that will load the creds from the keyring when we retry.
- Adds the script that allows to launch the creds dialog.
Adds tests for main.
- Allows the creds dialog to store the credentials in the keyring
(LP: #929451).
- Adds the credentials dialog with nearly no functionality to the project
(LP: #916029).
- Adds support for username:
of the webclient.
[ Natalia B. Bidart <email address hidden> ]
- Proper name in setup.py for the proxy credentials executable
(LP: #932328).
- No more 'Congratulations, app_name has installed' message since
we're not installing (LP: #931574).
- Refactored logic on setup_account_
privacy links properly (LP: #931589).
- Unified UI parse_args and have them accepting a policy_url param
(LP: #931464).
- Make the UI runner use the absolute path to the UI executables
(LP: #930651).
- Allow callers pass a 'policy_url' parameter to use in the UIs
(LP: #930142).
- Execute the UI as a separated process from the sso main thread
(LP: #919330).
- Hold on to the Qprocess instance to avoid garbage collection
(LP: #930140).
- Move the ping method from the credentials module to the
UserManagement interface (LP: #929670).
- The Gtk UI must handle errors from dbus when calling the backend
(LP: #929820).
- Provide a helper to spawn programs from the main loop that is being
used by the SSO Service (LP: #920949).
- Install ui files consitently between Gtk and Qt (part of LP: #927994).
- Remove unused "thread_execute" function (LP: #928581).
- Delay twisted.
ReactorAlre
- 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).
- Provide a QT UI executable (LP: #925073).
- Add a method to obtain an OAuth signed uri.
[ Rodney Dawes <email address hidden> ]
- Connect the activate-link button by hand to avoid Gtk-WARNING messages.
Description of the change
Preview Diff
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2011-04-11 09:38:16 +0000 | |||
3 | +++ .bzrignore 2012-02-14 22:04:20 +0000 | |||
4 | @@ -1,16 +1,9 @@ | |||
5 | 1 | _trial_temp | 1 | _trial_temp |
6 | 2 | data/*.service | 2 | data/*.service |
7 | 3 | MANIFEST | ||
8 | 3 | build/ | 4 | build/ |
9 | 4 | dist/ | 5 | dist/ |
10 | 5 | MANIFEST | ||
11 | 6 | po/ubuntu-sso-client.pot | 6 | po/ubuntu-sso-client.pot |
22 | 7 | ubuntu_sso/qt/captcha_ui.py | 7 | ubuntu_sso/constants.py |
23 | 8 | ubuntu_sso/qt/choose_sign_in_ui.py | 8 | ubuntu_sso/qt/ui/*_ui.py |
24 | 9 | ubuntu_sso/qt/current_user_sign_in_ui.py | 9 | ubuntu_sso/qt/ui/*_rc.py |
15 | 10 | ubuntu_sso/qt/email_verification_ui.py | ||
16 | 11 | ubuntu_sso/qt/setup_account_ui.py | ||
17 | 12 | ubuntu_sso/qt/terms_and_conditions_ui.py | ||
18 | 13 | ubuntu_sso/qt/success_message_ui.py | ||
19 | 14 | ubuntu_sso/qt/error_message_ui.py | ||
20 | 15 | ubuntu_sso/qt/forgotten_password_ui.py | ||
21 | 16 | ubuntu_sso/qt/reset_password_ui.py | ||
25 | 17 | 10 | ||
26 | === modified file 'bin/ubuntu-sso-login-gtk' | |||
27 | --- bin/ubuntu-sso-login-gtk 2012-01-16 21:10:12 +0000 | |||
28 | +++ bin/ubuntu-sso-login-gtk 2012-02-14 22:04:20 +0000 | |||
29 | @@ -20,7 +20,8 @@ | |||
30 | 20 | # Invalid name "ubuntu-sso-login-gtk", pylint: disable=C0103 | 20 | # Invalid name "ubuntu-sso-login-gtk", pylint: disable=C0103 |
31 | 21 | # Access to a protected member, pylint: disable=W0212 | 21 | # Access to a protected member, pylint: disable=W0212 |
32 | 22 | 22 | ||
34 | 23 | from ubuntu_sso.gtk.main import parse_args, main | 23 | from ubuntu_sso.gtk.main import main |
35 | 24 | from ubuntu_sso.utils.ui import parse_args | ||
36 | 24 | 25 | ||
37 | 25 | from dbus.mainloop.glib import DBusGMainLoop | 26 | from dbus.mainloop.glib import DBusGMainLoop |
38 | 26 | DBusGMainLoop(set_as_default=True) | 27 | DBusGMainLoop(set_as_default=True) |
39 | 27 | 28 | ||
40 | === added file 'bin/ubuntu-sso-login-qt' | |||
41 | --- bin/ubuntu-sso-login-qt 1970-01-01 00:00:00 +0000 | |||
42 | +++ bin/ubuntu-sso-login-qt 2012-02-14 22:04:20 +0000 | |||
43 | @@ -0,0 +1,32 @@ | |||
44 | 1 | #!/usr/bin/env python | ||
45 | 2 | # -*- coding: utf-8 -*- | ||
46 | 3 | # | ||
47 | 4 | # Copyright 2012 Canonical Ltd. | ||
48 | 5 | # | ||
49 | 6 | # This program is free software: you can redistribute it and/or modify it | ||
50 | 7 | # under the terms of the GNU General Public License version 3, as published | ||
51 | 8 | # by the Free Software Foundation. | ||
52 | 9 | # | ||
53 | 10 | # This program is distributed in the hope that it will be useful, but | ||
54 | 11 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
55 | 12 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
56 | 13 | # PURPOSE. See the GNU General Public License for more details. | ||
57 | 14 | # | ||
58 | 15 | # You should have received a copy of the GNU General Public License along | ||
59 | 16 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
60 | 17 | |||
61 | 18 | """Start the sso GTK UI.""" | ||
62 | 19 | |||
63 | 20 | # Invalid name "ubuntu-sso-login-qt", pylint: disable=C0103 | ||
64 | 21 | # Access to a protected member, pylint: disable=W0212 | ||
65 | 22 | |||
66 | 23 | from ubuntu_sso.qt.main import main | ||
67 | 24 | from ubuntu_sso.utils.ui import parse_args | ||
68 | 25 | |||
69 | 26 | from dbus.mainloop.qt import DBusQtMainLoop | ||
70 | 27 | DBusQtMainLoop(set_as_default=True) | ||
71 | 28 | |||
72 | 29 | |||
73 | 30 | if __name__ == "__main__": | ||
74 | 31 | args = parse_args() | ||
75 | 32 | main(**dict(args._get_kwargs())) | ||
76 | 0 | 33 | ||
77 | === added file 'bin/ubuntu-sso-proxy-creds-qt' | |||
78 | --- bin/ubuntu-sso-proxy-creds-qt 1970-01-01 00:00:00 +0000 | |||
79 | +++ bin/ubuntu-sso-proxy-creds-qt 2012-02-14 22:04:20 +0000 | |||
80 | @@ -0,0 +1,33 @@ | |||
81 | 1 | #!/usr/bin/env python | ||
82 | 2 | # -*- coding: utf-8 -*- | ||
83 | 3 | # | ||
84 | 4 | # Copyright 2012 Canonical Ltd. | ||
85 | 5 | # | ||
86 | 6 | # This program is free software: you can redistribute it and/or modify it | ||
87 | 7 | # under the terms of the GNU General Public License version 3, as published | ||
88 | 8 | # by the Free Software Foundation. | ||
89 | 9 | # | ||
90 | 10 | # This program is distributed in the hope that it will be useful, but | ||
91 | 11 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
92 | 12 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
93 | 13 | # PURPOSE. See the GNU General Public License for more details. | ||
94 | 14 | # | ||
95 | 15 | # You should have received a copy of the GNU General Public License along | ||
96 | 16 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
97 | 17 | |||
98 | 18 | """Start the QT proxy creds dialog.""" | ||
99 | 19 | |||
100 | 20 | # Invalid name, pylint: disable=C0103 | ||
101 | 21 | |||
102 | 22 | import os | ||
103 | 23 | # HACK: At the moment we need to do that until sso is refactored | ||
104 | 24 | os.environ['USE_QT_MAINLOOP'] = '1' | ||
105 | 25 | |||
106 | 26 | # set the dbus main loop to be used | ||
107 | 27 | from dbus.mainloop.qt import DBusQtMainLoop | ||
108 | 28 | DBusQtMainLoop(set_as_default=True) | ||
109 | 29 | |||
110 | 30 | from ubuntu_sso.qt.proxy_dialog import main | ||
111 | 31 | |||
112 | 32 | if __name__ == "__main__": | ||
113 | 33 | main() | ||
114 | 0 | 34 | ||
115 | === modified file 'data/gtk/ui.glade' | |||
116 | --- data/gtk/ui.glade 2011-09-19 13:09:46 +0000 | |||
117 | +++ data/gtk/ui.glade 2012-02-14 22:04:20 +0000 | |||
118 | @@ -1,72 +1,14 @@ | |||
119 | 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
120 | 2 | <interface> | 2 | <interface> |
121 | 3 | <requires lib="gtk+" version="2.16"/> | 3 | <requires lib="gtk+" version="2.16"/> |
122 | 4 | <!-- interface-naming-policy project-wide --> | ||
123 | 5 | <object class="GtkWindow" id="window"> | ||
124 | 6 | <property name="border_width">10</property> | ||
125 | 7 | <property name="window_position">center</property> | ||
126 | 8 | <signal name="delete_event" handler="on_close_clicked"/> | ||
127 | 9 | <child> | ||
128 | 10 | <object class="GtkVBox" id="window_vbox"> | ||
129 | 11 | <property name="visible">True</property> | ||
130 | 12 | <property name="spacing">5</property> | ||
131 | 13 | <child> | ||
132 | 14 | <object class="GtkLabel" id="header_label"> | ||
133 | 15 | <property name="visible">True</property> | ||
134 | 16 | <property name="xalign">0</property> | ||
135 | 17 | <property name="label" translatable="yes">Header Label </property> | ||
136 | 18 | <property name="wrap">True</property> | ||
137 | 19 | </object> | ||
138 | 20 | <packing> | ||
139 | 21 | <property name="expand">False</property> | ||
140 | 22 | <property name="padding">5</property> | ||
141 | 23 | <property name="position">0</property> | ||
142 | 24 | </packing> | ||
143 | 25 | </child> | ||
144 | 26 | <child> | ||
145 | 27 | <object class="GtkLabel" id="help_label"> | ||
146 | 28 | <property name="visible">True</property> | ||
147 | 29 | <property name="xalign">0</property> | ||
148 | 30 | <property name="label" translatable="yes">help label</property> | ||
149 | 31 | <property name="wrap">True</property> | ||
150 | 32 | </object> | ||
151 | 33 | <packing> | ||
152 | 34 | <property name="expand">False</property> | ||
153 | 35 | <property name="position">1</property> | ||
154 | 36 | </packing> | ||
155 | 37 | </child> | ||
156 | 38 | <child> | ||
157 | 39 | <object class="GtkLabel" id="warning_label"> | ||
158 | 40 | <property name="visible">True</property> | ||
159 | 41 | <property name="xalign">0</property> | ||
160 | 42 | <property name="label" translatable="yes">warning label</property> | ||
161 | 43 | <property name="wrap">True</property> | ||
162 | 44 | </object> | ||
163 | 45 | <packing> | ||
164 | 46 | <property name="expand">False</property> | ||
165 | 47 | <property name="position">2</property> | ||
166 | 48 | </packing> | ||
167 | 49 | </child> | ||
168 | 50 | <child> | ||
169 | 51 | <object class="GtkNotebook" id="content"> | ||
170 | 52 | <property name="visible">True</property> | ||
171 | 53 | <property name="can_focus">True</property> | ||
172 | 54 | <property name="show_tabs">False</property> | ||
173 | 55 | <property name="show_border">False</property> | ||
174 | 56 | </object> | ||
175 | 57 | <packing> | ||
176 | 58 | <property name="position">3</property> | ||
177 | 59 | </packing> | ||
178 | 60 | </child> | ||
179 | 61 | </object> | ||
180 | 62 | </child> | ||
181 | 63 | </object> | ||
182 | 64 | <object class="GtkVBox" id="enter_details_vbox"> | 4 | <object class="GtkVBox" id="enter_details_vbox"> |
183 | 65 | <property name="visible">True</property> | 5 | <property name="visible">True</property> |
184 | 6 | <property name="can_focus">False</property> | ||
185 | 66 | <property name="spacing">5</property> | 7 | <property name="spacing">5</property> |
186 | 67 | <child> | 8 | <child> |
187 | 68 | <object class="GtkHBox" id="emails_hbox"> | 9 | <object class="GtkHBox" id="emails_hbox"> |
188 | 69 | <property name="visible">True</property> | 10 | <property name="visible">True</property> |
189 | 11 | <property name="can_focus">False</property> | ||
190 | 70 | <property name="spacing">5</property> | 12 | <property name="spacing">5</property> |
191 | 71 | <property name="homogeneous">True</property> | 13 | <property name="homogeneous">True</property> |
192 | 72 | <child> | 14 | <child> |
193 | @@ -78,12 +20,14 @@ | |||
194 | 78 | </object> | 20 | </object> |
195 | 79 | <packing> | 21 | <packing> |
196 | 80 | <property name="expand">False</property> | 22 | <property name="expand">False</property> |
197 | 23 | <property name="fill">True</property> | ||
198 | 81 | <property name="position">0</property> | 24 | <property name="position">0</property> |
199 | 82 | </packing> | 25 | </packing> |
200 | 83 | </child> | 26 | </child> |
201 | 84 | <child> | 27 | <child> |
202 | 85 | <object class="GtkHBox" id="passwords_hbox"> | 28 | <object class="GtkHBox" id="passwords_hbox"> |
203 | 86 | <property name="visible">True</property> | 29 | <property name="visible">True</property> |
204 | 30 | <property name="can_focus">False</property> | ||
205 | 87 | <property name="spacing">5</property> | 31 | <property name="spacing">5</property> |
206 | 88 | <property name="homogeneous">True</property> | 32 | <property name="homogeneous">True</property> |
207 | 89 | <child> | 33 | <child> |
208 | @@ -95,38 +39,45 @@ | |||
209 | 95 | </object> | 39 | </object> |
210 | 96 | <packing> | 40 | <packing> |
211 | 97 | <property name="expand">False</property> | 41 | <property name="expand">False</property> |
212 | 42 | <property name="fill">True</property> | ||
213 | 98 | <property name="position">1</property> | 43 | <property name="position">1</property> |
214 | 99 | </packing> | 44 | </packing> |
215 | 100 | </child> | 45 | </child> |
216 | 101 | <child> | 46 | <child> |
217 | 102 | <object class="GtkLabel" id="password_help_label"> | 47 | <object class="GtkLabel" id="password_help_label"> |
218 | 103 | <property name="visible">True</property> | 48 | <property name="visible">True</property> |
219 | 49 | <property name="can_focus">False</property> | ||
220 | 104 | <property name="label">password help</property> | 50 | <property name="label">password help</property> |
221 | 105 | <property name="wrap">True</property> | 51 | <property name="wrap">True</property> |
222 | 106 | </object> | 52 | </object> |
223 | 107 | <packing> | 53 | <packing> |
224 | 108 | <property name="expand">False</property> | 54 | <property name="expand">False</property> |
225 | 55 | <property name="fill">True</property> | ||
226 | 109 | <property name="position">2</property> | 56 | <property name="position">2</property> |
227 | 110 | </packing> | 57 | </packing> |
228 | 111 | </child> | 58 | </child> |
229 | 112 | <child> | 59 | <child> |
230 | 113 | <object class="GtkAlignment" id="alignment5"> | 60 | <object class="GtkAlignment" id="alignment5"> |
231 | 114 | <property name="visible">True</property> | 61 | <property name="visible">True</property> |
232 | 62 | <property name="can_focus">False</property> | ||
233 | 115 | <property name="xscale">0</property> | 63 | <property name="xscale">0</property> |
234 | 116 | <property name="yscale">0</property> | 64 | <property name="yscale">0</property> |
235 | 117 | <child> | 65 | <child> |
236 | 118 | <object class="GtkHBox" id="hbox1"> | 66 | <object class="GtkHBox" id="hbox1"> |
237 | 119 | <property name="visible">True</property> | 67 | <property name="visible">True</property> |
238 | 68 | <property name="can_focus">False</property> | ||
239 | 120 | <child> | 69 | <child> |
240 | 121 | <object class="GtkVBox" id="captcha_vbox"> | 70 | <object class="GtkVBox" id="captcha_vbox"> |
241 | 122 | <property name="width_request">300</property> | 71 | <property name="width_request">300</property> |
242 | 123 | <property name="height_request">60</property> | 72 | <property name="height_request">60</property> |
243 | 124 | <property name="visible">True</property> | 73 | <property name="visible">True</property> |
244 | 74 | <property name="can_focus">False</property> | ||
245 | 125 | <child> | 75 | <child> |
246 | 126 | <object class="GtkEventBox" id="captcha_loading"> | 76 | <object class="GtkEventBox" id="captcha_loading"> |
247 | 127 | <property name="width_request">300</property> | 77 | <property name="width_request">300</property> |
248 | 128 | <property name="height_request">60</property> | 78 | <property name="height_request">60</property> |
249 | 129 | <property name="visible">True</property> | 79 | <property name="visible">True</property> |
250 | 80 | <property name="can_focus">False</property> | ||
251 | 130 | <child> | 81 | <child> |
252 | 131 | <placeholder/> | 82 | <placeholder/> |
253 | 132 | </child> | 83 | </child> |
254 | @@ -141,9 +92,12 @@ | |||
255 | 141 | <object class="GtkImage" id="captcha_image"> | 92 | <object class="GtkImage" id="captcha_image"> |
256 | 142 | <property name="width_request">300</property> | 93 | <property name="width_request">300</property> |
257 | 143 | <property name="visible">True</property> | 94 | <property name="visible">True</property> |
258 | 95 | <property name="can_focus">False</property> | ||
259 | 144 | <property name="stock">gtk-missing-image</property> | 96 | <property name="stock">gtk-missing-image</property> |
260 | 145 | </object> | 97 | </object> |
261 | 146 | <packing> | 98 | <packing> |
262 | 99 | <property name="expand">True</property> | ||
263 | 100 | <property name="fill">True</property> | ||
264 | 147 | <property name="position">1</property> | 101 | <property name="position">1</property> |
265 | 148 | </packing> | 102 | </packing> |
266 | 149 | </child> | 103 | </child> |
267 | @@ -157,23 +111,28 @@ | |||
268 | 157 | <child> | 111 | <child> |
269 | 158 | <object class="GtkVBox" id="vbox1"> | 112 | <object class="GtkVBox" id="vbox1"> |
270 | 159 | <property name="visible">True</property> | 113 | <property name="visible">True</property> |
271 | 114 | <property name="can_focus">False</property> | ||
272 | 160 | <child> | 115 | <child> |
273 | 161 | <object class="GtkButton" id="captcha_reload_button"> | 116 | <object class="GtkButton" id="captcha_reload_button"> |
274 | 117 | <property name="use_action_appearance">False</property> | ||
275 | 162 | <property name="visible">True</property> | 118 | <property name="visible">True</property> |
276 | 163 | <property name="can_focus">True</property> | 119 | <property name="can_focus">True</property> |
277 | 164 | <property name="receives_default">True</property> | 120 | <property name="receives_default">True</property> |
278 | 121 | <property name="use_action_appearance">False</property> | ||
279 | 165 | <property name="relief">none</property> | 122 | <property name="relief">none</property> |
280 | 166 | <property name="focus_on_click">False</property> | 123 | <property name="focus_on_click">False</property> |
282 | 167 | <signal name="clicked" handler="on_captcha_reload_button_clicked"/> | 124 | <signal name="clicked" handler="on_captcha_reload_button_clicked" swapped="no"/> |
283 | 168 | <child> | 125 | <child> |
284 | 169 | <object class="GtkImage" id="image1"> | 126 | <object class="GtkImage" id="image1"> |
285 | 170 | <property name="visible">True</property> | 127 | <property name="visible">True</property> |
286 | 128 | <property name="can_focus">False</property> | ||
287 | 171 | <property name="icon_name">reload</property> | 129 | <property name="icon_name">reload</property> |
288 | 172 | </object> | 130 | </object> |
289 | 173 | </child> | 131 | </child> |
290 | 174 | </object> | 132 | </object> |
291 | 175 | <packing> | 133 | <packing> |
292 | 176 | <property name="expand">False</property> | 134 | <property name="expand">False</property> |
293 | 135 | <property name="fill">True</property> | ||
294 | 177 | <property name="position">0</property> | 136 | <property name="position">0</property> |
295 | 178 | </packing> | 137 | </packing> |
296 | 179 | </child> | 138 | </child> |
297 | @@ -186,6 +145,7 @@ | |||
298 | 186 | </object> | 145 | </object> |
299 | 187 | <packing> | 146 | <packing> |
300 | 188 | <property name="expand">False</property> | 147 | <property name="expand">False</property> |
301 | 148 | <property name="fill">True</property> | ||
302 | 189 | <property name="position">1</property> | 149 | <property name="position">1</property> |
303 | 190 | </packing> | 150 | </packing> |
304 | 191 | </child> | 151 | </child> |
305 | @@ -194,64 +154,76 @@ | |||
306 | 194 | </object> | 154 | </object> |
307 | 195 | <packing> | 155 | <packing> |
308 | 196 | <property name="expand">False</property> | 156 | <property name="expand">False</property> |
309 | 157 | <property name="fill">True</property> | ||
310 | 197 | <property name="position">3</property> | 158 | <property name="position">3</property> |
311 | 198 | </packing> | 159 | </packing> |
312 | 199 | </child> | 160 | </child> |
313 | 200 | <child> | 161 | <child> |
314 | 201 | <object class="GtkVBox" id="captcha_solution_vbox"> | 162 | <object class="GtkVBox" id="captcha_solution_vbox"> |
315 | 202 | <property name="visible">True</property> | 163 | <property name="visible">True</property> |
316 | 164 | <property name="can_focus">False</property> | ||
317 | 203 | <child> | 165 | <child> |
318 | 204 | <placeholder/> | 166 | <placeholder/> |
319 | 205 | </child> | 167 | </child> |
320 | 206 | </object> | 168 | </object> |
321 | 207 | <packing> | 169 | <packing> |
322 | 208 | <property name="expand">False</property> | 170 | <property name="expand">False</property> |
323 | 171 | <property name="fill">True</property> | ||
324 | 209 | <property name="position">4</property> | 172 | <property name="position">4</property> |
325 | 210 | </packing> | 173 | </packing> |
326 | 211 | </child> | 174 | </child> |
327 | 212 | <child> | 175 | <child> |
328 | 213 | <object class="GtkCheckButton" id="yes_to_updates_checkbutton"> | 176 | <object class="GtkCheckButton" id="yes_to_updates_checkbutton"> |
329 | 214 | <property name="label" translatable="yes">yes to updates</property> | 177 | <property name="label" translatable="yes">yes to updates</property> |
330 | 178 | <property name="use_action_appearance">False</property> | ||
331 | 215 | <property name="visible">True</property> | 179 | <property name="visible">True</property> |
332 | 216 | <property name="can_focus">True</property> | 180 | <property name="can_focus">True</property> |
333 | 217 | <property name="receives_default">False</property> | 181 | <property name="receives_default">False</property> |
334 | 182 | <property name="use_action_appearance">False</property> | ||
335 | 218 | <property name="active">True</property> | 183 | <property name="active">True</property> |
336 | 219 | <property name="draw_indicator">True</property> | 184 | <property name="draw_indicator">True</property> |
337 | 220 | </object> | 185 | </object> |
338 | 221 | <packing> | 186 | <packing> |
339 | 222 | <property name="expand">False</property> | 187 | <property name="expand">False</property> |
340 | 188 | <property name="fill">True</property> | ||
341 | 223 | <property name="position">5</property> | 189 | <property name="position">5</property> |
342 | 224 | </packing> | 190 | </packing> |
343 | 225 | </child> | 191 | </child> |
344 | 226 | <child> | 192 | <child> |
345 | 227 | <object class="GtkVBox" id="tc_vbox"> | 193 | <object class="GtkVBox" id="tc_vbox"> |
346 | 228 | <property name="visible">True</property> | 194 | <property name="visible">True</property> |
347 | 195 | <property name="can_focus">False</property> | ||
348 | 229 | <property name="spacing">5</property> | 196 | <property name="spacing">5</property> |
349 | 230 | <child> | 197 | <child> |
350 | 231 | <object class="GtkCheckButton" id="yes_to_tc_checkbutton"> | 198 | <object class="GtkCheckButton" id="yes_to_tc_checkbutton"> |
351 | 232 | <property name="label" translatable="yes">yes to tc</property> | 199 | <property name="label" translatable="yes">yes to tc</property> |
352 | 200 | <property name="use_action_appearance">False</property> | ||
353 | 233 | <property name="visible">True</property> | 201 | <property name="visible">True</property> |
354 | 234 | <property name="can_focus">True</property> | 202 | <property name="can_focus">True</property> |
355 | 235 | <property name="receives_default">False</property> | 203 | <property name="receives_default">False</property> |
357 | 236 | <property name="active">False</property> | 204 | <property name="use_action_appearance">False</property> |
358 | 237 | <property name="draw_indicator">True</property> | 205 | <property name="draw_indicator">True</property> |
359 | 238 | </object> | 206 | </object> |
360 | 239 | <packing> | 207 | <packing> |
361 | 240 | <property name="expand">False</property> | 208 | <property name="expand">False</property> |
362 | 209 | <property name="fill">True</property> | ||
363 | 241 | <property name="position">0</property> | 210 | <property name="position">0</property> |
364 | 242 | </packing> | 211 | </packing> |
365 | 243 | </child> | 212 | </child> |
366 | 244 | <child> | 213 | <child> |
367 | 245 | <object class="GtkHButtonBox" id="hbuttonbox3"> | 214 | <object class="GtkHButtonBox" id="hbuttonbox3"> |
368 | 246 | <property name="visible">True</property> | 215 | <property name="visible">True</property> |
369 | 216 | <property name="can_focus">False</property> | ||
370 | 247 | <property name="layout_style">start</property> | 217 | <property name="layout_style">start</property> |
371 | 248 | <child> | 218 | <child> |
372 | 249 | <object class="GtkButton" id="tc_button"> | 219 | <object class="GtkButton" id="tc_button"> |
373 | 250 | <property name="label">show tc</property> | 220 | <property name="label">show tc</property> |
374 | 221 | <property name="use_action_appearance">False</property> | ||
375 | 251 | <property name="visible">True</property> | 222 | <property name="visible">True</property> |
376 | 252 | <property name="can_focus">True</property> | 223 | <property name="can_focus">True</property> |
377 | 253 | <property name="receives_default">True</property> | 224 | <property name="receives_default">True</property> |
379 | 254 | <signal name="clicked" handler="on_tc_button_clicked"/> | 225 | <property name="use_action_appearance">False</property> |
380 | 226 | <signal name="clicked" handler="on_tc_button_clicked" swapped="no"/> | ||
381 | 255 | </object> | 227 | </object> |
382 | 256 | <packing> | 228 | <packing> |
383 | 257 | <property name="expand">False</property> | 229 | <property name="expand">False</property> |
384 | @@ -262,42 +234,53 @@ | |||
385 | 262 | </object> | 234 | </object> |
386 | 263 | <packing> | 235 | <packing> |
387 | 264 | <property name="expand">False</property> | 236 | <property name="expand">False</property> |
388 | 237 | <property name="fill">True</property> | ||
389 | 265 | <property name="position">1</property> | 238 | <property name="position">1</property> |
390 | 266 | </packing> | 239 | </packing> |
391 | 267 | </child> | 240 | </child> |
392 | 268 | <child> | 241 | <child> |
393 | 269 | <object class="GtkLabel" id="tc_warning_label"> | 242 | <object class="GtkLabel" id="tc_warning_label"> |
394 | 270 | <property name="visible">True</property> | 243 | <property name="visible">True</property> |
395 | 244 | <property name="can_focus">False</property> | ||
396 | 271 | <property name="xalign">0</property> | 245 | <property name="xalign">0</property> |
397 | 272 | <property name="label">tc warning</property> | 246 | <property name="label">tc warning</property> |
398 | 273 | <property name="wrap">True</property> | 247 | <property name="wrap">True</property> |
399 | 274 | </object> | 248 | </object> |
400 | 275 | <packing> | 249 | <packing> |
401 | 250 | <property name="expand">True</property> | ||
402 | 251 | <property name="fill">True</property> | ||
403 | 276 | <property name="position">2</property> | 252 | <property name="position">2</property> |
404 | 277 | </packing> | 253 | </packing> |
405 | 278 | </child> | 254 | </child> |
406 | 279 | </object> | 255 | </object> |
407 | 280 | <packing> | 256 | <packing> |
408 | 281 | <property name="expand">False</property> | 257 | <property name="expand">False</property> |
409 | 258 | <property name="fill">True</property> | ||
410 | 282 | <property name="position">6</property> | 259 | <property name="position">6</property> |
411 | 283 | </packing> | 260 | </packing> |
412 | 284 | </child> | 261 | </child> |
413 | 285 | <child> | 262 | <child> |
414 | 286 | <object class="GtkHBox" id="hbox2"> | 263 | <object class="GtkHBox" id="hbox2"> |
415 | 287 | <property name="visible">True</property> | 264 | <property name="visible">True</property> |
416 | 265 | <property name="can_focus">False</property> | ||
417 | 288 | <property name="spacing">5</property> | 266 | <property name="spacing">5</property> |
418 | 289 | <child> | 267 | <child> |
419 | 290 | <object class="GtkHButtonBox" id="hbuttonbox9"> | 268 | <object class="GtkHButtonBox" id="hbuttonbox9"> |
420 | 291 | <property name="visible">True</property> | 269 | <property name="visible">True</property> |
421 | 270 | <property name="can_focus">False</property> | ||
422 | 292 | <property name="layout_style">start</property> | 271 | <property name="layout_style">start</property> |
423 | 293 | <child> | 272 | <child> |
424 | 294 | <object class="GtkLinkButton" id="login_button"> | 273 | <object class="GtkLinkButton" id="login_button"> |
425 | 295 | <property name="label">login button</property> | 274 | <property name="label">login button</property> |
426 | 275 | <property name="use_action_appearance">False</property> | ||
427 | 296 | <property name="visible">True</property> | 276 | <property name="visible">True</property> |
428 | 297 | <property name="can_focus">True</property> | 277 | <property name="can_focus">True</property> |
429 | 298 | <property name="receives_default">True</property> | 278 | <property name="receives_default">True</property> |
430 | 279 | <property name="use_action_appearance">False</property> | ||
431 | 299 | <property name="relief">none</property> | 280 | <property name="relief">none</property> |
433 | 300 | <signal name="clicked" handler="on_sign_in_button_clicked"/> | 281 | <property name="uri">foo</property> |
434 | 282 | <signal name="activate-link" handler="on_activate_link" swapped="no"/> | ||
435 | 283 | <signal name="clicked" handler="on_sign_in_button_clicked" swapped="no"/> | ||
436 | 301 | </object> | 284 | </object> |
437 | 302 | <packing> | 285 | <packing> |
438 | 303 | <property name="expand">False</property> | 286 | <property name="expand">False</property> |
439 | @@ -308,20 +291,24 @@ | |||
440 | 308 | </object> | 291 | </object> |
441 | 309 | <packing> | 292 | <packing> |
442 | 310 | <property name="expand">False</property> | 293 | <property name="expand">False</property> |
443 | 294 | <property name="fill">True</property> | ||
444 | 311 | <property name="position">0</property> | 295 | <property name="position">0</property> |
445 | 312 | </packing> | 296 | </packing> |
446 | 313 | </child> | 297 | </child> |
447 | 314 | <child> | 298 | <child> |
448 | 315 | <object class="GtkHButtonBox" id="hbuttonbox1"> | 299 | <object class="GtkHButtonBox" id="hbuttonbox1"> |
449 | 316 | <property name="visible">True</property> | 300 | <property name="visible">True</property> |
450 | 301 | <property name="can_focus">False</property> | ||
451 | 317 | <property name="spacing">5</property> | 302 | <property name="spacing">5</property> |
452 | 318 | <property name="layout_style">end</property> | 303 | <property name="layout_style">end</property> |
453 | 319 | <child> | 304 | <child> |
454 | 320 | <object class="GtkButton" id="join_cancel_button"> | 305 | <object class="GtkButton" id="join_cancel_button"> |
455 | 321 | <property name="label">gtk-cancel</property> | 306 | <property name="label">gtk-cancel</property> |
456 | 307 | <property name="use_action_appearance">False</property> | ||
457 | 322 | <property name="visible">True</property> | 308 | <property name="visible">True</property> |
458 | 323 | <property name="can_focus">True</property> | 309 | <property name="can_focus">True</property> |
459 | 324 | <property name="receives_default">True</property> | 310 | <property name="receives_default">True</property> |
460 | 311 | <property name="use_action_appearance">False</property> | ||
461 | 325 | <property name="use_stock">True</property> | 312 | <property name="use_stock">True</property> |
462 | 326 | </object> | 313 | </object> |
463 | 327 | <packing> | 314 | <packing> |
464 | @@ -333,11 +320,13 @@ | |||
465 | 333 | <child> | 320 | <child> |
466 | 334 | <object class="GtkButton" id="join_ok_button"> | 321 | <object class="GtkButton" id="join_ok_button"> |
467 | 335 | <property name="label">gtk-go-forward</property> | 322 | <property name="label">gtk-go-forward</property> |
468 | 323 | <property name="use_action_appearance">False</property> | ||
469 | 336 | <property name="visible">True</property> | 324 | <property name="visible">True</property> |
470 | 337 | <property name="can_focus">True</property> | 325 | <property name="can_focus">True</property> |
471 | 338 | <property name="receives_default">True</property> | 326 | <property name="receives_default">True</property> |
472 | 327 | <property name="use_action_appearance">False</property> | ||
473 | 339 | <property name="use_stock">True</property> | 328 | <property name="use_stock">True</property> |
475 | 340 | <signal name="clicked" handler="on_join_ok_button_clicked"/> | 329 | <signal name="clicked" handler="on_join_ok_button_clicked" swapped="no"/> |
476 | 341 | </object> | 330 | </object> |
477 | 342 | <packing> | 331 | <packing> |
478 | 343 | <property name="expand">False</property> | 332 | <property name="expand">False</property> |
479 | @@ -348,6 +337,7 @@ | |||
480 | 348 | </object> | 337 | </object> |
481 | 349 | <packing> | 338 | <packing> |
482 | 350 | <property name="expand">False</property> | 339 | <property name="expand">False</property> |
483 | 340 | <property name="fill">True</property> | ||
484 | 351 | <property name="pack_type">end</property> | 341 | <property name="pack_type">end</property> |
485 | 352 | <property name="position">1</property> | 342 | <property name="position">1</property> |
486 | 353 | </packing> | 343 | </packing> |
487 | @@ -355,122 +345,72 @@ | |||
488 | 355 | </object> | 345 | </object> |
489 | 356 | <packing> | 346 | <packing> |
490 | 357 | <property name="expand">False</property> | 347 | <property name="expand">False</property> |
491 | 348 | <property name="fill">True</property> | ||
492 | 358 | <property name="pack_type">end</property> | 349 | <property name="pack_type">end</property> |
493 | 359 | <property name="position">7</property> | 350 | <property name="position">7</property> |
494 | 360 | </packing> | 351 | </packing> |
495 | 361 | </child> | 352 | </child> |
496 | 362 | </object> | 353 | </object> |
593 | 363 | <object class="GtkVBox" id="processing_vbox"> | 354 | <object class="GtkVBox" id="finish_vbox"> |
594 | 364 | <property name="visible">True</property> | 355 | <property name="visible">True</property> |
595 | 365 | <property name="spacing">10</property> | 356 | <property name="can_focus">False</property> |
596 | 366 | <child> | 357 | <property name="spacing">10</property> |
597 | 367 | <placeholder/> | 358 | <child> |
598 | 368 | </child> | 359 | <object class="GtkLabel" id="finish_label"> |
599 | 369 | </object> | 360 | <property name="visible">True</property> |
600 | 370 | <object class="GtkVBox" id="verify_email_vbox"> | 361 | <property name="can_focus">False</property> |
601 | 371 | <property name="visible">True</property> | 362 | <property name="wrap">True</property> |
602 | 372 | <property name="spacing">10</property> | 363 | </object> |
603 | 373 | <child> | 364 | <packing> |
604 | 374 | <object class="GtkAlignment" id="alignment4"> | 365 | <property name="expand">True</property> |
605 | 375 | <property name="visible">True</property> | 366 | <property name="fill">True</property> |
606 | 376 | <property name="xscale">0</property> | 367 | <property name="position">0</property> |
607 | 377 | <property name="yscale">0</property> | 368 | </packing> |
608 | 378 | <child> | 369 | </child> |
609 | 379 | <object class="GtkVBox" id="verify_email_details_vbox"> | 370 | <child> |
610 | 380 | <property name="visible">True</property> | 371 | <object class="GtkHButtonBox" id="hbuttonbox8"> |
611 | 381 | <child> | 372 | <property name="visible">True</property> |
612 | 382 | <placeholder/> | 373 | <property name="can_focus">False</property> |
613 | 383 | </child> | 374 | <property name="layout_style">end</property> |
614 | 384 | </object> | 375 | <child> |
615 | 385 | </child> | 376 | <object class="GtkButton" id="finish_close_button"> |
616 | 386 | </object> | 377 | <property name="label">gtk-close</property> |
617 | 387 | <packing> | 378 | <property name="use_action_appearance">False</property> |
618 | 388 | <property name="position">0</property> | 379 | <property name="visible">True</property> |
619 | 389 | </packing> | 380 | <property name="can_focus">True</property> |
620 | 390 | </child> | 381 | <property name="receives_default">True</property> |
621 | 391 | <child> | 382 | <property name="use_action_appearance">False</property> |
622 | 392 | <object class="GtkHButtonBox" id="hbuttonbox2"> | 383 | <property name="use_stock">True</property> |
623 | 393 | <property name="visible">True</property> | 384 | <signal name="clicked" handler="on_close_clicked" swapped="no"/> |
624 | 394 | <property name="spacing">5</property> | 385 | </object> |
625 | 395 | <property name="layout_style">end</property> | 386 | <packing> |
626 | 396 | <child> | 387 | <property name="expand">False</property> |
627 | 397 | <object class="GtkButton" id="verify_token_button"> | 388 | <property name="fill">False</property> |
628 | 398 | <property name="label">gtk-ok</property> | 389 | <property name="position">0</property> |
629 | 399 | <property name="visible">True</property> | 390 | </packing> |
630 | 400 | <property name="can_focus">True</property> | 391 | </child> |
631 | 401 | <property name="receives_default">True</property> | 392 | </object> |
632 | 402 | <property name="use_stock">True</property> | 393 | <packing> |
633 | 403 | <signal name="clicked" handler="on_verify_token_button_clicked"/> | 394 | <property name="expand">False</property> |
634 | 404 | </object> | 395 | <property name="fill">True</property> |
539 | 405 | <packing> | ||
540 | 406 | <property name="expand">False</property> | ||
541 | 407 | <property name="fill">False</property> | ||
542 | 408 | <property name="position">0</property> | ||
543 | 409 | </packing> | ||
544 | 410 | </child> | ||
545 | 411 | </object> | ||
546 | 412 | <packing> | ||
547 | 413 | <property name="expand">False</property> | ||
548 | 414 | <property name="position">1</property> | ||
549 | 415 | </packing> | ||
550 | 416 | </child> | ||
551 | 417 | </object> | ||
552 | 418 | <object class="GtkVBox" id="tc_browser_vbox"> | ||
553 | 419 | <property name="visible">True</property> | ||
554 | 420 | <signal name="hide" handler="on_tc_browser_vbox_hide"/> | ||
555 | 421 | <child> | ||
556 | 422 | <object class="GtkScrolledWindow" id="tc_browser_window"> | ||
557 | 423 | <property name="visible">True</property> | ||
558 | 424 | <property name="can_focus">True</property> | ||
559 | 425 | <property name="border_width">10</property> | ||
560 | 426 | <property name="hscrollbar_policy">never</property> | ||
561 | 427 | <property name="vscrollbar_policy">automatic</property> | ||
562 | 428 | <property name="shadow_type">in</property> | ||
563 | 429 | <child> | ||
564 | 430 | <placeholder/> | ||
565 | 431 | </child> | ||
566 | 432 | </object> | ||
567 | 433 | <packing> | ||
568 | 434 | <property name="position">0</property> | ||
569 | 435 | </packing> | ||
570 | 436 | </child> | ||
571 | 437 | <child> | ||
572 | 438 | <object class="GtkHButtonBox" id="hbuttonbox4"> | ||
573 | 439 | <property name="visible">True</property> | ||
574 | 440 | <property name="layout_style">end</property> | ||
575 | 441 | <child> | ||
576 | 442 | <object class="GtkButton" id="tc_back_button"> | ||
577 | 443 | <property name="label">gtk-go-back</property> | ||
578 | 444 | <property name="visible">True</property> | ||
579 | 445 | <property name="can_focus">True</property> | ||
580 | 446 | <property name="receives_default">True</property> | ||
581 | 447 | <property name="use_stock">True</property> | ||
582 | 448 | <signal name="clicked" handler="on_tc_back_button_clicked"/> | ||
583 | 449 | </object> | ||
584 | 450 | <packing> | ||
585 | 451 | <property name="expand">False</property> | ||
586 | 452 | <property name="fill">False</property> | ||
587 | 453 | <property name="position">0</property> | ||
588 | 454 | </packing> | ||
589 | 455 | </child> | ||
590 | 456 | </object> | ||
591 | 457 | <packing> | ||
592 | 458 | <property name="expand">False</property> | ||
635 | 459 | <property name="position">1</property> | 396 | <property name="position">1</property> |
636 | 460 | </packing> | 397 | </packing> |
637 | 461 | </child> | 398 | </child> |
638 | 462 | </object> | 399 | </object> |
639 | 463 | <object class="GtkVBox" id="login_vbox"> | 400 | <object class="GtkVBox" id="login_vbox"> |
640 | 464 | <property name="visible">True</property> | 401 | <property name="visible">True</property> |
641 | 402 | <property name="can_focus">False</property> | ||
642 | 465 | <property name="spacing">10</property> | 403 | <property name="spacing">10</property> |
643 | 466 | <child> | 404 | <child> |
644 | 467 | <object class="GtkAlignment" id="alignment3"> | 405 | <object class="GtkAlignment" id="alignment3"> |
645 | 468 | <property name="visible">True</property> | 406 | <property name="visible">True</property> |
646 | 407 | <property name="can_focus">False</property> | ||
647 | 469 | <property name="xscale">0</property> | 408 | <property name="xscale">0</property> |
648 | 470 | <property name="yscale">0</property> | 409 | <property name="yscale">0</property> |
649 | 471 | <child> | 410 | <child> |
650 | 472 | <object class="GtkVBox" id="login_details_vbox"> | 411 | <object class="GtkVBox" id="login_details_vbox"> |
651 | 473 | <property name="visible">True</property> | 412 | <property name="visible">True</property> |
652 | 413 | <property name="can_focus">False</property> | ||
653 | 474 | <property name="spacing">5</property> | 414 | <property name="spacing">5</property> |
654 | 475 | <child> | 415 | <child> |
655 | 476 | <placeholder/> | 416 | <placeholder/> |
656 | @@ -482,26 +422,34 @@ | |||
657 | 482 | </child> | 422 | </child> |
658 | 483 | </object> | 423 | </object> |
659 | 484 | <packing> | 424 | <packing> |
660 | 425 | <property name="expand">True</property> | ||
661 | 426 | <property name="fill">True</property> | ||
662 | 485 | <property name="position">0</property> | 427 | <property name="position">0</property> |
663 | 486 | </packing> | 428 | </packing> |
664 | 487 | </child> | 429 | </child> |
665 | 488 | <child> | 430 | <child> |
666 | 489 | <object class="GtkHBox" id="hbox3"> | 431 | <object class="GtkHBox" id="hbox3"> |
667 | 490 | <property name="visible">True</property> | 432 | <property name="visible">True</property> |
668 | 433 | <property name="can_focus">False</property> | ||
669 | 491 | <property name="spacing">5</property> | 434 | <property name="spacing">5</property> |
670 | 492 | <child> | 435 | <child> |
671 | 493 | <object class="GtkHButtonBox" id="hbuttonbox10"> | 436 | <object class="GtkHButtonBox" id="hbuttonbox10"> |
672 | 494 | <property name="visible">True</property> | 437 | <property name="visible">True</property> |
673 | 438 | <property name="can_focus">False</property> | ||
674 | 495 | <property name="layout_style">start</property> | 439 | <property name="layout_style">start</property> |
675 | 496 | <child> | 440 | <child> |
676 | 497 | <object class="GtkLinkButton" id="forgotten_password_button"> | 441 | <object class="GtkLinkButton" id="forgotten_password_button"> |
678 | 498 | <property name="label" translatable="yes">button</property> | 442 | <property name="label" translatable="yes">forgot password button</property> |
679 | 443 | <property name="use_action_appearance">False</property> | ||
680 | 499 | <property name="visible">True</property> | 444 | <property name="visible">True</property> |
681 | 500 | <property name="can_focus">True</property> | 445 | <property name="can_focus">True</property> |
682 | 501 | <property name="receives_default">True</property> | 446 | <property name="receives_default">True</property> |
683 | 502 | <property name="has_tooltip">True</property> | 447 | <property name="has_tooltip">True</property> |
684 | 448 | <property name="use_action_appearance">False</property> | ||
685 | 503 | <property name="relief">none</property> | 449 | <property name="relief">none</property> |
687 | 504 | <signal name="clicked" handler="on_forgotten_password_button_clicked"/> | 450 | <property name="uri">foo</property> |
688 | 451 | <signal name="activate-link" handler="on_activate_link" swapped="no"/> | ||
689 | 452 | <signal name="clicked" handler="on_forgotten_password_button_clicked" swapped="no"/> | ||
690 | 505 | </object> | 453 | </object> |
691 | 506 | <packing> | 454 | <packing> |
692 | 507 | <property name="expand">False</property> | 455 | <property name="expand">False</property> |
693 | @@ -513,20 +461,24 @@ | |||
694 | 513 | </object> | 461 | </object> |
695 | 514 | <packing> | 462 | <packing> |
696 | 515 | <property name="expand">False</property> | 463 | <property name="expand">False</property> |
697 | 464 | <property name="fill">True</property> | ||
698 | 516 | <property name="position">0</property> | 465 | <property name="position">0</property> |
699 | 517 | </packing> | 466 | </packing> |
700 | 518 | </child> | 467 | </child> |
701 | 519 | <child> | 468 | <child> |
702 | 520 | <object class="GtkHButtonBox" id="hbuttonbox5"> | 469 | <object class="GtkHButtonBox" id="hbuttonbox5"> |
703 | 521 | <property name="visible">True</property> | 470 | <property name="visible">True</property> |
704 | 471 | <property name="can_focus">False</property> | ||
705 | 522 | <property name="spacing">5</property> | 472 | <property name="spacing">5</property> |
706 | 523 | <property name="layout_style">end</property> | 473 | <property name="layout_style">end</property> |
707 | 524 | <child> | 474 | <child> |
708 | 525 | <object class="GtkButton" id="login_cancel_button"> | 475 | <object class="GtkButton" id="login_cancel_button"> |
709 | 526 | <property name="label">gtk-cancel</property> | 476 | <property name="label">gtk-cancel</property> |
710 | 477 | <property name="use_action_appearance">False</property> | ||
711 | 527 | <property name="visible">True</property> | 478 | <property name="visible">True</property> |
712 | 528 | <property name="can_focus">True</property> | 479 | <property name="can_focus">True</property> |
713 | 529 | <property name="receives_default">True</property> | 480 | <property name="receives_default">True</property> |
714 | 481 | <property name="use_action_appearance">False</property> | ||
715 | 530 | <property name="use_stock">True</property> | 482 | <property name="use_stock">True</property> |
716 | 531 | </object> | 483 | </object> |
717 | 532 | <packing> | 484 | <packing> |
718 | @@ -538,11 +490,13 @@ | |||
719 | 538 | <child> | 490 | <child> |
720 | 539 | <object class="GtkButton" id="login_back_button"> | 491 | <object class="GtkButton" id="login_back_button"> |
721 | 540 | <property name="label">gtk-go-back</property> | 492 | <property name="label">gtk-go-back</property> |
722 | 493 | <property name="use_action_appearance">False</property> | ||
723 | 541 | <property name="visible">True</property> | 494 | <property name="visible">True</property> |
724 | 542 | <property name="can_focus">True</property> | 495 | <property name="can_focus">True</property> |
725 | 543 | <property name="receives_default">True</property> | 496 | <property name="receives_default">True</property> |
726 | 497 | <property name="use_action_appearance">False</property> | ||
727 | 544 | <property name="use_stock">True</property> | 498 | <property name="use_stock">True</property> |
729 | 545 | <signal name="clicked" handler="on_login_back_button_clicked"/> | 499 | <signal name="clicked" handler="on_login_back_button_clicked" swapped="no"/> |
730 | 546 | </object> | 500 | </object> |
731 | 547 | <packing> | 501 | <packing> |
732 | 548 | <property name="expand">False</property> | 502 | <property name="expand">False</property> |
733 | @@ -553,11 +507,13 @@ | |||
734 | 553 | <child> | 507 | <child> |
735 | 554 | <object class="GtkButton" id="login_ok_button"> | 508 | <object class="GtkButton" id="login_ok_button"> |
736 | 555 | <property name="label">gtk-connect</property> | 509 | <property name="label">gtk-connect</property> |
737 | 510 | <property name="use_action_appearance">False</property> | ||
738 | 556 | <property name="visible">True</property> | 511 | <property name="visible">True</property> |
739 | 557 | <property name="can_focus">True</property> | 512 | <property name="can_focus">True</property> |
740 | 558 | <property name="receives_default">True</property> | 513 | <property name="receives_default">True</property> |
741 | 514 | <property name="use_action_appearance">False</property> | ||
742 | 559 | <property name="use_stock">True</property> | 515 | <property name="use_stock">True</property> |
744 | 560 | <signal name="clicked" handler="on_login_connect_button_clicked"/> | 516 | <signal name="clicked" handler="on_login_connect_button_clicked" swapped="no"/> |
745 | 561 | </object> | 517 | </object> |
746 | 562 | <packing> | 518 | <packing> |
747 | 563 | <property name="expand">False</property> | 519 | <property name="expand">False</property> |
748 | @@ -568,6 +524,7 @@ | |||
749 | 568 | </object> | 524 | </object> |
750 | 569 | <packing> | 525 | <packing> |
751 | 570 | <property name="expand">False</property> | 526 | <property name="expand">False</property> |
752 | 527 | <property name="fill">True</property> | ||
753 | 571 | <property name="pack_type">end</property> | 528 | <property name="pack_type">end</property> |
754 | 572 | <property name="position">1</property> | 529 | <property name="position">1</property> |
755 | 573 | </packing> | 530 | </packing> |
756 | @@ -575,21 +532,33 @@ | |||
757 | 575 | </object> | 532 | </object> |
758 | 576 | <packing> | 533 | <packing> |
759 | 577 | <property name="expand">False</property> | 534 | <property name="expand">False</property> |
760 | 535 | <property name="fill">True</property> | ||
761 | 578 | <property name="position">1</property> | 536 | <property name="position">1</property> |
762 | 579 | </packing> | 537 | </packing> |
763 | 580 | </child> | 538 | </child> |
764 | 581 | </object> | 539 | </object> |
765 | 540 | <object class="GtkVBox" id="processing_vbox"> | ||
766 | 541 | <property name="visible">True</property> | ||
767 | 542 | <property name="can_focus">False</property> | ||
768 | 543 | <property name="spacing">10</property> | ||
769 | 544 | <child> | ||
770 | 545 | <placeholder/> | ||
771 | 546 | </child> | ||
772 | 547 | </object> | ||
773 | 582 | <object class="GtkVBox" id="request_password_token_vbox"> | 548 | <object class="GtkVBox" id="request_password_token_vbox"> |
774 | 583 | <property name="visible">True</property> | 549 | <property name="visible">True</property> |
775 | 550 | <property name="can_focus">False</property> | ||
776 | 584 | <property name="spacing">10</property> | 551 | <property name="spacing">10</property> |
777 | 585 | <child> | 552 | <child> |
778 | 586 | <object class="GtkAlignment" id="alignment2"> | 553 | <object class="GtkAlignment" id="alignment2"> |
779 | 587 | <property name="visible">True</property> | 554 | <property name="visible">True</property> |
780 | 555 | <property name="can_focus">False</property> | ||
781 | 588 | <property name="xscale">0</property> | 556 | <property name="xscale">0</property> |
782 | 589 | <property name="yscale">0</property> | 557 | <property name="yscale">0</property> |
783 | 590 | <child> | 558 | <child> |
784 | 591 | <object class="GtkVBox" id="request_password_token_details_vbox"> | 559 | <object class="GtkVBox" id="request_password_token_details_vbox"> |
785 | 592 | <property name="visible">True</property> | 560 | <property name="visible">True</property> |
786 | 561 | <property name="can_focus">False</property> | ||
787 | 593 | <property name="spacing">5</property> | 562 | <property name="spacing">5</property> |
788 | 594 | <child> | 563 | <child> |
789 | 595 | <placeholder/> | 564 | <placeholder/> |
790 | @@ -598,20 +567,25 @@ | |||
791 | 598 | </child> | 567 | </child> |
792 | 599 | </object> | 568 | </object> |
793 | 600 | <packing> | 569 | <packing> |
794 | 570 | <property name="expand">True</property> | ||
795 | 571 | <property name="fill">True</property> | ||
796 | 601 | <property name="position">0</property> | 572 | <property name="position">0</property> |
797 | 602 | </packing> | 573 | </packing> |
798 | 603 | </child> | 574 | </child> |
799 | 604 | <child> | 575 | <child> |
800 | 605 | <object class="GtkHButtonBox" id="hbuttonbox7"> | 576 | <object class="GtkHButtonBox" id="hbuttonbox7"> |
801 | 606 | <property name="visible">True</property> | 577 | <property name="visible">True</property> |
802 | 578 | <property name="can_focus">False</property> | ||
803 | 607 | <property name="spacing">5</property> | 579 | <property name="spacing">5</property> |
804 | 608 | <property name="layout_style">end</property> | 580 | <property name="layout_style">end</property> |
805 | 609 | <child> | 581 | <child> |
806 | 610 | <object class="GtkButton" id="request_password_token_cancel_button"> | 582 | <object class="GtkButton" id="request_password_token_cancel_button"> |
807 | 611 | <property name="label">gtk-cancel</property> | 583 | <property name="label">gtk-cancel</property> |
808 | 584 | <property name="use_action_appearance">False</property> | ||
809 | 612 | <property name="visible">True</property> | 585 | <property name="visible">True</property> |
810 | 613 | <property name="can_focus">True</property> | 586 | <property name="can_focus">True</property> |
811 | 614 | <property name="receives_default">True</property> | 587 | <property name="receives_default">True</property> |
812 | 588 | <property name="use_action_appearance">False</property> | ||
813 | 615 | <property name="use_stock">True</property> | 589 | <property name="use_stock">True</property> |
814 | 616 | </object> | 590 | </object> |
815 | 617 | <packing> | 591 | <packing> |
816 | @@ -623,11 +597,13 @@ | |||
817 | 623 | <child> | 597 | <child> |
818 | 624 | <object class="GtkButton" id="request_password_token_back_button"> | 598 | <object class="GtkButton" id="request_password_token_back_button"> |
819 | 625 | <property name="label">gtk-go-back</property> | 599 | <property name="label">gtk-go-back</property> |
820 | 600 | <property name="use_action_appearance">False</property> | ||
821 | 626 | <property name="visible">True</property> | 601 | <property name="visible">True</property> |
822 | 627 | <property name="can_focus">True</property> | 602 | <property name="can_focus">True</property> |
823 | 628 | <property name="receives_default">True</property> | 603 | <property name="receives_default">True</property> |
824 | 604 | <property name="use_action_appearance">False</property> | ||
825 | 629 | <property name="use_stock">True</property> | 605 | <property name="use_stock">True</property> |
827 | 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"/> |
828 | 631 | </object> | 607 | </object> |
829 | 632 | <packing> | 608 | <packing> |
830 | 633 | <property name="expand">False</property> | 609 | <property name="expand">False</property> |
831 | @@ -638,11 +614,13 @@ | |||
832 | 638 | <child> | 614 | <child> |
833 | 639 | <object class="GtkButton" id="request_password_token_ok_button"> | 615 | <object class="GtkButton" id="request_password_token_ok_button"> |
834 | 640 | <property name="label">gtk-ok</property> | 616 | <property name="label">gtk-ok</property> |
835 | 617 | <property name="use_action_appearance">False</property> | ||
836 | 641 | <property name="visible">True</property> | 618 | <property name="visible">True</property> |
837 | 642 | <property name="can_focus">True</property> | 619 | <property name="can_focus">True</property> |
838 | 643 | <property name="receives_default">True</property> | 620 | <property name="receives_default">True</property> |
839 | 621 | <property name="use_action_appearance">False</property> | ||
840 | 644 | <property name="use_stock">True</property> | 622 | <property name="use_stock">True</property> |
842 | 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"/> |
843 | 646 | </object> | 624 | </object> |
844 | 647 | <packing> | 625 | <packing> |
845 | 648 | <property name="expand">False</property> | 626 | <property name="expand">False</property> |
846 | @@ -653,35 +631,42 @@ | |||
847 | 653 | </object> | 631 | </object> |
848 | 654 | <packing> | 632 | <packing> |
849 | 655 | <property name="expand">False</property> | 633 | <property name="expand">False</property> |
850 | 634 | <property name="fill">True</property> | ||
851 | 656 | <property name="position">1</property> | 635 | <property name="position">1</property> |
852 | 657 | </packing> | 636 | </packing> |
853 | 658 | </child> | 637 | </child> |
854 | 659 | </object> | 638 | </object> |
855 | 660 | <object class="GtkVBox" id="set_new_password_vbox"> | 639 | <object class="GtkVBox" id="set_new_password_vbox"> |
856 | 661 | <property name="visible">True</property> | 640 | <property name="visible">True</property> |
857 | 641 | <property name="can_focus">False</property> | ||
858 | 662 | <property name="spacing">10</property> | 642 | <property name="spacing">10</property> |
859 | 663 | <child> | 643 | <child> |
860 | 664 | <object class="GtkVBox" id="vbox2"> | 644 | <object class="GtkVBox" id="vbox2"> |
861 | 665 | <property name="visible">True</property> | 645 | <property name="visible">True</property> |
862 | 646 | <property name="can_focus">False</property> | ||
863 | 666 | <child> | 647 | <child> |
864 | 667 | <object class="GtkLabel" id="reset_password_help_label"> | 648 | <object class="GtkLabel" id="reset_password_help_label"> |
865 | 668 | <property name="visible">True</property> | 649 | <property name="visible">True</property> |
866 | 650 | <property name="can_focus">False</property> | ||
867 | 669 | <property name="label">label</property> | 651 | <property name="label">label</property> |
868 | 670 | <property name="wrap">True</property> | 652 | <property name="wrap">True</property> |
869 | 671 | </object> | 653 | </object> |
870 | 672 | <packing> | 654 | <packing> |
871 | 673 | <property name="expand">False</property> | 655 | <property name="expand">False</property> |
872 | 656 | <property name="fill">True</property> | ||
873 | 674 | <property name="position">0</property> | 657 | <property name="position">0</property> |
874 | 675 | </packing> | 658 | </packing> |
875 | 676 | </child> | 659 | </child> |
876 | 677 | <child> | 660 | <child> |
877 | 678 | <object class="GtkAlignment" id="alignment1"> | 661 | <object class="GtkAlignment" id="alignment1"> |
878 | 679 | <property name="visible">True</property> | 662 | <property name="visible">True</property> |
879 | 663 | <property name="can_focus">False</property> | ||
880 | 680 | <property name="xscale">0</property> | 664 | <property name="xscale">0</property> |
881 | 681 | <property name="yscale">0</property> | 665 | <property name="yscale">0</property> |
882 | 682 | <child> | 666 | <child> |
883 | 683 | <object class="GtkVBox" id="set_new_password_details_vbox"> | 667 | <object class="GtkVBox" id="set_new_password_details_vbox"> |
884 | 684 | <property name="visible">True</property> | 668 | <property name="visible">True</property> |
885 | 669 | <property name="can_focus">False</property> | ||
886 | 685 | <property name="spacing">5</property> | 670 | <property name="spacing">5</property> |
887 | 686 | <child> | 671 | <child> |
888 | 687 | <placeholder/> | 672 | <placeholder/> |
889 | @@ -696,25 +681,32 @@ | |||
890 | 696 | </child> | 681 | </child> |
891 | 697 | </object> | 682 | </object> |
892 | 698 | <packing> | 683 | <packing> |
893 | 684 | <property name="expand">True</property> | ||
894 | 685 | <property name="fill">True</property> | ||
895 | 699 | <property name="position">1</property> | 686 | <property name="position">1</property> |
896 | 700 | </packing> | 687 | </packing> |
897 | 701 | </child> | 688 | </child> |
898 | 702 | </object> | 689 | </object> |
899 | 703 | <packing> | 690 | <packing> |
900 | 691 | <property name="expand">True</property> | ||
901 | 692 | <property name="fill">True</property> | ||
902 | 704 | <property name="position">0</property> | 693 | <property name="position">0</property> |
903 | 705 | </packing> | 694 | </packing> |
904 | 706 | </child> | 695 | </child> |
905 | 707 | <child> | 696 | <child> |
906 | 708 | <object class="GtkHButtonBox" id="hbuttonbox6"> | 697 | <object class="GtkHButtonBox" id="hbuttonbox6"> |
907 | 709 | <property name="visible">True</property> | 698 | <property name="visible">True</property> |
908 | 699 | <property name="can_focus">False</property> | ||
909 | 710 | <property name="spacing">5</property> | 700 | <property name="spacing">5</property> |
910 | 711 | <property name="layout_style">end</property> | 701 | <property name="layout_style">end</property> |
911 | 712 | <child> | 702 | <child> |
912 | 713 | <object class="GtkButton" id="set_new_password_cancel_button"> | 703 | <object class="GtkButton" id="set_new_password_cancel_button"> |
913 | 714 | <property name="label">gtk-cancel</property> | 704 | <property name="label">gtk-cancel</property> |
914 | 705 | <property name="use_action_appearance">False</property> | ||
915 | 715 | <property name="visible">True</property> | 706 | <property name="visible">True</property> |
916 | 716 | <property name="can_focus">True</property> | 707 | <property name="can_focus">True</property> |
917 | 717 | <property name="receives_default">True</property> | 708 | <property name="receives_default">True</property> |
918 | 709 | <property name="use_action_appearance">False</property> | ||
919 | 718 | <property name="use_stock">True</property> | 710 | <property name="use_stock">True</property> |
920 | 719 | </object> | 711 | </object> |
921 | 720 | <packing> | 712 | <packing> |
922 | @@ -726,11 +718,13 @@ | |||
923 | 726 | <child> | 718 | <child> |
924 | 727 | <object class="GtkButton" id="set_new_password_ok_button"> | 719 | <object class="GtkButton" id="set_new_password_ok_button"> |
925 | 728 | <property name="label">gtk-ok</property> | 720 | <property name="label">gtk-ok</property> |
926 | 721 | <property name="use_action_appearance">False</property> | ||
927 | 729 | <property name="visible">True</property> | 722 | <property name="visible">True</property> |
928 | 730 | <property name="can_focus">True</property> | 723 | <property name="can_focus">True</property> |
929 | 731 | <property name="receives_default">True</property> | 724 | <property name="receives_default">True</property> |
930 | 725 | <property name="use_action_appearance">False</property> | ||
931 | 732 | <property name="use_stock">True</property> | 726 | <property name="use_stock">True</property> |
933 | 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"/> |
934 | 734 | </object> | 728 | </object> |
935 | 735 | <packing> | 729 | <packing> |
936 | 736 | <property name="expand">False</property> | 730 | <property name="expand">False</property> |
937 | @@ -741,34 +735,104 @@ | |||
938 | 741 | </object> | 735 | </object> |
939 | 742 | <packing> | 736 | <packing> |
940 | 743 | <property name="expand">False</property> | 737 | <property name="expand">False</property> |
947 | 744 | <property name="position">1</property> | 738 | <property name="fill">True</property> |
948 | 745 | </packing> | 739 | <property name="position">1</property> |
949 | 746 | </child> | 740 | </packing> |
950 | 747 | </object> | 741 | </child> |
951 | 748 | <object class="GtkVBox" id="finish_vbox"> | 742 | </object> |
952 | 749 | <property name="visible">True</property> | 743 | <object class="GtkVBox" id="tc_browser_vbox"> |
953 | 744 | <property name="visible">True</property> | ||
954 | 745 | <property name="can_focus">False</property> | ||
955 | 746 | <signal name="hide" handler="on_tc_browser_vbox_hide" swapped="no"/> | ||
956 | 747 | <child> | ||
957 | 748 | <object class="GtkScrolledWindow" id="tc_browser_window"> | ||
958 | 749 | <property name="visible">True</property> | ||
959 | 750 | <property name="can_focus">True</property> | ||
960 | 751 | <property name="border_width">10</property> | ||
961 | 752 | <property name="hscrollbar_policy">never</property> | ||
962 | 753 | <property name="shadow_type">in</property> | ||
963 | 754 | <child> | ||
964 | 755 | <placeholder/> | ||
965 | 756 | </child> | ||
966 | 757 | </object> | ||
967 | 758 | <packing> | ||
968 | 759 | <property name="expand">True</property> | ||
969 | 760 | <property name="fill">True</property> | ||
970 | 761 | <property name="position">0</property> | ||
971 | 762 | </packing> | ||
972 | 763 | </child> | ||
973 | 764 | <child> | ||
974 | 765 | <object class="GtkHButtonBox" id="hbuttonbox4"> | ||
975 | 766 | <property name="visible">True</property> | ||
976 | 767 | <property name="can_focus">False</property> | ||
977 | 768 | <property name="layout_style">end</property> | ||
978 | 769 | <child> | ||
979 | 770 | <object class="GtkButton" id="tc_back_button"> | ||
980 | 771 | <property name="label">gtk-go-back</property> | ||
981 | 772 | <property name="use_action_appearance">False</property> | ||
982 | 773 | <property name="visible">True</property> | ||
983 | 774 | <property name="can_focus">True</property> | ||
984 | 775 | <property name="receives_default">True</property> | ||
985 | 776 | <property name="use_action_appearance">False</property> | ||
986 | 777 | <property name="use_stock">True</property> | ||
987 | 778 | <signal name="clicked" handler="on_tc_back_button_clicked" swapped="no"/> | ||
988 | 779 | </object> | ||
989 | 780 | <packing> | ||
990 | 781 | <property name="expand">False</property> | ||
991 | 782 | <property name="fill">False</property> | ||
992 | 783 | <property name="position">0</property> | ||
993 | 784 | </packing> | ||
994 | 785 | </child> | ||
995 | 786 | </object> | ||
996 | 787 | <packing> | ||
997 | 788 | <property name="expand">False</property> | ||
998 | 789 | <property name="fill">True</property> | ||
999 | 790 | <property name="position">1</property> | ||
1000 | 791 | </packing> | ||
1001 | 792 | </child> | ||
1002 | 793 | </object> | ||
1003 | 794 | <object class="GtkVBox" id="verify_email_vbox"> | ||
1004 | 795 | <property name="visible">True</property> | ||
1005 | 796 | <property name="can_focus">False</property> | ||
1006 | 750 | <property name="spacing">10</property> | 797 | <property name="spacing">10</property> |
1007 | 751 | <child> | 798 | <child> |
1009 | 752 | <object class="GtkLabel" id="finish_label"> | 799 | <object class="GtkAlignment" id="alignment4"> |
1010 | 753 | <property name="visible">True</property> | 800 | <property name="visible">True</property> |
1012 | 754 | <property name="wrap">True</property> | 801 | <property name="can_focus">False</property> |
1013 | 802 | <property name="xscale">0</property> | ||
1014 | 803 | <property name="yscale">0</property> | ||
1015 | 804 | <child> | ||
1016 | 805 | <object class="GtkVBox" id="verify_email_details_vbox"> | ||
1017 | 806 | <property name="visible">True</property> | ||
1018 | 807 | <property name="can_focus">False</property> | ||
1019 | 808 | <child> | ||
1020 | 809 | <placeholder/> | ||
1021 | 810 | </child> | ||
1022 | 811 | </object> | ||
1023 | 812 | </child> | ||
1024 | 755 | </object> | 813 | </object> |
1025 | 756 | <packing> | 814 | <packing> |
1026 | 815 | <property name="expand">True</property> | ||
1027 | 816 | <property name="fill">True</property> | ||
1028 | 757 | <property name="position">0</property> | 817 | <property name="position">0</property> |
1029 | 758 | </packing> | 818 | </packing> |
1030 | 759 | </child> | 819 | </child> |
1031 | 760 | <child> | 820 | <child> |
1033 | 761 | <object class="GtkHButtonBox" id="hbuttonbox8"> | 821 | <object class="GtkHButtonBox" id="hbuttonbox2"> |
1034 | 762 | <property name="visible">True</property> | 822 | <property name="visible">True</property> |
1035 | 823 | <property name="can_focus">False</property> | ||
1036 | 824 | <property name="spacing">5</property> | ||
1037 | 763 | <property name="layout_style">end</property> | 825 | <property name="layout_style">end</property> |
1038 | 764 | <child> | 826 | <child> |
1041 | 765 | <object class="GtkButton" id="finish_close_button"> | 827 | <object class="GtkButton" id="verify_token_button"> |
1042 | 766 | <property name="label">gtk-close</property> | 828 | <property name="label">gtk-ok</property> |
1043 | 829 | <property name="use_action_appearance">False</property> | ||
1044 | 767 | <property name="visible">True</property> | 830 | <property name="visible">True</property> |
1045 | 768 | <property name="can_focus">True</property> | 831 | <property name="can_focus">True</property> |
1046 | 769 | <property name="receives_default">True</property> | 832 | <property name="receives_default">True</property> |
1047 | 833 | <property name="use_action_appearance">False</property> | ||
1048 | 770 | <property name="use_stock">True</property> | 834 | <property name="use_stock">True</property> |
1050 | 771 | <signal name="clicked" handler="on_close_clicked"/> | 835 | <signal name="clicked" handler="on_verify_token_button_clicked" swapped="no"/> |
1051 | 772 | </object> | 836 | </object> |
1052 | 773 | <packing> | 837 | <packing> |
1053 | 774 | <property name="expand">False</property> | 838 | <property name="expand">False</property> |
1054 | @@ -779,8 +843,78 @@ | |||
1055 | 779 | </object> | 843 | </object> |
1056 | 780 | <packing> | 844 | <packing> |
1057 | 781 | <property name="expand">False</property> | 845 | <property name="expand">False</property> |
1058 | 846 | <property name="fill">True</property> | ||
1059 | 782 | <property name="position">1</property> | 847 | <property name="position">1</property> |
1060 | 783 | </packing> | 848 | </packing> |
1061 | 784 | </child> | 849 | </child> |
1062 | 785 | </object> | 850 | </object> |
1063 | 851 | <object class="GtkWindow" id="window"> | ||
1064 | 852 | <property name="can_focus">False</property> | ||
1065 | 853 | <property name="border_width">10</property> | ||
1066 | 854 | <property name="window_position">center</property> | ||
1067 | 855 | <signal name="delete-event" handler="on_close_clicked" swapped="no"/> | ||
1068 | 856 | <child> | ||
1069 | 857 | <object class="GtkVBox" id="window_vbox"> | ||
1070 | 858 | <property name="visible">True</property> | ||
1071 | 859 | <property name="can_focus">False</property> | ||
1072 | 860 | <property name="spacing">5</property> | ||
1073 | 861 | <child> | ||
1074 | 862 | <object class="GtkLabel" id="header_label"> | ||
1075 | 863 | <property name="visible">True</property> | ||
1076 | 864 | <property name="can_focus">False</property> | ||
1077 | 865 | <property name="xalign">0</property> | ||
1078 | 866 | <property name="label" translatable="yes">Header Label </property> | ||
1079 | 867 | <property name="wrap">True</property> | ||
1080 | 868 | </object> | ||
1081 | 869 | <packing> | ||
1082 | 870 | <property name="expand">False</property> | ||
1083 | 871 | <property name="fill">True</property> | ||
1084 | 872 | <property name="padding">5</property> | ||
1085 | 873 | <property name="position">0</property> | ||
1086 | 874 | </packing> | ||
1087 | 875 | </child> | ||
1088 | 876 | <child> | ||
1089 | 877 | <object class="GtkLabel" id="help_label"> | ||
1090 | 878 | <property name="visible">True</property> | ||
1091 | 879 | <property name="can_focus">False</property> | ||
1092 | 880 | <property name="xalign">0</property> | ||
1093 | 881 | <property name="label" translatable="yes">help label</property> | ||
1094 | 882 | <property name="wrap">True</property> | ||
1095 | 883 | </object> | ||
1096 | 884 | <packing> | ||
1097 | 885 | <property name="expand">False</property> | ||
1098 | 886 | <property name="fill">True</property> | ||
1099 | 887 | <property name="position">1</property> | ||
1100 | 888 | </packing> | ||
1101 | 889 | </child> | ||
1102 | 890 | <child> | ||
1103 | 891 | <object class="GtkLabel" id="warning_label"> | ||
1104 | 892 | <property name="visible">True</property> | ||
1105 | 893 | <property name="can_focus">False</property> | ||
1106 | 894 | <property name="xalign">0</property> | ||
1107 | 895 | <property name="label" translatable="yes">warning label</property> | ||
1108 | 896 | <property name="wrap">True</property> | ||
1109 | 897 | </object> | ||
1110 | 898 | <packing> | ||
1111 | 899 | <property name="expand">False</property> | ||
1112 | 900 | <property name="fill">True</property> | ||
1113 | 901 | <property name="position">2</property> | ||
1114 | 902 | </packing> | ||
1115 | 903 | </child> | ||
1116 | 904 | <child> | ||
1117 | 905 | <object class="GtkNotebook" id="content"> | ||
1118 | 906 | <property name="visible">True</property> | ||
1119 | 907 | <property name="can_focus">True</property> | ||
1120 | 908 | <property name="show_tabs">False</property> | ||
1121 | 909 | <property name="show_border">False</property> | ||
1122 | 910 | </object> | ||
1123 | 911 | <packing> | ||
1124 | 912 | <property name="expand">True</property> | ||
1125 | 913 | <property name="fill">True</property> | ||
1126 | 914 | <property name="position">3</property> | ||
1127 | 915 | </packing> | ||
1128 | 916 | </child> | ||
1129 | 917 | </object> | ||
1130 | 918 | </child> | ||
1131 | 919 | </object> | ||
1132 | 786 | </interface> | 920 | </interface> |
1133 | 787 | 921 | ||
1134 | === modified file 'data/qt/choose_sign_in.ui' | |||
1135 | --- data/qt/choose_sign_in.ui 2011-04-05 14:04:50 +0000 | |||
1136 | +++ data/qt/choose_sign_in.ui 2012-02-14 22:04:20 +0000 | |||
1137 | @@ -1,32 +1,103 @@ | |||
1138 | 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
1139 | 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
1140 | 3 | <class>ChooseSignInPage</class> | 3 | <class>ChooseSignInPage</class> |
1142 | 4 | <widget class="QWizardPage" name="ChooseSingInPage"> | 4 | <widget class="QWizardPage" name="ChooseSignInPage"> |
1143 | 5 | <property name="geometry"> | 5 | <property name="geometry"> |
1144 | 6 | <rect> | 6 | <rect> |
1145 | 7 | <x>0</x> | 7 | <x>0</x> |
1146 | 8 | <y>0</y> | 8 | <y>0</y> |
1149 | 9 | <width>400</width> | 9 | <width>432</width> |
1150 | 10 | <height>300</height> | 10 | <height>387</height> |
1151 | 11 | </rect> | 11 | </rect> |
1152 | 12 | </property> | 12 | </property> |
1153 | 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
1154 | 14 | <string>WizardPage</string> | 14 | <string>WizardPage</string> |
1155 | 15 | </property> | 15 | </property> |
1159 | 16 | <layout class="QHBoxLayout" name="horizontalLayout"> | 16 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
1160 | 17 | <item> | 17 | <property name="leftMargin"> |
1161 | 18 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | 18 | <number>0</number> |
1162 | 19 | </property> | ||
1163 | 20 | <property name="topMargin"> | ||
1164 | 21 | <number>0</number> | ||
1165 | 22 | </property> | ||
1166 | 23 | <property name="rightMargin"> | ||
1167 | 24 | <number>0</number> | ||
1168 | 25 | </property> | ||
1169 | 26 | <item> | ||
1170 | 27 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1171 | 28 | <item> | ||
1172 | 29 | <widget class="QLabel" name="image_label"> | ||
1173 | 30 | <property name="sizePolicy"> | ||
1174 | 31 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1175 | 32 | <horstretch>0</horstretch> | ||
1176 | 33 | <verstretch>0</verstretch> | ||
1177 | 34 | </sizepolicy> | ||
1178 | 35 | </property> | ||
1179 | 36 | <property name="minimumSize"> | ||
1180 | 37 | <size> | ||
1181 | 38 | <width>400</width> | ||
1182 | 39 | <height>150</height> | ||
1183 | 40 | </size> | ||
1184 | 41 | </property> | ||
1185 | 42 | <property name="text"> | ||
1186 | 43 | <string/> | ||
1187 | 44 | </property> | ||
1188 | 45 | <property name="textFormat"> | ||
1189 | 46 | <enum>Qt::PlainText</enum> | ||
1190 | 47 | </property> | ||
1191 | 48 | <property name="alignment"> | ||
1192 | 49 | <set>Qt::AlignCenter</set> | ||
1193 | 50 | </property> | ||
1194 | 51 | <property name="wordWrap"> | ||
1195 | 52 | <bool>true</bool> | ||
1196 | 53 | </property> | ||
1197 | 54 | </widget> | ||
1198 | 55 | </item> | ||
1199 | 56 | </layout> | ||
1200 | 57 | </item> | ||
1201 | 58 | <item> | ||
1202 | 59 | <widget class="QLabel" name="message_label"> | ||
1203 | 60 | <property name="font"> | ||
1204 | 61 | <font> | ||
1205 | 62 | <pointsize>11</pointsize> | ||
1206 | 63 | <weight>50</weight> | ||
1207 | 64 | <bold>false</bold> | ||
1208 | 65 | </font> | ||
1209 | 66 | </property> | ||
1210 | 67 | <property name="text"> | ||
1211 | 68 | <string>Congratulations, app_name is installed!</string> | ||
1212 | 69 | </property> | ||
1213 | 70 | <property name="alignment"> | ||
1214 | 71 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | ||
1215 | 72 | </property> | ||
1216 | 73 | </widget> | ||
1217 | 74 | </item> | ||
1218 | 75 | <item> | ||
1219 | 76 | <spacer name="verticalSpacer_3"> | ||
1220 | 77 | <property name="orientation"> | ||
1221 | 78 | <enum>Qt::Vertical</enum> | ||
1222 | 79 | </property> | ||
1223 | 80 | <property name="sizeType"> | ||
1224 | 81 | <enum>QSizePolicy::Fixed</enum> | ||
1225 | 82 | </property> | ||
1226 | 83 | <property name="sizeHint" stdset="0"> | ||
1227 | 84 | <size> | ||
1228 | 85 | <width>20</width> | ||
1229 | 86 | <height>30</height> | ||
1230 | 87 | </size> | ||
1231 | 88 | </property> | ||
1232 | 89 | </spacer> | ||
1233 | 90 | </item> | ||
1234 | 91 | <item> | ||
1235 | 92 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
1236 | 19 | <item> | 93 | <item> |
1237 | 20 | <spacer name="horizontalSpacer_2"> | 94 | <spacer name="horizontalSpacer_2"> |
1238 | 21 | <property name="orientation"> | 95 | <property name="orientation"> |
1239 | 22 | <enum>Qt::Horizontal</enum> | 96 | <enum>Qt::Horizontal</enum> |
1240 | 23 | </property> | 97 | </property> |
1241 | 24 | <property name="sizeType"> | ||
1242 | 25 | <enum>QSizePolicy::Expanding</enum> | ||
1243 | 26 | </property> | ||
1244 | 27 | <property name="sizeHint" stdset="0"> | 98 | <property name="sizeHint" stdset="0"> |
1245 | 28 | <size> | 99 | <size> |
1247 | 29 | <width>40</width> | 100 | <width>20</width> |
1248 | 30 | <height>20</height> | 101 | <height>20</height> |
1249 | 31 | </size> | 102 | </size> |
1250 | 32 | </property> | 103 | </property> |
1251 | @@ -35,44 +106,11 @@ | |||
1252 | 35 | <item> | 106 | <item> |
1253 | 36 | <layout class="QVBoxLayout" name="verticalLayout"> | 107 | <layout class="QVBoxLayout" name="verticalLayout"> |
1254 | 37 | <item> | 108 | <item> |
1293 | 38 | <spacer name="verticalSpacer_3"> | 109 | <widget class="QPushButton" name="existing_account_button"> |
1294 | 39 | <property name="orientation"> | 110 | <property name="text"> |
1295 | 40 | <enum>Qt::Vertical</enum> | 111 | <string/> |
1296 | 41 | </property> | 112 | </property> |
1297 | 42 | <property name="sizeHint" stdset="0"> | 113 | </widget> |
1260 | 43 | <size> | ||
1261 | 44 | <width>20</width> | ||
1262 | 45 | <height>40</height> | ||
1263 | 46 | </size> | ||
1264 | 47 | </property> | ||
1265 | 48 | </spacer> | ||
1266 | 49 | </item> | ||
1267 | 50 | <item> | ||
1268 | 51 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1269 | 52 | <item> | ||
1270 | 53 | <widget class="QPushButton" name="existing_account_button"> | ||
1271 | 54 | <property name="text"> | ||
1272 | 55 | <string/> | ||
1273 | 56 | </property> | ||
1274 | 57 | </widget> | ||
1275 | 58 | </item> | ||
1276 | 59 | </layout> | ||
1277 | 60 | </item> | ||
1278 | 61 | <item> | ||
1279 | 62 | <spacer name="verticalSpacer"> | ||
1280 | 63 | <property name="orientation"> | ||
1281 | 64 | <enum>Qt::Vertical</enum> | ||
1282 | 65 | </property> | ||
1283 | 66 | <property name="sizeType"> | ||
1284 | 67 | <enum>QSizePolicy::Fixed</enum> | ||
1285 | 68 | </property> | ||
1286 | 69 | <property name="sizeHint" stdset="0"> | ||
1287 | 70 | <size> | ||
1288 | 71 | <width>20</width> | ||
1289 | 72 | <height>10</height> | ||
1290 | 73 | </size> | ||
1291 | 74 | </property> | ||
1292 | 75 | </spacer> | ||
1298 | 76 | </item> | 114 | </item> |
1299 | 77 | <item> | 115 | <item> |
1300 | 78 | <widget class="QPushButton" name="setup_account_button"> | 116 | <widget class="QPushButton" name="setup_account_button"> |
1301 | @@ -82,17 +120,11 @@ | |||
1302 | 82 | </widget> | 120 | </widget> |
1303 | 83 | </item> | 121 | </item> |
1304 | 84 | <item> | 122 | <item> |
1316 | 85 | <spacer name="verticalSpacer_2"> | 123 | <widget class="QPushButton" name="cancel_button"> |
1317 | 86 | <property name="orientation"> | 124 | <property name="text"> |
1318 | 87 | <enum>Qt::Vertical</enum> | 125 | <string/> |
1319 | 88 | </property> | 126 | </property> |
1320 | 89 | <property name="sizeHint" stdset="0"> | 127 | </widget> |
1310 | 90 | <size> | ||
1311 | 91 | <width>20</width> | ||
1312 | 92 | <height>40</height> | ||
1313 | 93 | </size> | ||
1314 | 94 | </property> | ||
1315 | 95 | </spacer> | ||
1321 | 96 | </item> | 128 | </item> |
1322 | 97 | </layout> | 129 | </layout> |
1323 | 98 | </item> | 130 | </item> |
1324 | @@ -106,7 +138,7 @@ | |||
1325 | 106 | </property> | 138 | </property> |
1326 | 107 | <property name="sizeHint" stdset="0"> | 139 | <property name="sizeHint" stdset="0"> |
1327 | 108 | <size> | 140 | <size> |
1329 | 109 | <width>40</width> | 141 | <width>20</width> |
1330 | 110 | <height>20</height> | 142 | <height>20</height> |
1331 | 111 | </size> | 143 | </size> |
1332 | 112 | </property> | 144 | </property> |
1333 | @@ -114,8 +146,20 @@ | |||
1334 | 114 | </item> | 146 | </item> |
1335 | 115 | </layout> | 147 | </layout> |
1336 | 116 | </item> | 148 | </item> |
1337 | 149 | <item> | ||
1338 | 150 | <spacer name="verticalSpacer_2"> | ||
1339 | 151 | <property name="orientation"> | ||
1340 | 152 | <enum>Qt::Vertical</enum> | ||
1341 | 153 | </property> | ||
1342 | 154 | <property name="sizeHint" stdset="0"> | ||
1343 | 155 | <size> | ||
1344 | 156 | <width>20</width> | ||
1345 | 157 | <height>50</height> | ||
1346 | 158 | </size> | ||
1347 | 159 | </property> | ||
1348 | 160 | </spacer> | ||
1349 | 161 | </item> | ||
1350 | 117 | </layout> | 162 | </layout> |
1351 | 118 | </widget> | 163 | </widget> |
1352 | 119 | <resources/> | ||
1353 | 120 | <connections/> | 164 | <connections/> |
1354 | 121 | </ui> | 165 | </ui> |
1355 | 122 | 166 | ||
1356 | === added file 'data/qt/loadingoverlay.ui' | |||
1357 | --- data/qt/loadingoverlay.ui 1970-01-01 00:00:00 +0000 | |||
1358 | +++ data/qt/loadingoverlay.ui 2012-02-14 22:04:20 +0000 | |||
1359 | @@ -0,0 +1,103 @@ | |||
1360 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1361 | 2 | <ui version="4.0"> | ||
1362 | 3 | <class>Form</class> | ||
1363 | 4 | <widget class="QFrame" name="Form"> | ||
1364 | 5 | <property name="geometry"> | ||
1365 | 6 | <rect> | ||
1366 | 7 | <x>0</x> | ||
1367 | 8 | <y>0</y> | ||
1368 | 9 | <width>702</width> | ||
1369 | 10 | <height>230</height> | ||
1370 | 11 | </rect> | ||
1371 | 12 | </property> | ||
1372 | 13 | <property name="windowTitle"> | ||
1373 | 14 | <string>Frame</string> | ||
1374 | 15 | </property> | ||
1375 | 16 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
1376 | 17 | <property name="topMargin"> | ||
1377 | 18 | <number>30</number> | ||
1378 | 19 | </property> | ||
1379 | 20 | <item> | ||
1380 | 21 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1381 | 22 | <item> | ||
1382 | 23 | <spacer name="horizontalSpacer_2"> | ||
1383 | 24 | <property name="orientation"> | ||
1384 | 25 | <enum>Qt::Horizontal</enum> | ||
1385 | 26 | </property> | ||
1386 | 27 | <property name="sizeHint" stdset="0"> | ||
1387 | 28 | <size> | ||
1388 | 29 | <width>40</width> | ||
1389 | 30 | <height>20</height> | ||
1390 | 31 | </size> | ||
1391 | 32 | </property> | ||
1392 | 33 | </spacer> | ||
1393 | 34 | </item> | ||
1394 | 35 | <item> | ||
1395 | 36 | <widget class="QFrame" name="frm_box"> | ||
1396 | 37 | <property name="minimumSize"> | ||
1397 | 38 | <size> | ||
1398 | 39 | <width>0</width> | ||
1399 | 40 | <height>102</height> | ||
1400 | 41 | </size> | ||
1401 | 42 | </property> | ||
1402 | 43 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
1403 | 44 | <property name="topMargin"> | ||
1404 | 45 | <number>0</number> | ||
1405 | 46 | </property> | ||
1406 | 47 | <property name="bottomMargin"> | ||
1407 | 48 | <number>30</number> | ||
1408 | 49 | </property> | ||
1409 | 50 | <item> | ||
1410 | 51 | <widget class="QLabel" name="label"> | ||
1411 | 52 | <property name="sizePolicy"> | ||
1412 | 53 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1413 | 54 | <horstretch>0</horstretch> | ||
1414 | 55 | <verstretch>0</verstretch> | ||
1415 | 56 | </sizepolicy> | ||
1416 | 57 | </property> | ||
1417 | 58 | <property name="font"> | ||
1418 | 59 | <font> | ||
1419 | 60 | <pointsize>14</pointsize> | ||
1420 | 61 | </font> | ||
1421 | 62 | </property> | ||
1422 | 63 | <property name="text"> | ||
1423 | 64 | <string>Getting information, please wait...</string> | ||
1424 | 65 | </property> | ||
1425 | 66 | </widget> | ||
1426 | 67 | </item> | ||
1427 | 68 | </layout> | ||
1428 | 69 | </widget> | ||
1429 | 70 | </item> | ||
1430 | 71 | <item> | ||
1431 | 72 | <spacer name="horizontalSpacer"> | ||
1432 | 73 | <property name="orientation"> | ||
1433 | 74 | <enum>Qt::Horizontal</enum> | ||
1434 | 75 | </property> | ||
1435 | 76 | <property name="sizeHint" stdset="0"> | ||
1436 | 77 | <size> | ||
1437 | 78 | <width>40</width> | ||
1438 | 79 | <height>20</height> | ||
1439 | 80 | </size> | ||
1440 | 81 | </property> | ||
1441 | 82 | </spacer> | ||
1442 | 83 | </item> | ||
1443 | 84 | </layout> | ||
1444 | 85 | </item> | ||
1445 | 86 | <item> | ||
1446 | 87 | <spacer name="verticalSpacer"> | ||
1447 | 88 | <property name="orientation"> | ||
1448 | 89 | <enum>Qt::Vertical</enum> | ||
1449 | 90 | </property> | ||
1450 | 91 | <property name="sizeHint" stdset="0"> | ||
1451 | 92 | <size> | ||
1452 | 93 | <width>20</width> | ||
1453 | 94 | <height>20</height> | ||
1454 | 95 | </size> | ||
1455 | 96 | </property> | ||
1456 | 97 | </spacer> | ||
1457 | 98 | </item> | ||
1458 | 99 | </layout> | ||
1459 | 100 | </widget> | ||
1460 | 101 | <resources/> | ||
1461 | 102 | <connections/> | ||
1462 | 103 | </ui> | ||
1463 | 0 | 104 | ||
1464 | === added file 'data/qt/network_detection.ui' | |||
1465 | --- data/qt/network_detection.ui 1970-01-01 00:00:00 +0000 | |||
1466 | +++ data/qt/network_detection.ui 2012-02-14 22:04:20 +0000 | |||
1467 | @@ -0,0 +1,142 @@ | |||
1468 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1469 | 2 | <ui version="4.0"> | ||
1470 | 3 | <class>Form</class> | ||
1471 | 4 | <widget class="QWizardPage" name="Form"> | ||
1472 | 5 | <property name="geometry"> | ||
1473 | 6 | <rect> | ||
1474 | 7 | <x>0</x> | ||
1475 | 8 | <y>0</y> | ||
1476 | 9 | <width>541</width> | ||
1477 | 10 | <height>365</height> | ||
1478 | 11 | </rect> | ||
1479 | 12 | </property> | ||
1480 | 13 | <property name="windowTitle"> | ||
1481 | 14 | <string>WizardPage</string> | ||
1482 | 15 | </property> | ||
1483 | 16 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
1484 | 17 | <item> | ||
1485 | 18 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1486 | 19 | <item> | ||
1487 | 20 | <spacer name="horizontalSpacer_3"> | ||
1488 | 21 | <property name="orientation"> | ||
1489 | 22 | <enum>Qt::Horizontal</enum> | ||
1490 | 23 | </property> | ||
1491 | 24 | <property name="sizeHint" stdset="0"> | ||
1492 | 25 | <size> | ||
1493 | 26 | <width>40</width> | ||
1494 | 27 | <height>20</height> | ||
1495 | 28 | </size> | ||
1496 | 29 | </property> | ||
1497 | 30 | </spacer> | ||
1498 | 31 | </item> | ||
1499 | 32 | <item> | ||
1500 | 33 | <widget class="QLabel" name="image_label"> | ||
1501 | 34 | <property name="sizePolicy"> | ||
1502 | 35 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1503 | 36 | <horstretch>0</horstretch> | ||
1504 | 37 | <verstretch>0</verstretch> | ||
1505 | 38 | </sizepolicy> | ||
1506 | 39 | </property> | ||
1507 | 40 | <property name="minimumSize"> | ||
1508 | 41 | <size> | ||
1509 | 42 | <width>400</width> | ||
1510 | 43 | <height>150</height> | ||
1511 | 44 | </size> | ||
1512 | 45 | </property> | ||
1513 | 46 | <property name="text"> | ||
1514 | 47 | <string/> | ||
1515 | 48 | </property> | ||
1516 | 49 | <property name="textFormat"> | ||
1517 | 50 | <enum>Qt::PlainText</enum> | ||
1518 | 51 | </property> | ||
1519 | 52 | <property name="alignment"> | ||
1520 | 53 | <set>Qt::AlignCenter</set> | ||
1521 | 54 | </property> | ||
1522 | 55 | <property name="wordWrap"> | ||
1523 | 56 | <bool>true</bool> | ||
1524 | 57 | </property> | ||
1525 | 58 | </widget> | ||
1526 | 59 | </item> | ||
1527 | 60 | <item> | ||
1528 | 61 | <spacer name="horizontalSpacer_4"> | ||
1529 | 62 | <property name="orientation"> | ||
1530 | 63 | <enum>Qt::Horizontal</enum> | ||
1531 | 64 | </property> | ||
1532 | 65 | <property name="sizeHint" stdset="0"> | ||
1533 | 66 | <size> | ||
1534 | 67 | <width>40</width> | ||
1535 | 68 | <height>20</height> | ||
1536 | 69 | </size> | ||
1537 | 70 | </property> | ||
1538 | 71 | </spacer> | ||
1539 | 72 | </item> | ||
1540 | 73 | </layout> | ||
1541 | 74 | </item> | ||
1542 | 75 | <item> | ||
1543 | 76 | <widget class="QLabel" name="message_label"> | ||
1544 | 77 | <property name="alignment"> | ||
1545 | 78 | <set>Qt::AlignCenter</set> | ||
1546 | 79 | </property> | ||
1547 | 80 | </widget> | ||
1548 | 81 | </item> | ||
1549 | 82 | <item> | ||
1550 | 83 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
1551 | 84 | <item> | ||
1552 | 85 | <spacer name="horizontalSpacer"> | ||
1553 | 86 | <property name="orientation"> | ||
1554 | 87 | <enum>Qt::Horizontal</enum> | ||
1555 | 88 | </property> | ||
1556 | 89 | <property name="sizeHint" stdset="0"> | ||
1557 | 90 | <size> | ||
1558 | 91 | <width>40</width> | ||
1559 | 92 | <height>20</height> | ||
1560 | 93 | </size> | ||
1561 | 94 | </property> | ||
1562 | 95 | </spacer> | ||
1563 | 96 | </item> | ||
1564 | 97 | <item> | ||
1565 | 98 | <widget class="QLabel" name="label"> | ||
1566 | 99 | <property name="text"> | ||
1567 | 100 | <string>Are you online? We can't detect an internet connection - you will need to be connected to set up Ubuntu Single Sign On</string> | ||
1568 | 101 | </property> | ||
1569 | 102 | <property name="textFormat"> | ||
1570 | 103 | <enum>Qt::PlainText</enum> | ||
1571 | 104 | </property> | ||
1572 | 105 | <property name="wordWrap"> | ||
1573 | 106 | <bool>true</bool> | ||
1574 | 107 | </property> | ||
1575 | 108 | </widget> | ||
1576 | 109 | </item> | ||
1577 | 110 | <item> | ||
1578 | 111 | <spacer name="horizontalSpacer_2"> | ||
1579 | 112 | <property name="orientation"> | ||
1580 | 113 | <enum>Qt::Horizontal</enum> | ||
1581 | 114 | </property> | ||
1582 | 115 | <property name="sizeHint" stdset="0"> | ||
1583 | 116 | <size> | ||
1584 | 117 | <width>40</width> | ||
1585 | 118 | <height>20</height> | ||
1586 | 119 | </size> | ||
1587 | 120 | </property> | ||
1588 | 121 | </spacer> | ||
1589 | 122 | </item> | ||
1590 | 123 | </layout> | ||
1591 | 124 | </item> | ||
1592 | 125 | <item> | ||
1593 | 126 | <spacer name="verticalSpacer"> | ||
1594 | 127 | <property name="orientation"> | ||
1595 | 128 | <enum>Qt::Vertical</enum> | ||
1596 | 129 | </property> | ||
1597 | 130 | <property name="sizeHint" stdset="0"> | ||
1598 | 131 | <size> | ||
1599 | 132 | <width>20</width> | ||
1600 | 133 | <height>76</height> | ||
1601 | 134 | </size> | ||
1602 | 135 | </property> | ||
1603 | 136 | </spacer> | ||
1604 | 137 | </item> | ||
1605 | 138 | </layout> | ||
1606 | 139 | </widget> | ||
1607 | 140 | <resources/> | ||
1608 | 141 | <connections/> | ||
1609 | 142 | </ui> | ||
1610 | 0 | 143 | ||
1611 | === added file 'data/qt/proxy_credentials_dialog.ui' | |||
1612 | --- data/qt/proxy_credentials_dialog.ui 1970-01-01 00:00:00 +0000 | |||
1613 | +++ data/qt/proxy_credentials_dialog.ui 2012-02-14 22:04:20 +0000 | |||
1614 | @@ -0,0 +1,316 @@ | |||
1615 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1616 | 2 | <ui version="4.0"> | ||
1617 | 3 | <class>ProxyCredsDialog</class> | ||
1618 | 4 | <widget class="QDialog" name="ProxyCredsDialog"> | ||
1619 | 5 | <property name="windowModality"> | ||
1620 | 6 | <enum>Qt::NonModal</enum> | ||
1621 | 7 | </property> | ||
1622 | 8 | <property name="geometry"> | ||
1623 | 9 | <rect> | ||
1624 | 10 | <x>0</x> | ||
1625 | 11 | <y>0</y> | ||
1626 | 12 | <width>550</width> | ||
1627 | 13 | <height>364</height> | ||
1628 | 14 | </rect> | ||
1629 | 15 | </property> | ||
1630 | 16 | <property name="sizePolicy"> | ||
1631 | 17 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1632 | 18 | <horstretch>0</horstretch> | ||
1633 | 19 | <verstretch>0</verstretch> | ||
1634 | 20 | </sizepolicy> | ||
1635 | 21 | </property> | ||
1636 | 22 | <property name="minimumSize"> | ||
1637 | 23 | <size> | ||
1638 | 24 | <width>502</width> | ||
1639 | 25 | <height>0</height> | ||
1640 | 26 | </size> | ||
1641 | 27 | </property> | ||
1642 | 28 | <property name="windowTitle"> | ||
1643 | 29 | <string>Add proxy settings</string> | ||
1644 | 30 | </property> | ||
1645 | 31 | <property name="sizeGripEnabled"> | ||
1646 | 32 | <bool>false</bool> | ||
1647 | 33 | </property> | ||
1648 | 34 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
1649 | 35 | <property name="sizeConstraint"> | ||
1650 | 36 | <enum>QLayout::SetFixedSize</enum> | ||
1651 | 37 | </property> | ||
1652 | 38 | <item> | ||
1653 | 39 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
1654 | 40 | <property name="spacing"> | ||
1655 | 41 | <number>24</number> | ||
1656 | 42 | </property> | ||
1657 | 43 | <item> | ||
1658 | 44 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
1659 | 45 | <property name="spacing"> | ||
1660 | 46 | <number>12</number> | ||
1661 | 47 | </property> | ||
1662 | 48 | <item> | ||
1663 | 49 | <layout class="QVBoxLayout" name="verticalLayout_4"> | ||
1664 | 50 | <property name="spacing"> | ||
1665 | 51 | <number>0</number> | ||
1666 | 52 | </property> | ||
1667 | 53 | <property name="sizeConstraint"> | ||
1668 | 54 | <enum>QLayout::SetDefaultConstraint</enum> | ||
1669 | 55 | </property> | ||
1670 | 56 | <item> | ||
1671 | 57 | <widget class="QLabel" name="logo_label"> | ||
1672 | 58 | <property name="sizePolicy"> | ||
1673 | 59 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1674 | 60 | <horstretch>0</horstretch> | ||
1675 | 61 | <verstretch>0</verstretch> | ||
1676 | 62 | </sizepolicy> | ||
1677 | 63 | </property> | ||
1678 | 64 | <property name="minimumSize"> | ||
1679 | 65 | <size> | ||
1680 | 66 | <width>48</width> | ||
1681 | 67 | <height>48</height> | ||
1682 | 68 | </size> | ||
1683 | 69 | </property> | ||
1684 | 70 | <property name="maximumSize"> | ||
1685 | 71 | <size> | ||
1686 | 72 | <width>48</width> | ||
1687 | 73 | <height>48</height> | ||
1688 | 74 | </size> | ||
1689 | 75 | </property> | ||
1690 | 76 | <property name="text"> | ||
1691 | 77 | <string>TextLabel</string> | ||
1692 | 78 | </property> | ||
1693 | 79 | </widget> | ||
1694 | 80 | </item> | ||
1695 | 81 | <item> | ||
1696 | 82 | <spacer name="verticalSpacer_4"> | ||
1697 | 83 | <property name="orientation"> | ||
1698 | 84 | <enum>Qt::Vertical</enum> | ||
1699 | 85 | </property> | ||
1700 | 86 | <property name="sizeType"> | ||
1701 | 87 | <enum>QSizePolicy::Expanding</enum> | ||
1702 | 88 | </property> | ||
1703 | 89 | <property name="sizeHint" stdset="0"> | ||
1704 | 90 | <size> | ||
1705 | 91 | <width>0</width> | ||
1706 | 92 | <height>20</height> | ||
1707 | 93 | </size> | ||
1708 | 94 | </property> | ||
1709 | 95 | </spacer> | ||
1710 | 96 | </item> | ||
1711 | 97 | </layout> | ||
1712 | 98 | </item> | ||
1713 | 99 | <item> | ||
1714 | 100 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
1715 | 101 | <property name="spacing"> | ||
1716 | 102 | <number>24</number> | ||
1717 | 103 | </property> | ||
1718 | 104 | <item> | ||
1719 | 105 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
1720 | 106 | <property name="spacing"> | ||
1721 | 107 | <number>24</number> | ||
1722 | 108 | </property> | ||
1723 | 109 | <item> | ||
1724 | 110 | <widget class="QLabel" name="title_label"> | ||
1725 | 111 | <property name="sizePolicy"> | ||
1726 | 112 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
1727 | 113 | <horstretch>0</horstretch> | ||
1728 | 114 | <verstretch>0</verstretch> | ||
1729 | 115 | </sizepolicy> | ||
1730 | 116 | </property> | ||
1731 | 117 | <property name="font"> | ||
1732 | 118 | <font> | ||
1733 | 119 | <pointsize>14</pointsize> | ||
1734 | 120 | <weight>75</weight> | ||
1735 | 121 | <bold>true</bold> | ||
1736 | 122 | </font> | ||
1737 | 123 | </property> | ||
1738 | 124 | <property name="text"> | ||
1739 | 125 | <string>You are connection through a proxy.</string> | ||
1740 | 126 | </property> | ||
1741 | 127 | <property name="wordWrap"> | ||
1742 | 128 | <bool>true</bool> | ||
1743 | 129 | </property> | ||
1744 | 130 | </widget> | ||
1745 | 131 | </item> | ||
1746 | 132 | <item> | ||
1747 | 133 | <widget class="QLabel" name="explanation_label"> | ||
1748 | 134 | <property name="text"> | ||
1749 | 135 | <string>Please provide the login details below, or check your system settings</string> | ||
1750 | 136 | </property> | ||
1751 | 137 | <property name="wordWrap"> | ||
1752 | 138 | <bool>true</bool> | ||
1753 | 139 | </property> | ||
1754 | 140 | </widget> | ||
1755 | 141 | </item> | ||
1756 | 142 | </layout> | ||
1757 | 143 | </item> | ||
1758 | 144 | <item> | ||
1759 | 145 | <widget class="QFrame" name="frame"> | ||
1760 | 146 | <property name="frameShape"> | ||
1761 | 147 | <enum>QFrame::NoFrame</enum> | ||
1762 | 148 | </property> | ||
1763 | 149 | <property name="frameShadow"> | ||
1764 | 150 | <enum>QFrame::Plain</enum> | ||
1765 | 151 | </property> | ||
1766 | 152 | <layout class="QGridLayout" name="gridLayout_2"> | ||
1767 | 153 | <property name="spacing"> | ||
1768 | 154 | <number>12</number> | ||
1769 | 155 | </property> | ||
1770 | 156 | <item row="0" column="0"> | ||
1771 | 157 | <widget class="QLabel" name="connection_label"> | ||
1772 | 158 | <property name="sizePolicy"> | ||
1773 | 159 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
1774 | 160 | <horstretch>0</horstretch> | ||
1775 | 161 | <verstretch>0</verstretch> | ||
1776 | 162 | </sizepolicy> | ||
1777 | 163 | </property> | ||
1778 | 164 | <property name="text"> | ||
1779 | 165 | <string>Connecting to:</string> | ||
1780 | 166 | </property> | ||
1781 | 167 | <property name="alignment"> | ||
1782 | 168 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
1783 | 169 | </property> | ||
1784 | 170 | </widget> | ||
1785 | 171 | </item> | ||
1786 | 172 | <item row="0" column="1"> | ||
1787 | 173 | <widget class="QLabel" name="domain_label"> | ||
1788 | 174 | <property name="text"> | ||
1789 | 175 | <string/> | ||
1790 | 176 | </property> | ||
1791 | 177 | </widget> | ||
1792 | 178 | </item> | ||
1793 | 179 | <item row="4" column="0"> | ||
1794 | 180 | <widget class="QLabel" name="username_label"> | ||
1795 | 181 | <property name="text"> | ||
1796 | 182 | <string>Proxy username:</string> | ||
1797 | 183 | </property> | ||
1798 | 184 | <property name="alignment"> | ||
1799 | 185 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
1800 | 186 | </property> | ||
1801 | 187 | </widget> | ||
1802 | 188 | </item> | ||
1803 | 189 | <item row="4" column="1"> | ||
1804 | 190 | <widget class="QLineEdit" name="username_entry"> | ||
1805 | 191 | <property name="text"> | ||
1806 | 192 | <string/> | ||
1807 | 193 | </property> | ||
1808 | 194 | </widget> | ||
1809 | 195 | </item> | ||
1810 | 196 | <item row="5" column="0"> | ||
1811 | 197 | <widget class="QLabel" name="password_label"> | ||
1812 | 198 | <property name="text"> | ||
1813 | 199 | <string>Proxy password:</string> | ||
1814 | 200 | </property> | ||
1815 | 201 | <property name="alignment"> | ||
1816 | 202 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
1817 | 203 | </property> | ||
1818 | 204 | </widget> | ||
1819 | 205 | </item> | ||
1820 | 206 | <item row="5" column="1"> | ||
1821 | 207 | <widget class="QLineEdit" name="password_entry"> | ||
1822 | 208 | <property name="echoMode"> | ||
1823 | 209 | <enum>QLineEdit::Password</enum> | ||
1824 | 210 | </property> | ||
1825 | 211 | </widget> | ||
1826 | 212 | </item> | ||
1827 | 213 | <item row="1" column="0"> | ||
1828 | 214 | <spacer name="verticalSpacer"> | ||
1829 | 215 | <property name="orientation"> | ||
1830 | 216 | <enum>Qt::Vertical</enum> | ||
1831 | 217 | </property> | ||
1832 | 218 | <property name="sizeType"> | ||
1833 | 219 | <enum>QSizePolicy::Fixed</enum> | ||
1834 | 220 | </property> | ||
1835 | 221 | <property name="sizeHint" stdset="0"> | ||
1836 | 222 | <size> | ||
1837 | 223 | <width>24</width> | ||
1838 | 224 | <height>12</height> | ||
1839 | 225 | </size> | ||
1840 | 226 | </property> | ||
1841 | 227 | </spacer> | ||
1842 | 228 | </item> | ||
1843 | 229 | <item row="2" column="0" colspan="2"> | ||
1844 | 230 | <widget class="QLabel" name="error_label"> | ||
1845 | 231 | <property name="text"> | ||
1846 | 232 | <string>TextLabel</string> | ||
1847 | 233 | </property> | ||
1848 | 234 | <property name="wordWrap"> | ||
1849 | 235 | <bool>false</bool> | ||
1850 | 236 | </property> | ||
1851 | 237 | </widget> | ||
1852 | 238 | </item> | ||
1853 | 239 | <item row="3" column="0"> | ||
1854 | 240 | <spacer name="verticalSpacer_2"> | ||
1855 | 241 | <property name="orientation"> | ||
1856 | 242 | <enum>Qt::Vertical</enum> | ||
1857 | 243 | </property> | ||
1858 | 244 | <property name="sizeType"> | ||
1859 | 245 | <enum>QSizePolicy::Fixed</enum> | ||
1860 | 246 | </property> | ||
1861 | 247 | <property name="sizeHint" stdset="0"> | ||
1862 | 248 | <size> | ||
1863 | 249 | <width>24</width> | ||
1864 | 250 | <height>12</height> | ||
1865 | 251 | </size> | ||
1866 | 252 | </property> | ||
1867 | 253 | </spacer> | ||
1868 | 254 | </item> | ||
1869 | 255 | </layout> | ||
1870 | 256 | </widget> | ||
1871 | 257 | </item> | ||
1872 | 258 | </layout> | ||
1873 | 259 | </item> | ||
1874 | 260 | </layout> | ||
1875 | 261 | </item> | ||
1876 | 262 | <item> | ||
1877 | 263 | <layout class="QHBoxLayout" name="horizontalLayout_5"> | ||
1878 | 264 | <item> | ||
1879 | 265 | <widget class="QPushButton" name="help_button"> | ||
1880 | 266 | <property name="text"> | ||
1881 | 267 | <string>Get Help With Proxies</string> | ||
1882 | 268 | </property> | ||
1883 | 269 | </widget> | ||
1884 | 270 | </item> | ||
1885 | 271 | <item> | ||
1886 | 272 | <spacer name="horizontalSpacer"> | ||
1887 | 273 | <property name="orientation"> | ||
1888 | 274 | <enum>Qt::Horizontal</enum> | ||
1889 | 275 | </property> | ||
1890 | 276 | <property name="sizeHint" stdset="0"> | ||
1891 | 277 | <size> | ||
1892 | 278 | <width>40</width> | ||
1893 | 279 | <height>20</height> | ||
1894 | 280 | </size> | ||
1895 | 281 | </property> | ||
1896 | 282 | </spacer> | ||
1897 | 283 | </item> | ||
1898 | 284 | <item> | ||
1899 | 285 | <widget class="QPushButton" name="cancel_button"> | ||
1900 | 286 | <property name="text"> | ||
1901 | 287 | <string>Cancel and Close</string> | ||
1902 | 288 | </property> | ||
1903 | 289 | </widget> | ||
1904 | 290 | </item> | ||
1905 | 291 | <item> | ||
1906 | 292 | <widget class="QPushButton" name="save_button"> | ||
1907 | 293 | <property name="text"> | ||
1908 | 294 | <string>Save</string> | ||
1909 | 295 | </property> | ||
1910 | 296 | <property name="default"> | ||
1911 | 297 | <bool>true</bool> | ||
1912 | 298 | </property> | ||
1913 | 299 | </widget> | ||
1914 | 300 | </item> | ||
1915 | 301 | </layout> | ||
1916 | 302 | </item> | ||
1917 | 303 | </layout> | ||
1918 | 304 | </item> | ||
1919 | 305 | </layout> | ||
1920 | 306 | </widget> | ||
1921 | 307 | <tabstops> | ||
1922 | 308 | <tabstop>username_entry</tabstop> | ||
1923 | 309 | <tabstop>password_entry</tabstop> | ||
1924 | 310 | <tabstop>save_button</tabstop> | ||
1925 | 311 | <tabstop>cancel_button</tabstop> | ||
1926 | 312 | <tabstop>help_button</tabstop> | ||
1927 | 313 | </tabstops> | ||
1928 | 314 | <resources/> | ||
1929 | 315 | <connections/> | ||
1930 | 316 | </ui> | ||
1931 | 0 | 317 | ||
1932 | === modified file 'data/qt/setup_account.ui' | |||
1933 | --- data/qt/setup_account.ui 2011-09-02 12:53:55 +0000 | |||
1934 | +++ data/qt/setup_account.ui 2012-02-14 22:04:20 +0000 | |||
1935 | @@ -6,275 +6,662 @@ | |||
1936 | 6 | <rect> | 6 | <rect> |
1937 | 7 | <x>0</x> | 7 | <x>0</x> |
1938 | 8 | <y>0</y> | 8 | <y>0</y> |
1941 | 9 | <width>407</width> | 9 | <width>543</width> |
1942 | 10 | <height>572</height> | 10 | <height>523</height> |
1943 | 11 | </rect> | 11 | </rect> |
1944 | 12 | </property> | 12 | </property> |
1945 | 13 | <property name="sizePolicy"> | ||
1946 | 14 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
1947 | 15 | <horstretch>0</horstretch> | ||
1948 | 16 | <verstretch>0</verstretch> | ||
1949 | 17 | </sizepolicy> | ||
1950 | 18 | </property> | ||
1951 | 19 | <property name="maximumSize"> | ||
1952 | 20 | <size> | ||
1953 | 21 | <width>16777215</width> | ||
1954 | 22 | <height>16777215</height> | ||
1955 | 23 | </size> | ||
1956 | 24 | </property> | ||
1957 | 13 | <property name="windowTitle"> | 25 | <property name="windowTitle"> |
1958 | 14 | <string>WizardPage</string> | 26 | <string>WizardPage</string> |
1959 | 15 | </property> | 27 | </property> |
1961 | 16 | <layout class="QVBoxLayout" name="verticalLayout_5"> | 28 | <layout class="QVBoxLayout" name="verticalLayout"> |
1962 | 29 | <property name="spacing"> | ||
1963 | 30 | <number>0</number> | ||
1964 | 31 | </property> | ||
1965 | 32 | <property name="leftMargin"> | ||
1966 | 33 | <number>0</number> | ||
1967 | 34 | </property> | ||
1968 | 17 | <property name="topMargin"> | 35 | <property name="topMargin"> |
1969 | 18 | <number>0</number> | 36 | <number>0</number> |
1970 | 19 | </property> | 37 | </property> |
1971 | 38 | <property name="rightMargin"> | ||
1972 | 39 | <number>3</number> | ||
1973 | 40 | </property> | ||
1974 | 41 | <property name="bottomMargin"> | ||
1975 | 42 | <number>0</number> | ||
1976 | 43 | </property> | ||
1977 | 20 | <item> | 44 | <item> |
2219 | 21 | <layout class="QVBoxLayout" name="verticalLayout"> | 45 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="310,220"> |
2220 | 22 | <item> | 46 | <item row="0" column="0"> |
2221 | 23 | <widget class="QFrame" name="_signInFrame"> | 47 | <widget class="QLabel" name="password_info_label"> |
2222 | 24 | <property name="frameShape"> | 48 | <property name="sizePolicy"> |
2223 | 25 | <enum>QFrame::NoFrame</enum> | 49 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> |
2224 | 26 | </property> | 50 | <horstretch>0</horstretch> |
2225 | 27 | <layout class="QVBoxLayout" name="verticalLayout_3"> | 51 | <verstretch>0</verstretch> |
2226 | 28 | <item> | 52 | </sizepolicy> |
2227 | 29 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 53 | </property> |
2228 | 30 | <item> | 54 | <property name="text"> |
2229 | 31 | <widget class="QLabel" name="password_info_label"> | 55 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#dd4814;">refresh</span></a> this page</span></string> |
2230 | 32 | <property name="sizePolicy"> | 56 | </property> |
2231 | 33 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | 57 | <property name="wordWrap"> |
2232 | 34 | <horstretch>0</horstretch> | 58 | <bool>true</bool> |
2233 | 35 | <verstretch>0</verstretch> | 59 | </property> |
2234 | 36 | </sizepolicy> | 60 | </widget> |
2235 | 37 | </property> | 61 | </item> |
2236 | 38 | <property name="text"> | 62 | <item row="1" column="0"> |
2237 | 39 | <string/> | 63 | <layout class="QVBoxLayout" name="verticalLayout"> |
2238 | 40 | </property> | 64 | <property name="spacing"> |
2239 | 41 | <property name="wordWrap"> | 65 | <number>3</number> |
2240 | 42 | <bool>true</bool> | 66 | </property> |
2241 | 43 | </property> | 67 | <item> |
2242 | 44 | </widget> | 68 | <widget class="QLabel" name="name_label"> |
2243 | 45 | </item> | 69 | <property name="font"> |
2244 | 46 | <item> | 70 | <font> |
2245 | 47 | <layout class="QVBoxLayout" name="verticalLayout_4"> | 71 | <weight>75</weight> |
2246 | 48 | <item> | 72 | <bold>true</bold> |
2247 | 49 | <widget class="QLabel" name="name_label"> | 73 | </font> |
2248 | 50 | <property name="text"> | 74 | </property> |
2249 | 51 | <string/> | 75 | <property name="text"> |
2250 | 52 | </property> | 76 | <string>name_label</string> |
2251 | 53 | </widget> | 77 | </property> |
2252 | 54 | </item> | 78 | </widget> |
2253 | 55 | <item> | 79 | </item> |
2254 | 56 | <widget class="QLineEdit" name="name_edit"> | 80 | <item> |
2255 | 57 | <property name="placeholderText"> | 81 | <widget class="QLineEdit" name="name_edit"> |
2256 | 58 | <string/> | 82 | <property name="sizePolicy"> |
2257 | 59 | </property> | 83 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> |
2258 | 60 | </widget> | 84 | <horstretch>0</horstretch> |
2259 | 61 | </item> | 85 | <verstretch>0</verstretch> |
2260 | 62 | <item> | 86 | </sizepolicy> |
2261 | 63 | <widget class="QLabel" name="email_label"> | 87 | </property> |
2262 | 64 | <property name="text"> | 88 | <property name="minimumSize"> |
2263 | 65 | <string/> | 89 | <size> |
2264 | 66 | </property> | 90 | <width>300</width> |
2265 | 67 | </widget> | 91 | <height>0</height> |
2266 | 68 | </item> | 92 | </size> |
2267 | 69 | <item> | 93 | </property> |
2268 | 70 | <widget class="QLineEdit" name="email_edit"> | 94 | <property name="maximumSize"> |
2269 | 71 | <property name="placeholderText"> | 95 | <size> |
2270 | 72 | <string/> | 96 | <width>300</width> |
2271 | 73 | </property> | 97 | <height>16777215</height> |
2272 | 74 | </widget> | 98 | </size> |
2273 | 75 | </item> | 99 | </property> |
2274 | 76 | <item> | 100 | <property name="font"> |
2275 | 77 | <widget class="QLabel" name="confirm_email_label"> | 101 | <font> |
2276 | 78 | <property name="text"> | 102 | <pointsize>11</pointsize> |
2277 | 79 | <string/> | 103 | </font> |
2278 | 80 | </property> | 104 | </property> |
2279 | 81 | </widget> | 105 | <property name="formError" stdset="0"> |
2280 | 82 | </item> | 106 | <bool>false</bool> |
2281 | 83 | <item> | 107 | </property> |
2282 | 84 | <widget class="QLineEdit" name="confirm_email_edit"> | 108 | </widget> |
2283 | 85 | <property name="placeholderText"> | 109 | </item> |
2284 | 86 | <string/> | 110 | </layout> |
2285 | 87 | </property> | 111 | </item> |
2286 | 88 | </widget> | 112 | <item row="3" column="0"> |
2287 | 89 | </item> | 113 | <layout class="QVBoxLayout" name="verticalLayout"> |
2288 | 90 | <item> | 114 | <property name="spacing"> |
2289 | 91 | <widget class="QLabel" name="password_label"> | 115 | <number>3</number> |
2290 | 92 | <property name="text"> | 116 | </property> |
2291 | 93 | <string/> | 117 | <item> |
2292 | 94 | </property> | 118 | <widget class="QLabel" name="email_label"> |
2293 | 95 | </widget> | 119 | <property name="font"> |
2294 | 96 | </item> | 120 | <font> |
2295 | 97 | <item> | 121 | <weight>75</weight> |
2296 | 98 | <widget class="QLineEdit" name="password_edit"> | 122 | <bold>true</bold> |
2297 | 99 | <property name="toolTip"> | 123 | </font> |
2298 | 100 | <string>Your password must be at least 8 characters long and at least contain one number and one upper later.</string> | 124 | </property> |
2299 | 101 | </property> | 125 | <property name="text"> |
2300 | 102 | <property name="statusTip"> | 126 | <string>email_label</string> |
2301 | 103 | <string/> | 127 | </property> |
2302 | 104 | </property> | 128 | </widget> |
2303 | 105 | <property name="echoMode"> | 129 | </item> |
2304 | 106 | <enum>QLineEdit::Password</enum> | 130 | <item> |
2305 | 107 | </property> | 131 | <widget class="QLineEdit" name="email_edit"> |
2306 | 108 | <property name="placeholderText"> | 132 | <property name="sizePolicy"> |
2307 | 109 | <string/> | 133 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> |
2308 | 110 | </property> | 134 | <horstretch>0</horstretch> |
2309 | 111 | </widget> | 135 | <verstretch>0</verstretch> |
2310 | 112 | </item> | 136 | </sizepolicy> |
2311 | 113 | <item> | 137 | </property> |
2312 | 114 | <widget class="QLabel" name="confirm_password_label"> | 138 | <property name="minimumSize"> |
2313 | 115 | <property name="text"> | 139 | <size> |
2314 | 116 | <string/> | 140 | <width>300</width> |
2315 | 117 | </property> | 141 | <height>0</height> |
2316 | 118 | </widget> | 142 | </size> |
2317 | 119 | </item> | 143 | </property> |
2318 | 120 | <item> | 144 | <property name="maximumSize"> |
2319 | 121 | <widget class="QLineEdit" name="confirm_password_edit"> | 145 | <size> |
2320 | 122 | <property name="echoMode"> | 146 | <width>300</width> |
2321 | 123 | <enum>QLineEdit::Password</enum> | 147 | <height>16777215</height> |
2322 | 124 | </property> | 148 | </size> |
2323 | 125 | <property name="placeholderText"> | 149 | </property> |
2324 | 126 | <string/> | 150 | <property name="font"> |
2325 | 127 | </property> | 151 | <font> |
2326 | 128 | </widget> | 152 | <pointsize>11</pointsize> |
2327 | 129 | </item> | 153 | </font> |
2328 | 130 | </layout> | 154 | </property> |
2329 | 131 | </item> | 155 | <property name="placeholderText"> |
2330 | 132 | <item> | 156 | <string/> |
2331 | 133 | <layout class="QVBoxLayout" name="verticalLayout_9"> | 157 | </property> |
2332 | 134 | <item> | 158 | <property name="formError" stdset="0"> |
2333 | 135 | <widget class="QFrame" name="frame_2"> | 159 | <bool>false</bool> |
2334 | 136 | <property name="sizePolicy"> | 160 | </property> |
2335 | 137 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | 161 | </widget> |
2336 | 138 | <horstretch>0</horstretch> | 162 | </item> |
2337 | 139 | <verstretch>0</verstretch> | 163 | </layout> |
2338 | 140 | </sizepolicy> | 164 | </item> |
2339 | 141 | </property> | 165 | <item row="4" column="0"> |
2340 | 142 | <property name="frameShape"> | 166 | <layout class="QVBoxLayout" name="verticalLayout"> |
2341 | 143 | <enum>QFrame::StyledPanel</enum> | 167 | <property name="spacing"> |
2342 | 144 | </property> | 168 | <number>3</number> |
2343 | 145 | <property name="frameShadow"> | 169 | </property> |
2344 | 146 | <enum>QFrame::Raised</enum> | 170 | <item> |
2345 | 147 | </property> | 171 | <widget class="QLabel" name="confirm_email_label"> |
2346 | 148 | <layout class="QHBoxLayout" name="horizontalLayout_16"> | 172 | <property name="font"> |
2347 | 149 | <property name="leftMargin"> | 173 | <font> |
2348 | 150 | <number>0</number> | 174 | <weight>75</weight> |
2349 | 151 | </property> | 175 | <bold>true</bold> |
2350 | 152 | <item> | 176 | </font> |
2351 | 153 | <widget class="QLabel" name="captcha_view"> | 177 | </property> |
2352 | 154 | <property name="minimumSize"> | 178 | <property name="text"> |
2353 | 155 | <size> | 179 | <string>confirm_email_label</string> |
2354 | 156 | <width>0</width> | 180 | </property> |
2355 | 157 | <height>57</height> | 181 | </widget> |
2356 | 158 | </size> | 182 | </item> |
2357 | 159 | </property> | 183 | <item> |
2358 | 160 | <property name="frameShape"> | 184 | <widget class="QLineEdit" name="confirm_email_edit"> |
2359 | 161 | <enum>QFrame::Box</enum> | 185 | <property name="sizePolicy"> |
2360 | 162 | </property> | 186 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> |
2361 | 163 | <property name="text"> | 187 | <horstretch>0</horstretch> |
2362 | 164 | <string/> | 188 | <verstretch>0</verstretch> |
2363 | 165 | </property> | 189 | </sizepolicy> |
2364 | 166 | </widget> | 190 | </property> |
2365 | 167 | </item> | 191 | <property name="minimumSize"> |
2366 | 168 | <item> | 192 | <size> |
2367 | 169 | <widget class="QLabel" name="refresh_label"> | 193 | <width>300</width> |
2368 | 170 | <property name="sizePolicy"> | 194 | <height>0</height> |
2369 | 171 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | 195 | </size> |
2370 | 172 | <horstretch>0</horstretch> | 196 | </property> |
2371 | 173 | <verstretch>0</verstretch> | 197 | <property name="maximumSize"> |
2372 | 174 | </sizepolicy> | 198 | <size> |
2373 | 175 | </property> | 199 | <width>300</width> |
2374 | 176 | <property name="locale"> | 200 | <height>16777215</height> |
2375 | 177 | <locale language="English" country="UnitedStates"/> | 201 | </size> |
2376 | 178 | </property> | 202 | </property> |
2377 | 179 | <property name="text"> | 203 | <property name="font"> |
2378 | 180 | <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | 204 | <font> |
2379 | 181 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> | 205 | <pointsize>11</pointsize> |
2380 | 182 | p, li { white-space: pre-wrap; } | 206 | </font> |
2381 | 183 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> | 207 | </property> |
2382 | 184 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">If you can't read this then </span><a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a><span style=" font-size:8pt;"> this page</span></p></body></html></string> | 208 | <property name="placeholderText"> |
2383 | 185 | </property> | 209 | <string/> |
2384 | 186 | <property name="wordWrap"> | 210 | </property> |
2385 | 187 | <bool>true</bool> | 211 | <property name="formError" stdset="0"> |
2386 | 188 | </property> | 212 | <bool>false</bool> |
2387 | 189 | </widget> | 213 | </property> |
2388 | 190 | </item> | 214 | </widget> |
2389 | 191 | </layout> | 215 | </item> |
2390 | 192 | </widget> | 216 | </layout> |
2391 | 193 | </item> | 217 | </item> |
2392 | 194 | <item> | 218 | <item row="6" column="0"> |
2393 | 195 | <widget class="QLineEdit" name="captcha_solution_edit"> | 219 | <layout class="QVBoxLayout" name="verticalLayout"> |
2394 | 196 | <property name="locale"> | 220 | <property name="spacing"> |
2395 | 197 | <locale language="English" country="UnitedStates"/> | 221 | <number>3</number> |
2396 | 198 | </property> | 222 | </property> |
2397 | 199 | <property name="inputMask"> | 223 | <item> |
2398 | 200 | <string/> | 224 | <widget class="QLabel" name="password_label"> |
2399 | 201 | </property> | 225 | <property name="font"> |
2400 | 202 | <property name="text"> | 226 | <font> |
2401 | 203 | <string/> | 227 | <weight>75</weight> |
2402 | 204 | </property> | 228 | <bold>true</bold> |
2403 | 205 | <property name="placeholderText"> | 229 | </font> |
2404 | 206 | <string/> | 230 | </property> |
2405 | 207 | </property> | 231 | <property name="text"> |
2406 | 208 | </widget> | 232 | <string>password_label</string> |
2407 | 209 | </item> | 233 | </property> |
2408 | 210 | </layout> | 234 | </widget> |
2409 | 211 | </item> | 235 | </item> |
2410 | 212 | <item> | 236 | <item> |
2411 | 213 | <widget class="QCheckBox" name="terms_checkbox"> | 237 | <widget class="QLineEdit" name="password_edit"> |
2412 | 214 | <property name="text"> | 238 | <property name="sizePolicy"> |
2413 | 215 | <string/> | 239 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> |
2414 | 216 | </property> | 240 | <horstretch>0</horstretch> |
2415 | 217 | </widget> | 241 | <verstretch>0</verstretch> |
2416 | 218 | </item> | 242 | </sizepolicy> |
2417 | 219 | <item> | 243 | </property> |
2418 | 220 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | 244 | <property name="minimumSize"> |
2419 | 221 | <property name="spacing"> | 245 | <size> |
2420 | 222 | <number>0</number> | 246 | <width>300</width> |
2421 | 223 | </property> | 247 | <height>0</height> |
2422 | 224 | <item> | 248 | </size> |
2423 | 225 | <widget class="QPushButton" name="terms_button"> | 249 | </property> |
2424 | 226 | <property name="text"> | 250 | <property name="maximumSize"> |
2425 | 227 | <string/> | 251 | <size> |
2426 | 228 | </property> | 252 | <width>300</width> |
2427 | 229 | </widget> | 253 | <height>16777215</height> |
2428 | 230 | </item> | 254 | </size> |
2429 | 231 | <item> | 255 | </property> |
2430 | 232 | <spacer name="horizontalSpacer_3"> | 256 | <property name="font"> |
2431 | 233 | <property name="orientation"> | 257 | <font> |
2432 | 234 | <enum>Qt::Horizontal</enum> | 258 | <pointsize>11</pointsize> |
2433 | 235 | </property> | 259 | </font> |
2434 | 236 | <property name="sizeHint" stdset="0"> | 260 | </property> |
2435 | 237 | <size> | 261 | <property name="toolTip"> |
2436 | 238 | <width>40</width> | 262 | <string>Your password must be at least 8 characters long and at least contain one number and one upper later.</string> |
2437 | 239 | <height>20</height> | 263 | </property> |
2438 | 240 | </size> | 264 | <property name="statusTip"> |
2439 | 241 | </property> | 265 | <string/> |
2440 | 242 | </spacer> | 266 | </property> |
2441 | 243 | </item> | 267 | <property name="echoMode"> |
2442 | 244 | <item> | 268 | <enum>QLineEdit::Password</enum> |
2443 | 245 | <widget class="QPushButton" name="set_up_button"> | 269 | </property> |
2444 | 246 | <property name="enabled"> | 270 | <property name="placeholderText"> |
2445 | 247 | <bool>false</bool> | 271 | <string/> |
2446 | 248 | </property> | 272 | </property> |
2447 | 249 | <property name="text"> | 273 | <property name="formError" stdset="0"> |
2448 | 250 | <string/> | 274 | <bool>false</bool> |
2449 | 251 | </property> | 275 | </property> |
2450 | 252 | </widget> | 276 | </widget> |
2451 | 253 | </item> | 277 | </item> |
2452 | 254 | </layout> | 278 | </layout> |
2453 | 255 | </item> | 279 | </item> |
2454 | 256 | </layout> | 280 | <item row="7" column="0"> |
2455 | 257 | </item> | 281 | <layout class="QVBoxLayout" name="verticalLayout"> |
2456 | 258 | </layout> | 282 | <property name="spacing"> |
2457 | 259 | </widget> | 283 | <number>3</number> |
2458 | 260 | </item> | 284 | </property> |
2459 | 261 | <item> | 285 | <item> |
2460 | 286 | <widget class="QLabel" name="confirm_password_label"> | ||
2461 | 287 | <property name="font"> | ||
2462 | 288 | <font> | ||
2463 | 289 | <weight>75</weight> | ||
2464 | 290 | <bold>true</bold> | ||
2465 | 291 | </font> | ||
2466 | 292 | </property> | ||
2467 | 293 | <property name="text"> | ||
2468 | 294 | <string>confirm_password_label</string> | ||
2469 | 295 | </property> | ||
2470 | 296 | </widget> | ||
2471 | 297 | </item> | ||
2472 | 298 | <item> | ||
2473 | 299 | <widget class="QLineEdit" name="confirm_password_edit"> | ||
2474 | 300 | <property name="sizePolicy"> | ||
2475 | 301 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
2476 | 302 | <horstretch>0</horstretch> | ||
2477 | 303 | <verstretch>0</verstretch> | ||
2478 | 304 | </sizepolicy> | ||
2479 | 305 | </property> | ||
2480 | 306 | <property name="minimumSize"> | ||
2481 | 307 | <size> | ||
2482 | 308 | <width>300</width> | ||
2483 | 309 | <height>0</height> | ||
2484 | 310 | </size> | ||
2485 | 311 | </property> | ||
2486 | 312 | <property name="maximumSize"> | ||
2487 | 313 | <size> | ||
2488 | 314 | <width>300</width> | ||
2489 | 315 | <height>16777215</height> | ||
2490 | 316 | </size> | ||
2491 | 317 | </property> | ||
2492 | 318 | <property name="font"> | ||
2493 | 319 | <font> | ||
2494 | 320 | <pointsize>11</pointsize> | ||
2495 | 321 | </font> | ||
2496 | 322 | </property> | ||
2497 | 323 | <property name="echoMode"> | ||
2498 | 324 | <enum>QLineEdit::Password</enum> | ||
2499 | 325 | </property> | ||
2500 | 326 | <property name="placeholderText"> | ||
2501 | 327 | <string/> | ||
2502 | 328 | </property> | ||
2503 | 329 | <property name="formError" stdset="0"> | ||
2504 | 330 | <bool>false</bool> | ||
2505 | 331 | </property> | ||
2506 | 332 | </widget> | ||
2507 | 333 | </item> | ||
2508 | 334 | </layout> | ||
2509 | 335 | </item> | ||
2510 | 336 | <item row="9" column="0"> | ||
2511 | 337 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
2512 | 338 | <property name="spacing"> | ||
2513 | 339 | <number>3</number> | ||
2514 | 340 | </property> | ||
2515 | 341 | <item> | ||
2516 | 342 | <widget class="QLabel" name="captcha_view"> | ||
2517 | 343 | <property name="sizePolicy"> | ||
2518 | 344 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
2519 | 345 | <horstretch>0</horstretch> | ||
2520 | 346 | <verstretch>0</verstretch> | ||
2521 | 347 | </sizepolicy> | ||
2522 | 348 | </property> | ||
2523 | 349 | <property name="minimumSize"> | ||
2524 | 350 | <size> | ||
2525 | 351 | <width>300</width> | ||
2526 | 352 | <height>57</height> | ||
2527 | 353 | </size> | ||
2528 | 354 | </property> | ||
2529 | 355 | <property name="maximumSize"> | ||
2530 | 356 | <size> | ||
2531 | 357 | <width>300</width> | ||
2532 | 358 | <height>16777215</height> | ||
2533 | 359 | </size> | ||
2534 | 360 | </property> | ||
2535 | 361 | <property name="styleSheet"> | ||
2536 | 362 | <string notr="true">background-color: white</string> | ||
2537 | 363 | </property> | ||
2538 | 364 | <property name="frameShape"> | ||
2539 | 365 | <enum>QFrame::Box</enum> | ||
2540 | 366 | </property> | ||
2541 | 367 | <property name="text"> | ||
2542 | 368 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#dd4814;">refresh</span></a> this page</span></string> | ||
2543 | 369 | </property> | ||
2544 | 370 | </widget> | ||
2545 | 371 | </item> | ||
2546 | 372 | <item> | ||
2547 | 373 | <widget class="QLineEdit" name="captcha_solution_edit"> | ||
2548 | 374 | <property name="sizePolicy"> | ||
2549 | 375 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
2550 | 376 | <horstretch>0</horstretch> | ||
2551 | 377 | <verstretch>0</verstretch> | ||
2552 | 378 | </sizepolicy> | ||
2553 | 379 | </property> | ||
2554 | 380 | <property name="minimumSize"> | ||
2555 | 381 | <size> | ||
2556 | 382 | <width>300</width> | ||
2557 | 383 | <height>0</height> | ||
2558 | 384 | </size> | ||
2559 | 385 | </property> | ||
2560 | 386 | <property name="maximumSize"> | ||
2561 | 387 | <size> | ||
2562 | 388 | <width>300</width> | ||
2563 | 389 | <height>16777215</height> | ||
2564 | 390 | </size> | ||
2565 | 391 | </property> | ||
2566 | 392 | <property name="font"> | ||
2567 | 393 | <font> | ||
2568 | 394 | <pointsize>11</pointsize> | ||
2569 | 395 | </font> | ||
2570 | 396 | </property> | ||
2571 | 397 | <property name="locale"> | ||
2572 | 398 | <locale language="English" country="UnitedStates"/> | ||
2573 | 399 | </property> | ||
2574 | 400 | <property name="inputMask"> | ||
2575 | 401 | <string/> | ||
2576 | 402 | </property> | ||
2577 | 403 | <property name="text"> | ||
2578 | 404 | <string/> | ||
2579 | 405 | </property> | ||
2580 | 406 | <property name="placeholderText"> | ||
2581 | 407 | <string/> | ||
2582 | 408 | </property> | ||
2583 | 409 | <property name="formError" stdset="0"> | ||
2584 | 410 | <bool>false</bool> | ||
2585 | 411 | </property> | ||
2586 | 412 | </widget> | ||
2587 | 413 | </item> | ||
2588 | 414 | </layout> | ||
2589 | 415 | </item> | ||
2590 | 416 | <item row="9" column="1"> | ||
2591 | 417 | <widget class="QLabel" name="refresh_label"> | ||
2592 | 418 | <property name="sizePolicy"> | ||
2593 | 419 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
2594 | 420 | <horstretch>0</horstretch> | ||
2595 | 421 | <verstretch>0</verstretch> | ||
2596 | 422 | </sizepolicy> | ||
2597 | 423 | </property> | ||
2598 | 424 | <property name="minimumSize"> | ||
2599 | 425 | <size> | ||
2600 | 426 | <width>220</width> | ||
2601 | 427 | <height>0</height> | ||
2602 | 428 | </size> | ||
2603 | 429 | </property> | ||
2604 | 430 | <property name="maximumSize"> | ||
2605 | 431 | <size> | ||
2606 | 432 | <width>220</width> | ||
2607 | 433 | <height>16777215</height> | ||
2608 | 434 | </size> | ||
2609 | 435 | </property> | ||
2610 | 436 | <property name="locale"> | ||
2611 | 437 | <locale language="English" country="UnitedStates"/> | ||
2612 | 438 | </property> | ||
2613 | 439 | <property name="text"> | ||
2614 | 440 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#dd4814;">refresh</span></a> this page</span></string> | ||
2615 | 441 | </property> | ||
2616 | 442 | <property name="wordWrap"> | ||
2617 | 443 | <bool>true</bool> | ||
2618 | 444 | </property> | ||
2619 | 445 | <property name="indent"> | ||
2620 | 446 | <number>0</number> | ||
2621 | 447 | </property> | ||
2622 | 448 | </widget> | ||
2623 | 449 | </item> | ||
2624 | 450 | <item row="1" column="1"> | ||
2625 | 451 | <layout class="QVBoxLayout" name="verticalLayout_7"> | ||
2626 | 452 | <property name="spacing"> | ||
2627 | 453 | <number>0</number> | ||
2628 | 454 | </property> | ||
2629 | 455 | <property name="leftMargin"> | ||
2630 | 456 | <number>0</number> | ||
2631 | 457 | </property> | ||
2632 | 458 | <item> | ||
2633 | 459 | <widget class="QLabel" name="name_assistance"> | ||
2634 | 460 | <property name="sizePolicy"> | ||
2635 | 461 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
2636 | 462 | <horstretch>0</horstretch> | ||
2637 | 463 | <verstretch>0</verstretch> | ||
2638 | 464 | </sizepolicy> | ||
2639 | 465 | </property> | ||
2640 | 466 | <property name="minimumSize"> | ||
2641 | 467 | <size> | ||
2642 | 468 | <width>220</width> | ||
2643 | 469 | <height>0</height> | ||
2644 | 470 | </size> | ||
2645 | 471 | </property> | ||
2646 | 472 | <property name="maximumSize"> | ||
2647 | 473 | <size> | ||
2648 | 474 | <width>220</width> | ||
2649 | 475 | <height>16777215</height> | ||
2650 | 476 | </size> | ||
2651 | 477 | </property> | ||
2652 | 478 | <property name="text"> | ||
2653 | 479 | <string>name_assistance</string> | ||
2654 | 480 | </property> | ||
2655 | 481 | <property name="alignment"> | ||
2656 | 482 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
2657 | 483 | </property> | ||
2658 | 484 | <property name="wordWrap"> | ||
2659 | 485 | <bool>true</bool> | ||
2660 | 486 | </property> | ||
2661 | 487 | </widget> | ||
2662 | 488 | </item> | ||
2663 | 489 | </layout> | ||
2664 | 490 | </item> | ||
2665 | 491 | <item row="3" column="1"> | ||
2666 | 492 | <layout class="QVBoxLayout" name="verticalLayout_8"> | ||
2667 | 493 | <property name="spacing"> | ||
2668 | 494 | <number>0</number> | ||
2669 | 495 | </property> | ||
2670 | 496 | <property name="leftMargin"> | ||
2671 | 497 | <number>0</number> | ||
2672 | 498 | </property> | ||
2673 | 499 | <item> | ||
2674 | 500 | <widget class="QLabel" name="email_assistance"> | ||
2675 | 501 | <property name="sizePolicy"> | ||
2676 | 502 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
2677 | 503 | <horstretch>0</horstretch> | ||
2678 | 504 | <verstretch>0</verstretch> | ||
2679 | 505 | </sizepolicy> | ||
2680 | 506 | </property> | ||
2681 | 507 | <property name="minimumSize"> | ||
2682 | 508 | <size> | ||
2683 | 509 | <width>220</width> | ||
2684 | 510 | <height>0</height> | ||
2685 | 511 | </size> | ||
2686 | 512 | </property> | ||
2687 | 513 | <property name="maximumSize"> | ||
2688 | 514 | <size> | ||
2689 | 515 | <width>220</width> | ||
2690 | 516 | <height>16777215</height> | ||
2691 | 517 | </size> | ||
2692 | 518 | </property> | ||
2693 | 519 | <property name="text"> | ||
2694 | 520 | <string>email_assistance</string> | ||
2695 | 521 | </property> | ||
2696 | 522 | <property name="alignment"> | ||
2697 | 523 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
2698 | 524 | </property> | ||
2699 | 525 | <property name="wordWrap"> | ||
2700 | 526 | <bool>true</bool> | ||
2701 | 527 | </property> | ||
2702 | 528 | </widget> | ||
2703 | 529 | </item> | ||
2704 | 530 | </layout> | ||
2705 | 531 | </item> | ||
2706 | 532 | <item row="4" column="1"> | ||
2707 | 533 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
2708 | 534 | <property name="spacing"> | ||
2709 | 535 | <number>0</number> | ||
2710 | 536 | </property> | ||
2711 | 537 | <property name="leftMargin"> | ||
2712 | 538 | <number>0</number> | ||
2713 | 539 | </property> | ||
2714 | 540 | <item> | ||
2715 | 541 | <widget class="QLabel" name="confirm_email_assistance"> | ||
2716 | 542 | <property name="sizePolicy"> | ||
2717 | 543 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
2718 | 544 | <horstretch>0</horstretch> | ||
2719 | 545 | <verstretch>0</verstretch> | ||
2720 | 546 | </sizepolicy> | ||
2721 | 547 | </property> | ||
2722 | 548 | <property name="minimumSize"> | ||
2723 | 549 | <size> | ||
2724 | 550 | <width>220</width> | ||
2725 | 551 | <height>0</height> | ||
2726 | 552 | </size> | ||
2727 | 553 | </property> | ||
2728 | 554 | <property name="maximumSize"> | ||
2729 | 555 | <size> | ||
2730 | 556 | <width>220</width> | ||
2731 | 557 | <height>16777215</height> | ||
2732 | 558 | </size> | ||
2733 | 559 | </property> | ||
2734 | 560 | <property name="text"> | ||
2735 | 561 | <string>confirm_email_assistance</string> | ||
2736 | 562 | </property> | ||
2737 | 563 | <property name="alignment"> | ||
2738 | 564 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
2739 | 565 | </property> | ||
2740 | 566 | <property name="wordWrap"> | ||
2741 | 567 | <bool>true</bool> | ||
2742 | 568 | </property> | ||
2743 | 569 | <property name="indent"> | ||
2744 | 570 | <number>0</number> | ||
2745 | 571 | </property> | ||
2746 | 572 | </widget> | ||
2747 | 573 | </item> | ||
2748 | 574 | </layout> | ||
2749 | 575 | </item> | ||
2750 | 576 | <item row="6" column="1" rowspan="2"> | ||
2751 | 577 | <widget class="QLabel" name="password_assistance"> | ||
2752 | 578 | <property name="sizePolicy"> | ||
2753 | 579 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
2754 | 580 | <horstretch>0</horstretch> | ||
2755 | 581 | <verstretch>0</verstretch> | ||
2756 | 582 | </sizepolicy> | ||
2757 | 583 | </property> | ||
2758 | 584 | <property name="minimumSize"> | ||
2759 | 585 | <size> | ||
2760 | 586 | <width>220</width> | ||
2761 | 587 | <height>0</height> | ||
2762 | 588 | </size> | ||
2763 | 589 | </property> | ||
2764 | 590 | <property name="maximumSize"> | ||
2765 | 591 | <size> | ||
2766 | 592 | <width>220</width> | ||
2767 | 593 | <height>16777215</height> | ||
2768 | 594 | </size> | ||
2769 | 595 | </property> | ||
2770 | 596 | <property name="text"> | ||
2771 | 597 | <string>password_assistance</string> | ||
2772 | 598 | </property> | ||
2773 | 599 | <property name="wordWrap"> | ||
2774 | 600 | <bool>true</bool> | ||
2775 | 601 | </property> | ||
2776 | 602 | <property name="indent"> | ||
2777 | 603 | <number>17</number> | ||
2778 | 604 | </property> | ||
2779 | 605 | </widget> | ||
2780 | 606 | </item> | ||
2781 | 607 | <item row="2" column="1"> | ||
2782 | 608 | <spacer name="verticalSpacer"> | ||
2783 | 609 | <property name="orientation"> | ||
2784 | 610 | <enum>Qt::Vertical</enum> | ||
2785 | 611 | </property> | ||
2786 | 612 | <property name="sizeType"> | ||
2787 | 613 | <enum>QSizePolicy::Fixed</enum> | ||
2788 | 614 | </property> | ||
2789 | 615 | <property name="sizeHint" stdset="0"> | ||
2790 | 616 | <size> | ||
2791 | 617 | <width>20</width> | ||
2792 | 618 | <height>15</height> | ||
2793 | 619 | </size> | ||
2794 | 620 | </property> | ||
2795 | 621 | </spacer> | ||
2796 | 622 | </item> | ||
2797 | 623 | <item row="5" column="1"> | ||
2798 | 262 | <spacer name="verticalSpacer_2"> | 624 | <spacer name="verticalSpacer_2"> |
2799 | 263 | <property name="orientation"> | 625 | <property name="orientation"> |
2800 | 264 | <enum>Qt::Vertical</enum> | 626 | <enum>Qt::Vertical</enum> |
2801 | 265 | </property> | 627 | </property> |
2810 | 266 | <property name="sizeHint" stdset="0"> | 628 | <property name="sizeType"> |
2811 | 267 | <size> | 629 | <enum>QSizePolicy::Fixed</enum> |
2812 | 268 | <width>20</width> | 630 | </property> |
2813 | 269 | <height>40</height> | 631 | <property name="sizeHint" stdset="0"> |
2814 | 270 | </size> | 632 | <size> |
2815 | 271 | </property> | 633 | <width>20</width> |
2816 | 272 | </spacer> | 634 | <height>15</height> |
2817 | 273 | </item> | 635 | </size> |
2818 | 636 | </property> | ||
2819 | 637 | </spacer> | ||
2820 | 638 | </item> | ||
2821 | 639 | <item row="8" column="1"> | ||
2822 | 640 | <spacer name="verticalSpacer_3"> | ||
2823 | 641 | <property name="orientation"> | ||
2824 | 642 | <enum>Qt::Vertical</enum> | ||
2825 | 643 | </property> | ||
2826 | 644 | <property name="sizeType"> | ||
2827 | 645 | <enum>QSizePolicy::Fixed</enum> | ||
2828 | 646 | </property> | ||
2829 | 647 | <property name="sizeHint" stdset="0"> | ||
2830 | 648 | <size> | ||
2831 | 649 | <width>20</width> | ||
2832 | 650 | <height>15</height> | ||
2833 | 651 | </size> | ||
2834 | 652 | </property> | ||
2835 | 653 | </spacer> | ||
2836 | 654 | </item> | ||
2837 | 655 | </layout> | ||
2838 | 656 | </item> | ||
2839 | 657 | <item> | ||
2840 | 658 | <layout class="QHBoxLayout" name="hlayout_check"> | ||
2841 | 659 | <property name="spacing"> | ||
2842 | 660 | <number>0</number> | ||
2843 | 661 | </property> | ||
2844 | 274 | </layout> | 662 | </layout> |
2845 | 275 | </item> | 663 | </item> |
2846 | 276 | </layout> | 664 | </layout> |
2847 | 277 | </widget> | 665 | </widget> |
2848 | 278 | <resources/> | ||
2849 | 279 | <connections/> | 666 | <connections/> |
2850 | 280 | </ui> | 667 | </ui> |
2851 | 281 | 668 | ||
2852 | === modified file 'run-tests' | |||
2853 | --- run-tests 2011-12-09 14:07:38 +0000 | |||
2854 | +++ run-tests 2012-02-14 22:04:20 +0000 | |||
2855 | @@ -18,16 +18,10 @@ | |||
2856 | 18 | 18 | ||
2857 | 19 | QT_TESTS_PATH=ubuntu_sso/qt/tests | 19 | QT_TESTS_PATH=ubuntu_sso/qt/tests |
2858 | 20 | GTK_TESTS_PATH=ubuntu_sso/gtk/tests | 20 | GTK_TESTS_PATH=ubuntu_sso/gtk/tests |
2859 | 21 | WINDOWS_TESTS=test_windows.py | ||
2860 | 21 | 22 | ||
2861 | 22 | set -e | 23 | set -e |
2862 | 23 | 24 | ||
2863 | 24 | if [ "$1" == "-qt" ]; then | ||
2864 | 25 | USE_QT=1 | ||
2865 | 26 | shift | ||
2866 | 27 | else | ||
2867 | 28 | USE_QT=0 | ||
2868 | 29 | fi | ||
2869 | 30 | |||
2870 | 31 | if [ $# -ne 0 ]; then | 25 | if [ $# -ne 0 ]; then |
2871 | 32 | # run specific module given by the caller | 26 | # run specific module given by the caller |
2872 | 33 | MODULE="$@" | 27 | MODULE="$@" |
2873 | @@ -37,24 +31,34 @@ | |||
2874 | 37 | fi | 31 | fi |
2875 | 38 | 32 | ||
2876 | 39 | style_check() { | 33 | style_check() { |
2879 | 40 | ./setup.py clean | 34 | u1lint --ignore ubuntu_sso/qt/ui |
2878 | 41 | u1lint | ||
2880 | 42 | if [ -x `which pep8` ]; then | 35 | if [ -x `which pep8` ]; then |
2882 | 43 | pep8 --repeat . | 36 | pep8 --exclude '.svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py' --repeat . bin/* |
2883 | 44 | else | 37 | else |
2884 | 45 | echo "Please install the 'pep8' package." | 38 | echo "Please install the 'pep8' package." |
2885 | 46 | fi | 39 | fi |
2886 | 47 | } | 40 | } |
2887 | 48 | |||
2888 | 49 | unset GTK_MODULES | 41 | unset GTK_MODULES |
2889 | 50 | 42 | ||
2896 | 51 | echo "Running test suite for ""$MODULE" | 43 | XVFB_CMDLINE="" |
2897 | 52 | if [ "$USE_QT" -eq 0 ]; then | 44 | XVFB=$(which xvfb-run) |
2898 | 53 | `which xvfb-run` u1trial -p "$QT_TESTS_PATH" -i "test_windows.py" "$MODULE" | 45 | if [ $XVFB ]; then |
2899 | 54 | else | 46 | XVFB_CMDLINE="$XVFB -a" |
2894 | 55 | ./setup.py build | ||
2895 | 56 | `which xvfb-run` u1trial -p "$GTK_TESTS_PATH" -i "test_windows.py" --reactor=qt4 --gui "$MODULE" | ||
2900 | 57 | fi | 47 | fi |
2901 | 48 | |||
2902 | 49 | echo "*** Running GTK test suite for ""$MODULE"" ***" | ||
2903 | 50 | $XVFB_CMDLINE u1trial --reactor=gi --gui -p "$QT_TESTS_PATH" -i "test_windows.py" "$MODULE" | ||
2904 | 51 | rm -rf _trial_temp | ||
2905 | 52 | |||
2906 | 53 | # hack to avoid: | ||
2907 | 54 | # g_dbus_connection_real_closed: Remote peer vanished with error: Underlying | ||
2908 | 55 | # GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. | ||
2909 | 56 | sleep 3 | ||
2910 | 57 | |||
2911 | 58 | echo "*** Running QT test suite for ""$MODULE"" ***" | ||
2912 | 59 | ./setup.py build | ||
2913 | 60 | USE_QT_MAINLOOP=True $XVFB_CMDLINE u1trial --reactor=qt4 --gui -p "$GTK_TESTS_PATH" -i "test_windows.py" "$MODULE" | ||
2914 | 61 | rm -rf _trial_temp | ||
2915 | 62 | rm -rf build | ||
2916 | 63 | |||
2917 | 58 | style_check | 64 | style_check |
2918 | 59 | rm -rf _trial_temp | ||
2919 | 60 | rm -rf build | ||
2920 | 61 | 65 | ||
2921 | === modified file 'setup.py' | |||
2922 | --- setup.py 2012-02-02 13:37:55 +0000 | |||
2923 | +++ setup.py 2012-02-14 22:04:20 +0000 | |||
2924 | @@ -1,11 +1,7 @@ | |||
2925 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2926 | 2 | # setup.py - Build system for Ubuntu SSO Client package | 2 | # setup.py - Build system for Ubuntu SSO Client package |
2927 | 3 | # | 3 | # |
2933 | 4 | # Authors: Natalia B. Bidart <natalia.bidart@canonical.com> | 4 | # Copyright 2010-2012 Canonical Ltd. |
2929 | 5 | # Manuel de la Pena <manuel@canonical.com> | ||
2930 | 6 | # Alejandro J. Cura <alecu@canonical.com> | ||
2931 | 7 | # | ||
2932 | 8 | # Copyright 2010-2011 Canonical Ltd. | ||
2934 | 9 | # | 5 | # |
2935 | 10 | # This program is free software: you can redistribute it and/or modify it | 6 | # This program is free software: you can redistribute it and/or modify it |
2936 | 11 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
2937 | @@ -40,15 +36,16 @@ | |||
2938 | 40 | 36 | ||
2939 | 41 | POT_FILE = 'po/ubuntu-sso-client.pot' | 37 | POT_FILE = 'po/ubuntu-sso-client.pot' |
2940 | 42 | SERVICE_FILE = 'data/com.ubuntu.sso.service' | 38 | SERVICE_FILE = 'data/com.ubuntu.sso.service' |
2941 | 39 | CONSTANTS = 'ubuntu_sso/constants.py' | ||
2942 | 43 | 40 | ||
2945 | 44 | CLEANFILES = [SERVICE_FILE, POT_FILE, 'MANIFEST'] | 41 | CLEANFILES = [SERVICE_FILE, POT_FILE, CONSTANTS, 'MANIFEST'] |
2946 | 45 | QT_UI_DIR = os.path.join('ubuntu_sso', 'qt') | 42 | QT_UI_DIR = os.path.join('ubuntu_sso', 'qt', 'ui') |
2947 | 46 | 43 | ||
2948 | 47 | 44 | ||
2949 | 48 | def replace_prefix(prefix): | 45 | def replace_prefix(prefix): |
2950 | 49 | """Replace every '@prefix@' with prefix within 'filename' content.""" | 46 | """Replace every '@prefix@' with prefix within 'filename' content.""" |
2953 | 50 | # replace .service file | 47 | # replace .service file, DATA_DIR constant |
2954 | 51 | for filename in (SERVICE_FILE,): | 48 | for filename in (SERVICE_FILE, CONSTANTS): |
2955 | 52 | with open(filename + '.in') as in_file: | 49 | with open(filename + '.in') as in_file: |
2956 | 53 | content = in_file.read() | 50 | content = in_file.read() |
2957 | 54 | with open(filename, 'w') as out_file: | 51 | with open(filename, 'w') as out_file: |
2958 | @@ -112,7 +109,8 @@ | |||
2959 | 112 | path = os.getenv('PATH') | 109 | path = os.getenv('PATH') |
2960 | 113 | os.putenv('PATH', path + os.path.pathsep + os.path.join( | 110 | os.putenv('PATH', path + os.path.pathsep + os.path.join( |
2961 | 114 | os.path.dirname(PyQt4.__file__), 'bin')) | 111 | os.path.dirname(PyQt4.__file__), 'bin')) |
2963 | 115 | if os.system('pyrcc4 "%s" -o "%s"' % (qrc_file, py_file)) > 0: | 112 | if os.system('pyrcc4 -no-compress "%s" -o "%s"' % |
2964 | 113 | (qrc_file, py_file)) > 0: | ||
2965 | 116 | self.warn('Unable to generate python module {py_file}' | 114 | self.warn('Unable to generate python module {py_file}' |
2966 | 117 | ' for resource file {qrc_file}'.format( | 115 | ' for resource file {qrc_file}'.format( |
2967 | 118 | py_file=py_file, qrc_file=qrc_file)) | 116 | py_file=py_file, qrc_file=qrc_file)) |
2968 | @@ -313,6 +311,14 @@ | |||
2969 | 313 | } | 311 | } |
2970 | 314 | 312 | ||
2971 | 315 | 313 | ||
2972 | 314 | sso_executables = [ | ||
2973 | 315 | 'bin/ubuntu-sso-login', | ||
2974 | 316 | 'bin/ubuntu-sso-login-gtk', | ||
2975 | 317 | 'bin/ubuntu-sso-login-qt', | ||
2976 | 318 | 'bin/ubuntu-sso-proxy-creds-qt', | ||
2977 | 319 | ] | ||
2978 | 320 | |||
2979 | 321 | |||
2980 | 316 | class dummy_build_i18n(distutils.cmd.Command): | 322 | class dummy_build_i18n(distutils.cmd.Command): |
2981 | 317 | 323 | ||
2982 | 318 | """Dummy for windows.""" | 324 | """Dummy for windows.""" |
2983 | @@ -326,6 +332,7 @@ | |||
2984 | 326 | def run(self, *args): | 332 | def run(self, *args): |
2985 | 327 | """Dummy.""" | 333 | """Dummy.""" |
2986 | 328 | 334 | ||
2987 | 335 | |||
2988 | 329 | if sys.platform == 'win32': | 336 | if sys.platform == 'win32': |
2989 | 330 | cmdclass['build_i18n'] = dummy_build_i18n | 337 | cmdclass['build_i18n'] = dummy_build_i18n |
2990 | 331 | 338 | ||
2991 | @@ -349,7 +356,7 @@ | |||
2992 | 349 | }, | 356 | }, |
2993 | 350 | }, | 357 | }, |
2994 | 351 | # add the console script so that py2exe compiles it | 358 | # add the console script so that py2exe compiles it |
2996 | 352 | 'console': ['bin/ubuntu-sso-login'], | 359 | 'console': sso_executables, |
2997 | 353 | 'zipfile': None, | 360 | 'zipfile': None, |
2998 | 354 | } | 361 | } |
2999 | 355 | return _data_files, _extra | 362 | return _data_files, _extra |
3000 | @@ -358,10 +365,8 @@ | |||
3001 | 358 | data_files, extra = setup_windows() | 365 | data_files, extra = setup_windows() |
3002 | 359 | else: | 366 | else: |
3003 | 360 | data_files = [ | 367 | data_files = [ |
3006 | 361 | ('lib/ubuntu-sso-client', ['bin/ubuntu-sso-login']), | 368 | ('lib/ubuntu-sso-client', sso_executables), |
3005 | 362 | ('lib/ubuntu-sso-client', ['bin/ubuntu-sso-login-gtk']), | ||
3007 | 363 | ('share/dbus-1/services', ['data/com.ubuntu.sso.service']), | 369 | ('share/dbus-1/services', ['data/com.ubuntu.sso.service']), |
3008 | 364 | ('share/ubuntu-sso-client/data/gtk', ['data/gtk/ui.glade']), | ||
3009 | 365 | ] | 370 | ] |
3010 | 366 | extra = {} | 371 | extra = {} |
3011 | 367 | 372 | ||
3012 | @@ -379,14 +384,24 @@ | |||
3013 | 379 | data_files=data_files, | 384 | data_files=data_files, |
3014 | 380 | packages=[ | 385 | packages=[ |
3015 | 381 | 'ubuntu_sso', | 386 | 'ubuntu_sso', |
3016 | 387 | 'ubuntu_sso.tests', | ||
3017 | 382 | 'ubuntu_sso.gtk', | 388 | 'ubuntu_sso.gtk', |
3018 | 383 | 'ubuntu_sso.keyring', | 389 | 'ubuntu_sso.keyring', |
3019 | 390 | 'ubuntu_sso.keyring.tests', | ||
3020 | 384 | 'ubuntu_sso.main', | 391 | 'ubuntu_sso.main', |
3021 | 392 | 'ubuntu_sso.main.tests', | ||
3022 | 385 | 'ubuntu_sso.networkstate', | 393 | 'ubuntu_sso.networkstate', |
3023 | 394 | 'ubuntu_sso.networkstate.tests', | ||
3024 | 386 | 'ubuntu_sso.qt', | 395 | 'ubuntu_sso.qt', |
3025 | 396 | 'ubuntu_sso.qt.ui', | ||
3026 | 387 | 'ubuntu_sso.utils', | 397 | 'ubuntu_sso.utils', |
3027 | 398 | 'ubuntu_sso.utils.tests', | ||
3028 | 399 | 'ubuntu_sso.utils.runner', | ||
3029 | 400 | 'ubuntu_sso.utils.runner.tests', | ||
3030 | 388 | 'ubuntu_sso.utils.webclient', | 401 | 'ubuntu_sso.utils.webclient', |
3031 | 402 | 'ubuntu_sso.utils.webclient.tests', | ||
3032 | 389 | 'ubuntu_sso.xdg_base_directory', | 403 | 'ubuntu_sso.xdg_base_directory', |
3033 | 404 | 'ubuntu_sso.xdg_base_directory.tests', | ||
3034 | 390 | ], | 405 | ], |
3035 | 391 | cmdclass=cmdclass, | 406 | cmdclass=cmdclass, |
3036 | 392 | **extra) | 407 | **extra) |
3037 | 393 | 408 | ||
3038 | === modified file 'ubuntu_sso/__init__.py' | |||
3039 | --- ubuntu_sso/__init__.py 2010-10-07 21:09:01 +0000 | |||
3040 | +++ ubuntu_sso/__init__.py 2012-02-14 22:04:20 +0000 | |||
3041 | @@ -15,17 +15,21 @@ | |||
3042 | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
3043 | 16 | """Ubuntu Single Sign On client code.""" | 16 | """Ubuntu Single Sign On client code.""" |
3044 | 17 | 17 | ||
3046 | 18 | # constants | 18 | # DBus constants |
3047 | 19 | DBUS_BUS_NAME = "com.ubuntu.sso" | 19 | DBUS_BUS_NAME = "com.ubuntu.sso" |
3050 | 20 | DBUS_PATH = "/sso" # deprecated! | 20 | |
3049 | 21 | DBUS_CRED_PATH = "/credentials" # deprecated! | ||
3051 | 22 | DBUS_ACCOUNT_PATH = "/com/ubuntu/sso/accounts" | 21 | DBUS_ACCOUNT_PATH = "/com/ubuntu/sso/accounts" |
3052 | 23 | |||
3053 | 24 | DBUS_IFACE_AUTH_NAME = "com.ubuntu.sso" | ||
3054 | 25 | DBUS_IFACE_USER_NAME = "com.ubuntu.sso.UserManagement" | 22 | DBUS_IFACE_USER_NAME = "com.ubuntu.sso.UserManagement" |
3055 | 26 | DBUS_IFACE_CRED_NAME = "com.ubuntu.sso.ApplicationCredentials" | ||
3056 | 27 | 23 | ||
3057 | 28 | DBUS_CREDENTIALS_PATH = "/com/ubuntu/sso/credentials" | 24 | DBUS_CREDENTIALS_PATH = "/com/ubuntu/sso/credentials" |
3058 | 29 | DBUS_CREDENTIALS_IFACE = "com.ubuntu.sso.CredentialsManagement" | 25 | DBUS_CREDENTIALS_IFACE = "com.ubuntu.sso.CredentialsManagement" |
3059 | 30 | 26 | ||
3060 | 31 | NO_OP = lambda *args, **kwargs: None | 27 | NO_OP = lambda *args, **kwargs: None |
3061 | 28 | |||
3062 | 29 | # return codes for UIs | ||
3063 | 30 | USER_SUCCESS = 0 | ||
3064 | 31 | USER_CANCELLATION = 10 | ||
3065 | 32 | |||
3066 | 33 | # available UIs | ||
3067 | 34 | UI_EXECUTABLE_GTK = 'ubuntu-sso-login-gtk' | ||
3068 | 35 | UI_EXECUTABLE_QT = 'ubuntu-sso-login-qt' | ||
3069 | 32 | 36 | ||
3070 | === modified file 'ubuntu_sso/account.py' | |||
3071 | --- ubuntu_sso/account.py 2011-12-15 20:52:32 +0000 | |||
3072 | +++ ubuntu_sso/account.py 2012-02-14 22:04:20 +0000 | |||
3073 | @@ -16,27 +16,27 @@ | |||
3074 | 16 | # | 16 | # |
3075 | 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 |
3076 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
3078 | 19 | """Single Sign On account management.""" | 19 | """Single Sign On account management. |
3079 | 20 | |||
3080 | 21 | All the methods in Account expect unicode as parameters. | ||
3081 | 22 | |||
3082 | 23 | """ | ||
3083 | 20 | 24 | ||
3084 | 21 | import os | 25 | import os |
3085 | 22 | import re | 26 | import re |
3086 | 23 | import urllib2 | ||
3087 | 24 | 27 | ||
3088 | 25 | # Unable to import 'lazr.restfulclient.*' | ||
3089 | 26 | # pylint: disable=F0401 | ||
3090 | 27 | from lazr.restfulclient.authorize import BasicHttpAuthorizer | ||
3091 | 28 | from lazr.restfulclient.authorize.oauth import OAuthAuthorizer | 28 | from lazr.restfulclient.authorize.oauth import OAuthAuthorizer |
3092 | 29 | from lazr.restfulclient.errors import HTTPError | ||
3093 | 30 | from lazr.restfulclient.resource import ServiceRoot | ||
3094 | 31 | # pylint: enable=F0401 | ||
3095 | 32 | from oauth import oauth | 29 | from oauth import oauth |
3096 | 30 | from twisted.internet import defer | ||
3097 | 33 | 31 | ||
3098 | 34 | from ubuntu_sso.logger import setup_logging | 32 | from ubuntu_sso.logger import setup_logging |
3100 | 35 | from ubuntu_sso.utils import timestamp_checker | 33 | from ubuntu_sso.utils import webclient |
3101 | 34 | from ubuntu_sso.utils.webclient import restful | ||
3102 | 35 | from ubuntu_sso.utils.webclient.common import WebClientError | ||
3103 | 36 | 36 | ||
3104 | 37 | 37 | ||
3105 | 38 | logger = setup_logging("ubuntu_sso.account") | 38 | logger = setup_logging("ubuntu_sso.account") |
3107 | 39 | SERVICE_URL = "https://login.ubuntu.com/api/1.0" | 39 | SERVICE_URL = u"https://login.ubuntu.com/api/1.0/" |
3108 | 40 | SSO_STATUS_OK = 'ok' | 40 | SSO_STATUS_OK = 'ok' |
3109 | 41 | SSO_STATUS_ERROR = 'error' | 41 | SSO_STATUS_ERROR = 'error' |
3110 | 42 | 42 | ||
3111 | @@ -102,8 +102,9 @@ | |||
3112 | 102 | self.service_url = service_url | 102 | self.service_url = service_url |
3113 | 103 | else: | 103 | else: |
3114 | 104 | self.service_url = os.environ.get('USSOC_SERVICE_URL', SERVICE_URL) | 104 | self.service_url = os.environ.get('USSOC_SERVICE_URL', SERVICE_URL) |
3116 | 105 | logger.info('Created a new SSO access layer for service url %r', | 105 | logger.info('Creating a new SSO access layer for service url %r', |
3117 | 106 | self.service_url) | 106 | self.service_url) |
3118 | 107 | assert self.service_url.endswith("/") | ||
3119 | 107 | 108 | ||
3120 | 108 | def _valid_email(self, email): | 109 | def _valid_email(self, email): |
3121 | 109 | """Validate the given email.""" | 110 | """Validate the given email.""" |
3122 | @@ -127,46 +128,57 @@ | |||
3123 | 127 | result[key] = "\n".join(val) | 128 | result[key] = "\n".join(val) |
3124 | 128 | return result | 129 | return result |
3125 | 129 | 130 | ||
3126 | 131 | @defer.inlineCallbacks | ||
3127 | 130 | def generate_captcha(self, filename): | 132 | def generate_captcha(self, filename): |
3128 | 131 | """Generate a captcha using the SSO service.""" | 133 | """Generate a captcha using the SSO service.""" |
3129 | 132 | logger.debug('generate_captcha: requesting captcha, filename: %r', | 134 | logger.debug('generate_captcha: requesting captcha, filename: %r', |
3130 | 133 | filename) | 135 | filename) |
3133 | 134 | sso_service = ServiceRoot(None, self.service_url) | 136 | restful_client = restful.RestfulClient(self.service_url) |
3134 | 135 | captcha = sso_service.captchas.new() | 137 | try: |
3135 | 138 | captcha = yield restful_client.restcall(u"captchas.new") | ||
3136 | 139 | finally: | ||
3137 | 140 | restful_client.shutdown() | ||
3138 | 136 | 141 | ||
3139 | 137 | # download captcha and save to 'filename' | 142 | # download captcha and save to 'filename' |
3140 | 138 | logger.debug('generate_captcha: server answered: %r', captcha) | 143 | logger.debug('generate_captcha: server answered: %r', captcha) |
3141 | 144 | wc = webclient.webclient_factory() | ||
3142 | 139 | try: | 145 | try: |
3144 | 140 | res = urllib2.urlopen(captcha['image_url']) | 146 | response = yield wc.request(captcha['image_url']) |
3145 | 141 | with open(filename, 'wb') as f: | 147 | with open(filename, 'wb') as f: |
3147 | 142 | f.write(res.read()) | 148 | f.write(response.content) |
3148 | 143 | except: | 149 | except: |
3149 | 144 | msg = 'generate_captcha crashed while downloading the image.' | 150 | msg = 'generate_captcha crashed while downloading the image.' |
3150 | 145 | logger.exception(msg) | 151 | logger.exception(msg) |
3151 | 146 | raise | 152 | raise |
3155 | 147 | 153 | finally: | |
3156 | 148 | return captcha['captcha_id'] | 154 | wc.shutdown() |
3157 | 149 | 155 | ||
3158 | 156 | defer.returnValue(captcha['captcha_id']) | ||
3159 | 157 | |||
3160 | 158 | @defer.inlineCallbacks | ||
3161 | 150 | def register_user(self, email, password, displayname, | 159 | def register_user(self, email, password, displayname, |
3162 | 151 | captcha_id, captcha_solution): | 160 | captcha_id, captcha_solution): |
3163 | 152 | """Register a new user with 'email' and 'password'.""" | 161 | """Register a new user with 'email' and 'password'.""" |
3164 | 153 | logger.debug('register_user: email: %r password: <hidden>, ' | 162 | logger.debug('register_user: email: %r password: <hidden>, ' |
3165 | 154 | 'displayname: %r, captcha_id: %r, captcha_solution: %r', | 163 | 'displayname: %r, captcha_id: %r, captcha_solution: %r', |
3166 | 155 | email, displayname, captcha_id, captcha_solution) | 164 | email, displayname, captcha_id, captcha_solution) |
3175 | 156 | sso_service = ServiceRoot(None, self.service_url) | 165 | restful_client = restful.RestfulClient(self.service_url) |
3176 | 157 | if not self._valid_email(email): | 166 | try: |
3177 | 158 | logger.error('register_user: InvalidEmailError for email: %r', | 167 | if not self._valid_email(email): |
3178 | 159 | email) | 168 | logger.error('register_user: InvalidEmailError for email: %r', |
3179 | 160 | raise InvalidEmailError() | 169 | email) |
3180 | 161 | if not self._valid_password(password): | 170 | raise InvalidEmailError() |
3181 | 162 | logger.error('register_user: InvalidPasswordError') | 171 | if not self._valid_password(password): |
3182 | 163 | raise InvalidPasswordError() | 172 | logger.error('register_user: InvalidPasswordError') |
3183 | 173 | raise InvalidPasswordError() | ||
3184 | 164 | 174 | ||
3190 | 165 | result = sso_service.registrations.register( | 175 | result = yield restful_client.restcall(u"registration.register", |
3191 | 166 | email=email, password=password, | 176 | email=email, password=password, |
3192 | 167 | displayname=displayname, | 177 | displayname=displayname, |
3193 | 168 | captcha_id=captcha_id, | 178 | captcha_id=captcha_id, |
3194 | 169 | captcha_solution=captcha_solution) | 179 | captcha_solution=captcha_solution) |
3195 | 180 | finally: | ||
3196 | 181 | restful_client.shutdown() | ||
3197 | 170 | logger.info('register_user: email: %r result: %r', email, result) | 182 | logger.info('register_user: email: %r result: %r', email, result) |
3198 | 171 | 183 | ||
3199 | 172 | if result['status'].lower() == SSO_STATUS_ERROR: | 184 | if result['status'].lower() == SSO_STATUS_ERROR: |
3200 | @@ -175,87 +187,91 @@ | |||
3201 | 175 | elif result['status'].lower() != SSO_STATUS_OK: | 187 | elif result['status'].lower() != SSO_STATUS_OK: |
3202 | 176 | raise RegistrationError('Received unknown status: %s' % result) | 188 | raise RegistrationError('Received unknown status: %s' % result) |
3203 | 177 | else: | 189 | else: |
3205 | 178 | return email | 190 | defer.returnValue(email) |
3206 | 179 | 191 | ||
3207 | 192 | @defer.inlineCallbacks | ||
3208 | 180 | def login(self, email, password, token_name): | 193 | def login(self, email, password, token_name): |
3209 | 181 | """Login a user with 'email' and 'password'.""" | 194 | """Login a user with 'email' and 'password'.""" |
3210 | 182 | logger.debug('login: email: %r password: <hidden>, token_name: %r', | 195 | logger.debug('login: email: %r password: <hidden>, token_name: %r', |
3211 | 183 | email, token_name) | 196 | email, token_name) |
3216 | 184 | basic = BasicHttpAuthorizer(email, password) | 197 | restful_client = restful.RestfulClient(self.service_url, |
3217 | 185 | sso_service = ServiceRoot(basic, self.service_url) | 198 | username=email, |
3218 | 186 | service = sso_service.authentications.authenticate | 199 | password=password) |
3215 | 187 | |||
3219 | 188 | try: | 200 | try: |
3222 | 189 | credentials = service(token_name=token_name) | 201 | credentials = yield restful_client.restcall( |
3223 | 190 | except HTTPError: | 202 | u"authentications.authenticate", |
3224 | 203 | token_name=token_name) | ||
3225 | 204 | except WebClientError: | ||
3226 | 191 | logger.exception('login failed with:') | 205 | logger.exception('login failed with:') |
3227 | 192 | raise AuthenticationError() | 206 | raise AuthenticationError() |
3228 | 207 | finally: | ||
3229 | 208 | restful_client.shutdown() | ||
3230 | 193 | 209 | ||
3231 | 194 | logger.debug('login: authentication successful! consumer_key: %r, ' \ | 210 | logger.debug('login: authentication successful! consumer_key: %r, ' \ |
3232 | 195 | 'token_name: %r', credentials['consumer_key'], token_name) | 211 | 'token_name: %r', credentials['consumer_key'], token_name) |
3234 | 196 | return credentials | 212 | defer.returnValue(credentials) |
3235 | 197 | 213 | ||
3237 | 198 | def is_validated(self, token, sso_service=None): | 214 | @defer.inlineCallbacks |
3238 | 215 | def is_validated(self, token): | ||
3239 | 199 | """Return if user with 'email' and 'password' is validated.""" | 216 | """Return if user with 'email' and 'password' is validated.""" |
3240 | 200 | logger.debug('is_validated: requesting accounts.me() info.') | 217 | logger.debug('is_validated: requesting accounts.me() info.') |
3252 | 201 | if sso_service is None: | 218 | restful_client = restful.RestfulClient(self.service_url, |
3253 | 202 | oauth_token = oauth.OAuthToken(token['token'], | 219 | oauth_credentials=token) |
3254 | 203 | token['token_secret']) | 220 | try: |
3255 | 204 | authorizer = TimestampedAuthorizer( | 221 | me_info = yield restful_client.restcall(u"accounts.me") |
3256 | 205 | timestamp_checker.get_faithful_time, | 222 | finally: |
3257 | 206 | token['consumer_key'], | 223 | restful_client.shutdown() |
3247 | 207 | token['consumer_secret'], | ||
3248 | 208 | oauth_token) | ||
3249 | 209 | sso_service = ServiceRoot(authorizer, self.service_url) | ||
3250 | 210 | |||
3251 | 211 | me_info = sso_service.accounts.me() | ||
3258 | 212 | key = 'preferred_email' | 224 | key = 'preferred_email' |
3259 | 213 | result = key in me_info and me_info[key] != None | 225 | result = key in me_info and me_info[key] != None |
3260 | 214 | 226 | ||
3261 | 215 | logger.info('is_validated: consumer_key: %r, result: %r.', | 227 | logger.info('is_validated: consumer_key: %r, result: %r.', |
3262 | 216 | token['consumer_key'], result) | 228 | token['consumer_key'], result) |
3264 | 217 | return result | 229 | defer.returnValue(result) |
3265 | 218 | 230 | ||
3266 | 231 | @defer.inlineCallbacks | ||
3267 | 219 | def validate_email(self, email, password, email_token, token_name): | 232 | def validate_email(self, email, password, email_token, token_name): |
3268 | 220 | """Validate an email token for user with 'email' and 'password'.""" | 233 | """Validate an email token for user with 'email' and 'password'.""" |
3269 | 221 | logger.debug('validate_email: email: %r password: <hidden>, ' | 234 | logger.debug('validate_email: email: %r password: <hidden>, ' |
3270 | 222 | 'email_token: %r, token_name: %r.', | 235 | 'email_token: %r, token_name: %r.', |
3271 | 223 | email, email_token, token_name) | 236 | email, email_token, token_name) |
3282 | 224 | token = self.login(email=email, password=password, | 237 | credentials = yield self.login(email=email, password=password, |
3283 | 225 | token_name=token_name) | 238 | token_name=token_name) |
3284 | 226 | 239 | restful_client = restful.RestfulClient(self.service_url, | |
3285 | 227 | oauth_token = oauth.OAuthToken(token['token'], token['token_secret']) | 240 | oauth_credentials=credentials) |
3286 | 228 | authorizer = TimestampedAuthorizer(timestamp_checker.get_faithful_time, | 241 | try: |
3287 | 229 | token['consumer_key'], | 242 | result = yield restful_client.restcall(u"accounts.validate_email", |
3288 | 230 | token['consumer_secret'], | 243 | email_token=email_token) |
3289 | 231 | oauth_token) | 244 | finally: |
3290 | 232 | sso_service = ServiceRoot(authorizer, self.service_url) | 245 | restful_client.shutdown() |
3281 | 233 | result = sso_service.accounts.validate_email(email_token=email_token) | ||
3291 | 234 | logger.info('validate_email: email: %r result: %r', email, result) | 246 | logger.info('validate_email: email: %r result: %r', email, result) |
3292 | 235 | if 'errors' in result: | 247 | if 'errors' in result: |
3293 | 236 | errorsdict = self._format_webservice_errors(result['errors']) | 248 | errorsdict = self._format_webservice_errors(result['errors']) |
3294 | 237 | raise EmailTokenError(errorsdict) | 249 | raise EmailTokenError(errorsdict) |
3295 | 238 | elif 'email' in result: | 250 | elif 'email' in result: |
3297 | 239 | return token | 251 | defer.returnValue(credentials) |
3298 | 240 | else: | 252 | else: |
3299 | 241 | raise EmailTokenError('Received invalid reply: %s' % result) | 253 | raise EmailTokenError('Received invalid reply: %s' % result) |
3300 | 242 | 254 | ||
3301 | 255 | @defer.inlineCallbacks | ||
3302 | 243 | def request_password_reset_token(self, email): | 256 | def request_password_reset_token(self, email): |
3303 | 244 | """Request a token to reset the password for the account 'email'.""" | 257 | """Request a token to reset the password for the account 'email'.""" |
3306 | 245 | sso_service = ServiceRoot(None, self.service_url) | 258 | restful_client = restful.RestfulClient(self.service_url) |
3305 | 246 | service = sso_service.registrations.request_password_reset_token | ||
3307 | 247 | try: | 259 | try: |
3310 | 248 | result = service(email=email) | 260 | operation = u"registration.request_password_reset_token" |
3311 | 249 | except HTTPError, e: | 261 | result = yield restful_client.restcall(operation, email=email) |
3312 | 262 | except WebClientError, e: | ||
3313 | 250 | logger.exception('request_password_reset_token failed with:') | 263 | logger.exception('request_password_reset_token failed with:') |
3315 | 251 | raise ResetPasswordTokenError(e.content.split('\n')[0]) | 264 | raise ResetPasswordTokenError(e[1].split('\n')[0]) |
3316 | 265 | finally: | ||
3317 | 266 | restful_client.shutdown() | ||
3318 | 252 | 267 | ||
3319 | 253 | if result['status'].lower() == SSO_STATUS_OK: | 268 | if result['status'].lower() == SSO_STATUS_OK: |
3321 | 254 | return email | 269 | defer.returnValue(email) |
3322 | 255 | else: | 270 | else: |
3323 | 256 | raise ResetPasswordTokenError('Received invalid reply: %s' % | 271 | raise ResetPasswordTokenError('Received invalid reply: %s' % |
3324 | 257 | result) | 272 | result) |
3325 | 258 | 273 | ||
3326 | 274 | @defer.inlineCallbacks | ||
3327 | 259 | def set_new_password(self, email, token, new_password): | 275 | def set_new_password(self, email, token, new_password): |
3328 | 260 | """Set a new password for the account 'email' to be 'new_password'. | 276 | """Set a new password for the account 'email' to be 'new_password'. |
3329 | 261 | 277 | ||
3330 | @@ -263,16 +279,19 @@ | |||
3331 | 263 | 'request_password_reset_token'. | 279 | 'request_password_reset_token'. |
3332 | 264 | 280 | ||
3333 | 265 | """ | 281 | """ |
3336 | 266 | sso_service = ServiceRoot(None, self.service_url) | 282 | restful_client = restful.RestfulClient(self.service_url) |
3335 | 267 | service = sso_service.registrations.set_new_password | ||
3337 | 268 | try: | 283 | try: |
3341 | 269 | result = service(email=email, token=token, | 284 | result = yield restful_client.restcall( |
3342 | 270 | new_password=new_password) | 285 | u"registration.set_new_password", |
3343 | 271 | except HTTPError, e: | 286 | email=email, token=token, |
3344 | 287 | new_password=new_password) | ||
3345 | 288 | except WebClientError, e: | ||
3346 | 272 | logger.exception('set_new_password failed with:') | 289 | logger.exception('set_new_password failed with:') |
3348 | 273 | raise NewPasswordError(e.content.split('\n')[0]) | 290 | raise NewPasswordError(e[1].split('\n')[0]) |
3349 | 291 | finally: | ||
3350 | 292 | restful_client.shutdown() | ||
3351 | 274 | 293 | ||
3352 | 275 | if result['status'].lower() == SSO_STATUS_OK: | 294 | if result['status'].lower() == SSO_STATUS_OK: |
3354 | 276 | return email | 295 | defer.returnValue(email) |
3355 | 277 | else: | 296 | else: |
3356 | 278 | raise NewPasswordError('Received invalid reply: %s' % result) | 297 | raise NewPasswordError('Received invalid reply: %s' % result) |
3357 | 279 | 298 | ||
3358 | === added file 'ubuntu_sso/constants.py.in' | |||
3359 | --- ubuntu_sso/constants.py.in 1970-01-01 00:00:00 +0000 | |||
3360 | +++ ubuntu_sso/constants.py.in 2012-02-14 22:04:20 +0000 | |||
3361 | @@ -0,0 +1,28 @@ | |||
3362 | 1 | # -*- coding: utf-8 -*- | ||
3363 | 2 | # | ||
3364 | 3 | # Copyright 2012 Canonical Ltd. | ||
3365 | 4 | # | ||
3366 | 5 | # This program is free software: you can redistribute it and/or modify it | ||
3367 | 6 | # under the terms of the GNU General Public License version 3, as published | ||
3368 | 7 | # by the Free Software Foundation. | ||
3369 | 8 | # | ||
3370 | 9 | # This program is distributed in the hope that it will be useful, but | ||
3371 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3372 | 11 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3373 | 12 | # PURPOSE. See the GNU General Public License for more details. | ||
3374 | 13 | # | ||
3375 | 14 | # You should have received a copy of the GNU General Public License along | ||
3376 | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3377 | 16 | |||
3378 | 17 | """Some generated constants. | ||
3379 | 18 | |||
3380 | 19 | DO NO EDIT! This is a generated file. It will be built at installation time. | ||
3381 | 20 | |||
3382 | 21 | """ | ||
3383 | 22 | |||
3384 | 23 | import os | ||
3385 | 24 | |||
3386 | 25 | |||
3387 | 26 | PROJECT_NAME = 'ubuntu-sso-client' | ||
3388 | 27 | PROJECT_DIR = os.path.join('@prefix@', 'share', PROJECT_NAME) | ||
3389 | 28 | BIN_DIR = os.path.join('@prefix@', 'lib', PROJECT_NAME) | ||
3390 | 0 | 29 | ||
3391 | === modified file 'ubuntu_sso/credentials.py' | |||
3392 | --- ubuntu_sso/credentials.py 2012-01-17 15:09:12 +0000 | |||
3393 | +++ ubuntu_sso/credentials.py 2012-02-14 22:04:20 +0000 | |||
3394 | @@ -1,9 +1,6 @@ | |||
3395 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
3396 | 2 | |||
3397 | 3 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | ||
3398 | 4 | # Author: Alejandro J. Cura <alecu@canonical.com> | ||
3399 | 5 | # | 2 | # |
3401 | 6 | # Copyright 2010 Canonical Ltd. | 3 | # Copyright 2010-2012 Canonical Ltd. |
3402 | 7 | # | 4 | # |
3403 | 8 | # 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 |
3404 | 9 | # 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 |
3405 | @@ -26,28 +23,24 @@ | |||
3406 | 26 | * register | 23 | * register |
3407 | 27 | * login | 24 | * login |
3408 | 28 | 25 | ||
3410 | 29 | The first three return a Deferred that will be fired when the operation was | 26 | All the methods return a Deferred that will be fired when the operation was |
3411 | 30 | completed. | 27 | completed. |
3412 | 31 | 28 | ||
3413 | 32 | The second two use the 'success_cb', 'error_cb' and 'denial_cb' to signal the | ||
3414 | 33 | caller when the credentials were retrieved successfully, when there was an | ||
3415 | 34 | error or when the user denied the access to the application, respectively. | ||
3416 | 35 | |||
3417 | 36 | For details, please read the Credentials class documentation. | 29 | For details, please read the Credentials class documentation. |
3418 | 37 | 30 | ||
3419 | 38 | """ | 31 | """ |
3420 | 39 | 32 | ||
3424 | 40 | import sys | 33 | import os |
3422 | 41 | import traceback | ||
3423 | 42 | import urllib2 | ||
3425 | 43 | 34 | ||
3426 | 44 | from functools import wraps | 35 | from functools import wraps |
3427 | 45 | 36 | ||
3428 | 46 | from twisted.internet import defer | 37 | from twisted.internet import defer |
3429 | 47 | 38 | ||
3431 | 48 | from ubuntu_sso import NO_OP, utils | 39 | from ubuntu_sso import UI_EXECUTABLE_GTK, USER_CANCELLATION, USER_SUCCESS |
3432 | 49 | from ubuntu_sso.keyring import Keyring | 40 | from ubuntu_sso.keyring import Keyring |
3433 | 50 | from ubuntu_sso.logger import setup_logging | 41 | from ubuntu_sso.logger import setup_logging |
3434 | 42 | from ubuntu_sso.utils import get_bin_dir, runner | ||
3435 | 43 | |||
3436 | 51 | 44 | ||
3437 | 52 | logger = setup_logging('ubuntu_sso.credentials') | 45 | logger = setup_logging('ubuntu_sso.credentials') |
3438 | 53 | 46 | ||
3439 | @@ -57,44 +50,20 @@ | |||
3440 | 57 | HELP_TEXT_KEY = 'help_text' | 50 | HELP_TEXT_KEY = 'help_text' |
3441 | 58 | WINDOW_ID_KEY = 'window_id' | 51 | WINDOW_ID_KEY = 'window_id' |
3442 | 59 | PING_URL_KEY = 'ping_url' | 52 | PING_URL_KEY = 'ping_url' |
3481 | 60 | UI_MODULE_KEY = 'ui_module' | 53 | POLICY_URL_KEY = 'policy_url' |
3482 | 61 | UI_CLASS_KEY = 'ui_class' | 54 | UI_EXECUTABLE_KEY = 'ui_executable' |
3483 | 62 | SUCCESS_CB_KEY = 'success_cb' | 55 | |
3484 | 63 | ERROR_CB_KEY = 'error_cb' | 56 | |
3485 | 64 | DENIAL_CB_KEY = 'denial_cb' | 57 | class CredentialsError(Exception): |
3486 | 65 | ERROR_KEY = 'error_message' | 58 | """Generic credentials error.""" |
3487 | 66 | ERROR_DETAIL_KEY = 'detailed_error' | 59 | |
3488 | 67 | 60 | ||
3489 | 68 | 61 | class UserCancellationError(CredentialsError): | |
3490 | 69 | def handle_exceptions(msg): | 62 | """The user cancelled the process of authentication.""" |
3491 | 70 | """Handle exceptions using 'msg' as error message.""" | 63 | |
3492 | 71 | 64 | ||
3493 | 72 | def middle(f): | 65 | class UserNotValidatedError(CredentialsError): |
3494 | 73 | """Decorate 'f' to catch all errors.""" | 66 | """The user is not validated.""" |
3457 | 74 | |||
3458 | 75 | @wraps(f) | ||
3459 | 76 | def inner(self, *a, **kw): | ||
3460 | 77 | """Call 'f' within a try-except block. | ||
3461 | 78 | |||
3462 | 79 | If any exception occurs, self.error_cb is called and the exception | ||
3463 | 80 | is logged. | ||
3464 | 81 | """ | ||
3465 | 82 | result = None | ||
3466 | 83 | try: | ||
3467 | 84 | result = f(self, *a, **kw) | ||
3468 | 85 | except: # pylint: disable=W0702 | ||
3469 | 86 | logger.exception('%s (app_name: %s): %s.', | ||
3470 | 87 | f.__name__, self.app_name, msg) | ||
3471 | 88 | logger.error('%s (app_name: %s): Calling error_cb at %r.', | ||
3472 | 89 | f.__name__, self.app_name, self.error_cb) | ||
3473 | 90 | error_dict = {ERROR_KEY: msg, | ||
3474 | 91 | ERROR_DETAIL_KEY: traceback.format_exc()} | ||
3475 | 92 | self.error_cb(error_dict) | ||
3476 | 93 | return result | ||
3477 | 94 | |||
3478 | 95 | return inner | ||
3479 | 96 | |||
3480 | 97 | return middle | ||
3495 | 98 | 67 | ||
3496 | 99 | 68 | ||
3497 | 100 | def handle_failures(msg): | 69 | def handle_failures(msg): |
3498 | @@ -108,20 +77,17 @@ | |||
3499 | 108 | def inner(self, *a, **kw): | 77 | def inner(self, *a, **kw): |
3500 | 109 | """Call 'f' within a try-except block. | 78 | """Call 'f' within a try-except block. |
3501 | 110 | 79 | ||
3504 | 111 | If any exception occurs, self.error_cb is called and the exception | 80 | If any exception occurs, the exception is logged and re-raised. |
3505 | 112 | is logged. | 81 | |
3506 | 113 | """ | 82 | """ |
3507 | 114 | result = None | 83 | result = None |
3508 | 115 | try: | 84 | try: |
3509 | 116 | result = yield f(self, *a, **kw) | 85 | result = yield f(self, *a, **kw) |
3511 | 117 | except Exception: # pylint: disable=W0703 | 86 | except: |
3512 | 118 | logger.exception('%s (app_name: %s): %s.', | 87 | logger.exception('%s (app_name: %s): %s.', |
3513 | 119 | f.__name__, self.app_name, msg) | 88 | f.__name__, self.app_name, msg) |
3519 | 120 | logger.error('%s (app_name: %s): Calling error_cb at %r.', | 89 | raise |
3520 | 121 | f.__name__, self.app_name, self.error_cb) | 90 | |
3516 | 122 | error_dict = {ERROR_KEY: msg, | ||
3517 | 123 | ERROR_DETAIL_KEY: traceback.format_exc()} | ||
3518 | 124 | self.error_cb(error_dict) | ||
3521 | 125 | defer.returnValue(result) | 91 | defer.returnValue(result) |
3522 | 126 | 92 | ||
3523 | 127 | return inner | 93 | return inner |
3524 | @@ -133,14 +99,13 @@ | |||
3525 | 133 | """Credentials management gateway.""" | 99 | """Credentials management gateway.""" |
3526 | 134 | 100 | ||
3527 | 135 | def __init__(self, app_name, tc_url=None, help_text='', | 101 | def __init__(self, app_name, tc_url=None, help_text='', |
3531 | 136 | window_id=0, ping_url=None, | 102 | window_id=0, ping_url=None, policy_url=None, |
3532 | 137 | ui_module='ubuntu_sso.gtk.gui', ui_class='UbuntuSSOClientGUI', | 103 | ui_executable=UI_EXECUTABLE_GTK): |
3530 | 138 | success_cb=NO_OP, error_cb=NO_OP, denial_cb=NO_OP): | ||
3533 | 139 | """Return a Credentials management object. | 104 | """Return a Credentials management object. |
3534 | 140 | 105 | ||
3535 | 141 | 'app_name' is the application name to be displayed in the GUI. | 106 | 'app_name' is the application name to be displayed in the GUI. |
3536 | 142 | 107 | ||
3538 | 143 | 'tc_url' is the URL pointing to Terms & Conditions. If None, no | 108 | 'tc_url' is the url pointing to Terms & Conditions. If None, no |
3539 | 144 | TOS agreement will be displayed. | 109 | TOS agreement will be displayed. |
3540 | 145 | 110 | ||
3541 | 146 | 'help_text' is an explanatory text for the end-users, will be shown | 111 | 'help_text' is an explanatory text for the end-users, will be shown |
3542 | @@ -152,9 +117,11 @@ | |||
3543 | 152 | 'ping_url' is the url that will be pinged when a user registers/logins | 117 | 'ping_url' is the url that will be pinged when a user registers/logins |
3544 | 153 | successfully. The user email will be attached to 'ping_url'. | 118 | successfully. The user email will be attached to 'ping_url'. |
3545 | 154 | 119 | ||
3549 | 155 | 'success_cb' will be called when the credentials were retrieved | 120 | 'policy_url' is the url pointing to the privacy policy. If None, no |
3550 | 156 | successfully. Two params will be passed: the app_name and the | 121 | privacy policy agreement will be displayed. |
3551 | 157 | credentials per se. The credentials is a dictionary of the form: | 122 | |
3552 | 123 | When the credentials are retrieved successfully, a dictionary like the | ||
3553 | 124 | one below is returned: | ||
3554 | 158 | 125 | ||
3555 | 159 | {'token': <value>, | 126 | {'token': <value>, |
3556 | 160 | 'token_secret': <value>, | 127 | 'token_secret': <value>, |
3557 | @@ -162,106 +129,44 @@ | |||
3558 | 162 | 'consumer_secret': <value>, | 129 | 'consumer_secret': <value>, |
3559 | 163 | 'name': <the token name, matches "[app_name] @ [host name]">} | 130 | 'name': <the token name, matches "[app_name] @ [host name]">} |
3560 | 164 | 131 | ||
3561 | 165 | 'error_cb' will be called when the credentials retrieval failed. Two | ||
3562 | 166 | params will be passed: the app_name, and an error dict with 2 keys: | ||
3563 | 167 | the error message (user friendly, not translatable so far), and | ||
3564 | 168 | the detailed error (usually the traceback). | ||
3565 | 169 | |||
3566 | 170 | 'denial_cb' will be called when the user denied the credentials to the | ||
3567 | 171 | caller. A single param is passed: the app_name. | ||
3568 | 172 | |||
3569 | 173 | """ | 132 | """ |
3570 | 174 | self.app_name = app_name | 133 | self.app_name = app_name |
3571 | 175 | self.help_text = help_text | 134 | self.help_text = help_text |
3572 | 176 | self.window_id = window_id | 135 | self.window_id = window_id |
3573 | 177 | self.ping_url = ping_url | 136 | self.ping_url = ping_url |
3574 | 178 | self.tc_url = tc_url | 137 | self.tc_url = tc_url |
3581 | 179 | self.ui_module = ui_module | 138 | self.policy_url = policy_url |
3582 | 180 | self.ui_class = ui_class | 139 | self.ui_executable = ui_executable |
3577 | 181 | self._success_cb = success_cb | ||
3578 | 182 | self._error_cb = error_cb | ||
3579 | 183 | self.denial_cb = denial_cb | ||
3580 | 184 | self.inner = None # will hold the GUI or SSOLoginRoot instance | ||
3583 | 185 | 140 | ||
3584 | 186 | @handle_failures(msg='Problem while retrieving credentials') | ||
3585 | 187 | @defer.inlineCallbacks | 141 | @defer.inlineCallbacks |
3586 | 188 | def _login_success_cb(self, app_name, email): | ||
3587 | 189 | """Store credentials when the login/registration succeeded. | ||
3588 | 190 | |||
3589 | 191 | Also, open self.ping_url/email to notify about this new token. If any | ||
3590 | 192 | error occur, self.error_cb is called. Otherwise, self.success_cb is | ||
3591 | 193 | called. | ||
3592 | 194 | |||
3593 | 195 | Return 0 on success, and a non-zero value (or None) on error. | ||
3594 | 196 | |||
3595 | 197 | """ | ||
3596 | 198 | logger.info('Login/registration was successful for app %r, email %r', | ||
3597 | 199 | app_name, email) | ||
3598 | 200 | creds = yield self.find_credentials() | ||
3599 | 201 | if creds is not None: | ||
3600 | 202 | assert len(creds) > 0, 'Creds are empty! This should not happen' | ||
3601 | 203 | # ping a server with the credentials if we were requested to | ||
3602 | 204 | if self.ping_url is not None: | ||
3603 | 205 | status = yield self._ping_url(app_name, email, creds) | ||
3604 | 206 | if status is None: | ||
3605 | 207 | yield self.clear_credentials() | ||
3606 | 208 | return | ||
3607 | 209 | |||
3608 | 210 | self.success_cb(creds) | ||
3609 | 211 | defer.returnValue(0) | ||
3610 | 212 | |||
3611 | 213 | def _auth_denial_cb(self, app_name): | ||
3612 | 214 | """The user decided not to allow the registration or login.""" | ||
3613 | 215 | logger.warning('Login/registration was denied to app %r', app_name) | ||
3614 | 216 | self.denial_cb(app_name) | ||
3615 | 217 | |||
3616 | 218 | @handle_failures(msg='Problem opening the ping_url') | ||
3617 | 219 | def _ping_url(self, app_name, email, credentials): | ||
3618 | 220 | """Ping the self.ping_url with the email attached. | ||
3619 | 221 | |||
3620 | 222 | Sign the request with the user credentials. The self.ping_url must be | ||
3621 | 223 | defined if this method is being called. | ||
3622 | 224 | |||
3623 | 225 | """ | ||
3624 | 226 | logger.info('Pinging server for app_name %r, ping_url: %r, ' | ||
3625 | 227 | 'email %r.', app_name, self.ping_url, email) | ||
3626 | 228 | try: | ||
3627 | 229 | url = self.ping_url.format(email=email) | ||
3628 | 230 | except IndexError: # tuple index out of range | ||
3629 | 231 | url = self.ping_url.format(email) # format the first substitution | ||
3630 | 232 | |||
3631 | 233 | if url == self.ping_url: | ||
3632 | 234 | logger.debug('Original url (%r) could not be formatted, ' | ||
3633 | 235 | 'appending email (%r).', self.ping_url, email) | ||
3634 | 236 | url = self.ping_url + email | ||
3635 | 237 | |||
3636 | 238 | headers = utils.oauth_headers(url, credentials) | ||
3637 | 239 | request = urllib2.Request(url, headers=headers) | ||
3638 | 240 | logger.debug('Opening the url %r with urllib2.urlopen.', | ||
3639 | 241 | request.get_full_url()) | ||
3640 | 242 | # This code is blocking, we should change this. | ||
3641 | 243 | # I've tried with deferToThread an twisted.web.client.getPage | ||
3642 | 244 | # but the returned deferred will never be fired (nataliabidart). | ||
3643 | 245 | response = urllib2.urlopen(request) | ||
3644 | 246 | logger.debug('Url opened. Response: %s.', response.code) | ||
3645 | 247 | return defer.succeed(response) | ||
3646 | 248 | |||
3647 | 249 | @handle_exceptions(msg='Problem opening the Ubuntu SSO user interface') | ||
3648 | 250 | def _show_ui(self, login_only): | 142 | def _show_ui(self, login_only): |
3649 | 251 | """Shows the UI, connect outcome signals.""" | 143 | """Shows the UI, connect outcome signals.""" |
3663 | 252 | 144 | ui_exe_path = os.path.join(get_bin_dir(), self.ui_executable) | |
3664 | 253 | __import__(self.ui_module) | 145 | args = [ui_exe_path] |
3665 | 254 | gui = sys.modules[self.ui_module] | 146 | for arg in ('app_name', 'help_text', 'ping_url', 'policy_url', |
3666 | 255 | 147 | 'tc_url', 'window_id'): | |
3667 | 256 | self.inner = getattr(gui, self.ui_class)(app_name=self.app_name, | 148 | value = getattr(self, arg) |
3668 | 257 | tc_url=self.tc_url, help_text=self.help_text, | 149 | if value: |
3669 | 258 | window_id=self.window_id, login_only=login_only) | 150 | args.append('--%s' % arg) |
3670 | 259 | 151 | args.append("%s" % str(value)) | |
3671 | 260 | self.inner.login_success_callback = self._login_success_cb | 152 | |
3672 | 261 | self.inner.registration_success_callback = self._login_success_cb | 153 | if login_only: |
3673 | 262 | self.inner.user_cancellation_callback = self._auth_denial_cb | 154 | args.append('--login_only') |
3674 | 263 | 155 | ||
3675 | 264 | @handle_exceptions(msg='Problem logging with email and password.') | 156 | return_code = yield runner.spawn_program(args) |
3676 | 157 | logger.info('_show_ui: received from the ui return code %r.', | ||
3677 | 158 | return_code) | ||
3678 | 159 | |||
3679 | 160 | credentials = None | ||
3680 | 161 | if return_code == USER_SUCCESS: | ||
3681 | 162 | credentials = yield self.find_credentials() | ||
3682 | 163 | elif return_code == USER_CANCELLATION: | ||
3683 | 164 | raise UserCancellationError() | ||
3684 | 165 | else: | ||
3685 | 166 | raise CredentialsError(return_code) | ||
3686 | 167 | |||
3687 | 168 | defer.returnValue(credentials) | ||
3688 | 169 | |||
3689 | 265 | def _do_login(self, email, password): | 170 | def _do_login(self, email, password): |
3690 | 266 | """Login using email/password, connect outcome signals.""" | 171 | """Login using email/password, connect outcome signals.""" |
3691 | 267 | from ubuntu_sso.main import SSOLogin | 172 | from ubuntu_sso.main import SSOLogin |
3692 | @@ -279,62 +184,43 @@ | |||
3693 | 279 | 184 | ||
3694 | 280 | def LoginError(self, app_name, error): | 185 | def LoginError(self, app_name, error): |
3695 | 281 | """There was an error on login.""" | 186 | """There was an error on login.""" |
3696 | 187 | error = CredentialsError(error['errtype']) | ||
3697 | 282 | d.errback(error) | 188 | d.errback(error) |
3698 | 283 | 189 | ||
3699 | 284 | def UserNotValidated(self, app_name, email): | 190 | def UserNotValidated(self, app_name, email): |
3700 | 285 | """User is not validated.""" | 191 | """User is not validated.""" |
3702 | 286 | d.callback(None) | 192 | d.errback(UserNotValidatedError(email)) |
3703 | 287 | 193 | ||
3704 | 288 | # pylint: enable=C0103 | 194 | # pylint: enable=C0103 |
3705 | 289 | 195 | ||
3725 | 290 | self.inner = SSOLogin(proxy=DummyProxy()) | 196 | inner = SSOLogin(proxy=DummyProxy()) |
3726 | 291 | self.inner.login(app_name=self.app_name, | 197 | inner.login(app_name=self.app_name, |
3727 | 292 | email=email, password=password) | 198 | email=email, password=password, |
3728 | 293 | 199 | ping_url=self.ping_url) | |
3729 | 294 | def _success(result): | 200 | |
3730 | 295 | """Check if 'result' is a valid token, and callback properly.""" | 201 | d.addCallback(lambda _: self.find_credentials()) |
3731 | 296 | if result is not None: | 202 | return d |
3732 | 297 | return self._login_success_cb(self.app_name, email) | 203 | |
3714 | 298 | else: | ||
3715 | 299 | error_dict = { | ||
3716 | 300 | 'errtype': 'UserNotValidated', | ||
3717 | 301 | 'message': email, | ||
3718 | 302 | } | ||
3719 | 303 | self._error_cb(self.app_name, error_dict) | ||
3720 | 304 | |||
3721 | 305 | d.addCallback(_success) | ||
3722 | 306 | d.addErrback(lambda f: self._error_cb(self.app_name, f.value)) | ||
3723 | 307 | |||
3724 | 308 | @handle_failures(msg='Problem while retrieving credentials') | ||
3733 | 309 | @defer.inlineCallbacks | 204 | @defer.inlineCallbacks |
3734 | 310 | def _login_or_register(self, login_only, email=None, password=None): | 205 | def _login_or_register(self, login_only, email=None, password=None): |
3736 | 311 | """Get credentials if found else prompt the GUI.""" | 206 | """Get credentials if found else prompt the GUI. |
3737 | 207 | |||
3738 | 208 | Will return either the credentials, or will raise UserCancellationError | ||
3739 | 209 | if the user aborted the operation when the UI was opened. | ||
3740 | 210 | |||
3741 | 211 | """ | ||
3742 | 312 | logger.info("_login_or_register: login_only=%r email=%r.", | 212 | logger.info("_login_or_register: login_only=%r email=%r.", |
3744 | 313 | login_only, email) | 213 | login_only, email) |
3745 | 314 | token = yield self.find_credentials() | 214 | token = yield self.find_credentials() |
3749 | 315 | if token is not None and len(token) > 0: | 215 | if not token: |
3747 | 316 | self.success_cb(token) | ||
3748 | 317 | elif token == {}: | ||
3750 | 318 | if email and password: | 216 | if email and password: |
3752 | 319 | self._do_login(email, password) | 217 | token = yield self._do_login(email, password) |
3753 | 320 | else: | 218 | else: |
3771 | 321 | self._show_ui(login_only) | 219 | token = yield self._show_ui(login_only) |
3772 | 322 | else: | 220 | |
3773 | 323 | # something went wrong with find_credentials, already handled. | 221 | defer.returnValue(token) |
3774 | 324 | logger.info('_login_or_register: call to "find_credentials" went ' | 222 | |
3775 | 325 | 'wrong, and was already handled.') | 223 | @handle_failures(msg='Problem while getting credentials from the keyring') |
3759 | 326 | |||
3760 | 327 | def error_cb(self, error_dict): | ||
3761 | 328 | """Handle error and notify the caller.""" | ||
3762 | 329 | logger.error('Calling error callback at %r (error is %r).', | ||
3763 | 330 | self._error_cb, error_dict) | ||
3764 | 331 | self._error_cb(self.app_name, error_dict) | ||
3765 | 332 | |||
3766 | 333 | def success_cb(self, creds): | ||
3767 | 334 | """Handle success and notify the caller.""" | ||
3768 | 335 | logger.debug('Calling success callback at %r.', self._success_cb) | ||
3769 | 336 | self._success_cb(self.app_name, creds) | ||
3770 | 337 | |||
3776 | 338 | @defer.inlineCallbacks | 224 | @defer.inlineCallbacks |
3777 | 339 | def find_credentials(self): | 225 | def find_credentials(self): |
3778 | 340 | """Get the credentials for 'self.app_name'. Return {} if not there.""" | 226 | """Get the credentials for 'self.app_name'. Return {} if not there.""" |
3779 | @@ -343,20 +229,22 @@ | |||
3780 | 343 | 'result is {}? %s', self.app_name, creds is None) | 229 | 'result is {}? %s', self.app_name, creds is None) |
3781 | 344 | defer.returnValue(creds if creds is not None else {}) | 230 | defer.returnValue(creds if creds is not None else {}) |
3782 | 345 | 231 | ||
3784 | 346 | @defer.inlineCallbacks | 232 | @handle_failures(msg='Problem while clearing credentials in the keyring') |
3785 | 347 | def clear_credentials(self): | 233 | def clear_credentials(self): |
3786 | 348 | """Clear the credentials for 'self.app_name'.""" | 234 | """Clear the credentials for 'self.app_name'.""" |
3788 | 349 | yield Keyring().delete_credentials(self.app_name) | 235 | return Keyring().delete_credentials(self.app_name) |
3789 | 350 | 236 | ||
3791 | 351 | @defer.inlineCallbacks | 237 | @handle_failures(msg='Problem while storing credentials in the keyring') |
3792 | 352 | def store_credentials(self, token): | 238 | def store_credentials(self, token): |
3793 | 353 | """Store the credentials for 'self.app_name'.""" | 239 | """Store the credentials for 'self.app_name'.""" |
3795 | 354 | yield Keyring().set_credentials(self.app_name, token) | 240 | return Keyring().set_credentials(self.app_name, token) |
3796 | 355 | 241 | ||
3797 | 242 | @handle_failures(msg='Problem while performing register') | ||
3798 | 356 | def register(self): | 243 | def register(self): |
3799 | 357 | """Get credentials if found else prompt the GUI to register.""" | 244 | """Get credentials if found else prompt the GUI to register.""" |
3800 | 358 | return self._login_or_register(login_only=False) | 245 | return self._login_or_register(login_only=False) |
3801 | 359 | 246 | ||
3802 | 247 | @handle_failures(msg='Problem while performing login') | ||
3803 | 360 | def login(self, email=None, password=None): | 248 | def login(self, email=None, password=None): |
3804 | 361 | """Get credentials if found else prompt the GUI to login. | 249 | """Get credentials if found else prompt the GUI to login. |
3805 | 362 | 250 | ||
3806 | 363 | 251 | ||
3807 | === modified file 'ubuntu_sso/gtk/__init__.py' | |||
3808 | --- ubuntu_sso/gtk/__init__.py 2010-11-19 19:53:22 +0000 | |||
3809 | +++ ubuntu_sso/gtk/__init__.py 2012-02-14 22:04:20 +0000 | |||
3810 | @@ -1,8 +1,6 @@ | |||
3811 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
3812 | 2 | # | 2 | # |
3816 | 3 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | 3 | # Copyright 2009-2012 Canonical Ltd. |
3814 | 4 | # | ||
3815 | 5 | # Copyright 2009-2010 Canonical Ltd. | ||
3817 | 6 | # | 4 | # |
3818 | 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 |
3819 | 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 |
3820 | 9 | 7 | ||
3821 | === modified file 'ubuntu_sso/gtk/gui.py' | |||
3822 | --- ubuntu_sso/gtk/gui.py 2012-01-31 19:02:36 +0000 | |||
3823 | +++ ubuntu_sso/gtk/gui.py 2012-02-14 22:04:20 +0000 | |||
3824 | @@ -1,6 +1,6 @@ | |||
3825 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
3826 | 2 | # | 2 | # |
3828 | 3 | # Copyright 2010 Canonical Ltd. | 3 | # Copyright 2010-2012 Canonical Ltd. |
3829 | 4 | # | 4 | # |
3830 | 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 |
3831 | 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 |
3832 | @@ -22,18 +22,23 @@ | |||
3833 | 22 | import tempfile | 22 | import tempfile |
3834 | 23 | import webbrowser | 23 | import webbrowser |
3835 | 24 | 24 | ||
3840 | 25 | from functools import wraps | 25 | from functools import wraps, partial |
3841 | 26 | 26 | ||
3842 | 27 | import gtk | 27 | # pylint: disable=E0611,F0401 |
3843 | 28 | 28 | from gi.repository import Gdk, Gtk | |
3844 | 29 | from gi.repository.GdkX11 import X11Window | ||
3845 | 30 | # pylint: enable=E0611,F0401 | ||
3846 | 29 | from twisted.internet import defer | 31 | from twisted.internet import defer |
3847 | 30 | 32 | ||
3848 | 31 | from ubuntu_sso import ( | 33 | from ubuntu_sso import ( |
3849 | 32 | main, | 34 | main, |
3850 | 33 | NO_OP, | 35 | NO_OP, |
3851 | 36 | USER_CANCELLATION, | ||
3852 | 37 | USER_SUCCESS, | ||
3853 | 34 | utils, | 38 | utils, |
3854 | 35 | ) | 39 | ) |
3856 | 36 | from ubuntu_sso.logger import setup_logging | 40 | from ubuntu_sso.logger import setup_gui_logging |
3857 | 41 | from ubuntu_sso.utils import get_data_file | ||
3858 | 37 | from ubuntu_sso.utils.ui import ( | 42 | from ubuntu_sso.utils.ui import ( |
3859 | 38 | CAPTCHA_LOAD_ERROR, | 43 | CAPTCHA_LOAD_ERROR, |
3860 | 39 | CAPTCHA_RELOAD_TOOLTIP, | 44 | CAPTCHA_RELOAD_TOOLTIP, |
3861 | @@ -43,7 +48,7 @@ | |||
3862 | 43 | ERROR, | 48 | ERROR, |
3863 | 44 | FIELD_REQUIRED, | 49 | FIELD_REQUIRED, |
3864 | 45 | FORGOTTEN_PASSWORD_BUTTON, | 50 | FORGOTTEN_PASSWORD_BUTTON, |
3866 | 46 | get_data_file, | 51 | GENERIC_BACKEND_ERROR, |
3867 | 47 | is_min_required_password, | 52 | is_min_required_password, |
3868 | 48 | is_correct_email, | 53 | is_correct_email, |
3869 | 49 | JOIN_HEADER_LABEL, | 54 | JOIN_HEADER_LABEL, |
3870 | @@ -72,7 +77,19 @@ | |||
3871 | 72 | # pylint: disable=E1101 | 77 | # pylint: disable=E1101 |
3872 | 73 | 78 | ||
3873 | 74 | 79 | ||
3875 | 75 | logger = setup_logging('ubuntu_sso.gui') | 80 | logger = setup_gui_logging('ubuntu_sso.gui.gtk') |
3876 | 81 | |||
3877 | 82 | |||
3878 | 83 | # pylint: disable=C0103 | ||
3879 | 84 | def parse_color(color): | ||
3880 | 85 | """Parse a string color into Gdk.Color.""" | ||
3881 | 86 | c = Gdk.RGBA() | ||
3882 | 87 | result = c.parse(color) | ||
3883 | 88 | if not result: | ||
3884 | 89 | logger.warning('Could not parse color %r.', color) | ||
3885 | 90 | return c | ||
3886 | 91 | # pylint: enable=C0103 | ||
3887 | 92 | |||
3888 | 76 | 93 | ||
3889 | 77 | # To be removed when Python bindings provide these constants | 94 | # To be removed when Python bindings provide these constants |
3890 | 78 | # as per http://code.google.com/p/pywebkitgtk/issues/detail?id=44 | 95 | # as per http://code.google.com/p/pywebkitgtk/issues/detail?id=44 |
3891 | @@ -92,11 +109,8 @@ | |||
3892 | 92 | 109 | ||
3893 | 93 | DEFAULT_WIDTH = 30 | 110 | DEFAULT_WIDTH = 30 |
3894 | 94 | # To be replaced by values from the theme (LP: #616526) | 111 | # To be replaced by values from the theme (LP: #616526) |
3900 | 95 | HELP_TEXT_COLOR = gtk.gdk.Color("#bfbfbf") | 112 | HELP_TEXT_COLOR = parse_color("#bfbfbf") |
3901 | 96 | WARNING_TEXT_COLOR = gtk.gdk.Color("red") | 113 | WARNING_TEXT_COLOR = parse_color("red") |
3897 | 97 | |||
3898 | 98 | USER_CANCELLATION = 10 | ||
3899 | 99 | LOGIN_SUCCESS = REGISTRATION_SUCCESS = 0 | ||
3902 | 100 | 114 | ||
3903 | 101 | 115 | ||
3904 | 102 | def log_call(f): | 116 | def log_call(f): |
3905 | @@ -111,9 +125,12 @@ | |||
3906 | 111 | return inner | 125 | return inner |
3907 | 112 | 126 | ||
3908 | 113 | 127 | ||
3910 | 114 | class LabeledEntry(gtk.Entry): | 128 | class LabeledEntry(Gtk.Entry): |
3911 | 115 | """An entry that displays the label within itself ina grey color.""" | 129 | """An entry that displays the label within itself ina grey color.""" |
3912 | 116 | 130 | ||
3913 | 131 | # Use of super on an old style class | ||
3914 | 132 | # pylint: disable=E1002 | ||
3915 | 133 | |||
3916 | 117 | def __init__(self, label, is_password=False, *args, **kwargs): | 134 | def __init__(self, label, is_password=False, *args, **kwargs): |
3917 | 118 | self.label = label | 135 | self.label = label |
3918 | 119 | self.is_password = is_password | 136 | self.is_password = is_password |
3919 | @@ -133,7 +150,8 @@ | |||
3920 | 133 | """Clear text and restore text color.""" | 150 | """Clear text and restore text color.""" |
3921 | 134 | self.set_text(self.get_text()) | 151 | self.set_text(self.get_text()) |
3922 | 135 | 152 | ||
3924 | 136 | self.modify_text(gtk.STATE_NORMAL, None) # restore to theme's default | 153 | # restore to theme's default |
3925 | 154 | self.override_color(Gtk.StateFlags.NORMAL, None) | ||
3926 | 137 | 155 | ||
3927 | 138 | if self.is_password: | 156 | if self.is_password: |
3928 | 139 | self.set_visibility(False) | 157 | self.set_visibility(False) |
3929 | @@ -146,7 +164,7 @@ | |||
3930 | 146 | return | 164 | return |
3931 | 147 | 165 | ||
3932 | 148 | self.set_text(self.label) | 166 | self.set_text(self.label) |
3934 | 149 | self.modify_text(gtk.STATE_NORMAL, HELP_TEXT_COLOR) | 167 | self.override_color(Gtk.StateFlags.NORMAL, HELP_TEXT_COLOR) |
3935 | 150 | 168 | ||
3936 | 151 | if self.is_password: | 169 | if self.is_password: |
3937 | 152 | self.set_visibility(True) | 170 | self.set_visibility(True) |
3938 | @@ -163,7 +181,7 @@ | |||
3939 | 163 | def set_warning(self, warning_msg): | 181 | def set_warning(self, warning_msg): |
3940 | 164 | """Display warning as secondary icon, set 'warning_msg' as tooltip.""" | 182 | """Display warning as secondary icon, set 'warning_msg' as tooltip.""" |
3941 | 165 | self.warning = warning_msg | 183 | self.warning = warning_msg |
3943 | 166 | self.set_property('secondary-icon-stock', gtk.STOCK_DIALOG_WARNING) | 184 | self.set_property('secondary-icon-stock', Gtk.STOCK_DIALOG_WARNING) |
3944 | 167 | self.set_property('secondary-icon-sensitive', True) | 185 | self.set_property('secondary-icon-sensitive', True) |
3945 | 168 | self.set_property('secondary-icon-activatable', False) | 186 | self.set_property('secondary-icon-activatable', False) |
3946 | 169 | self.set_property('secondary-icon-tooltip-text', warning_msg) | 187 | self.set_property('secondary-icon-tooltip-text', warning_msg) |
3947 | @@ -185,8 +203,6 @@ | |||
3948 | 185 | logger.debug('UbuntuSSOClientGUI: app_name %r, kwargs %r.', | 203 | logger.debug('UbuntuSSOClientGUI: app_name %r, kwargs %r.', |
3949 | 186 | app_name, kwargs) | 204 | app_name, kwargs) |
3950 | 187 | 205 | ||
3951 | 188 | gtk.link_button_set_uri_hook(NO_OP) | ||
3952 | 189 | |||
3953 | 190 | self._captcha_filename = tempfile.mktemp() | 206 | self._captcha_filename = tempfile.mktemp() |
3954 | 191 | self._captcha_id = None | 207 | self._captcha_id = None |
3955 | 192 | self._signals_receivers = {} | 208 | self._signals_receivers = {} |
3956 | @@ -201,29 +217,22 @@ | |||
3957 | 201 | window_id = kwargs.get('window_id', 0) | 217 | window_id = kwargs.get('window_id', 0) |
3958 | 202 | self.close_callback = kwargs.get('close_callback', NO_OP) | 218 | self.close_callback = kwargs.get('close_callback', NO_OP) |
3959 | 203 | self.backend = None | 219 | self.backend = None |
3960 | 204 | # the following 3 callbacks will be removed as soon as | ||
3961 | 205 | # the backend stop using them | ||
3962 | 206 | self.login_success_callback = NO_OP | ||
3963 | 207 | self.registration_success_callback = NO_OP | ||
3964 | 208 | self.user_cancellation_callback = NO_OP | ||
3965 | 209 | |||
3966 | 210 | self.user_email = None | 220 | self.user_email = None |
3967 | 211 | self.user_password = None | 221 | self.user_password = None |
3968 | 212 | 222 | ||
3969 | 213 | ui_filename = get_data_file('gtk', 'ui.glade') | 223 | ui_filename = get_data_file('gtk', 'ui.glade') |
3971 | 214 | builder = gtk.Builder() | 224 | builder = Gtk.Builder() |
3972 | 215 | builder.add_from_file(ui_filename) | 225 | builder.add_from_file(ui_filename) |
3973 | 216 | builder.connect_signals(self) | 226 | builder.connect_signals(self) |
3974 | 217 | 227 | ||
3975 | 218 | self.widgets = [] | 228 | self.widgets = [] |
3976 | 219 | self.warnings = [] | 229 | self.warnings = [] |
3977 | 220 | self.cancels = [] | 230 | self.cancels = [] |
3978 | 221 | self.labels = [] | ||
3979 | 222 | for obj in builder.get_objects(): | 231 | for obj in builder.get_objects(): |
3980 | 223 | name = getattr(obj, 'name', None) | 232 | name = getattr(obj, 'name', None) |
3982 | 224 | if name is None and isinstance(obj, gtk.Buildable): | 233 | if name is None and isinstance(obj, Gtk.Buildable): |
3983 | 225 | # work around bug lp:507739 | 234 | # work around bug lp:507739 |
3985 | 226 | name = gtk.Buildable.get_name(obj) | 235 | name = Gtk.Buildable.get_name(obj) |
3986 | 227 | if name is None: | 236 | if name is None: |
3987 | 228 | logging.warn("%s has no name (??)", obj) | 237 | logging.warn("%s has no name (??)", obj) |
3988 | 229 | else: | 238 | else: |
3989 | @@ -235,9 +244,12 @@ | |||
3990 | 235 | if 'cancel_button' in name: | 244 | if 'cancel_button' in name: |
3991 | 236 | obj.connect('clicked', self.on_close_clicked) | 245 | obj.connect('clicked', self.on_close_clicked) |
3992 | 237 | self.cancels.append(obj) | 246 | self.cancels.append(obj) |
3996 | 238 | if 'label' in name: | 247 | |
3997 | 239 | obj.connect('size-allocate', self.on_size_allocate) | 248 | # Connect the activate-link signal here |
3998 | 240 | self.labels.append(obj) | 249 | # GtkBuilder in GTK 3 seems to not do this |
3999 | 250 | self.login_button.connect('activate-link', self.on_activate_link) | ||
4000 | 251 | self.forgotten_password_button.connect('activate-link', | ||
4001 | 252 | self.on_activate_link) | ||
4002 | 241 | 253 | ||
4003 | 242 | self.entries = (u'name_entry', u'email1_entry', u'email2_entry', | 254 | self.entries = (u'name_entry', u'email1_entry', u'email2_entry', |
4004 | 243 | u'password1_entry', u'password2_entry', | 255 | u'password1_entry', u'password2_entry', |
4005 | @@ -297,7 +309,10 @@ | |||
4006 | 297 | # still do everything as a standalone window. Also, | 309 | # still do everything as a standalone window. Also, |
4007 | 298 | # window_foreign_new may return None breaking set_transient_for. | 310 | # window_foreign_new may return None breaking set_transient_for. |
4008 | 299 | try: | 311 | try: |
4010 | 300 | win = gtk.gdk.window_foreign_new(window_id) | 312 | display = Gdk.Display.get_default() |
4011 | 313 | # this is not working, we need to create a XLib.window | ||
4012 | 314 | # as a second parameter to foreign_new_for_display | ||
4013 | 315 | win = X11Window.foreign_new_for_display(display, None) | ||
4014 | 301 | self.window.realize() | 316 | self.window.realize() |
4015 | 302 | self.window.window.set_transient_for(win) | 317 | self.window.window.set_transient_for(win) |
4016 | 303 | except: # pylint: disable=W0702 | 318 | except: # pylint: disable=W0702 |
4017 | @@ -366,20 +381,21 @@ | |||
4018 | 366 | 381 | ||
4019 | 367 | def _add_spinner_to_container(self, container, legend=None): | 382 | def _add_spinner_to_container(self, container, legend=None): |
4020 | 368 | """Add a spinner to 'container'.""" | 383 | """Add a spinner to 'container'.""" |
4022 | 369 | spinner = gtk.Spinner() | 384 | spinner = Gtk.Spinner() |
4023 | 370 | spinner.start() | 385 | spinner.start() |
4024 | 371 | 386 | ||
4026 | 372 | label = gtk.Label() | 387 | label = Gtk.Label() |
4027 | 373 | if legend: | 388 | if legend: |
4028 | 374 | label.set_text(legend) | 389 | label.set_text(legend) |
4029 | 375 | else: | 390 | else: |
4030 | 376 | label.set_text(LOADING) | 391 | label.set_text(LOADING) |
4031 | 377 | 392 | ||
4035 | 378 | hbox = gtk.HBox(spacing=5) | 393 | hbox = Gtk.HBox(spacing=5) |
4036 | 379 | hbox.pack_start(spinner, expand=False) | 394 | hbox.pack_start(spinner, expand=False, fill=True, padding=0) |
4037 | 380 | hbox.pack_start(label, expand=False) | 395 | hbox.pack_start(label, expand=False, fill=True, padding=0) |
4038 | 381 | 396 | ||
4040 | 382 | alignment = gtk.Alignment(xalign=0.5, yalign=0.5) | 397 | alignment = Gtk.Alignment(xalign=0.5, yalign=0.5, |
4041 | 398 | xscale=0, yscale=0) | ||
4042 | 383 | alignment.add(hbox) | 399 | alignment.add(hbox) |
4043 | 384 | alignment.show_all() | 400 | alignment.show_all() |
4044 | 385 | 401 | ||
4045 | @@ -394,7 +410,7 @@ | |||
4046 | 394 | def _set_warning_message(self, widget, message): | 410 | def _set_warning_message(self, widget, message): |
4047 | 395 | """Set 'message' as text for 'widget'.""" | 411 | """Set 'message' as text for 'widget'.""" |
4048 | 396 | widget.set_text(message) | 412 | widget.set_text(message) |
4050 | 397 | widget.modify_fg(gtk.STATE_NORMAL, WARNING_TEXT_COLOR) | 413 | widget.override_color(Gtk.StateFlags.NORMAL, WARNING_TEXT_COLOR) |
4051 | 398 | widget.show() | 414 | widget.show() |
4052 | 399 | 415 | ||
4053 | 400 | def _clear_warnings(self): | 416 | def _clear_warnings(self): |
4054 | @@ -409,6 +425,12 @@ | |||
4055 | 409 | text = widget.get_text() | 425 | text = widget.get_text() |
4056 | 410 | return bool(text and not text.isspace()) | 426 | return bool(text and not text.isspace()) |
4057 | 411 | 427 | ||
4058 | 428 | def _handle_error(self, remote_call, handler, error): | ||
4059 | 429 | """Handle any error when calling the remote backend.""" | ||
4060 | 430 | logger.error('Remote call %r failed with: %r', remote_call, error) | ||
4061 | 431 | errordict = {'message': GENERIC_BACKEND_ERROR} | ||
4062 | 432 | handler(self.app_name, errordict) | ||
4063 | 433 | |||
4064 | 412 | # build pages | 434 | # build pages |
4065 | 413 | 435 | ||
4066 | 414 | def _append_pages(self): | 436 | def _append_pages(self): |
4067 | @@ -433,7 +455,7 @@ | |||
4068 | 433 | 455 | ||
4069 | 434 | def _append_page(self, page): | 456 | def _append_page(self, page): |
4070 | 435 | """Append 'page' to the 'window'.""" | 457 | """Append 'page' to the 'window'.""" |
4072 | 436 | self.content.append_page(page) | 458 | self.content.append_page(page, None) |
4073 | 437 | 459 | ||
4074 | 438 | def _set_header(self, header): | 460 | def _set_header(self, header): |
4075 | 439 | """Set 'header' as the window title and header.""" | 461 | """Set 'header' as the window title and header.""" |
4076 | @@ -464,16 +486,19 @@ | |||
4077 | 464 | logger.info('Calling generate_captcha with filename path at %r', | 486 | logger.info('Calling generate_captcha with filename path at %r', |
4078 | 465 | self._captcha_filename) | 487 | self._captcha_filename) |
4079 | 466 | self.warning_label.set_text('') | 488 | self.warning_label.set_text('') |
4082 | 467 | self.backend.generate_captcha(self.app_name, self._captcha_filename, | 489 | f = self.backend.generate_captcha |
4083 | 468 | reply_handler=NO_OP, error_handler=NO_OP) | 490 | error_handler = partial(self._handle_error, f, |
4084 | 491 | self.on_captcha_generation_error) | ||
4085 | 492 | f(self.app_name, self._captcha_filename, | ||
4086 | 493 | reply_handler=NO_OP, error_handler=error_handler) | ||
4087 | 469 | self._set_captcha_loading() | 494 | self._set_captcha_loading() |
4088 | 470 | 495 | ||
4089 | 471 | def _set_captcha_loading(self): | 496 | def _set_captcha_loading(self): |
4090 | 472 | """Present a spinner to the user while the captcha is downloaded.""" | 497 | """Present a spinner to the user while the captcha is downloaded.""" |
4091 | 473 | self.captcha_image.hide() | 498 | self.captcha_image.hide() |
4092 | 474 | self._add_spinner_to_container(self.captcha_loading) | 499 | self._add_spinner_to_container(self.captcha_loading) |
4095 | 475 | white = gtk.gdk.Color('white') | 500 | self.captcha_loading.override_background_color(Gtk.StateFlags.NORMAL, |
4096 | 476 | self.captcha_loading.modify_bg(gtk.STATE_NORMAL, white) | 501 | parse_color('white')) |
4097 | 477 | self.captcha_loading.show_all() | 502 | self.captcha_loading.show_all() |
4098 | 478 | self.join_ok_button.set_sensitive(False) | 503 | self.join_ok_button.set_sensitive(False) |
4099 | 479 | 504 | ||
4100 | @@ -490,20 +515,26 @@ | |||
4101 | 490 | self.enter_details_vbox.header = JOIN_HEADER_LABEL % d | 515 | self.enter_details_vbox.header = JOIN_HEADER_LABEL % d |
4102 | 491 | self.enter_details_vbox.help_text = self.help_text | 516 | self.enter_details_vbox.help_text = self.help_text |
4103 | 492 | self.enter_details_vbox.default_widget = self.join_ok_button | 517 | self.enter_details_vbox.default_widget = self.join_ok_button |
4105 | 493 | self.join_ok_button.set_flags(gtk.CAN_DEFAULT) | 518 | self.join_ok_button.set_can_default(True) |
4106 | 494 | 519 | ||
4108 | 495 | self.enter_details_vbox.pack_start(self.name_entry, expand=False) | 520 | self.enter_details_vbox.pack_start(self.name_entry, |
4109 | 521 | expand=False, fill=True, padding=0) | ||
4110 | 496 | self.enter_details_vbox.reorder_child(self.name_entry, 0) | 522 | self.enter_details_vbox.reorder_child(self.name_entry, 0) |
4111 | 497 | entry = self.captcha_solution_entry | 523 | entry = self.captcha_solution_entry |
4113 | 498 | self.captcha_solution_vbox.pack_start(entry, expand=False) | 524 | self.captcha_solution_vbox.pack_start(entry, |
4114 | 525 | expand=False, fill=True, padding=0) | ||
4115 | 499 | msg = CAPTCHA_RELOAD_TOOLTIP | 526 | msg = CAPTCHA_RELOAD_TOOLTIP |
4116 | 500 | self.captcha_reload_button.set_tooltip_text(msg) | 527 | self.captcha_reload_button.set_tooltip_text(msg) |
4117 | 501 | 528 | ||
4120 | 502 | self.emails_hbox.pack_start(self.email1_entry, expand=False) | 529 | self.emails_hbox.pack_start(self.email1_entry, |
4121 | 503 | self.emails_hbox.pack_start(self.email2_entry, expand=False) | 530 | expand=False, fill=True, padding=0) |
4122 | 531 | self.emails_hbox.pack_start(self.email2_entry, | ||
4123 | 532 | expand=False, fill=True, padding=0) | ||
4124 | 504 | 533 | ||
4127 | 505 | self.passwords_hbox.pack_start(self.password1_entry, expand=False) | 534 | self.passwords_hbox.pack_start(self.password1_entry, |
4128 | 506 | self.passwords_hbox.pack_start(self.password2_entry, expand=False) | 535 | expand=False, fill=True, padding=0) |
4129 | 536 | self.passwords_hbox.pack_start(self.password2_entry, | ||
4130 | 537 | expand=False, fill=True, padding=0) | ||
4131 | 507 | help_msg = '<small>%s</small>' % PASSWORD_HELP | 538 | help_msg = '<small>%s</small>' % PASSWORD_HELP |
4132 | 508 | self.password_help_label.set_markup(help_msg) | 539 | self.password_help_label.set_markup(help_msg) |
4133 | 509 | 540 | ||
4134 | @@ -519,7 +550,7 @@ | |||
4135 | 519 | self.yes_to_tc_checkbutton.set_label(msg) | 550 | self.yes_to_tc_checkbutton.set_label(msg) |
4136 | 520 | self.tc_button.set_label(TC_BUTTON) | 551 | self.tc_button.set_label(TC_BUTTON) |
4137 | 521 | else: | 552 | else: |
4139 | 522 | self.tc_vbox.hide_all() | 553 | self.tc_vbox.hide() |
4140 | 523 | self.login_button.set_label(LOGIN_BUTTON_LABEL) | 554 | self.login_button.set_label(LOGIN_BUTTON_LABEL) |
4141 | 524 | 555 | ||
4142 | 525 | return self.enter_details_vbox | 556 | return self.enter_details_vbox |
4143 | @@ -528,7 +559,7 @@ | |||
4144 | 528 | """Build the Terms & Conditions page.""" | 559 | """Build the Terms & Conditions page.""" |
4145 | 529 | self.tc_browser_vbox.help_text = '' | 560 | self.tc_browser_vbox.help_text = '' |
4146 | 530 | self.tc_browser_vbox.default_widget = self.tc_back_button | 561 | self.tc_browser_vbox.default_widget = self.tc_back_button |
4148 | 531 | self.tc_browser_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 562 | self.tc_browser_vbox.default_widget.set_can_default(True) |
4149 | 532 | return self.tc_browser_vbox | 563 | return self.tc_browser_vbox |
4150 | 533 | 564 | ||
4151 | 534 | def _build_processing_page(self): | 565 | def _build_processing_page(self): |
4152 | @@ -541,17 +572,16 @@ | |||
4153 | 541 | def _build_verify_email_page(self): | 572 | def _build_verify_email_page(self): |
4154 | 542 | """Build the verify email page.""" | 573 | """Build the verify email page.""" |
4155 | 543 | self.verify_email_vbox.default_widget = self.verify_token_button | 574 | self.verify_email_vbox.default_widget = self.verify_token_button |
4157 | 544 | self.verify_email_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 575 | self.verify_email_vbox.default_widget.set_can_default(True) |
4158 | 545 | 576 | ||
4159 | 546 | self.verify_email_details_vbox.pack_start(self.email_token_entry, | 577 | self.verify_email_details_vbox.pack_start(self.email_token_entry, |
4162 | 547 | expand=False) | 578 | expand=False, fill=True, padding=0) |
4161 | 548 | |||
4163 | 549 | return self.verify_email_vbox | 579 | return self.verify_email_vbox |
4164 | 550 | 580 | ||
4165 | 551 | def _build_finish_page(self): | 581 | def _build_finish_page(self): |
4166 | 552 | """Build the success page.""" | 582 | """Build the success page.""" |
4167 | 553 | self.finish_vbox.default_widget = self.finish_close_button | 583 | self.finish_vbox.default_widget = self.finish_close_button |
4169 | 554 | self.finish_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 584 | self.finish_vbox.default_widget.set_can_default(True) |
4170 | 555 | self.finish_vbox.label = self.finish_label | 585 | self.finish_vbox.label = self.finish_label |
4171 | 556 | return self.finish_vbox | 586 | return self.finish_vbox |
4172 | 557 | 587 | ||
4173 | @@ -561,11 +591,13 @@ | |||
4174 | 561 | self.login_vbox.header = LOGIN_HEADER_LABEL % d | 591 | self.login_vbox.header = LOGIN_HEADER_LABEL % d |
4175 | 562 | self.login_vbox.help_text = CONNECT_HELP_LABEL % d | 592 | self.login_vbox.help_text = CONNECT_HELP_LABEL % d |
4176 | 563 | self.login_vbox.default_widget = self.login_ok_button | 593 | self.login_vbox.default_widget = self.login_ok_button |
4178 | 564 | self.login_vbox.default_widget.set_flags(gtk.CAN_DEFAULT) | 594 | self.login_vbox.default_widget.set_can_default(True) |
4179 | 565 | 595 | ||
4181 | 566 | self.login_details_vbox.pack_start(self.login_email_entry) | 596 | self.login_details_vbox.pack_start(self.login_email_entry, |
4182 | 597 | expand=True, fill=True, padding=0) | ||
4183 | 567 | self.login_details_vbox.reorder_child(self.login_email_entry, 0) | 598 | self.login_details_vbox.reorder_child(self.login_email_entry, 0) |
4185 | 568 | self.login_details_vbox.pack_start(self.login_password_entry) | 599 | self.login_details_vbox.pack_start(self.login_password_entry, |
4186 | 600 | expand=True, fill=True, padding=0) | ||
4187 | 569 | self.login_details_vbox.reorder_child(self.login_password_entry, 1) | 601 | self.login_details_vbox.reorder_child(self.login_password_entry, 1) |
4188 | 570 | 602 | ||
4189 | 571 | msg = FORGOTTEN_PASSWORD_BUTTON | 603 | msg = FORGOTTEN_PASSWORD_BUTTON |
4190 | @@ -580,12 +612,12 @@ | |||
4191 | 580 | text = REQUEST_PASSWORD_TOKEN_LABEL % {'app_name': self.app_label} | 612 | text = REQUEST_PASSWORD_TOKEN_LABEL % {'app_name': self.app_label} |
4192 | 581 | self.request_password_token_vbox.help_text = text | 613 | self.request_password_token_vbox.help_text = text |
4193 | 582 | btn = self.request_password_token_ok_button | 614 | btn = self.request_password_token_ok_button |
4195 | 583 | btn.set_flags(gtk.CAN_DEFAULT) | 615 | btn.set_can_default(True) |
4196 | 584 | self.request_password_token_vbox.default_widget = btn | 616 | self.request_password_token_vbox.default_widget = btn |
4197 | 585 | 617 | ||
4198 | 586 | entry = self.reset_email_entry | 618 | entry = self.reset_email_entry |
4199 | 587 | self.request_password_token_details_vbox.pack_start(entry, | 619 | self.request_password_token_details_vbox.pack_start(entry, |
4201 | 588 | expand=False) | 620 | expand=False, fill=True, padding=0) |
4202 | 589 | cb = self.on_reset_email_entry_changed | 621 | cb = self.on_reset_email_entry_changed |
4203 | 590 | self.reset_email_entry.connect('changed', cb) | 622 | self.reset_email_entry.connect('changed', cb) |
4204 | 591 | self.request_password_token_ok_button.set_label(NEXT) | 623 | self.request_password_token_ok_button.set_label(NEXT) |
4205 | @@ -598,13 +630,14 @@ | |||
4206 | 598 | self.set_new_password_vbox.header = RESET_PASSWORD | 630 | self.set_new_password_vbox.header = RESET_PASSWORD |
4207 | 599 | self.set_new_password_vbox.help_text = SET_NEW_PASSWORD_LABEL | 631 | self.set_new_password_vbox.help_text = SET_NEW_PASSWORD_LABEL |
4208 | 600 | btn = self.set_new_password_ok_button | 632 | btn = self.set_new_password_ok_button |
4210 | 601 | btn.set_flags(gtk.CAN_DEFAULT) | 633 | btn.set_can_default(True) |
4211 | 602 | self.set_new_password_vbox.default_widget = btn | 634 | self.set_new_password_vbox.default_widget = btn |
4212 | 603 | 635 | ||
4213 | 604 | for entry in (self.reset_code_entry, | 636 | for entry in (self.reset_code_entry, |
4214 | 605 | self.reset_password1_entry, | 637 | self.reset_password1_entry, |
4215 | 606 | self.reset_password2_entry): | 638 | self.reset_password2_entry): |
4217 | 607 | self.set_new_password_details_vbox.pack_start(entry, expand=False) | 639 | self.set_new_password_details_vbox.pack_start(entry, |
4218 | 640 | expand=False, fill=True, padding=0) | ||
4219 | 608 | 641 | ||
4220 | 609 | cb = self.on_set_new_password_entries_changed | 642 | cb = self.on_set_new_password_entries_changed |
4221 | 610 | self.reset_code_entry.connect('changed', cb) | 643 | self.reset_code_entry.connect('changed', cb) |
4222 | @@ -645,6 +678,11 @@ | |||
4223 | 645 | 678 | ||
4224 | 646 | # GTK callbacks | 679 | # GTK callbacks |
4225 | 647 | 680 | ||
4226 | 681 | def destroy(self): | ||
4227 | 682 | """Destroy this UI.""" | ||
4228 | 683 | self.window.hide() | ||
4229 | 684 | self.window.destroy() | ||
4230 | 685 | |||
4231 | 648 | def connect(self, signal_name, handler, *args, **kwargs): | 686 | def connect(self, signal_name, handler, *args, **kwargs): |
4232 | 649 | """Connect 'signal_name' with 'handler'.""" | 687 | """Connect 'signal_name' with 'handler'.""" |
4233 | 650 | logger.debug('connect: signal %r, handler %r, args %r, kwargs, %r', | 688 | logger.debug('connect: signal %r, handler %r, args %r, kwargs, %r', |
4234 | @@ -661,9 +699,9 @@ | |||
4235 | 661 | self._done = True | 699 | self._done = True |
4236 | 662 | self._set_current_page(self.error_vbox) | 700 | self._set_current_page(self.error_vbox) |
4237 | 663 | 701 | ||
4241 | 664 | def on_size_allocate(self, widget, allocation): | 702 | def on_activate_link(self, button): |
4242 | 665 | """The widget can re rezised, embrase it!.""" | 703 | """Do nothing, used for LinkButtons that are used as regular ones.""" |
4243 | 666 | widget.set_size_request(allocation.width - 2, -1) | 704 | return True |
4244 | 667 | 705 | ||
4245 | 668 | def on_close_clicked(self, *args, **kwargs): | 706 | def on_close_clicked(self, *args, **kwargs): |
4246 | 669 | """Call self.close_callback if defined.""" | 707 | """Call self.close_callback if defined.""" |
4247 | @@ -678,16 +716,16 @@ | |||
4248 | 678 | self.window.hide() | 716 | self.window.hide() |
4249 | 679 | 717 | ||
4250 | 680 | # process any pending events before callbacking with result | 718 | # process any pending events before callbacking with result |
4253 | 681 | while gtk.events_pending(): | 719 | while Gtk.events_pending(): |
4254 | 682 | gtk.main_iteration() | 720 | Gtk.main_iteration() |
4255 | 683 | 721 | ||
4257 | 684 | return_code = LOGIN_SUCCESS | 722 | return_code = USER_SUCCESS |
4258 | 685 | if not self._done: | 723 | if not self._done: |
4259 | 686 | self.user_cancellation_callback(self.app_name) | ||
4260 | 687 | return_code = USER_CANCELLATION | 724 | return_code = USER_CANCELLATION |
4261 | 725 | logger.info('Return code will be %r.', return_code) | ||
4262 | 688 | 726 | ||
4263 | 689 | # call user defined callback | 727 | # call user defined callback |
4265 | 690 | logger.info('Calling custom close_callback %r with params %r, %r', | 728 | logger.debug('Calling custom close_callback %r with params %r, %r', |
4266 | 691 | self.close_callback, args, kwargs) | 729 | self.close_callback, args, kwargs) |
4267 | 692 | self.close_callback(*args, **kwargs) | 730 | self.close_callback(*args, **kwargs) |
4268 | 693 | 731 | ||
4269 | @@ -750,10 +788,14 @@ | |||
4270 | 750 | logger.info('Calling register_user with email %r, password <hidden>,' \ | 788 | logger.info('Calling register_user with email %r, password <hidden>,' \ |
4271 | 751 | ' name %r, captcha_id %r and captcha_solution %r.', email1, | 789 | ' name %r, captcha_id %r and captcha_solution %r.', email1, |
4272 | 752 | name, self._captcha_id, captcha_solution) | 790 | name, self._captcha_id, captcha_solution) |
4273 | 791 | |||
4274 | 753 | f = self.backend.register_user | 792 | f = self.backend.register_user |
4278 | 754 | f(self.app_name, email1, password1, name, | 793 | error_handler = partial(self._handle_error, f, |
4279 | 755 | self._captcha_id, captcha_solution, | 794 | self.on_user_registration_error) |
4280 | 756 | reply_handler=NO_OP, error_handler=NO_OP) | 795 | f(unicode(self.app_name), email1.decode('utf8'), |
4281 | 796 | password1.decode('utf8'), name.decode('utf8'), | ||
4282 | 797 | unicode(self._captcha_id), captcha_solution.decode('utf8'), | ||
4283 | 798 | reply_handler=NO_OP, error_handler=error_handler) | ||
4284 | 757 | 799 | ||
4285 | 758 | def on_verify_token_button_clicked(self, *args, **kwargs): | 800 | def on_verify_token_button_clicked(self, *args, **kwargs): |
4286 | 759 | """The user entered the email token, let's verify!""" | 801 | """The user entered the email token, let's verify!""" |
4287 | @@ -772,7 +814,7 @@ | |||
4288 | 772 | 814 | ||
4289 | 773 | args = (self.app_name, email, password, email_token) | 815 | args = (self.app_name, email, password, email_token) |
4290 | 774 | if self.ping_url: | 816 | if self.ping_url: |
4292 | 775 | f = self.backend.validate_email_with_ping | 817 | f = self.backend.validate_email_and_ping |
4293 | 776 | args = args + (self.ping_url,) | 818 | args = args + (self.ping_url,) |
4294 | 777 | else: | 819 | else: |
4295 | 778 | f = self.backend.validate_email | 820 | f = self.backend.validate_email |
4296 | @@ -780,7 +822,9 @@ | |||
4297 | 780 | logger.info('Calling validate_email with email %r, password <hidden>, ' | 822 | logger.info('Calling validate_email with email %r, password <hidden>, ' |
4298 | 781 | 'app_name %r and email_token %r.', email, self.app_name, | 823 | 'app_name %r and email_token %r.', email, self.app_name, |
4299 | 782 | email_token) | 824 | email_token) |
4301 | 783 | f(*args, reply_handler=NO_OP, error_handler=NO_OP) | 825 | error_handler = partial(self._handle_error, f, |
4302 | 826 | self.on_email_validation_error) | ||
4303 | 827 | f(*args, reply_handler=NO_OP, error_handler=error_handler) | ||
4304 | 784 | 828 | ||
4305 | 785 | self._set_current_page(self.processing_vbox) | 829 | self._set_current_page(self.processing_vbox) |
4306 | 786 | 830 | ||
4307 | @@ -809,12 +853,13 @@ | |||
4308 | 809 | 853 | ||
4309 | 810 | args = (self.app_name, email, password) | 854 | args = (self.app_name, email, password) |
4310 | 811 | if self.ping_url: | 855 | if self.ping_url: |
4312 | 812 | f = self.backend.login_with_ping | 856 | f = self.backend.login_and_ping |
4313 | 813 | args = args + (self.ping_url,) | 857 | args = args + (self.ping_url,) |
4314 | 814 | else: | 858 | else: |
4315 | 815 | f = self.backend.login | 859 | f = self.backend.login |
4316 | 816 | 860 | ||
4318 | 817 | f(*args, reply_handler=NO_OP, error_handler=NO_OP) | 861 | error_handler = partial(self._handle_error, f, self.on_login_error) |
4319 | 862 | f(*args, reply_handler=NO_OP, error_handler=error_handler) | ||
4320 | 818 | 863 | ||
4321 | 819 | self._set_current_page(self.processing_vbox) | 864 | self._set_current_page(self.processing_vbox) |
4322 | 820 | self.user_email = email | 865 | self.user_email = email |
4323 | @@ -843,7 +888,10 @@ | |||
4324 | 843 | 888 | ||
4325 | 844 | logger.info('Calling request_password_reset_token with %r.', email) | 889 | logger.info('Calling request_password_reset_token with %r.', email) |
4326 | 845 | f = self.backend.request_password_reset_token | 890 | f = self.backend.request_password_reset_token |
4328 | 846 | f(self.app_name, email, reply_handler=NO_OP, error_handler=NO_OP) | 891 | error_handler = partial(self._handle_error, f, |
4329 | 892 | self.on_password_reset_error) | ||
4330 | 893 | f(self.app_name, email, | ||
4331 | 894 | reply_handler=NO_OP, error_handler=error_handler) | ||
4332 | 847 | 895 | ||
4333 | 848 | self._set_current_page(self.processing_vbox) | 896 | self._set_current_page(self.processing_vbox) |
4334 | 849 | 897 | ||
4335 | @@ -894,16 +942,18 @@ | |||
4336 | 894 | logger.info('Calling set_new_password with email %r, token %r and ' \ | 942 | logger.info('Calling set_new_password with email %r, token %r and ' \ |
4337 | 895 | 'new password: <hidden>.', email, token) | 943 | 'new password: <hidden>.', email, token) |
4338 | 896 | f = self.backend.set_new_password | 944 | f = self.backend.set_new_password |
4339 | 945 | error_handler = partial(self._handle_error, f, | ||
4340 | 946 | self.on_password_change_error) | ||
4341 | 897 | f(self.app_name, email, token, password1, | 947 | f(self.app_name, email, token, password1, |
4343 | 898 | reply_handler=NO_OP, error_handler=NO_OP) | 948 | reply_handler=NO_OP, error_handler=error_handler) |
4344 | 899 | 949 | ||
4345 | 900 | self._set_current_page(self.processing_vbox) | 950 | self._set_current_page(self.processing_vbox) |
4346 | 901 | 951 | ||
4347 | 902 | def on_tc_button_clicked(self, *args, **kwargs): | 952 | def on_tc_button_clicked(self, *args, **kwargs): |
4348 | 903 | """The T&C button was clicked, create the browser and load terms.""" | 953 | """The T&C button was clicked, create the browser and load terms.""" |
4349 | 904 | # delay the import of webkit to be able to build without it | 954 | # delay the import of webkit to be able to build without it |
4352 | 905 | import webkit | 955 | from gi.repository import WebKit # pylint: disable=E0611 |
4353 | 906 | browser = webkit.WebView() | 956 | browser = WebKit.WebView() |
4354 | 907 | 957 | ||
4355 | 908 | # The signal WebKitWebView::load-finished is deprecated and should not | 958 | # The signal WebKitWebView::load-finished is deprecated and should not |
4356 | 909 | # be used in newly-written code. Use the "load-status" property | 959 | # be used in newly-written code. Use the "load-status" property |
4357 | @@ -1023,7 +1073,6 @@ | |||
4358 | 1023 | @log_call | 1073 | @log_call |
4359 | 1024 | def on_email_validated(self, app_name, email, *args, **kwargs): | 1074 | def on_email_validated(self, app_name, email, *args, **kwargs): |
4360 | 1025 | """User email was successfully verified.""" | 1075 | """User email was successfully verified.""" |
4361 | 1026 | self.registration_success_callback(self.app_name, email) | ||
4362 | 1027 | self.finish_success() | 1076 | self.finish_success() |
4363 | 1028 | 1077 | ||
4364 | 1029 | @log_call | 1078 | @log_call |
4365 | @@ -1039,7 +1088,6 @@ | |||
4366 | 1039 | @log_call | 1088 | @log_call |
4367 | 1040 | def on_logged_in(self, app_name, email, *args, **kwargs): | 1089 | def on_logged_in(self, app_name, email, *args, **kwargs): |
4368 | 1041 | """User was successfully logged in.""" | 1090 | """User was successfully logged in.""" |
4369 | 1042 | self.login_success_callback(self.app_name, email) | ||
4370 | 1043 | self.finish_success() | 1091 | self.finish_success() |
4371 | 1044 | 1092 | ||
4372 | 1045 | @log_call | 1093 | @log_call |
4373 | 1046 | 1094 | ||
4374 | === modified file 'ubuntu_sso/gtk/main.py' | |||
4375 | --- ubuntu_sso/gtk/main.py 2012-01-16 21:10:12 +0000 | |||
4376 | +++ ubuntu_sso/gtk/main.py 2012-02-14 22:04:20 +0000 | |||
4377 | @@ -16,34 +16,14 @@ | |||
4378 | 16 | 16 | ||
4379 | 17 | """Main module to open the GTK UI.""" | 17 | """Main module to open the GTK UI.""" |
4380 | 18 | 18 | ||
4384 | 19 | import argparse | 19 | # pylint: disable=E0611 |
4385 | 20 | 20 | from gi.repository import Gtk | |
4386 | 21 | import gtk | 21 | # pylint: enable=E0611 |
4387 | 22 | 22 | ||
4388 | 23 | from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI | 23 | from ubuntu_sso.gtk.gui import UbuntuSSOClientGUI |
4389 | 24 | 24 | ||
4390 | 25 | 25 | ||
4391 | 26 | def parse_args(): | ||
4392 | 27 | """Parse sys.argv options.""" | ||
4393 | 28 | parser = argparse.ArgumentParser(description='Open the GTK SSO UI.') | ||
4394 | 29 | parser.add_argument('--app_name', required=True, | ||
4395 | 30 | help='the name of the application to retrieve credentials for') | ||
4396 | 31 | parser.add_argument('--ping_url', default='', | ||
4397 | 32 | help='a link to be used as the ping url (to notify about new tokens)') | ||
4398 | 33 | parser.add_argument('--tc_url', default='', | ||
4399 | 34 | help='a link to be used as Terms & Conditions url') | ||
4400 | 35 | parser.add_argument('--help_text', default='', | ||
4401 | 36 | help='extra text that will be shown below the headers') | ||
4402 | 37 | parser.add_argument('--window_id', type=int, default=0, | ||
4403 | 38 | help='the window id to be set transient for the SSO GTK dialogs') | ||
4404 | 39 | parser.add_argument('--login_only', action='store_true', default=False, | ||
4405 | 40 | help='whether the SSO GTK UI should only offer login or not') | ||
4406 | 41 | |||
4407 | 42 | args = parser.parse_args() | ||
4408 | 43 | return args | ||
4409 | 44 | |||
4410 | 45 | |||
4411 | 46 | def main(**kwargs): | 26 | def main(**kwargs): |
4412 | 47 | """Start the GTK mainloop and open the main window.""" | 27 | """Start the GTK mainloop and open the main window.""" |
4415 | 48 | UbuntuSSOClientGUI(close_callback=gtk.main_quit, **kwargs) | 28 | UbuntuSSOClientGUI(close_callback=Gtk.main_quit, **kwargs) |
4416 | 49 | gtk.main() | 29 | Gtk.main() |
4417 | 50 | 30 | ||
4418 | === modified file 'ubuntu_sso/gtk/tests/__init__.py' | |||
4419 | --- ubuntu_sso/gtk/tests/__init__.py 2010-11-19 19:53:22 +0000 | |||
4420 | +++ ubuntu_sso/gtk/tests/__init__.py 2012-02-14 22:04:20 +0000 | |||
4421 | @@ -1,8 +1,6 @@ | |||
4422 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
4423 | 2 | # | 2 | # |
4427 | 3 | # Author: Natalia Bidart <natalia.bidart@canonical.com> | 3 | # Copyright 2009-2012 Canonical Ltd. |
4425 | 4 | # | ||
4426 | 5 | # Copyright 2009 Canonical Ltd. | ||
4428 | 6 | # | 4 | # |
4429 | 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 |
4430 | 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 |
4431 | 9 | 7 | ||
4432 | === modified file 'ubuntu_sso/gtk/tests/test_gui.py' | |||
4433 | --- ubuntu_sso/gtk/tests/test_gui.py 2012-01-31 19:02:36 +0000 | |||
4434 | +++ ubuntu_sso/gtk/tests/test_gui.py 2012-02-14 22:04:20 +0000 | |||
4435 | @@ -21,8 +21,9 @@ | |||
4436 | 21 | 21 | ||
4437 | 22 | from collections import defaultdict | 22 | from collections import defaultdict |
4438 | 23 | 23 | ||
4441 | 24 | import gtk | 24 | # pylint: disable=E0611 |
4442 | 25 | import webkit | 25 | from gi.repository import Gdk, Gtk, WebKit |
4443 | 26 | # pylint: enable=E0611 | ||
4444 | 26 | 27 | ||
4445 | 27 | from twisted.internet import defer | 28 | from twisted.internet import defer |
4446 | 28 | from twisted.trial.unittest import TestCase | 29 | from twisted.trial.unittest import TestCase |
4447 | @@ -42,6 +43,9 @@ | |||
4448 | 42 | # Instance of 'UbuntuSSOClientGUI' has no 'yyy' member | 43 | # Instance of 'UbuntuSSOClientGUI' has no 'yyy' member |
4449 | 43 | # pylint: disable=E1101,E1103 | 44 | # pylint: disable=E1101,E1103 |
4450 | 44 | 45 | ||
4451 | 46 | # Use of super on an old style class | ||
4452 | 47 | # pylint: disable=E1002 | ||
4453 | 48 | |||
4454 | 45 | 49 | ||
4455 | 46 | class FakedSSOBackend(object): | 50 | class FakedSSOBackend(object): |
4456 | 47 | """Fake a SSO Backend.""" | 51 | """Fake a SSO Backend.""" |
4457 | @@ -52,9 +56,9 @@ | |||
4458 | 52 | self._called = {} | 56 | self._called = {} |
4459 | 53 | self.callbacks = defaultdict(list) | 57 | self.callbacks = defaultdict(list) |
4460 | 54 | 58 | ||
4462 | 55 | for i in ('generate_captcha', 'login', 'login_with_ping', | 59 | for i in ('generate_captcha', 'login', 'login_and_ping', |
4463 | 56 | 'register_user', 'validate_email', | 60 | 'register_user', 'validate_email', |
4465 | 57 | 'validate_email_with_ping', | 61 | 'validate_email_and_ping', |
4466 | 58 | 'request_password_reset_token', | 62 | 'request_password_reset_token', |
4467 | 59 | 'set_new_password'): | 63 | 'set_new_password'): |
4468 | 60 | setattr(self, i, self._record_call(i)) | 64 | setattr(self, i, self._record_call(i)) |
4469 | @@ -99,7 +103,7 @@ | |||
4470 | 99 | self[prop_name] = newval | 103 | self[prop_name] = newval |
4471 | 100 | 104 | ||
4472 | 101 | 105 | ||
4474 | 102 | class FakedEmbeddedBrowser(gtk.TextView): | 106 | class FakedEmbeddedBrowser(Gtk.TextView): |
4475 | 103 | """Faked an embedded browser.""" | 107 | """Faked an embedded browser.""" |
4476 | 104 | 108 | ||
4477 | 105 | def __init__(self): | 109 | def __init__(self): |
4478 | @@ -156,6 +160,29 @@ | |||
4479 | 156 | """Set _called to True.""" | 160 | """Set _called to True.""" |
4480 | 157 | self._called = (args, kwargs) | 161 | self._called = (args, kwargs) |
4481 | 158 | 162 | ||
4482 | 163 | def assert_color_equal(self, rgba_color, gdk_color): | ||
4483 | 164 | """Check that 'rgba_color' is the same as 'gdk_color'.""" | ||
4484 | 165 | tmp = Gdk.RGBA() | ||
4485 | 166 | assert tmp.parse(gdk_color.to_string()) | ||
4486 | 167 | |||
4487 | 168 | msg = 'Text color must be "%s" (got "%s" instead).' | ||
4488 | 169 | self.assertEqual(rgba_color, tmp, msg % (rgba_color, tmp)) | ||
4489 | 170 | |||
4490 | 171 | def assert_backend_called(self, method, *args, **kwargs): | ||
4491 | 172 | """Check that 'method(*args, **kwargs)' was called in the backend.""" | ||
4492 | 173 | self.assertIn(method, self.ui.backend._called) | ||
4493 | 174 | |||
4494 | 175 | call = self.ui.backend._called[method] | ||
4495 | 176 | self.assertEqual(call[0], args) | ||
4496 | 177 | |||
4497 | 178 | reply_handler = call[1].pop('reply_handler') | ||
4498 | 179 | self.assertEqual(reply_handler, gui.NO_OP) | ||
4499 | 180 | |||
4500 | 181 | error_handler = call[1].pop('error_handler') | ||
4501 | 182 | self.assertEqual(error_handler.func, self.ui._handle_error) | ||
4502 | 183 | |||
4503 | 184 | self.assertEqual(call[1], kwargs) | ||
4504 | 185 | |||
4505 | 159 | 186 | ||
4506 | 160 | class LabeledEntryTestCase(BasicTestCase): | 187 | class LabeledEntryTestCase(BasicTestCase): |
4507 | 161 | """Test suite for the labeled entry.""" | 188 | """Test suite for the labeled entry.""" |
4508 | @@ -168,9 +195,11 @@ | |||
4509 | 168 | self.entry = gui.LabeledEntry(label=self.label) | 195 | self.entry = gui.LabeledEntry(label=self.label) |
4510 | 169 | 196 | ||
4511 | 170 | # we need a window to be able to realize ourselves | 197 | # we need a window to be able to realize ourselves |
4513 | 171 | window = gtk.Window() | 198 | window = Gtk.Window() |
4514 | 172 | window.add(self.entry) | 199 | window.add(self.entry) |
4515 | 173 | window.show_all() | 200 | window.show_all() |
4516 | 201 | self.addCleanup(window.hide) | ||
4517 | 202 | self.addCleanup(window.destroy) | ||
4518 | 174 | 203 | ||
4519 | 175 | def grab_focus(self, focus_in=True): | 204 | def grab_focus(self, focus_in=True): |
4520 | 176 | """Grab focus on widget, if None use self.entry.""" | 205 | """Grab focus on widget, if None use self.entry.""" |
4521 | @@ -188,10 +217,9 @@ | |||
4522 | 188 | self.assertEqual(expected, actual, msg % (expected, actual)) | 217 | self.assertEqual(expected, actual, msg % (expected, actual)) |
4523 | 189 | 218 | ||
4524 | 190 | # text color is correct | 219 | # text color is correct |
4525 | 191 | msg = 'Text color must be "%s" (got "%s" instead).' | ||
4526 | 192 | expected = gui.HELP_TEXT_COLOR | 220 | expected = gui.HELP_TEXT_COLOR |
4529 | 193 | actual = self.entry.style.text[gtk.STATE_NORMAL] | 221 | actual = self.entry.get_style().text[Gtk.StateFlags.NORMAL] |
4530 | 194 | self.assertEqual(expected, actual, msg % (expected, actual)) | 222 | self.assert_color_equal(expected, actual) |
4531 | 195 | 223 | ||
4532 | 196 | def test_initial_text(self): | 224 | def test_initial_text(self): |
4533 | 197 | """Entry have the correct text at startup.""" | 225 | """Entry have the correct text at startup.""" |
4534 | @@ -218,11 +246,11 @@ | |||
4535 | 218 | 246 | ||
4536 | 219 | def test_text_defaults_to_theme_color_when_focus_in(self): | 247 | def test_text_defaults_to_theme_color_when_focus_in(self): |
4537 | 220 | """Entry restore its text color when focused in.""" | 248 | """Entry restore its text color when focused in.""" |
4539 | 221 | self.patch(self.entry, 'modify_text', self._set_called) | 249 | self.patch(self.entry, 'override_color', self._set_called) |
4540 | 222 | 250 | ||
4541 | 223 | self.grab_focus() | 251 | self.grab_focus() |
4542 | 224 | 252 | ||
4544 | 225 | self.assertEqual(((gtk.STATE_NORMAL, None), {}), self._called, | 253 | self.assertEqual(((Gtk.StateFlags.NORMAL, None), {}), self._called, |
4545 | 226 | 'Entry text color must be restore on focus in.') | 254 | 'Entry text color must be restore on focus in.') |
4546 | 227 | 255 | ||
4547 | 228 | def test_refill_entry_on_focus_out_if_no_input(self): | 256 | def test_refill_entry_on_focus_out_if_no_input(self): |
4548 | @@ -305,7 +333,7 @@ | |||
4549 | 305 | self.entry.set_warning(msg) | 333 | self.entry.set_warning(msg) |
4550 | 306 | self.assertEqual(self.entry.warning, msg) | 334 | self.assertEqual(self.entry.warning, msg) |
4551 | 307 | self.assertEqual(self.entry.get_property('secondary-icon-stock'), | 335 | self.assertEqual(self.entry.get_property('secondary-icon-stock'), |
4553 | 308 | gtk.STOCK_DIALOG_WARNING) | 336 | Gtk.STOCK_DIALOG_WARNING) |
4554 | 309 | self.assertEqual(self.entry.get_property('secondary-icon-sensitive'), | 337 | self.assertEqual(self.entry.get_property('secondary-icon-sensitive'), |
4555 | 310 | True) | 338 | True) |
4556 | 311 | self.assertEqual(self.entry.get_property('secondary-icon-activatable'), | 339 | self.assertEqual(self.entry.get_property('secondary-icon-activatable'), |
4557 | @@ -371,6 +399,7 @@ | |||
4558 | 371 | 'tc_browser', 'login', 'request_password_token', | 399 | 'tc_browser', 'login', 'request_password_token', |
4559 | 372 | 'set_new_password') | 400 | 'set_new_password') |
4560 | 373 | self.ui = self.gui_class(**self.kwargs) | 401 | self.ui = self.gui_class(**self.kwargs) |
4561 | 402 | self.addCleanup(self.ui.destroy) | ||
4562 | 374 | self.error = {'message': UNKNOWN_ERROR} | 403 | self.error = {'message': UNKNOWN_ERROR} |
4563 | 375 | 404 | ||
4564 | 376 | def assert_entries_are_packed_to_ui(self, container_name, entries): | 405 | def assert_entries_are_packed_to_ui(self, container_name, entries): |
4565 | @@ -405,8 +434,8 @@ | |||
4566 | 405 | 434 | ||
4567 | 406 | # content color is correct | 435 | # content color is correct |
4568 | 407 | expected = gui.WARNING_TEXT_COLOR | 436 | expected = gui.WARNING_TEXT_COLOR |
4571 | 408 | actual = label.style.fg[gtk.STATE_NORMAL] | 437 | actual = label.get_style().fg[Gtk.StateFlags.NORMAL] |
4572 | 409 | self.assertEqual(expected, actual) # until realized this will fail | 438 | self.assert_color_equal(expected, actual) |
4573 | 410 | 439 | ||
4574 | 411 | def assert_correct_entry_warning(self, entry, message): | 440 | def assert_correct_entry_warning(self, entry, message): |
4575 | 412 | """Check that a warning is shown displaying 'message'.""" | 441 | """Check that a warning is shown displaying 'message'.""" |
4576 | @@ -533,16 +562,6 @@ | |||
4577 | 533 | entry = getattr(self.ui, name) | 562 | entry = getattr(self.ui, name) |
4578 | 534 | self.assertTrue(entry.get_activates_default(), msg % (name,)) | 563 | self.assertTrue(entry.get_activates_default(), msg % (name,)) |
4579 | 535 | 564 | ||
4580 | 536 | def test_label_size_allocated_is_connected(self): | ||
4581 | 537 | """Labels have the size-allocate signal connected.""" | ||
4582 | 538 | msg = 'Label %r must have size-allocate connected.' | ||
4583 | 539 | labels = [i for i in self.ui.widgets if 'label' in i] | ||
4584 | 540 | for label in labels: | ||
4585 | 541 | widget = getattr(self.ui, label) | ||
4586 | 542 | widget.emit('size-allocate', gtk.gdk.Rectangle(1, 2, 3, 4)) | ||
4587 | 543 | self.assertEqual(widget.get_size_request(), (3 - 2, -1), | ||
4588 | 544 | msg % (label,)) | ||
4589 | 545 | |||
4590 | 546 | def test_password_fields_are_password(self): | 565 | def test_password_fields_are_password(self): |
4591 | 547 | """Password fields have the is_password flag set.""" | 566 | """Password fields have the is_password flag set.""" |
4592 | 548 | msg = '"%s" should be a password LabeledEntry instance.' | 567 | msg = '"%s" should be a password LabeledEntry instance.' |
4593 | @@ -573,28 +592,6 @@ | |||
4594 | 573 | """Main window has the proper icon.""" | 592 | """Main window has the proper icon.""" |
4595 | 574 | self.assertEqual('ubuntu-logo', self.ui.window.get_icon_name()) | 593 | self.assertEqual('ubuntu-logo', self.ui.window.get_icon_name()) |
4596 | 575 | 594 | ||
4597 | 576 | def test_transient_window_is_none_if_window_id_is_zero(self): | ||
4598 | 577 | """The transient window is correct.""" | ||
4599 | 578 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
4600 | 579 | self.gui_class(window_id=0, **self.kwargs) | ||
4601 | 580 | self.assertFalse(self._called, 'set_transient_for must not be called.') | ||
4602 | 581 | |||
4603 | 582 | def test_transient_window_is_correct(self): | ||
4604 | 583 | """The transient window is correct.""" | ||
4605 | 584 | xid = 5 | ||
4606 | 585 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
4607 | 586 | self.gui_class(window_id=xid, **self.kwargs) | ||
4608 | 587 | self.assertTrue(self.memento.check(logging.ERROR, 'set_transient_for')) | ||
4609 | 588 | self.assertTrue(self.memento.check(logging.ERROR, str(xid))) | ||
4610 | 589 | self.assertEqual(self._called, ((xid,), {})) | ||
4611 | 590 | |||
4612 | 591 | def test_transient_window_accepts_negative_id(self): | ||
4613 | 592 | """The transient window accepts a negative window id.""" | ||
4614 | 593 | xid = -5 | ||
4615 | 594 | self.patch(gtk.gdk, 'window_foreign_new', self._set_called) | ||
4616 | 595 | self.gui_class(window_id=xid, **self.kwargs) | ||
4617 | 596 | self.assertEqual(self._called, ((xid,), {})) | ||
4618 | 597 | |||
4619 | 598 | def test_finish_success_shows_success_page(self): | 595 | def test_finish_success_shows_success_page(self): |
4620 | 599 | """When calling 'finish_success' the success page is shown.""" | 596 | """When calling 'finish_success' the success page is shown.""" |
4621 | 600 | self.ui.finish_success() | 597 | self.ui.finish_success() |
4622 | @@ -611,6 +608,42 @@ | |||
4623 | 611 | self.assertEqual(gui.ERROR, self.ui.finish_vbox.label.get_text()) | 608 | self.assertEqual(gui.ERROR, self.ui.finish_vbox.label.get_text()) |
4624 | 612 | 609 | ||
4625 | 613 | 610 | ||
4626 | 611 | class SetTransientForTestCase(UbuntuSSOClientTestCase): | ||
4627 | 612 | """Test suite for setting the window as transient for another one.""" | ||
4628 | 613 | |||
4629 | 614 | def test_transient_window_is_none_if_window_id_is_zero(self): | ||
4630 | 615 | """The transient window is correct.""" | ||
4631 | 616 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
4632 | 617 | ui = self.gui_class(window_id=0, **self.kwargs) | ||
4633 | 618 | self.addCleanup(ui.destroy) | ||
4634 | 619 | |||
4635 | 620 | self.assertFalse(self._called, 'set_transient_for must not be called.') | ||
4636 | 621 | |||
4637 | 622 | def test_transient_window_is_correct(self): | ||
4638 | 623 | """The transient window is correct.""" | ||
4639 | 624 | xid = 5 | ||
4640 | 625 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
4641 | 626 | ui = self.gui_class(window_id=xid, **self.kwargs) | ||
4642 | 627 | self.addCleanup(ui.destroy) | ||
4643 | 628 | |||
4644 | 629 | self.assertTrue(self.memento.check(logging.ERROR, 'set_transient_for')) | ||
4645 | 630 | self.assertTrue(self.memento.check(logging.ERROR, str(xid))) | ||
4646 | 631 | self.assertEqual(self._called, ((xid,), {})) | ||
4647 | 632 | |||
4648 | 633 | def test_transient_window_accepts_negative_id(self): | ||
4649 | 634 | """The transient window accepts a negative window id.""" | ||
4650 | 635 | xid = -5 | ||
4651 | 636 | self.patch(gui.X11Window, 'foreign_new_for_display', self._set_called) | ||
4652 | 637 | ui = self.gui_class(window_id=xid, **self.kwargs) | ||
4653 | 638 | self.addCleanup(ui.destroy) | ||
4654 | 639 | |||
4655 | 640 | self.assertEqual(self._called, ((xid,), {})) | ||
4656 | 641 | |||
4657 | 642 | |||
4658 | 643 | SetTransientForTestCase.skip = "Apparently, so far we can't use XLib " \ | ||
4659 | 644 | "dynamic bindings to complete the call to X11Window.foreign_new_for_display." | ||
4660 | 645 | |||
4661 | 646 | |||
4662 | 614 | class EnterDetailsTestCase(UbuntuSSOClientTestCase): | 647 | class EnterDetailsTestCase(UbuntuSSOClientTestCase): |
4663 | 615 | """Test suite for the user registration (enter details page).""" | 648 | """Test suite for the user registration (enter details page).""" |
4664 | 616 | 649 | ||
4665 | @@ -670,13 +703,8 @@ | |||
4666 | 670 | self.click_join_with_valid_data() | 703 | self.click_join_with_valid_data() |
4667 | 671 | 704 | ||
4668 | 672 | # assert register_user was called | 705 | # assert register_user was called |
4676 | 673 | expected = 'register_user' | 706 | self.assert_backend_called('register_user', |
4677 | 674 | self.assertIn(expected, self.ui.backend._called) | 707 | APP_NAME, EMAIL, PASSWORD, NAME, CAPTCHA_ID, CAPTCHA_SOLUTION) |
4671 | 675 | self.assertEqual(self.ui.backend._called[expected], | ||
4672 | 676 | ((APP_NAME, EMAIL, PASSWORD, NAME, CAPTCHA_ID, | ||
4673 | 677 | CAPTCHA_SOLUTION), | ||
4674 | 678 | dict(reply_handler=gui.NO_OP, | ||
4675 | 679 | error_handler=gui.NO_OP))) | ||
4678 | 680 | 708 | ||
4679 | 681 | def test_join_ok_button_clicked_morphs_to_processing_page(self): | 709 | def test_join_ok_button_clicked_morphs_to_processing_page(self): |
4680 | 682 | """Clicking 'join_ok_button' presents the processing vbox.""" | 710 | """Clicking 'join_ok_button' presents the processing vbox.""" |
4681 | @@ -695,8 +723,8 @@ | |||
4682 | 695 | 'processing_vbox must have two children.') | 723 | 'processing_vbox must have two children.') |
4683 | 696 | 724 | ||
4684 | 697 | spinner, label = box.get_children() | 725 | spinner, label = box.get_children() |
4687 | 698 | self.assertIsInstance(spinner, gtk.Spinner) | 726 | self.assertIsInstance(spinner, Gtk.Spinner) |
4688 | 699 | self.assertIsInstance(label, gtk.Label) | 727 | self.assertIsInstance(label, Gtk.Label) |
4689 | 700 | 728 | ||
4690 | 701 | self.assertTrue(spinner.get_property('visible'), | 729 | self.assertTrue(spinner.get_property('visible'), |
4691 | 702 | 'the processing spinner should be visible.') | 730 | 'the processing spinner should be visible.') |
4692 | @@ -715,6 +743,8 @@ | |||
4693 | 715 | def test_captcha_filename_is_different_each_time(self): | 743 | def test_captcha_filename_is_different_each_time(self): |
4694 | 716 | """The captcha image is different each time.""" | 744 | """The captcha image is different each time.""" |
4695 | 717 | ui = self.gui_class(**self.kwargs) | 745 | ui = self.gui_class(**self.kwargs) |
4696 | 746 | self.addCleanup(ui.destroy) | ||
4697 | 747 | |||
4698 | 718 | self.assertNotEqual(self.ui._captcha_filename, ui._captcha_filename) | 748 | self.assertNotEqual(self.ui._captcha_filename, ui._captcha_filename) |
4699 | 719 | 749 | ||
4700 | 720 | def test_captcha_image_is_removed_when_exiting(self): | 750 | def test_captcha_image_is_removed_when_exiting(self): |
4701 | @@ -736,8 +766,8 @@ | |||
4702 | 736 | 'captcha_loading must have two children.') | 766 | 'captcha_loading must have two children.') |
4703 | 737 | 767 | ||
4704 | 738 | spinner, label = box.get_children() | 768 | spinner, label = box.get_children() |
4707 | 739 | self.assertIsInstance(spinner, gtk.Spinner) | 769 | self.assertIsInstance(spinner, Gtk.Spinner) |
4708 | 740 | self.assertIsInstance(label, gtk.Label) | 770 | self.assertIsInstance(label, Gtk.Label) |
4709 | 741 | 771 | ||
4710 | 742 | self.assertTrue(spinner.get_property('visible'), | 772 | self.assertTrue(spinner.get_property('visible'), |
4711 | 743 | 'the captcha_loading spinner should be visible.') | 773 | 'the captcha_loading spinner should be visible.') |
4712 | @@ -771,12 +801,8 @@ | |||
4713 | 771 | def test_captcha_image_is_requested_as_startup(self): | 801 | def test_captcha_image_is_requested_as_startup(self): |
4714 | 772 | """The captcha image is requested at startup.""" | 802 | """The captcha image is requested at startup.""" |
4715 | 773 | # assert generate_captcha was called | 803 | # assert generate_captcha was called |
4722 | 774 | expected = 'generate_captcha' | 804 | self.assert_backend_called('generate_captcha', |
4723 | 775 | self.assertIn(expected, self.ui.backend._called) | 805 | APP_NAME, self.ui._captcha_filename) |
4718 | 776 | self.assertEqual(self.ui.backend._called[expected], | ||
4719 | 777 | ((APP_NAME, self.ui._captcha_filename), | ||
4720 | 778 | dict(reply_handler=gui.NO_OP, | ||
4721 | 779 | error_handler=gui.NO_OP))) | ||
4724 | 780 | 806 | ||
4725 | 781 | def test_captcha_is_shown_when_available(self): | 807 | def test_captcha_is_shown_when_available(self): |
4726 | 782 | """The captcha image is shown when available.""" | 808 | """The captcha image is shown when available.""" |
4727 | @@ -872,7 +898,7 @@ | |||
4728 | 872 | @defer.inlineCallbacks | 898 | @defer.inlineCallbacks |
4729 | 873 | def setUp(self): | 899 | def setUp(self): |
4730 | 874 | yield super(TermsAndConditionsBrowserTestCase, self).setUp() | 900 | yield super(TermsAndConditionsBrowserTestCase, self).setUp() |
4732 | 875 | self.patch(webkit, 'WebView', FakedEmbeddedBrowser) | 901 | self.patch(WebKit, 'WebView', FakedEmbeddedBrowser) |
4733 | 876 | 902 | ||
4734 | 877 | self.ui.tc_button.clicked() | 903 | self.ui.tc_button.clicked() |
4735 | 878 | self.addCleanup(self.ui.tc_browser_vbox.hide) | 904 | self.addCleanup(self.ui.tc_browser_vbox.hide) |
4736 | @@ -968,10 +994,10 @@ | |||
4737 | 968 | 994 | ||
4738 | 969 | def test_navigation_requested_succeeds_for_no_clicking(self): | 995 | def test_navigation_requested_succeeds_for_no_clicking(self): |
4739 | 970 | """The navigation request succeeds when user hasn't clicked a link.""" | 996 | """The navigation request succeeds when user hasn't clicked a link.""" |
4741 | 971 | action = webkit.WebNavigationAction() | 997 | action = WebKit.WebNavigationAction() |
4742 | 972 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_OTHER) | 998 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_OTHER) |
4743 | 973 | 999 | ||
4745 | 974 | decision = webkit.WebPolicyDecision() | 1000 | decision = WebKit.WebPolicyDecision() |
4746 | 975 | decision.use = self._set_called | 1001 | decision.use = self._set_called |
4747 | 976 | 1002 | ||
4748 | 977 | kwargs = dict(browser=self.browser, frame=None, request=None, | 1003 | kwargs = dict(browser=self.browser, frame=None, request=None, |
4749 | @@ -981,10 +1007,10 @@ | |||
4750 | 981 | 1007 | ||
4751 | 982 | def test_navigation_requested_ignores_clicked_links(self): | 1008 | def test_navigation_requested_ignores_clicked_links(self): |
4752 | 983 | """The navigation request is ignored if a link was clicked.""" | 1009 | """The navigation request is ignored if a link was clicked.""" |
4754 | 984 | action = webkit.WebNavigationAction() | 1010 | action = WebKit.WebNavigationAction() |
4755 | 985 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) | 1011 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) |
4756 | 986 | 1012 | ||
4758 | 987 | decision = webkit.WebPolicyDecision() | 1013 | decision = WebKit.WebPolicyDecision() |
4759 | 988 | decision.ignore = self._set_called | 1014 | decision.ignore = self._set_called |
4760 | 989 | 1015 | ||
4761 | 990 | self.patch(gui.webbrowser, 'open', lambda *args, **kwargs: None) | 1016 | self.patch(gui.webbrowser, 'open', lambda *args, **kwargs: None) |
4762 | @@ -1007,11 +1033,11 @@ | |||
4763 | 1007 | 1033 | ||
4764 | 1008 | """ | 1034 | """ |
4765 | 1009 | url = 'http://something.com/yadda' | 1035 | url = 'http://something.com/yadda' |
4767 | 1010 | action = webkit.WebNavigationAction() | 1036 | action = WebKit.WebNavigationAction() |
4768 | 1011 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) | 1037 | action.set_reason(gui.WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) |
4769 | 1012 | action.set_original_uri(url) | 1038 | action.set_original_uri(url) |
4770 | 1013 | 1039 | ||
4772 | 1014 | decision = webkit.WebPolicyDecision() | 1040 | decision = WebKit.WebPolicyDecision() |
4773 | 1015 | decision.ignore = gui.NO_OP | 1041 | decision.ignore = gui.NO_OP |
4774 | 1016 | 1042 | ||
4775 | 1017 | self.patch(gui.webbrowser, 'open', self._set_called) | 1043 | self.patch(gui.webbrowser, 'open', self._set_called) |
4776 | @@ -1098,12 +1124,7 @@ | |||
4777 | 1098 | def test_on_verify_token_button_clicked_calls_backend(self): | 1124 | def test_on_verify_token_button_clicked_calls_backend(self): |
4778 | 1099 | """Verify token button triggers call to backend.""" | 1125 | """Verify token button triggers call to backend.""" |
4779 | 1100 | self.click_verify_email_with_valid_data() | 1126 | self.click_verify_email_with_valid_data() |
4786 | 1101 | expected = self.method | 1127 | self.assert_backend_called(self.method, *self.method_args) |
4781 | 1102 | self.assertIn(expected, self.ui.backend._called) | ||
4782 | 1103 | self.assertEqual(self.ui.backend._called[expected], | ||
4783 | 1104 | (self.method_args, | ||
4784 | 1105 | dict(reply_handler=gui.NO_OP, | ||
4785 | 1106 | error_handler=gui.NO_OP))) | ||
4787 | 1107 | 1128 | ||
4788 | 1108 | def test_on_verify_token_button_clicked(self): | 1129 | def test_on_verify_token_button_clicked(self): |
4789 | 1109 | """Verify token uses cached user_email and user_password.""" | 1130 | """Verify token uses cached user_email and user_password.""" |
4790 | @@ -1117,10 +1138,7 @@ | |||
4791 | 1117 | self.ui.email_token_entry.set_text(EMAIL_TOKEN) | 1138 | self.ui.email_token_entry.set_text(EMAIL_TOKEN) |
4792 | 1118 | 1139 | ||
4793 | 1119 | self.ui.on_verify_token_button_clicked() | 1140 | self.ui.on_verify_token_button_clicked() |
4798 | 1120 | self.assertEqual(self.ui.backend._called[self.method], | 1141 | self.assert_backend_called(self.method, *tuple(method_args)) |
4795 | 1121 | (tuple(method_args), | ||
4796 | 1122 | dict(reply_handler=gui.NO_OP, | ||
4797 | 1123 | error_handler=gui.NO_OP))) | ||
4799 | 1124 | 1142 | ||
4800 | 1125 | def test_on_verify_token_button_shows_processing_page(self): | 1143 | def test_on_verify_token_button_shows_processing_page(self): |
4801 | 1126 | """Verify token button triggers call to backend.""" | 1144 | """Verify token button triggers call to backend.""" |
4802 | @@ -1211,7 +1229,7 @@ | |||
4803 | 1211 | 1229 | ||
4804 | 1212 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT, | 1230 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT, |
4805 | 1213 | ping_url=PING_URL) | 1231 | ping_url=PING_URL) |
4807 | 1214 | method = 'validate_email_with_ping' | 1232 | method = 'validate_email_and_ping' |
4808 | 1215 | method_args = (APP_NAME, EMAIL, PASSWORD, EMAIL_TOKEN, PING_URL) | 1233 | method_args = (APP_NAME, EMAIL, PASSWORD, EMAIL_TOKEN, PING_URL) |
4809 | 1216 | 1234 | ||
4810 | 1217 | 1235 | ||
4811 | @@ -1455,13 +1473,7 @@ | |||
4812 | 1455 | def test_on_login_connect_button_clicked(self): | 1473 | def test_on_login_connect_button_clicked(self): |
4813 | 1456 | """Clicking login_ok_button calls backend.login.""" | 1474 | """Clicking login_ok_button calls backend.login.""" |
4814 | 1457 | self.click_connect_with_valid_data() | 1475 | self.click_connect_with_valid_data() |
4822 | 1458 | 1476 | self.assert_backend_called(self.method, *self.method_args) | |
4816 | 1459 | expected = self.method | ||
4817 | 1460 | self.assertIn(expected, self.ui.backend._called) | ||
4818 | 1461 | self.assertEqual(self.ui.backend._called[expected], | ||
4819 | 1462 | (self.method_args, | ||
4820 | 1463 | dict(reply_handler=gui.NO_OP, | ||
4821 | 1464 | error_handler=gui.NO_OP))) | ||
4823 | 1465 | 1477 | ||
4824 | 1466 | def test_on_login_connect_button_clicked_morphs_to_processing_page(self): | 1478 | def test_on_login_connect_button_clicked_morphs_to_processing_page(self): |
4825 | 1467 | """Clicking login_ok_button morphs to the processing page.""" | 1479 | """Clicking login_ok_button morphs to the processing page.""" |
4826 | @@ -1543,7 +1555,7 @@ | |||
4827 | 1543 | 1555 | ||
4828 | 1544 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT, | 1556 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT, |
4829 | 1545 | ping_url=PING_URL) | 1557 | ping_url=PING_URL) |
4831 | 1546 | method = 'login_with_ping' | 1558 | method = 'login_and_ping' |
4832 | 1547 | method_args = (APP_NAME, EMAIL, PASSWORD, PING_URL) | 1559 | method_args = (APP_NAME, EMAIL, PASSWORD, PING_URL) |
4833 | 1548 | 1560 | ||
4834 | 1549 | 1561 | ||
4835 | @@ -1665,12 +1677,8 @@ | |||
4836 | 1665 | def test_on_request_password_token_ok_button_clicked_calls_backend(self): | 1677 | def test_on_request_password_token_ok_button_clicked_calls_backend(self): |
4837 | 1666 | """Clicking request_password_token_ok_button the backend is called.""" | 1678 | """Clicking request_password_token_ok_button the backend is called.""" |
4838 | 1667 | self.click_request_password_token_with_valid_data() | 1679 | self.click_request_password_token_with_valid_data() |
4845 | 1668 | expected = 'request_password_reset_token' | 1680 | self.assert_backend_called('request_password_reset_token', |
4846 | 1669 | self.assertIn(expected, self.ui.backend._called) | 1681 | APP_NAME, EMAIL) |
4841 | 1670 | self.assertEqual(self.ui.backend._called[expected], | ||
4842 | 1671 | ((APP_NAME, EMAIL), | ||
4843 | 1672 | dict(reply_handler=gui.NO_OP, | ||
4844 | 1673 | error_handler=gui.NO_OP))) | ||
4847 | 1674 | 1682 | ||
4848 | 1675 | def test_on_password_reset_token_sent_morphs_window(self): | 1683 | def test_on_password_reset_token_sent_morphs_window(self): |
4849 | 1676 | """When the reset token was sent, the reset password page is shown.""" | 1684 | """When the reset token was sent, the reset password page is shown.""" |
4850 | @@ -1805,12 +1813,8 @@ | |||
4851 | 1805 | def test_on_set_new_password_ok_button_clicked_calls_backend(self): | 1813 | def test_on_set_new_password_ok_button_clicked_calls_backend(self): |
4852 | 1806 | """Clicking set_new_password_ok_button the backend is called.""" | 1814 | """Clicking set_new_password_ok_button the backend is called.""" |
4853 | 1807 | self.click_set_new_password_with_valid_data() | 1815 | self.click_set_new_password_with_valid_data() |
4860 | 1808 | expected = 'set_new_password' | 1816 | self.assert_backend_called('set_new_password', |
4861 | 1809 | self.assertIn(expected, self.ui.backend._called) | 1817 | APP_NAME, EMAIL, RESET_PASSWORD_TOKEN, PASSWORD) |
4856 | 1810 | self.assertEqual(self.ui.backend._called[expected], | ||
4857 | 1811 | ((APP_NAME, EMAIL, RESET_PASSWORD_TOKEN, PASSWORD), | ||
4858 | 1812 | dict(reply_handler=gui.NO_OP, | ||
4859 | 1813 | error_handler=gui.NO_OP))) | ||
4862 | 1814 | 1818 | ||
4863 | 1815 | def test_on_password_changed_shows_login_page(self): | 1819 | def test_on_password_changed_shows_login_page(self): |
4864 | 1816 | """When password was successfuly changed the login page is shown.""" | 1820 | """When password was successfuly changed the login page is shown.""" |
4865 | @@ -2070,10 +2074,6 @@ | |||
4866 | 2070 | class ReturnCodeTestCase(UbuntuSSOClientTestCase): | 2074 | class ReturnCodeTestCase(UbuntuSSOClientTestCase): |
4867 | 2071 | """Test the return codes.""" | 2075 | """Test the return codes.""" |
4868 | 2072 | 2076 | ||
4869 | 2073 | LOGIN_SUCCESS = gui.LOGIN_SUCCESS | ||
4870 | 2074 | REGISTRATION_SUCCESS = gui.REGISTRATION_SUCCESS | ||
4871 | 2075 | USER_CANCELLATION = gui.USER_CANCELLATION | ||
4872 | 2076 | |||
4873 | 2077 | @defer.inlineCallbacks | 2077 | @defer.inlineCallbacks |
4874 | 2078 | def setUp(self): | 2078 | def setUp(self): |
4875 | 2079 | yield super(ReturnCodeTestCase, self).setUp() | 2079 | yield super(ReturnCodeTestCase, self).setUp() |
4876 | @@ -2081,7 +2081,7 @@ | |||
4877 | 2081 | 2081 | ||
4878 | 2082 | def test_closing_main_window(self): | 2082 | def test_closing_main_window(self): |
4879 | 2083 | """When closing the main window, USER_CANCELLATION is called.""" | 2083 | """When closing the main window, USER_CANCELLATION is called.""" |
4881 | 2084 | self.ui.window.emit('delete-event', gtk.gdk.Event(gtk.gdk.DELETE)) | 2084 | self.ui.window.emit('delete-event', Gdk.Event()) |
4882 | 2085 | self.assertEqual(self._called, ((gui.USER_CANCELLATION,), {})) | 2085 | self.assertEqual(self._called, ((gui.USER_CANCELLATION,), {})) |
4883 | 2086 | 2086 | ||
4884 | 2087 | def test_every_cancel_calls_proper_callback(self): | 2087 | def test_every_cancel_calls_proper_callback(self): |
4885 | @@ -2108,7 +2108,7 @@ | |||
4886 | 2108 | self.ui.on_email_validated(app_name=APP_NAME, email=EMAIL) | 2108 | self.ui.on_email_validated(app_name=APP_NAME, email=EMAIL) |
4887 | 2109 | self.ui.on_close_clicked() | 2109 | self.ui.on_close_clicked() |
4888 | 2110 | 2110 | ||
4890 | 2111 | self.assertEqual(self._called, ((gui.REGISTRATION_SUCCESS,), {})) | 2111 | self.assertEqual(self._called, ((gui.USER_SUCCESS,), {})) |
4891 | 2112 | 2112 | ||
4892 | 2113 | def test_on_email_validation_error_proper_callback_is_called(self): | 2113 | def test_on_email_validation_error_proper_callback_is_called(self): |
4893 | 2114 | """On EmailValidationError, USER_CANCELLATION is called.""" | 2114 | """On EmailValidationError, USER_CANCELLATION is called.""" |
4894 | @@ -2122,7 +2122,7 @@ | |||
4895 | 2122 | self.ui.on_logged_in(app_name=APP_NAME, email=EMAIL) | 2122 | self.ui.on_logged_in(app_name=APP_NAME, email=EMAIL) |
4896 | 2123 | self.ui.on_close_clicked() | 2123 | self.ui.on_close_clicked() |
4897 | 2124 | 2124 | ||
4899 | 2125 | self.assertEqual(self._called, ((gui.LOGIN_SUCCESS,), {})) | 2125 | self.assertEqual(self._called, ((gui.USER_SUCCESS,), {})) |
4900 | 2126 | 2126 | ||
4901 | 2127 | def test_on_login_error_proper_callback_is_called(self): | 2127 | def test_on_login_error_proper_callback_is_called(self): |
4902 | 2128 | """On LoginError, USER_CANCELLATION is called.""" | 2128 | """On LoginError, USER_CANCELLATION is called.""" |
4903 | @@ -2145,7 +2145,7 @@ | |||
4904 | 2145 | self.ui.on_email_validated(app_name=APP_NAME, email=EMAIL) | 2145 | self.ui.on_email_validated(app_name=APP_NAME, email=EMAIL) |
4905 | 2146 | self.ui.on_close_clicked() | 2146 | self.ui.on_close_clicked() |
4906 | 2147 | 2147 | ||
4908 | 2148 | self.assertEqual(self._called, ((gui.REGISTRATION_SUCCESS,), {})) | 2148 | self.assertEqual(self._called, ((gui.USER_SUCCESS,), {})) |
4909 | 2149 | 2149 | ||
4910 | 2150 | def test_login_success_even_if_prior_login_error(self): | 2150 | def test_login_success_even_if_prior_login_error(self): |
4911 | 2151 | """Only one callback is called with the final outcome. | 2151 | """Only one callback is called with the final outcome. |
4912 | @@ -2160,7 +2160,7 @@ | |||
4913 | 2160 | self.ui.on_logged_in(app_name=APP_NAME, email=EMAIL) | 2160 | self.ui.on_logged_in(app_name=APP_NAME, email=EMAIL) |
4914 | 2161 | self.ui.on_close_clicked() | 2161 | self.ui.on_close_clicked() |
4915 | 2162 | 2162 | ||
4917 | 2163 | self.assertEqual(self._called, ((gui.LOGIN_SUCCESS,), {})) | 2163 | self.assertEqual(self._called, ((gui.USER_SUCCESS,), {})) |
4918 | 2164 | 2164 | ||
4919 | 2165 | def test_user_cancelation_even_if_prior_registration_error(self): | 2165 | def test_user_cancelation_even_if_prior_registration_error(self): |
4920 | 2166 | """Only one callback is called with the final outcome. | 2166 | """Only one callback is called with the final outcome. |
4921 | 2167 | 2167 | ||
4922 | === added file 'ubuntu_sso/gtk/tests/test_main.py' | |||
4923 | --- ubuntu_sso/gtk/tests/test_main.py 1970-01-01 00:00:00 +0000 | |||
4924 | +++ ubuntu_sso/gtk/tests/test_main.py 2012-02-14 22:04:20 +0000 | |||
4925 | @@ -0,0 +1,39 @@ | |||
4926 | 1 | # -*- coding: utf-8 -*- | ||
4927 | 2 | # | ||
4928 | 3 | # Copyright 2012 Canonical Ltd. | ||
4929 | 4 | # | ||
4930 | 5 | # This program is free software: you can redistribute it and/or modify it | ||
4931 | 6 | # under the terms of the GNU General Public License version 3, as published | ||
4932 | 7 | # by the Free Software Foundation. | ||
4933 | 8 | # | ||
4934 | 9 | # This program is distributed in the hope that it will be useful, but | ||
4935 | 10 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
4936 | 11 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
4937 | 12 | # PURPOSE. See the GNU General Public License for more details. | ||
4938 | 13 | # | ||
4939 | 14 | # You should have received a copy of the GNU General Public License along | ||
4940 | 15 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4941 | 16 | |||
4942 | 17 | """Tests for the main module.""" | ||
4943 | 18 | |||
4944 | 19 | from twisted.trial.unittest import TestCase | ||
4945 | 20 | |||
4946 | 21 | from ubuntu_sso.gtk import main | ||
4947 | 22 | |||
4948 | 23 | |||
4949 | 24 | class BasicTestCase(TestCase): | ||
4950 | 25 | """Test case with a helper tracker.""" | ||
4951 | 26 | |||
4952 | 27 | def test_main(self): | ||
4953 | 28 | """Calling main.main() a UI instance is created.""" | ||
4954 | 29 | called = [] | ||
4955 | 30 | self.patch(main, 'UbuntuSSOClientGUI', | ||
4956 | 31 | lambda **kw: called.append(('GUI', kw))) | ||
4957 | 32 | self.patch(main.Gtk, 'main', | ||
4958 | 33 | lambda: called.append('main')) | ||
4959 | 34 | |||
4960 | 35 | kwargs = dict(foo='foo', bar='bar', baz='yadda', yadda=0) | ||
4961 | 36 | main.main(**kwargs) | ||
4962 | 37 | |||
4963 | 38 | kwargs['close_callback'] = main.Gtk.main_quit | ||
4964 | 39 | self.assertEqual(called, [('GUI', kwargs), 'main']) | ||
4965 | 0 | 40 | ||
4966 | === modified file 'ubuntu_sso/keyring/__init__.py' | |||
4967 | --- ubuntu_sso/keyring/__init__.py 2011-10-17 18:24:55 +0000 | |||
4968 | +++ ubuntu_sso/keyring/__init__.py 2012-02-14 22:04:20 +0000 | |||
4969 | @@ -29,8 +29,8 @@ | |||
4970 | 29 | 29 | ||
4971 | 30 | logger = setup_logging("ubuntu_sso.keyring") | 30 | logger = setup_logging("ubuntu_sso.keyring") |
4972 | 31 | 31 | ||
4975 | 32 | TOKEN_SEPARATOR = ' @ ' | 32 | TOKEN_SEPARATOR = u' @ ' |
4976 | 33 | SEPARATOR_REPLACEMENT = ' AT ' | 33 | SEPARATOR_REPLACEMENT = u' AT ' |
4977 | 34 | 34 | ||
4978 | 35 | U1_APP_NAME = "Ubuntu One" | 35 | U1_APP_NAME = "Ubuntu One" |
4979 | 36 | U1_KEY_NAME = "UbuntuOne token for https://ubuntuone.com" | 36 | U1_KEY_NAME = "UbuntuOne token for https://ubuntuone.com" |
4980 | @@ -41,26 +41,34 @@ | |||
4981 | 41 | 41 | ||
4982 | 42 | 42 | ||
4983 | 43 | def gethostname(): | 43 | def gethostname(): |
4985 | 44 | """Get the hostname, encoded in utf-8.""" | 44 | """Get the hostname, return the name as unicode.""" |
4986 | 45 | sys_encoding = sys.getfilesystemencoding() | 45 | sys_encoding = sys.getfilesystemencoding() |
4987 | 46 | hostname = socket.gethostname().decode(sys_encoding) | 46 | hostname = socket.gethostname().decode(sys_encoding) |
4989 | 47 | return hostname.encode("utf-8") | 47 | return hostname |
4990 | 48 | 48 | ||
4991 | 49 | 49 | ||
4992 | 50 | def get_old_token_name(app_name): | 50 | def get_old_token_name(app_name): |
4994 | 51 | """Build the token name (old style).""" | 51 | """Build the token name (old style). Return an unicode.""" |
4995 | 52 | quoted_app_name = urllib.quote(app_name) | 52 | quoted_app_name = urllib.quote(app_name) |
4996 | 53 | computer_name = gethostname() | 53 | computer_name = gethostname() |
4997 | 54 | quoted_computer_name = urllib.quote(computer_name) | 54 | quoted_computer_name = urllib.quote(computer_name) |
4999 | 55 | return "%s - %s" % (quoted_app_name, quoted_computer_name) | 55 | |
5000 | 56 | assert isinstance(computer_name, unicode) |
+1