Merge lp:~ralsina/ubuntuone-windows-installer/fix_803929 into lp:ubuntuone-windows-installer
- fix_803929
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||
Approved revision: | 27 | ||||
Merged at revision: | 16 | ||||
Proposed branch: | lp:~ralsina/ubuntuone-windows-installer/fix_803929 | ||||
Merge into: | lp:ubuntuone-windows-installer | ||||
Diff against target: |
722 lines (+390/-41) 9 files modified
data/qt/side_widget.ui (+94/-0) ubuntuone_installer/gui/__init__.py (+7/-0) ubuntuone_installer/gui/qt/gui.py (+16/-0) ubuntuone_installer/gui/qt/local_folders.py (+20/-12) ubuntuone_installer/gui/qt/setup_account.py (+17/-12) ubuntuone_installer/gui/qt/side_widget.py (+49/-0) ubuntuone_installer/gui/qt/tests/test_gui.py (+80/-15) ubuntuone_installer/gui/qt/tests/test_side_widget.py (+100/-0) ubuntuone_installer/gui/qt/tos.py (+7/-2) |
||||
To merge this branch: | bzr merge lp:~ralsina/ubuntuone-windows-installer/fix_803929 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Review via email:
|
Commit message
Add sidewidget as specced.
Description of the change
Add sidewidget as specced.
Wireframe:
Implementation:
This doesn't look correct in all pages because theya re not all using title/subtitle, and that really breaks the look, so there is going to be another branch for that.
To test IRL (Windows):
On one terminal start SSO:
set PYTHONPATH=.
python bin\ubuntu-
On another terminal, start the installer:
set PYTHONPATH=
python bin\ubuntuone-
You should see a series of labels on the left side that show what stage of the installation/setup you are at.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Natalia Bidart (nataliabidart) wrote : | # |
The branch looks great. Some lint issues:
C0111: 85:SetupAccount
C0111: 93:SetupAccount
C0111:101:
C0111:110:
C0111:399:
W0612: 57:CalculateSiz
C0103: 84:LocalFolders
C0111: 84:LocalFolders
W0612:149:
C0103:152:
C0111: 30:TosPage: Missing docstring
W0201:293:
W0201:294:
nessita@
./build/
./ubuntuone_
./ubuntuone_
./ubuntuone_
./ubuntuone_
./ubuntuone_
./ubuntuone_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
Voting does not meet specified criteria. Required: Approve >= 1, Disapprove == 0, Needs Fixing == 0, Needs Information == 0, Resubmit == 0, Pending == 0. Got: 1 Needs Fixing.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Natalia Bidart (nataliabidart) wrote : | # |
Looks great, thanks!
Preview Diff
1 | === added file 'data/qt/side_widget.ui' | |||
2 | --- data/qt/side_widget.ui 1970-01-01 00:00:00 +0000 | |||
3 | +++ data/qt/side_widget.ui 2011-07-07 20:33:35 +0000 | |||
4 | @@ -0,0 +1,94 @@ | |||
5 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
6 | 2 | <ui version="4.0"> | ||
7 | 3 | <class>Form</class> | ||
8 | 4 | <widget class="QWidget" name="Form"> | ||
9 | 5 | <property name="geometry"> | ||
10 | 6 | <rect> | ||
11 | 7 | <x>0</x> | ||
12 | 8 | <y>0</y> | ||
13 | 9 | <width>185</width> | ||
14 | 10 | <height>511</height> | ||
15 | 11 | </rect> | ||
16 | 12 | </property> | ||
17 | 13 | <property name="windowTitle"> | ||
18 | 14 | <string>Form</string> | ||
19 | 15 | </property> | ||
20 | 16 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
21 | 17 | <property name="spacing"> | ||
22 | 18 | <number>20</number> | ||
23 | 19 | </property> | ||
24 | 20 | <item> | ||
25 | 21 | <widget class="QLabel" name="label"> | ||
26 | 22 | <property name="text"> | ||
27 | 23 | <string>Ubuntu One logo</string> | ||
28 | 24 | </property> | ||
29 | 25 | </widget> | ||
30 | 26 | </item> | ||
31 | 27 | <item> | ||
32 | 28 | <widget class="QLabel" name="install_label"> | ||
33 | 29 | <property name="enabled"> | ||
34 | 30 | <bool>true</bool> | ||
35 | 31 | </property> | ||
36 | 32 | <property name="text"> | ||
37 | 33 | <string>Install</string> | ||
38 | 34 | </property> | ||
39 | 35 | </widget> | ||
40 | 36 | </item> | ||
41 | 37 | <item> | ||
42 | 38 | <widget class="QLabel" name="sign_in_label"> | ||
43 | 39 | <property name="enabled"> | ||
44 | 40 | <bool>true</bool> | ||
45 | 41 | </property> | ||
46 | 42 | <property name="text"> | ||
47 | 43 | <string>Sign In</string> | ||
48 | 44 | </property> | ||
49 | 45 | </widget> | ||
50 | 46 | </item> | ||
51 | 47 | <item> | ||
52 | 48 | <widget class="QLabel" name="choose_services_label"> | ||
53 | 49 | <property name="enabled"> | ||
54 | 50 | <bool>true</bool> | ||
55 | 51 | </property> | ||
56 | 52 | <property name="text"> | ||
57 | 53 | <string>Choose services</string> | ||
58 | 54 | </property> | ||
59 | 55 | </widget> | ||
60 | 56 | </item> | ||
61 | 57 | <item> | ||
62 | 58 | <widget class="QLabel" name="select_folders_label"> | ||
63 | 59 | <property name="enabled"> | ||
64 | 60 | <bool>true</bool> | ||
65 | 61 | </property> | ||
66 | 62 | <property name="text"> | ||
67 | 63 | <string>Select sync folders</string> | ||
68 | 64 | </property> | ||
69 | 65 | </widget> | ||
70 | 66 | </item> | ||
71 | 67 | <item> | ||
72 | 68 | <widget class="QLabel" name="sync_label"> | ||
73 | 69 | <property name="enabled"> | ||
74 | 70 | <bool>true</bool> | ||
75 | 71 | </property> | ||
76 | 72 | <property name="text"> | ||
77 | 73 | <string>Sync, stream, share!</string> | ||
78 | 74 | </property> | ||
79 | 75 | </widget> | ||
80 | 76 | </item> | ||
81 | 77 | <item> | ||
82 | 78 | <spacer name="verticalSpacer"> | ||
83 | 79 | <property name="orientation"> | ||
84 | 80 | <enum>Qt::Vertical</enum> | ||
85 | 81 | </property> | ||
86 | 82 | <property name="sizeHint" stdset="0"> | ||
87 | 83 | <size> | ||
88 | 84 | <width>20</width> | ||
89 | 85 | <height>292</height> | ||
90 | 86 | </size> | ||
91 | 87 | </property> | ||
92 | 88 | </spacer> | ||
93 | 89 | </item> | ||
94 | 90 | </layout> | ||
95 | 91 | </widget> | ||
96 | 92 | <resources/> | ||
97 | 93 | <connections/> | ||
98 | 94 | </ui> | ||
99 | 0 | 95 | ||
100 | === modified file 'ubuntuone_installer/gui/__init__.py' | |||
101 | --- ubuntuone_installer/gui/__init__.py 2011-06-21 16:16:27 +0000 | |||
102 | +++ ubuntuone_installer/gui/__init__.py 2011-07-07 20:33:35 +0000 | |||
103 | @@ -21,3 +21,10 @@ | |||
104 | 21 | import gettext | 21 | import gettext |
105 | 22 | 22 | ||
106 | 23 | _ = gettext.gettext | 23 | _ = gettext.gettext |
107 | 24 | |||
108 | 25 | LOCAL_FOLDERS_TITLE = _("Syncing your computer with the cloud") | ||
109 | 26 | LOCAL_FOLDERS_SPACE_HEADER = _("Space (%s)") | ||
110 | 27 | LOCAL_FOLDERS_OFFER_LABEL = _("The folders you have selected to sync " | ||
111 | 28 | "take over your %(quota)s space. You can remove some folders or add " | ||
112 | 29 | "some extra space") | ||
113 | 30 | LOCAL_FOLDERS_CALCULATING = _("Calculating") | ||
114 | 24 | 31 | ||
115 | === modified file 'ubuntuone_installer/gui/qt/gui.py' | |||
116 | --- ubuntuone_installer/gui/qt/gui.py 2011-07-05 13:40:00 +0000 | |||
117 | +++ ubuntuone_installer/gui/qt/gui.py 2011-07-07 20:33:35 +0000 | |||
118 | @@ -72,6 +72,7 @@ | |||
119 | 72 | from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage | 72 | from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage |
120 | 73 | from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage | 73 | from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage |
121 | 74 | from ubuntuone_installer.gui.qt.setup_account import SetupAccountPage | 74 | from ubuntuone_installer.gui.qt.setup_account import SetupAccountPage |
122 | 75 | from ubuntuone_installer.gui.qt.side_widget import SideWidget | ||
123 | 75 | from ubuntuone_installer.gui.qt.tos import TosPage | 76 | from ubuntuone_installer.gui.qt.tos import TosPage |
124 | 76 | 77 | ||
125 | 77 | _ = gettext.gettext | 78 | _ = gettext.gettext |
126 | @@ -290,6 +291,8 @@ | |||
127 | 290 | self.setWizardStyle(self.ModernStyle) | 291 | self.setWizardStyle(self.ModernStyle) |
128 | 291 | self.close_callback = close_callback | 292 | self.close_callback = close_callback |
129 | 292 | 293 | ||
130 | 294 | self.setSideWidget(SideWidget()) | ||
131 | 295 | |||
132 | 293 | self.creds = Credentials( | 296 | self.creds = Credentials( |
133 | 294 | app_name=self.app_name, | 297 | app_name=self.app_name, |
134 | 295 | ui_module="ubuntuone_installer.gui.qt.embedded_sso", | 298 | ui_module="ubuntuone_installer.gui.qt.embedded_sso", |
135 | @@ -361,6 +364,8 @@ | |||
136 | 361 | self.SYNC_NOW_OR_LATER_PAGE = self.addPage(SyncNowOrLaterPage()) | 364 | self.SYNC_NOW_OR_LATER_PAGE = self.addPage(SyncNowOrLaterPage()) |
137 | 362 | self.CONGRATULATIONS_PAGE = self.addPage(CongratulationsPage()) | 365 | self.CONGRATULATIONS_PAGE = self.addPage(CongratulationsPage()) |
138 | 363 | 366 | ||
139 | 367 | self.currentIdChanged.connect(self.on_currentIdChanged) | ||
140 | 368 | |||
141 | 364 | # Invalid name "closeEvent" | 369 | # Invalid name "closeEvent" |
142 | 365 | # pylint: disable=C0103 | 370 | # pylint: disable=C0103 |
143 | 366 | 371 | ||
144 | @@ -390,3 +395,14 @@ | |||
145 | 390 | if self.close_callback is not None: | 395 | if self.close_callback is not None: |
146 | 391 | self.close_callback() | 396 | self.close_callback() |
147 | 392 | QtGui.QWizard.done(self, result) | 397 | QtGui.QWizard.done(self, result) |
148 | 398 | |||
149 | 399 | def on_currentIdChanged(self, page_id): | ||
150 | 400 | """The current page changed.""" | ||
151 | 401 | if page_id < self.SIGNIN_PAGE: | ||
152 | 402 | self.sideWidget().set_stage(0) | ||
153 | 403 | elif page_id < self.local_folders_page_id: | ||
154 | 404 | self.sideWidget().set_stage(1) | ||
155 | 405 | elif page_id < self.CONGRATULATIONS_PAGE: | ||
156 | 406 | self.sideWidget().set_stage(3) | ||
157 | 407 | else: | ||
158 | 408 | self.sideWidget().set_stage(4) | ||
159 | 393 | 409 | ||
160 | === modified file 'ubuntuone_installer/gui/qt/local_folders.py' | |||
161 | --- ubuntuone_installer/gui/qt/local_folders.py 2011-06-30 21:31:01 +0000 | |||
162 | +++ ubuntuone_installer/gui/qt/local_folders.py 2011-07-07 20:33:35 +0000 | |||
163 | @@ -19,7 +19,6 @@ | |||
164 | 19 | """Widget to create UDFs in the Windows Install Wizard.""" | 19 | """Widget to create UDFs in the Windows Install Wizard.""" |
165 | 20 | 20 | ||
166 | 21 | import ctypes | 21 | import ctypes |
167 | 22 | import gettext | ||
168 | 23 | import os | 22 | import os |
169 | 24 | import threading | 23 | import threading |
170 | 25 | import Queue | 24 | import Queue |
171 | @@ -29,8 +28,12 @@ | |||
172 | 29 | from ubuntuone.controlpanel.gui import humanize | 28 | from ubuntuone.controlpanel.gui import humanize |
173 | 30 | 29 | ||
174 | 31 | from ubuntuone_installer.gui.qt.ui import local_folders_ui | 30 | from ubuntuone_installer.gui.qt.ui import local_folders_ui |
177 | 32 | 31 | from ubuntuone_installer.gui import ( | |
178 | 33 | _ = gettext.gettext | 32 | LOCAL_FOLDERS_TITLE, |
179 | 33 | LOCAL_FOLDERS_SPACE_HEADER, | ||
180 | 34 | LOCAL_FOLDERS_OFFER_LABEL, | ||
181 | 35 | LOCAL_FOLDERS_CALCULATING, | ||
182 | 36 | ) | ||
183 | 34 | 37 | ||
184 | 35 | 38 | ||
185 | 36 | class FolderItem(QtGui.QTreeWidgetItem): | 39 | class FolderItem(QtGui.QTreeWidgetItem): |
186 | @@ -54,7 +57,7 @@ | |||
187 | 54 | 57 | ||
188 | 55 | def run(self): | 58 | def run(self): |
189 | 56 | total_size = 0 | 59 | total_size = 0 |
191 | 57 | for dirpath, dirnames, filenames in os.walk(self.path_name): | 60 | for dirpath, _, filenames in os.walk(self.path_name): |
192 | 58 | for f in filenames: | 61 | for f in filenames: |
193 | 59 | fp = os.path.join(dirpath, f) | 62 | fp = os.path.join(dirpath, f) |
194 | 60 | total_size += os.path.getsize(fp) | 63 | total_size += os.path.getsize(fp) |
195 | @@ -65,7 +68,7 @@ | |||
196 | 65 | """Wizard page to create UDFs in the Windows Installer.""" | 68 | """Wizard page to create UDFs in the Windows Installer.""" |
197 | 66 | def __init__(self, parent=None): | 69 | def __init__(self, parent=None): |
198 | 67 | super(LocalFoldersPage, self).__init__(parent) | 70 | super(LocalFoldersPage, self).__init__(parent) |
200 | 68 | self.setTitle(_("Syncing your computer with the cloud")) | 71 | self.setTitle(LOCAL_FOLDERS_TITLE) |
201 | 69 | self.ui = local_folders_ui.Ui_Form() | 72 | self.ui = local_folders_ui.Ui_Form() |
202 | 70 | self.ui.setupUi(self) | 73 | self.ui.setupUi(self) |
203 | 71 | 74 | ||
204 | @@ -81,7 +84,10 @@ | |||
205 | 81 | self.timer.start(2000) | 84 | self.timer.start(2000) |
206 | 82 | self.timer.timeout.connect(self.update_sizes) | 85 | self.timer.timeout.connect(self.update_sizes) |
207 | 83 | 86 | ||
208 | 87 | # initializePage is inherited | ||
209 | 88 | # pylint: disable=C0103 | ||
210 | 84 | def initializePage(self): | 89 | def initializePage(self): |
211 | 90 | """UI details.""" | ||
212 | 85 | self.wizard()._next_id = None | 91 | self.wizard()._next_id = None |
213 | 86 | 92 | ||
214 | 87 | def quota(self): | 93 | def quota(self): |
215 | @@ -102,7 +108,7 @@ | |||
216 | 102 | if path in self.items: | 108 | if path in self.items: |
217 | 103 | return None | 109 | return None |
218 | 104 | # FIXME: the path should actually be sent to u1cp to verify as valid | 110 | # FIXME: the path should actually be sent to u1cp to verify as valid |
220 | 105 | item = FolderItem([path, "", _("Remove")], path=path, queue=self.queue) | 111 | item = FolderItem([path, "", "remove"], path=path, queue=self.queue) |
221 | 106 | self.ui.folder_list.addTopLevelItem(item) | 112 | self.ui.folder_list.addTopLevelItem(item) |
222 | 107 | self.items[path] = item | 113 | self.items[path] = item |
223 | 108 | return item | 114 | return item |
224 | @@ -120,7 +126,7 @@ | |||
225 | 120 | total = 0 | 126 | total = 0 |
226 | 121 | for path, item in self.items.items(): | 127 | for path, item in self.items.items(): |
227 | 122 | if item.size is None: | 128 | if item.size is None: |
229 | 123 | total = _("Calculating") | 129 | total = LOCAL_FOLDERS_CALCULATING |
230 | 124 | break | 130 | break |
231 | 125 | total += item.size | 131 | total += item.size |
232 | 126 | 132 | ||
233 | @@ -129,7 +135,8 @@ | |||
234 | 129 | total = humanize(total) | 135 | total = humanize(total) |
235 | 130 | else: | 136 | else: |
236 | 131 | self.show_hide_offer(0) | 137 | self.show_hide_offer(0) |
238 | 132 | self.ui.folder_list.headerItem().setText(1, _("Space (%s)" % total)) | 138 | self.ui.folder_list.headerItem().setText( |
239 | 139 | 1, LOCAL_FOLDERS_SPACE_HEADER % total) | ||
240 | 133 | 140 | ||
241 | 134 | def show_hide_offer(self, cur_size): | 141 | def show_hide_offer(self, cur_size): |
242 | 135 | """Show or hide the offer to buy space according to the total size.""" | 142 | """Show or hide the offer to buy space according to the total size.""" |
243 | @@ -140,15 +147,16 @@ | |||
244 | 140 | else: | 147 | else: |
245 | 141 | self.ui.offer_frame.setVisible(False) | 148 | self.ui.offer_frame.setVisible(False) |
246 | 142 | 149 | ||
250 | 143 | self.ui.offer_label.setText(_("The folders you have selected to sync " | 150 | self.ui.offer_label.setText(LOCAL_FOLDERS_OFFER_LABEL % |
251 | 144 | "take over your %s space. You can remove some folders or add " | 151 | {"quota": humanize(quota)}) |
249 | 145 | "some extra space" % humanize(quota))) | ||
252 | 146 | 152 | ||
253 | 147 | def stop_threads(self): | 153 | def stop_threads(self): |
254 | 148 | """Stop all pending threads.""" | 154 | """Stop all pending threads.""" |
256 | 149 | for path, item in self.items: | 155 | for _, item in self.items: |
257 | 150 | item.thread._stop = True | 156 | item.thread._stop = True |
258 | 151 | 157 | ||
259 | 158 | # itemClicked is a Qt signal name. | ||
260 | 159 | # pylint: disable=C0103 | ||
261 | 152 | def on_folder_list_itemClicked(self, item, column): | 160 | def on_folder_list_itemClicked(self, item, column): |
262 | 153 | """Delete folder from the list.""" | 161 | """Delete folder from the list.""" |
263 | 154 | if column == 2: | 162 | if column == 2: |
264 | 155 | 163 | ||
265 | === modified file 'ubuntuone_installer/gui/qt/setup_account.py' | |||
266 | --- ubuntuone_installer/gui/qt/setup_account.py 2011-07-04 23:03:09 +0000 | |||
267 | +++ ubuntuone_installer/gui/qt/setup_account.py 2011-07-07 20:33:35 +0000 | |||
268 | @@ -27,8 +27,9 @@ | |||
269 | 27 | 27 | ||
270 | 28 | _ = gettext.gettext | 28 | _ = gettext.gettext |
271 | 29 | 29 | ||
274 | 30 | bad = u'<font color="red"> %s </font>' | 30 | # pylint: disable=C0103 |
275 | 31 | good = u'<font color="green"> %s </font>' | 31 | BAD = u'<font color="red"> %s </font>' |
276 | 32 | GOOD = u'<font color="green"> %s </font>' | ||
277 | 32 | 33 | ||
278 | 33 | EMPTY_NAME = _("Please enter your name") | 34 | EMPTY_NAME = _("Please enter your name") |
279 | 34 | INVALID_EMAIL = _("Please enter a valid email address") | 35 | INVALID_EMAIL = _("Please enter a valid email address") |
280 | @@ -83,55 +84,59 @@ | |||
281 | 83 | self.password_assistance() | 84 | self.password_assistance() |
282 | 84 | 85 | ||
283 | 85 | def name_assistance(self): | 86 | def name_assistance(self): |
284 | 87 | """Show help for the name field.""" | ||
285 | 86 | text = unicode(self.ui.name_edit.text()) | 88 | text = unicode(self.ui.name_edit.text()) |
286 | 87 | if not text.strip(): | 89 | if not text.strip(): |
287 | 88 | self.ui.name_assistance.setVisible(True) | 90 | self.ui.name_assistance.setVisible(True) |
289 | 89 | self.ui.name_assistance.setText(bad % EMPTY_NAME) | 91 | self.ui.name_assistance.setText(BAD % EMPTY_NAME) |
290 | 90 | else: | 92 | else: |
291 | 91 | self.ui.name_assistance.setVisible(False) | 93 | self.ui.name_assistance.setVisible(False) |
292 | 92 | 94 | ||
293 | 93 | def email_assistance(self): | 95 | def email_assistance(self): |
294 | 96 | """Show help for the email field.""" | ||
295 | 94 | text = unicode(self.ui.email_edit.text()) | 97 | text = unicode(self.ui.email_edit.text()) |
296 | 95 | if not is_correct_email(text): | 98 | if not is_correct_email(text): |
298 | 96 | self.ui.email_assistance.setText(bad % INVALID_EMAIL) | 99 | self.ui.email_assistance.setText(BAD % INVALID_EMAIL) |
299 | 97 | self.ui.email_assistance.setVisible(True) | 100 | self.ui.email_assistance.setVisible(True) |
300 | 98 | else: | 101 | else: |
301 | 99 | self.ui.email_assistance.setVisible(False) | 102 | self.ui.email_assistance.setVisible(False) |
302 | 100 | 103 | ||
303 | 101 | def confirm_email_assistance(self): | 104 | def confirm_email_assistance(self): |
304 | 105 | """Show help for the confirm email field.""" | ||
305 | 102 | text1 = unicode(self.ui.email_edit.text()) | 106 | text1 = unicode(self.ui.email_edit.text()) |
306 | 103 | text2 = unicode(self.ui.confirm_email_edit.text()) | 107 | text2 = unicode(self.ui.confirm_email_edit.text()) |
307 | 104 | if text1 != text2: | 108 | if text1 != text2: |
309 | 105 | self.ui.confirm_email_assistance.setText(bad % EMAIL_MATCH) | 109 | self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH) |
310 | 106 | self.ui.confirm_email_assistance.setVisible(True) | 110 | self.ui.confirm_email_assistance.setVisible(True) |
311 | 107 | else: | 111 | else: |
312 | 108 | self.ui.confirm_email_assistance.setVisible(False) | 112 | self.ui.confirm_email_assistance.setVisible(False) |
313 | 109 | 113 | ||
314 | 110 | def password_assistance(self): | 114 | def password_assistance(self): |
315 | 115 | """Show help for the password field.""" | ||
316 | 111 | text1 = unicode(self.ui.password_edit.text()) | 116 | text1 = unicode(self.ui.password_edit.text()) |
317 | 112 | text2 = unicode(self.ui.confirm_password_edit.text()) | 117 | text2 = unicode(self.ui.confirm_password_edit.text()) |
318 | 113 | label_text = [_("Your password must contain"), ] | 118 | label_text = [_("Your password must contain"), ] |
319 | 114 | 119 | ||
320 | 115 | if len(text1) < 8: | 120 | if len(text1) < 8: |
322 | 116 | sign = bad | 121 | sign = BAD |
323 | 117 | else: | 122 | else: |
325 | 118 | sign = good | 123 | sign = GOOD |
326 | 119 | label_text.append(sign % PASSWORD_LENGTH) | 124 | label_text.append(sign % PASSWORD_LENGTH) |
327 | 120 | 125 | ||
328 | 121 | if re.search('[A-Z]', text1) is None: | 126 | if re.search('[A-Z]', text1) is None: |
330 | 122 | sign = bad | 127 | sign = BAD |
331 | 123 | else: | 128 | else: |
333 | 124 | sign = good | 129 | sign = GOOD |
334 | 125 | label_text.append(sign % PASSWORD_UPPER) | 130 | label_text.append(sign % PASSWORD_UPPER) |
335 | 126 | 131 | ||
336 | 127 | if re.search('[\d+]', text1) is None: | 132 | if re.search('[\d+]', text1) is None: |
338 | 128 | sign = bad | 133 | sign = BAD |
339 | 129 | else: | 134 | else: |
341 | 130 | sign = good | 135 | sign = GOOD |
342 | 131 | label_text.append(sign % PASSWORD_DIGIT) | 136 | label_text.append(sign % PASSWORD_DIGIT) |
343 | 132 | 137 | ||
344 | 133 | if text1 != text2: | 138 | if text1 != text2: |
346 | 134 | label_text.append(bad % PASSWORD_MATCH) | 139 | label_text.append(BAD % PASSWORD_MATCH) |
347 | 135 | 140 | ||
348 | 136 | self.ui.password_assistance.setText("<br>".join(label_text)) | 141 | self.ui.password_assistance.setText("<br>".join(label_text)) |
349 | 137 | 142 | ||
350 | 138 | 143 | ||
351 | === added file 'ubuntuone_installer/gui/qt/side_widget.py' | |||
352 | --- ubuntuone_installer/gui/qt/side_widget.py 1970-01-01 00:00:00 +0000 | |||
353 | +++ ubuntuone_installer/gui/qt/side_widget.py 2011-07-07 20:33:35 +0000 | |||
354 | @@ -0,0 +1,49 @@ | |||
355 | 1 | # -*- coding: utf-8 -*- | ||
356 | 2 | |||
357 | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> | ||
358 | 4 | # | ||
359 | 5 | # Copyright 2011 Canonical Ltd. | ||
360 | 6 | # | ||
361 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
362 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
363 | 9 | # by the Free Software Foundation. | ||
364 | 10 | # | ||
365 | 11 | # This program is distributed in the hope that it will be useful, but | ||
366 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
367 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
368 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
369 | 15 | # | ||
370 | 16 | # You should have received a copy of the GNU General Public License along | ||
371 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
372 | 18 | |||
373 | 19 | """Wizard's side widget.""" | ||
374 | 20 | |||
375 | 21 | from PyQt4 import QtGui | ||
376 | 22 | |||
377 | 23 | from ubuntuone_installer.gui.qt.ui import side_widget_ui | ||
378 | 24 | |||
379 | 25 | |||
380 | 26 | class SideWidget(QtGui.QWidget): | ||
381 | 27 | |||
382 | 28 | """Wizard's side widget.""" | ||
383 | 29 | |||
384 | 30 | install_stage = 0 | ||
385 | 31 | signin_stage = 1 | ||
386 | 32 | choose_services_stage = 2 | ||
387 | 33 | select_sync_folders_stage = 3 | ||
388 | 34 | sync_stage = 4 | ||
389 | 35 | |||
390 | 36 | def __init__(self, *args, **kwargs): | ||
391 | 37 | super(SideWidget, self).__init__(*args, **kwargs) | ||
392 | 38 | self.ui = side_widget_ui.Ui_Form() | ||
393 | 39 | self.ui.setupUi(self) | ||
394 | 40 | self.stage = 0 | ||
395 | 41 | |||
396 | 42 | def set_stage(self, stage): | ||
397 | 43 | """Switch to the desired stage.""" | ||
398 | 44 | self.stage = stage | ||
399 | 45 | self.ui.install_label.setEnabled(stage >= 0) | ||
400 | 46 | self.ui.sign_in_label.setEnabled(stage >= 1) | ||
401 | 47 | self.ui.choose_services_label.setEnabled(stage >= 2) | ||
402 | 48 | self.ui.select_folders_label.setEnabled(stage >= 3) | ||
403 | 49 | self.ui.sync_label.setEnabled(stage >= 4) | ||
404 | 0 | 50 | ||
405 | === modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py' | |||
406 | --- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-04 23:01:14 +0000 | |||
407 | +++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-07 20:33:35 +0000 | |||
408 | @@ -170,6 +170,71 @@ | |||
409 | 170 | ((), {'title': gui.SIGN_IN, | 170 | ((), {'title': gui.SIGN_IN, |
410 | 171 | 'subtitle': gui.SIGN_IN_SUBTITLE})) | 171 | 'subtitle': gui.SIGN_IN_SUBTITLE})) |
411 | 172 | 172 | ||
412 | 173 | def test_stage_progression_1(self): | ||
413 | 174 | """Check that each page in the wizard sets the correct stage.""" | ||
414 | 175 | self.ui.on_currentIdChanged(self.ui.LICENSE_PAGE) | ||
415 | 176 | self.assertEqual(self.ui.sideWidget().stage, 0) | ||
416 | 177 | |||
417 | 178 | def test_stage_progression_2(self): | ||
418 | 179 | """Check that each page in the wizard sets the correct stage.""" | ||
419 | 180 | self.ui.on_currentIdChanged(self.ui.SIGNIN_PAGE) | ||
420 | 181 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
421 | 182 | |||
422 | 183 | def test_stage_progression_3(self): | ||
423 | 184 | """Check that each page in the wizard sets the correct stage.""" | ||
424 | 185 | self.ui.on_currentIdChanged(self.ui.setup_account_page_id) | ||
425 | 186 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
426 | 187 | |||
427 | 188 | def test_stage_progression_4(self): | ||
428 | 189 | """Check that each page in the wizard sets the correct stage.""" | ||
429 | 190 | self.ui.on_currentIdChanged(self.ui.tos_page_id) | ||
430 | 191 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
431 | 192 | |||
432 | 193 | def test_stage_progression_5(self): | ||
433 | 194 | """Check that each page in the wizard sets the correct stage.""" | ||
434 | 195 | self.ui.on_currentIdChanged(self.ui.email_verification_page_id) | ||
435 | 196 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
436 | 197 | |||
437 | 198 | def test_stage_progression_6(self): | ||
438 | 199 | """Check that each page in the wizard sets the correct stage.""" | ||
439 | 200 | self.ui.on_currentIdChanged(self.ui.current_user_page_id) | ||
440 | 201 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
441 | 202 | |||
442 | 203 | def test_stage_progression_7(self): | ||
443 | 204 | """Check that each page in the wizard sets the correct stage.""" | ||
444 | 205 | self.ui.on_currentIdChanged(self.ui.SUCCESS_PAGE) | ||
445 | 206 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
446 | 207 | |||
447 | 208 | def test_stage_progression_8(self): | ||
448 | 209 | """Check that each page in the wizard sets the correct stage.""" | ||
449 | 210 | self.ui.on_currentIdChanged(self.ui.ERROR_PAGE) | ||
450 | 211 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
451 | 212 | |||
452 | 213 | def test_stage_progression_9(self): | ||
453 | 214 | """Check that each page in the wizard sets the correct stage.""" | ||
454 | 215 | self.ui.on_currentIdChanged(self.ui.forgotten_password_page_id) | ||
455 | 216 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
456 | 217 | |||
457 | 218 | def test_stage_progression_10(self): | ||
458 | 219 | """Check that each page in the wizard sets the correct stage.""" | ||
459 | 220 | self.ui.on_currentIdChanged(self.ui.reset_password_page_id) | ||
460 | 221 | self.assertEqual(self.ui.sideWidget().stage, 1) | ||
461 | 222 | |||
462 | 223 | def test_stage_progression_11(self): | ||
463 | 224 | """Check that each page in the wizard sets the correct stage.""" | ||
464 | 225 | self.ui.on_currentIdChanged(self.ui.local_folders_page_id) | ||
465 | 226 | self.assertEqual(self.ui.sideWidget().stage, 3) | ||
466 | 227 | |||
467 | 228 | def test_stage_progression_12(self): | ||
468 | 229 | """Check that each page in the wizard sets the correct stage.""" | ||
469 | 230 | self.ui.on_currentIdChanged(self.ui.SYNC_NOW_OR_LATER_PAGE) | ||
470 | 231 | self.assertEqual(self.ui.sideWidget().stage, 3) | ||
471 | 232 | |||
472 | 233 | def test_stage_progression_13(self): | ||
473 | 234 | """Check that each page in the wizard sets the correct stage.""" | ||
474 | 235 | self.ui.on_currentIdChanged(self.ui.CONGRATULATIONS_PAGE) | ||
475 | 236 | self.assertEqual(self.ui.sideWidget().stage, 4) | ||
476 | 237 | |||
477 | 173 | def test_choose_signin_cancel(self): | 238 | def test_choose_signin_cancel(self): |
478 | 174 | """Test that the custom cancel button works.""" | 239 | """Test that the custom cancel button works.""" |
479 | 175 | self.ui.sign_in_page.ui.cancel_button.click() | 240 | self.ui.sign_in_page.ui.cancel_button.click() |
480 | @@ -225,10 +290,10 @@ | |||
481 | 225 | 290 | ||
482 | 226 | def test_size_calculation(self): | 291 | def test_size_calculation(self): |
483 | 227 | """Test the recursive folder size calculation.""" | 292 | """Test the recursive folder size calculation.""" |
488 | 228 | self.queue = Queue.Queue() | 293 | queue = Queue.Queue() |
489 | 229 | self.csize = local_folders.CalculateSize(self.tmpdir, self.queue) | 294 | csize = local_folders.CalculateSize(self.tmpdir, queue) |
490 | 230 | self.csize.run() | 295 | csize.run() |
491 | 231 | path, size = self.queue.get() | 296 | path, size = queue.get() |
492 | 232 | self.assertEqual(path, self.tmpdir) | 297 | self.assertEqual(path, self.tmpdir) |
493 | 233 | self.assertEqual(size, 1337) | 298 | self.assertEqual(size, 1337) |
494 | 234 | 299 | ||
495 | @@ -328,7 +393,7 @@ | |||
496 | 328 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) | 393 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) |
497 | 329 | self.assertEqual( | 394 | self.assertEqual( |
498 | 330 | unicode(self.ui.ui.name_assistance.text()), | 395 | unicode(self.ui.ui.name_assistance.text()), |
500 | 331 | setup_account.bad % setup_account.EMPTY_NAME | 396 | setup_account.BAD % setup_account.EMPTY_NAME |
501 | 332 | ) | 397 | ) |
502 | 333 | self.ui.hide() | 398 | self.ui.hide() |
503 | 334 | 399 | ||
504 | @@ -344,7 +409,7 @@ | |||
505 | 344 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) | 409 | self.assertEqual(self.ui.ui.name_assistance.isVisible(), True) |
506 | 345 | self.assertEqual( | 410 | self.assertEqual( |
507 | 346 | unicode(self.ui.ui.name_assistance.text()), | 411 | unicode(self.ui.ui.name_assistance.text()), |
509 | 347 | setup_account.bad % setup_account.EMPTY_NAME | 412 | setup_account.BAD % setup_account.EMPTY_NAME |
510 | 348 | ) | 413 | ) |
511 | 349 | self.ui.hide() | 414 | self.ui.hide() |
512 | 350 | 415 | ||
513 | @@ -371,7 +436,7 @@ | |||
514 | 371 | self.assertEqual(self.ui.ui.email_assistance.isVisible(), True) | 436 | self.assertEqual(self.ui.ui.email_assistance.isVisible(), True) |
515 | 372 | self.assertEqual( | 437 | self.assertEqual( |
516 | 373 | unicode(self.ui.ui.email_assistance.text()), | 438 | unicode(self.ui.ui.email_assistance.text()), |
518 | 374 | setup_account.bad % setup_account.INVALID_EMAIL | 439 | setup_account.BAD % setup_account.INVALID_EMAIL |
519 | 375 | ) | 440 | ) |
520 | 376 | self.ui.hide() | 441 | self.ui.hide() |
521 | 377 | 442 | ||
522 | @@ -412,7 +477,7 @@ | |||
523 | 412 | self.assertEqual(self.ui.ui.confirm_email_assistance.isVisible(), True) | 477 | self.assertEqual(self.ui.ui.confirm_email_assistance.isVisible(), True) |
524 | 413 | self.assertEqual( | 478 | self.assertEqual( |
525 | 414 | unicode(self.ui.ui.confirm_email_assistance.text()), | 479 | unicode(self.ui.ui.confirm_email_assistance.text()), |
527 | 415 | setup_account.bad % setup_account.EMAIL_MATCH | 480 | setup_account.BAD % setup_account.EMAIL_MATCH |
528 | 416 | ) | 481 | ) |
529 | 417 | self.ui.hide() | 482 | self.ui.hide() |
530 | 418 | 483 | ||
531 | @@ -425,7 +490,7 @@ | |||
532 | 425 | self.ui.password_assistance() | 490 | self.ui.password_assistance() |
533 | 426 | self.assertEqual( | 491 | self.assertEqual( |
534 | 427 | True, | 492 | True, |
536 | 428 | setup_account.bad % setup_account.PASSWORD_LENGTH in | 493 | setup_account.BAD % setup_account.PASSWORD_LENGTH in |
537 | 429 | unicode(self.ui.ui.password_assistance.text()), | 494 | unicode(self.ui.ui.password_assistance.text()), |
538 | 430 | ) | 495 | ) |
539 | 431 | 496 | ||
540 | @@ -438,7 +503,7 @@ | |||
541 | 438 | self.ui.password_assistance() | 503 | self.ui.password_assistance() |
542 | 439 | self.assertEqual( | 504 | self.assertEqual( |
543 | 440 | True, | 505 | True, |
545 | 441 | setup_account.good % setup_account.PASSWORD_LENGTH in | 506 | setup_account.GOOD % setup_account.PASSWORD_LENGTH in |
546 | 442 | unicode(self.ui.ui.password_assistance.text()), | 507 | unicode(self.ui.ui.password_assistance.text()), |
547 | 443 | ) | 508 | ) |
548 | 444 | 509 | ||
549 | @@ -451,7 +516,7 @@ | |||
550 | 451 | self.ui.password_assistance() | 516 | self.ui.password_assistance() |
551 | 452 | self.assertEqual( | 517 | self.assertEqual( |
552 | 453 | True, | 518 | True, |
554 | 454 | setup_account.bad % setup_account.PASSWORD_DIGIT in | 519 | setup_account.BAD % setup_account.PASSWORD_DIGIT in |
555 | 455 | unicode(self.ui.ui.password_assistance.text()), | 520 | unicode(self.ui.ui.password_assistance.text()), |
556 | 456 | ) | 521 | ) |
557 | 457 | 522 | ||
558 | @@ -464,7 +529,7 @@ | |||
559 | 464 | self.ui.password_assistance() | 529 | self.ui.password_assistance() |
560 | 465 | self.assertEqual( | 530 | self.assertEqual( |
561 | 466 | True, | 531 | True, |
563 | 467 | setup_account.good % setup_account.PASSWORD_DIGIT in | 532 | setup_account.GOOD % setup_account.PASSWORD_DIGIT in |
564 | 468 | unicode(self.ui.ui.password_assistance.text()), | 533 | unicode(self.ui.ui.password_assistance.text()), |
565 | 469 | ) | 534 | ) |
566 | 470 | 535 | ||
567 | @@ -477,7 +542,7 @@ | |||
568 | 477 | self.ui.password_assistance() | 542 | self.ui.password_assistance() |
569 | 478 | self.assertEqual( | 543 | self.assertEqual( |
570 | 479 | True, | 544 | True, |
572 | 480 | setup_account.bad % setup_account.PASSWORD_UPPER in | 545 | setup_account.BAD % setup_account.PASSWORD_UPPER in |
573 | 481 | unicode(self.ui.ui.password_assistance.text()), | 546 | unicode(self.ui.ui.password_assistance.text()), |
574 | 482 | ) | 547 | ) |
575 | 483 | 548 | ||
576 | @@ -490,7 +555,7 @@ | |||
577 | 490 | self.ui.password_assistance() | 555 | self.ui.password_assistance() |
578 | 491 | self.assertEqual( | 556 | self.assertEqual( |
579 | 492 | True, | 557 | True, |
581 | 493 | setup_account.good % setup_account.PASSWORD_UPPER in | 558 | setup_account.GOOD % setup_account.PASSWORD_UPPER in |
582 | 494 | unicode(self.ui.ui.password_assistance.text()), | 559 | unicode(self.ui.ui.password_assistance.text()), |
583 | 495 | ) | 560 | ) |
584 | 496 | 561 | ||
585 | @@ -518,6 +583,6 @@ | |||
586 | 518 | self.ui.password_assistance() | 583 | self.ui.password_assistance() |
587 | 519 | self.assertEqual( | 584 | self.assertEqual( |
588 | 520 | True, | 585 | True, |
590 | 521 | setup_account.bad % setup_account.PASSWORD_MATCH in | 586 | setup_account.BAD % setup_account.PASSWORD_MATCH in |
591 | 522 | unicode(self.ui.ui.password_assistance.text()), | 587 | unicode(self.ui.ui.password_assistance.text()), |
592 | 523 | ) | 588 | ) |
593 | 524 | 589 | ||
594 | === added file 'ubuntuone_installer/gui/qt/tests/test_side_widget.py' | |||
595 | --- ubuntuone_installer/gui/qt/tests/test_side_widget.py 1970-01-01 00:00:00 +0000 | |||
596 | +++ ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-07-07 20:33:35 +0000 | |||
597 | @@ -0,0 +1,100 @@ | |||
598 | 1 | # -*- coding: utf-8 -*- | ||
599 | 2 | |||
600 | 3 | # Authors: Alejandro J. Cura <alecu@canonical.com> | ||
601 | 4 | # Roberto Alsina <roberto.alsina@canonical.com> | ||
602 | 5 | # | ||
603 | 6 | # Copyright 2011 Canonical Ltd. | ||
604 | 7 | # | ||
605 | 8 | # This program is free software: you can redistribute it and/or modify it | ||
606 | 9 | # under the terms of the GNU General Public License version 3, as published | ||
607 | 10 | # by the Free Software Foundation. | ||
608 | 11 | # | ||
609 | 12 | # This program is distributed in the hope that it will be useful, but | ||
610 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
611 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
612 | 15 | # PURPOSE. See the GNU General Public License for more details. | ||
613 | 16 | # | ||
614 | 17 | # You should have received a copy of the GNU General Public License along | ||
615 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
616 | 19 | |||
617 | 20 | """Tests for the Qt UI.""" | ||
618 | 21 | |||
619 | 22 | from ubuntuone_installer.gui.qt.tests import BaseTestCase | ||
620 | 23 | from ubuntuone_installer.gui.qt.side_widget import SideWidget | ||
621 | 24 | |||
622 | 25 | |||
623 | 26 | class SideWidgetTestCase(BaseTestCase): | ||
624 | 27 | |||
625 | 28 | """Test the qt main window.""" | ||
626 | 29 | |||
627 | 30 | class_ui = SideWidget | ||
628 | 31 | |||
629 | 32 | def test_stage_0(self): | ||
630 | 33 | """Check that each stage in the widget enables the right labels.""" | ||
631 | 34 | self.ui.set_stage(0) | ||
632 | 35 | self.assertEqual( | ||
633 | 36 | self.ui.ui.install_label.isEnabled(), True) | ||
634 | 37 | self.assertEqual( | ||
635 | 38 | self.ui.ui.sign_in_label.isEnabled(), False) | ||
636 | 39 | self.assertEqual( | ||
637 | 40 | self.ui.ui.choose_services_label.isEnabled(), False) | ||
638 | 41 | self.assertEqual( | ||
639 | 42 | self.ui.ui.select_folders_label.isEnabled(), False) | ||
640 | 43 | self.assertEqual( | ||
641 | 44 | self.ui.ui.sync_label.isEnabled(), False) | ||
642 | 45 | |||
643 | 46 | def test_stage_1(self): | ||
644 | 47 | """Check that each stage in the widget enables the right labels.""" | ||
645 | 48 | self.ui.set_stage(1) | ||
646 | 49 | self.assertEqual( | ||
647 | 50 | self.ui.ui.install_label.isEnabled(), True) | ||
648 | 51 | self.assertEqual( | ||
649 | 52 | self.ui.ui.sign_in_label.isEnabled(), True) | ||
650 | 53 | self.assertEqual( | ||
651 | 54 | self.ui.ui.choose_services_label.isEnabled(), False) | ||
652 | 55 | self.assertEqual( | ||
653 | 56 | self.ui.ui.select_folders_label.isEnabled(), False) | ||
654 | 57 | self.assertEqual( | ||
655 | 58 | self.ui.ui.sync_label.isEnabled(), False) | ||
656 | 59 | |||
657 | 60 | def test_stage_2(self): | ||
658 | 61 | """Check that each stage in the widget enables the right labels.""" | ||
659 | 62 | self.ui.set_stage(2) | ||
660 | 63 | self.assertEqual( | ||
661 | 64 | self.ui.ui.install_label.isEnabled(), True) | ||
662 | 65 | self.assertEqual( | ||
663 | 66 | self.ui.ui.sign_in_label.isEnabled(), True) | ||
664 | 67 | self.assertEqual( | ||
665 | 68 | self.ui.ui.choose_services_label.isEnabled(), True) | ||
666 | 69 | self.assertEqual( | ||
667 | 70 | self.ui.ui.select_folders_label.isEnabled(), False) | ||
668 | 71 | self.assertEqual( | ||
669 | 72 | self.ui.ui.sync_label.isEnabled(), False) | ||
670 | 73 | |||
671 | 74 | def test_stage_3(self): | ||
672 | 75 | """Check that each stage in the widget enables the right labels.""" | ||
673 | 76 | self.ui.set_stage(3) | ||
674 | 77 | self.assertEqual( | ||
675 | 78 | self.ui.ui.install_label.isEnabled(), True) | ||
676 | 79 | self.assertEqual( | ||
677 | 80 | self.ui.ui.sign_in_label.isEnabled(), True) | ||
678 | 81 | self.assertEqual( | ||
679 | 82 | self.ui.ui.choose_services_label.isEnabled(), True) | ||
680 | 83 | self.assertEqual( | ||
681 | 84 | self.ui.ui.select_folders_label.isEnabled(), True) | ||
682 | 85 | self.assertEqual( | ||
683 | 86 | self.ui.ui.sync_label.isEnabled(), False) | ||
684 | 87 | |||
685 | 88 | def test_stage_4(self): | ||
686 | 89 | """Check that each stage in the widget enables the right labels.""" | ||
687 | 90 | self.ui.set_stage(4) | ||
688 | 91 | self.assertEqual( | ||
689 | 92 | self.ui.ui.install_label.isEnabled(), True) | ||
690 | 93 | self.assertEqual( | ||
691 | 94 | self.ui.ui.sign_in_label.isEnabled(), True) | ||
692 | 95 | self.assertEqual( | ||
693 | 96 | self.ui.ui.choose_services_label.isEnabled(), True) | ||
694 | 97 | self.assertEqual( | ||
695 | 98 | self.ui.ui.select_folders_label.isEnabled(), True) | ||
696 | 99 | self.assertEqual( | ||
697 | 100 | self.ui.ui.sync_label.isEnabled(), True) | ||
698 | 0 | 101 | ||
699 | === modified file 'ubuntuone_installer/gui/qt/tos.py' | |||
700 | --- ubuntuone_installer/gui/qt/tos.py 2011-07-04 20:10:17 +0000 | |||
701 | +++ ubuntuone_installer/gui/qt/tos.py 2011-07-07 20:33:35 +0000 | |||
702 | @@ -28,6 +28,11 @@ | |||
703 | 28 | 28 | ||
704 | 29 | 29 | ||
705 | 30 | class TosPage(sso_gui.TosPage): | 30 | class TosPage(sso_gui.TosPage): |
706 | 31 | |||
707 | 32 | """Page to display the Terms of Service.""" | ||
708 | 33 | |||
709 | 34 | # initializePage is inherited | ||
710 | 35 | # pylint: disable=C0103 | ||
711 | 31 | def initializePage(self): | 36 | def initializePage(self): |
712 | 32 | """Setup UI details.""" | 37 | """Setup UI details.""" |
713 | 33 | # Set the right texts and connections for buttons | 38 | # Set the right texts and connections for buttons |
714 | @@ -56,6 +61,6 @@ | |||
715 | 56 | def print_document(self, button_id): | 61 | def print_document(self, button_id): |
716 | 57 | """Print the document displayed in textBrowser.""" | 62 | """Print the document displayed in textBrowser.""" |
717 | 58 | if button_id == QtGui.QWizard.CustomButton1: | 63 | if button_id == QtGui.QWizard.CustomButton1: |
719 | 59 | self.previewer = QtGui.QPrintPreviewDialog( | 64 | previewer = QtGui.QPrintPreviewDialog( |
720 | 60 | paintRequested=self.ui.terms_webkit.print_) | 65 | paintRequested=self.ui.terms_webkit.print_) |
722 | 61 | self.previewer.exec_() | 66 | previewer.exec_() |
As per what we discussed in IRC, please add tests for the new side_widget, and split the current test_stage_ progression into smaller units of functionality to be tested.