Merge lp:~ralsina/ubuntuone-windows-installer/diego-installer-ui into lp:ubuntuone-windows-installer
- diego-installer-ui
- Merge into trunk
Proposed by
Roberto Alsina
Status: | Merged |
---|---|
Approved by: | Roberto Alsina |
Approved revision: | 31 |
Merged at revision: | 21 |
Proposed branch: | lp:~ralsina/ubuntuone-windows-installer/diego-installer-ui |
Merge into: | lp:ubuntuone-windows-installer |
Diff against target: |
1956 lines (+1028/-595) 12 files modified
data/qt/choose_sign_in.ui (+12/-6) data/qt/images.qrc (+17/-0) data/qt/license.ui (+8/-8) data/qt/setup_account.ui (+51/-34) data/qt/side_widget.ui (+238/-64) data/qt/ubuntuone.qss (+96/-0) ubuntuone_installer/gui/qt/gui.py (+23/-6) ubuntuone_installer/gui/qt/local_folders.py (+171/-171) ubuntuone_installer/gui/qt/setup_account.py (+158/-156) ubuntuone_installer/gui/qt/side_widget.py (+73/-49) ubuntuone_installer/gui/qt/tests/test_gui.py (+26/-1) ubuntuone_installer/gui/qt/tests/test_side_widget.py (+155/-100) |
To merge this branch: | bzr merge lp:~ralsina/ubuntuone-windows-installer/diego-installer-ui |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roberto Alsina (community) | Approve | ||
Review via email: mp+68876@code.launchpad.net |
Commit message
Styling for the installer (by Diego Sarmentero)
Description of the change
Styling for the installer (by Diego Sarmentero)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'data/Ubuntu-R.ttf' | |||
2 | 0 | Binary files data/Ubuntu-R.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-R.ttf 2011-07-22 16:39:49 +0000 differ | 0 | Binary files data/Ubuntu-R.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-R.ttf 2011-07-22 16:39:49 +0000 differ |
3 | === added file 'data/balloon_shape.png' | |||
4 | 1 | Binary files data/balloon_shape.png 1970-01-01 00:00:00 +0000 and data/balloon_shape.png 2011-07-22 16:39:49 +0000 differ | 1 | Binary files data/balloon_shape.png 1970-01-01 00:00:00 +0000 and data/balloon_shape.png 2011-07-22 16:39:49 +0000 differ |
5 | === added file 'data/password_hint_ok.png' | |||
6 | 2 | Binary files data/password_hint_ok.png 1970-01-01 00:00:00 +0000 and data/password_hint_ok.png 2011-07-22 16:39:49 +0000 differ | 2 | Binary files data/password_hint_ok.png 1970-01-01 00:00:00 +0000 and data/password_hint_ok.png 2011-07-22 16:39:49 +0000 differ |
7 | === added file 'data/password_hint_warning.png' | |||
8 | 3 | Binary files data/password_hint_warning.png 1970-01-01 00:00:00 +0000 and data/password_hint_warning.png 2011-07-22 16:39:49 +0000 differ | 3 | Binary files data/password_hint_warning.png 1970-01-01 00:00:00 +0000 and data/password_hint_warning.png 2011-07-22 16:39:49 +0000 differ |
9 | === added file 'data/progress_arrow_grey.png' | |||
10 | 4 | Binary files data/progress_arrow_grey.png 1970-01-01 00:00:00 +0000 and data/progress_arrow_grey.png 2011-07-22 16:39:49 +0000 differ | 4 | Binary files data/progress_arrow_grey.png 1970-01-01 00:00:00 +0000 and data/progress_arrow_grey.png 2011-07-22 16:39:49 +0000 differ |
11 | === added file 'data/progress_arrow_orange.png' | |||
12 | 5 | Binary files data/progress_arrow_orange.png 1970-01-01 00:00:00 +0000 and data/progress_arrow_orange.png 2011-07-22 16:39:49 +0000 differ | 5 | Binary files data/progress_arrow_orange.png 1970-01-01 00:00:00 +0000 and data/progress_arrow_orange.png 2011-07-22 16:39:49 +0000 differ |
13 | === added file 'data/progress_finish_grey.png' | |||
14 | 6 | Binary files data/progress_finish_grey.png 1970-01-01 00:00:00 +0000 and data/progress_finish_grey.png 2011-07-22 16:39:49 +0000 differ | 6 | Binary files data/progress_finish_grey.png 1970-01-01 00:00:00 +0000 and data/progress_finish_grey.png 2011-07-22 16:39:49 +0000 differ |
15 | === added file 'data/progress_finish_orange.png' | |||
16 | 7 | Binary files data/progress_finish_orange.png 1970-01-01 00:00:00 +0000 and data/progress_finish_orange.png 2011-07-22 16:39:49 +0000 differ | 7 | Binary files data/progress_finish_orange.png 1970-01-01 00:00:00 +0000 and data/progress_finish_orange.png 2011-07-22 16:39:49 +0000 differ |
17 | === added file 'data/progress_tick.png' | |||
18 | 8 | Binary files data/progress_tick.png 1970-01-01 00:00:00 +0000 and data/progress_tick.png 2011-07-22 16:39:49 +0000 differ | 8 | Binary files data/progress_tick.png 1970-01-01 00:00:00 +0000 and data/progress_tick.png 2011-07-22 16:39:49 +0000 differ |
19 | === modified file 'data/qt/choose_sign_in.ui' | |||
20 | --- data/qt/choose_sign_in.ui 2011-07-02 01:20:51 +0000 | |||
21 | +++ data/qt/choose_sign_in.ui 2011-07-22 16:39:49 +0000 | |||
22 | @@ -44,13 +44,14 @@ | |||
23 | 44 | </size> | 44 | </size> |
24 | 45 | </property> | 45 | </property> |
25 | 46 | <property name="text"> | 46 | <property name="text"> |
29 | 47 | <string>image | 47 | <string/> |
27 | 48 | |||
28 | 49 | [This will be the same image as appears on Ubuntu One Home page on the web - in production]</string> | ||
30 | 50 | </property> | 48 | </property> |
31 | 51 | <property name="textFormat"> | 49 | <property name="textFormat"> |
32 | 52 | <enum>Qt::PlainText</enum> | 50 | <enum>Qt::PlainText</enum> |
33 | 53 | </property> | 51 | </property> |
34 | 52 | <property name="pixmap"> | ||
35 | 53 | <pixmap resource="images.qrc">:/win_install_img_placeholder.png</pixmap> | ||
36 | 54 | </property> | ||
37 | 54 | <property name="alignment"> | 55 | <property name="alignment"> |
38 | 55 | <set>Qt::AlignCenter</set> | 56 | <set>Qt::AlignCenter</set> |
39 | 56 | </property> | 57 | </property> |
40 | @@ -93,7 +94,7 @@ | |||
41 | 93 | </property> | 94 | </property> |
42 | 94 | <property name="sizeHint" stdset="0"> | 95 | <property name="sizeHint" stdset="0"> |
43 | 95 | <size> | 96 | <size> |
45 | 96 | <width>40</width> | 97 | <width>20</width> |
46 | 97 | <height>20</height> | 98 | <height>20</height> |
47 | 98 | </size> | 99 | </size> |
48 | 99 | </property> | 100 | </property> |
49 | @@ -129,9 +130,12 @@ | |||
50 | 129 | <property name="orientation"> | 130 | <property name="orientation"> |
51 | 130 | <enum>Qt::Horizontal</enum> | 131 | <enum>Qt::Horizontal</enum> |
52 | 131 | </property> | 132 | </property> |
53 | 133 | <property name="sizeType"> | ||
54 | 134 | <enum>QSizePolicy::Expanding</enum> | ||
55 | 135 | </property> | ||
56 | 132 | <property name="sizeHint" stdset="0"> | 136 | <property name="sizeHint" stdset="0"> |
57 | 133 | <size> | 137 | <size> |
59 | 134 | <width>40</width> | 138 | <width>20</width> |
60 | 135 | <height>20</height> | 139 | <height>20</height> |
61 | 136 | </size> | 140 | </size> |
62 | 137 | </property> | 141 | </property> |
63 | @@ -154,6 +158,8 @@ | |||
64 | 154 | </item> | 158 | </item> |
65 | 155 | </layout> | 159 | </layout> |
66 | 156 | </widget> | 160 | </widget> |
68 | 157 | <resources/> | 161 | <resources> |
69 | 162 | <include location="images.qrc"/> | ||
70 | 163 | </resources> | ||
71 | 158 | <connections/> | 164 | <connections/> |
72 | 159 | </ui> | 165 | </ui> |
73 | 160 | 166 | ||
74 | === added file 'data/qt/images.qrc' | |||
75 | --- data/qt/images.qrc 1970-01-01 00:00:00 +0000 | |||
76 | +++ data/qt/images.qrc 2011-07-22 16:39:49 +0000 | |||
77 | @@ -0,0 +1,17 @@ | |||
78 | 1 | <RCC> | ||
79 | 2 | <qresource prefix="/"> | ||
80 | 3 | <file>../balloon_shape.png</file> | ||
81 | 4 | <file>../password_hint_ok.png</file> | ||
82 | 5 | <file>../password_hint_warning.png</file> | ||
83 | 6 | <file>../Ubuntu-R.ttf</file> | ||
84 | 7 | <file>ubuntuone.qss</file> | ||
85 | 8 | <file>../progress_arrow_grey.png</file> | ||
86 | 9 | <file>../u1_logo.png</file> | ||
87 | 10 | <file>../progress_arrow_orange.png</file> | ||
88 | 11 | <file>../progress_finish_grey.png</file> | ||
89 | 12 | <file>../progress_finish_orange.png</file> | ||
90 | 13 | <file>../progress_tick.png</file> | ||
91 | 14 | <file>../u1icon.png</file> | ||
92 | 15 | <file>../win_install_img_placeholder.png</file> | ||
93 | 16 | </qresource> | ||
94 | 17 | </RCC> | ||
95 | 0 | 18 | ||
96 | === modified file 'data/qt/license.ui' | |||
97 | --- data/qt/license.ui 2011-06-21 18:45:09 +0000 | |||
98 | +++ data/qt/license.ui 2011-07-22 16:39:49 +0000 | |||
99 | @@ -20,14 +20,14 @@ | |||
100 | 20 | <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | 20 | <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> |
101 | 21 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> | 21 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> |
102 | 22 | p, li { white-space: pre-wrap; } | 22 | p, li { white-space: pre-wrap; } |
111 | 23 | </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> | 23 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> |
112 | 24 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:14pt; font-weight:600;">License Agreement</span></p> | 24 | <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:14pt; font-weight:600;">License Agreement</span></p> |
113 | 25 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p> | 25 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> |
114 | 26 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.</span></p> | 26 | <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;">This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.</span></p> |
115 | 27 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p> | 27 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> |
116 | 28 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Ubuntu One Basic is free, while additional service add-ons may be paid for services.</span></p> | 28 | <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;">Ubuntu One Basic is free, while additional service add-ons may be paid for services.</span></p> |
117 | 29 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p> | 29 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> |
118 | 30 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">As free software, this programme is distributed without warranty. See the GNU General Public License for more details at </span><a href="http://www.gnu.org/licenses"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt; text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses</span></a></p></body></html></string> | 30 | <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;">As free software, this programme is distributed without warranty. See the GNU General Public License for more details at </span><a href="http://www.gnu.org/licenses"><span style=" font-size:8pt; text-decoration: underline; color:#dd4814;">http://www.gnu.org/licenses</span></a></p></body></html></string> |
119 | 31 | </property> | 31 | </property> |
120 | 32 | <property name="openExternalLinks"> | 32 | <property name="openExternalLinks"> |
121 | 33 | <bool>true</bool> | 33 | <bool>true</bool> |
122 | 34 | 34 | ||
123 | === modified file 'data/qt/setup_account.ui' | |||
124 | --- data/qt/setup_account.ui 2011-07-01 20:33:17 +0000 | |||
125 | +++ data/qt/setup_account.ui 2011-07-22 16:39:49 +0000 | |||
126 | @@ -6,8 +6,8 @@ | |||
127 | 6 | <rect> | 6 | <rect> |
128 | 7 | <x>0</x> | 7 | <x>0</x> |
129 | 8 | <y>0</y> | 8 | <y>0</y> |
132 | 9 | <width>482</width> | 9 | <width>631</width> |
133 | 10 | <height>514</height> | 10 | <height>527</height> |
134 | 11 | </rect> | 11 | </rect> |
135 | 12 | </property> | 12 | </property> |
136 | 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
137 | @@ -15,7 +15,7 @@ | |||
138 | 15 | </property> | 15 | </property> |
139 | 16 | <layout class="QVBoxLayout" name="verticalLayout"> | 16 | <layout class="QVBoxLayout" name="verticalLayout"> |
140 | 17 | <item> | 17 | <item> |
142 | 18 | <layout class="QGridLayout" name="gridLayout"> | 18 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="1,250"> |
143 | 19 | <item row="0" column="0"> | 19 | <item row="0" column="0"> |
144 | 20 | <widget class="QLabel" name="password_info_label"> | 20 | <widget class="QLabel" name="password_info_label"> |
145 | 21 | <property name="sizePolicy"> | 21 | <property name="sizePolicy"> |
146 | @@ -25,7 +25,7 @@ | |||
147 | 25 | </sizepolicy> | 25 | </sizepolicy> |
148 | 26 | </property> | 26 | </property> |
149 | 27 | <property name="text"> | 27 | <property name="text"> |
151 | 28 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 28 | <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> |
152 | 29 | </property> | 29 | </property> |
153 | 30 | <property name="wordWrap"> | 30 | <property name="wordWrap"> |
154 | 31 | <bool>true</bool> | 31 | <bool>true</bool> |
155 | @@ -35,7 +35,7 @@ | |||
156 | 35 | <item row="1" column="0"> | 35 | <item row="1" column="0"> |
157 | 36 | <widget class="QLabel" name="name_label"> | 36 | <widget class="QLabel" name="name_label"> |
158 | 37 | <property name="text"> | 37 | <property name="text"> |
160 | 38 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 38 | <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> |
161 | 39 | </property> | 39 | </property> |
162 | 40 | </widget> | 40 | </widget> |
163 | 41 | </item> | 41 | </item> |
164 | @@ -49,14 +49,17 @@ | |||
165 | 49 | <item row="2" column="1"> | 49 | <item row="2" column="1"> |
166 | 50 | <widget class="QLabel" name="name_assistance"> | 50 | <widget class="QLabel" name="name_assistance"> |
167 | 51 | <property name="text"> | 51 | <property name="text"> |
169 | 52 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 52 | <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> |
170 | 53 | </property> | ||
171 | 54 | <property name="indent"> | ||
172 | 55 | <number>20</number> | ||
173 | 53 | </property> | 56 | </property> |
174 | 54 | </widget> | 57 | </widget> |
175 | 55 | </item> | 58 | </item> |
176 | 56 | <item row="3" column="0"> | 59 | <item row="3" column="0"> |
177 | 57 | <widget class="QLabel" name="email_label"> | 60 | <widget class="QLabel" name="email_label"> |
178 | 58 | <property name="text"> | 61 | <property name="text"> |
180 | 59 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 62 | <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> |
181 | 60 | </property> | 63 | </property> |
182 | 61 | </widget> | 64 | </widget> |
183 | 62 | </item> | 65 | </item> |
184 | @@ -70,14 +73,17 @@ | |||
185 | 70 | <item row="4" column="1"> | 73 | <item row="4" column="1"> |
186 | 71 | <widget class="QLabel" name="email_assistance"> | 74 | <widget class="QLabel" name="email_assistance"> |
187 | 72 | <property name="text"> | 75 | <property name="text"> |
189 | 73 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 76 | <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> |
190 | 77 | </property> | ||
191 | 78 | <property name="indent"> | ||
192 | 79 | <number>20</number> | ||
193 | 74 | </property> | 80 | </property> |
194 | 75 | </widget> | 81 | </widget> |
195 | 76 | </item> | 82 | </item> |
196 | 77 | <item row="5" column="0"> | 83 | <item row="5" column="0"> |
197 | 78 | <widget class="QLabel" name="confirm_email_label"> | 84 | <widget class="QLabel" name="confirm_email_label"> |
198 | 79 | <property name="text"> | 85 | <property name="text"> |
200 | 80 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 86 | <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> |
201 | 81 | </property> | 87 | </property> |
202 | 82 | </widget> | 88 | </widget> |
203 | 83 | </item> | 89 | </item> |
204 | @@ -91,14 +97,17 @@ | |||
205 | 91 | <item row="6" column="1"> | 97 | <item row="6" column="1"> |
206 | 92 | <widget class="QLabel" name="confirm_email_assistance"> | 98 | <widget class="QLabel" name="confirm_email_assistance"> |
207 | 93 | <property name="text"> | 99 | <property name="text"> |
209 | 94 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 100 | <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> |
210 | 101 | </property> | ||
211 | 102 | <property name="indent"> | ||
212 | 103 | <number>20</number> | ||
213 | 95 | </property> | 104 | </property> |
214 | 96 | </widget> | 105 | </widget> |
215 | 97 | </item> | 106 | </item> |
216 | 98 | <item row="7" column="0"> | 107 | <item row="7" column="0"> |
217 | 99 | <widget class="QLabel" name="password_label"> | 108 | <widget class="QLabel" name="password_label"> |
218 | 100 | <property name="text"> | 109 | <property name="text"> |
220 | 101 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 110 | <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> |
221 | 102 | </property> | 111 | </property> |
222 | 103 | </widget> | 112 | </widget> |
223 | 104 | </item> | 113 | </item> |
224 | @@ -121,14 +130,17 @@ | |||
225 | 121 | <item row="9" column="0"> | 130 | <item row="9" column="0"> |
226 | 122 | <widget class="QLabel" name="confirm_password_label"> | 131 | <widget class="QLabel" name="confirm_password_label"> |
227 | 123 | <property name="text"> | 132 | <property name="text"> |
229 | 124 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 133 | <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> |
230 | 125 | </property> | 134 | </property> |
231 | 126 | </widget> | 135 | </widget> |
232 | 127 | </item> | 136 | </item> |
233 | 128 | <item row="8" column="1" rowspan="3"> | 137 | <item row="8" column="1" rowspan="3"> |
234 | 129 | <widget class="QLabel" name="password_assistance"> | 138 | <widget class="QLabel" name="password_assistance"> |
235 | 130 | <property name="text"> | 139 | <property name="text"> |
237 | 131 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 140 | <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> |
238 | 141 | </property> | ||
239 | 142 | <property name="indent"> | ||
240 | 143 | <number>20</number> | ||
241 | 132 | </property> | 144 | </property> |
242 | 133 | </widget> | 145 | </widget> |
243 | 134 | </item> | 146 | </item> |
244 | @@ -163,26 +175,7 @@ | |||
245 | 163 | <enum>QFrame::Box</enum> | 175 | <enum>QFrame::Box</enum> |
246 | 164 | </property> | 176 | </property> |
247 | 165 | <property name="text"> | 177 | <property name="text"> |
268 | 166 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | 178 | <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> |
249 | 167 | </property> | ||
250 | 168 | </widget> | ||
251 | 169 | </item> | ||
252 | 170 | <item row="11" column="1"> | ||
253 | 171 | <widget class="QLabel" name="refresh_label"> | ||
254 | 172 | <property name="sizePolicy"> | ||
255 | 173 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
256 | 174 | <horstretch>0</horstretch> | ||
257 | 175 | <verstretch>0</verstretch> | ||
258 | 176 | </sizepolicy> | ||
259 | 177 | </property> | ||
260 | 178 | <property name="locale"> | ||
261 | 179 | <locale language="English" country="UnitedStates"/> | ||
262 | 180 | </property> | ||
263 | 181 | <property name="text"> | ||
264 | 182 | <string>If you can't read this then <a href="example.com"><span style=" text-decoration: underline; color:#0000ff;">refresh</span></a> this page</span></string> | ||
265 | 183 | </property> | ||
266 | 184 | <property name="wordWrap"> | ||
267 | 185 | <bool>true</bool> | ||
269 | 186 | </property> | 179 | </property> |
270 | 187 | </widget> | 180 | </widget> |
271 | 188 | </item> | 181 | </item> |
272 | @@ -202,6 +195,28 @@ | |||
273 | 202 | </property> | 195 | </property> |
274 | 203 | </widget> | 196 | </widget> |
275 | 204 | </item> | 197 | </item> |
276 | 198 | <item row="11" column="1"> | ||
277 | 199 | <widget class="QLabel" name="refresh_label"> | ||
278 | 200 | <property name="sizePolicy"> | ||
279 | 201 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
280 | 202 | <horstretch>0</horstretch> | ||
281 | 203 | <verstretch>0</verstretch> | ||
282 | 204 | </sizepolicy> | ||
283 | 205 | </property> | ||
284 | 206 | <property name="locale"> | ||
285 | 207 | <locale language="English" country="UnitedStates"/> | ||
286 | 208 | </property> | ||
287 | 209 | <property name="text"> | ||
288 | 210 | <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> | ||
289 | 211 | </property> | ||
290 | 212 | <property name="wordWrap"> | ||
291 | 213 | <bool>true</bool> | ||
292 | 214 | </property> | ||
293 | 215 | <property name="indent"> | ||
294 | 216 | <number>20</number> | ||
295 | 217 | </property> | ||
296 | 218 | </widget> | ||
297 | 219 | </item> | ||
298 | 205 | </layout> | 220 | </layout> |
299 | 206 | </item> | 221 | </item> |
300 | 207 | <item> | 222 | <item> |
301 | @@ -250,6 +265,8 @@ | |||
302 | 250 | </item> | 265 | </item> |
303 | 251 | </layout> | 266 | </layout> |
304 | 252 | </widget> | 267 | </widget> |
306 | 253 | <resources/> | 268 | <resources> |
307 | 269 | <include location="images.qrc"/> | ||
308 | 270 | </resources> | ||
309 | 254 | <connections/> | 271 | <connections/> |
310 | 255 | </ui> | 272 | </ui> |
311 | 256 | 273 | ||
312 | === modified file 'data/qt/side_widget.ui' | |||
313 | --- data/qt/side_widget.ui 2011-07-04 17:39:31 +0000 | |||
314 | +++ data/qt/side_widget.ui 2011-07-22 16:39:49 +0000 | |||
315 | @@ -1,77 +1,249 @@ | |||
316 | 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
317 | 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
320 | 3 | <class>Form</class> | 3 | <class>SideWidget</class> |
321 | 4 | <widget class="QWidget" name="Form"> | 4 | <widget class="QFrame" name="SideWidget"> |
322 | 5 | <property name="geometry"> | 5 | <property name="geometry"> |
323 | 6 | <rect> | 6 | <rect> |
324 | 7 | <x>0</x> | 7 | <x>0</x> |
325 | 8 | <y>0</y> | 8 | <y>0</y> |
328 | 9 | <width>185</width> | 9 | <width>200</width> |
329 | 10 | <height>511</height> | 10 | <height>563</height> |
330 | 11 | </rect> | 11 | </rect> |
331 | 12 | </property> | 12 | </property> |
332 | 13 | <property name="sizePolicy"> | ||
333 | 14 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> | ||
334 | 15 | <horstretch>0</horstretch> | ||
335 | 16 | <verstretch>0</verstretch> | ||
336 | 17 | </sizepolicy> | ||
337 | 18 | </property> | ||
338 | 19 | <property name="minimumSize"> | ||
339 | 20 | <size> | ||
340 | 21 | <width>200</width> | ||
341 | 22 | <height>0</height> | ||
342 | 23 | </size> | ||
343 | 24 | </property> | ||
344 | 13 | <property name="windowTitle"> | 25 | <property name="windowTitle"> |
346 | 14 | <string>Form</string> | 26 | <string>Frame</string> |
347 | 27 | </property> | ||
348 | 28 | <property name="frameShape"> | ||
349 | 29 | <enum>QFrame::StyledPanel</enum> | ||
350 | 30 | </property> | ||
351 | 31 | <property name="frameShadow"> | ||
352 | 32 | <enum>QFrame::Raised</enum> | ||
353 | 15 | </property> | 33 | </property> |
354 | 16 | <layout class="QVBoxLayout" name="verticalLayout"> | 34 | <layout class="QVBoxLayout" name="verticalLayout"> |
355 | 17 | <property name="spacing"> | 35 | <property name="spacing"> |
413 | 18 | <number>20</number> | 36 | <number>40</number> |
414 | 19 | </property> | 37 | </property> |
415 | 20 | <item> | 38 | <property name="margin"> |
416 | 21 | <widget class="QLabel" name="label"> | 39 | <number>10</number> |
417 | 22 | <property name="text"> | 40 | </property> |
418 | 23 | <string>Ubuntu One logo</string> | 41 | <item> |
419 | 24 | </property> | 42 | <widget class="QLabel" name="ubuntu_one_logo_label"> |
420 | 25 | </widget> | 43 | <property name="sizePolicy"> |
421 | 26 | </item> | 44 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
422 | 27 | <item> | 45 | <horstretch>0</horstretch> |
423 | 28 | <widget class="QLabel" name="install_label"> | 46 | <verstretch>0</verstretch> |
424 | 29 | <property name="enabled"> | 47 | </sizepolicy> |
425 | 30 | <bool>true</bool> | 48 | </property> |
426 | 31 | </property> | 49 | <property name="text"> |
427 | 32 | <property name="text"> | 50 | <string/> |
428 | 33 | <string>Install</string> | 51 | </property> |
429 | 34 | </property> | 52 | <property name="pixmap"> |
430 | 35 | </widget> | 53 | <pixmap resource="images.qrc">:/u1_logo.png</pixmap> |
431 | 36 | </item> | 54 | </property> |
432 | 37 | <item> | 55 | </widget> |
433 | 38 | <widget class="QLabel" name="sign_in_label"> | 56 | </item> |
434 | 39 | <property name="enabled"> | 57 | <item> |
435 | 40 | <bool>true</bool> | 58 | <widget class="QFrame" name="states_frame"> |
436 | 41 | </property> | 59 | <property name="sizePolicy"> |
437 | 42 | <property name="text"> | 60 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> |
438 | 43 | <string>Sign In</string> | 61 | <horstretch>0</horstretch> |
439 | 44 | </property> | 62 | <verstretch>0</verstretch> |
440 | 45 | </widget> | 63 | </sizepolicy> |
441 | 46 | </item> | 64 | </property> |
442 | 47 | <item> | 65 | <property name="frameShape"> |
443 | 48 | <widget class="QLabel" name="choose_services_label"> | 66 | <enum>QFrame::StyledPanel</enum> |
444 | 49 | <property name="enabled"> | 67 | </property> |
445 | 50 | <bool>true</bool> | 68 | <property name="frameShadow"> |
446 | 51 | </property> | 69 | <enum>QFrame::Raised</enum> |
447 | 52 | <property name="text"> | 70 | </property> |
448 | 53 | <string>Choose services</string> | 71 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
449 | 54 | </property> | 72 | <property name="spacing"> |
450 | 55 | </widget> | 73 | <number>20</number> |
451 | 56 | </item> | 74 | </property> |
452 | 57 | <item> | 75 | <property name="margin"> |
453 | 58 | <widget class="QLabel" name="select_folders_label"> | 76 | <number>0</number> |
454 | 59 | <property name="enabled"> | 77 | </property> |
455 | 60 | <bool>true</bool> | 78 | <item> |
456 | 61 | </property> | 79 | <layout class="QHBoxLayout" name="horizontalLayout"> |
457 | 62 | <property name="text"> | 80 | <property name="spacing"> |
458 | 63 | <string>Select sync folders</string> | 81 | <number>7</number> |
459 | 64 | </property> | 82 | </property> |
460 | 65 | </widget> | 83 | <item> |
461 | 66 | </item> | 84 | <widget class="QLabel" name="install_icon_label"> |
462 | 67 | <item> | 85 | <property name="sizePolicy"> |
463 | 68 | <widget class="QLabel" name="sync_label"> | 86 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
464 | 69 | <property name="enabled"> | 87 | <horstretch>0</horstretch> |
465 | 70 | <bool>true</bool> | 88 | <verstretch>0</verstretch> |
466 | 71 | </property> | 89 | </sizepolicy> |
467 | 72 | <property name="text"> | 90 | </property> |
468 | 73 | <string>Sync, stream, share!</string> | 91 | <property name="text"> |
469 | 74 | </property> | 92 | <string/> |
470 | 93 | </property> | ||
471 | 94 | <property name="pixmap"> | ||
472 | 95 | <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap> | ||
473 | 96 | </property> | ||
474 | 97 | </widget> | ||
475 | 98 | </item> | ||
476 | 99 | <item> | ||
477 | 100 | <widget class="QLabel" name="install_label"> | ||
478 | 101 | <property name="enabled"> | ||
479 | 102 | <bool>true</bool> | ||
480 | 103 | </property> | ||
481 | 104 | <property name="text"> | ||
482 | 105 | <string>Install</string> | ||
483 | 106 | </property> | ||
484 | 107 | </widget> | ||
485 | 108 | </item> | ||
486 | 109 | </layout> | ||
487 | 110 | </item> | ||
488 | 111 | <item> | ||
489 | 112 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
490 | 113 | <property name="spacing"> | ||
491 | 114 | <number>7</number> | ||
492 | 115 | </property> | ||
493 | 116 | <property name="sizeConstraint"> | ||
494 | 117 | <enum>QLayout::SetDefaultConstraint</enum> | ||
495 | 118 | </property> | ||
496 | 119 | <item> | ||
497 | 120 | <widget class="QLabel" name="sign_icon_label"> | ||
498 | 121 | <property name="sizePolicy"> | ||
499 | 122 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
500 | 123 | <horstretch>0</horstretch> | ||
501 | 124 | <verstretch>0</verstretch> | ||
502 | 125 | </sizepolicy> | ||
503 | 126 | </property> | ||
504 | 127 | <property name="text"> | ||
505 | 128 | <string/> | ||
506 | 129 | </property> | ||
507 | 130 | <property name="pixmap"> | ||
508 | 131 | <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap> | ||
509 | 132 | </property> | ||
510 | 133 | </widget> | ||
511 | 134 | </item> | ||
512 | 135 | <item> | ||
513 | 136 | <widget class="QLabel" name="sign_in_label"> | ||
514 | 137 | <property name="enabled"> | ||
515 | 138 | <bool>true</bool> | ||
516 | 139 | </property> | ||
517 | 140 | <property name="text"> | ||
518 | 141 | <string>Sign In</string> | ||
519 | 142 | </property> | ||
520 | 143 | </widget> | ||
521 | 144 | </item> | ||
522 | 145 | </layout> | ||
523 | 146 | </item> | ||
524 | 147 | <item> | ||
525 | 148 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
526 | 149 | <property name="spacing"> | ||
527 | 150 | <number>7</number> | ||
528 | 151 | </property> | ||
529 | 152 | <item> | ||
530 | 153 | <widget class="QLabel" name="choose_icon_label"> | ||
531 | 154 | <property name="sizePolicy"> | ||
532 | 155 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
533 | 156 | <horstretch>0</horstretch> | ||
534 | 157 | <verstretch>0</verstretch> | ||
535 | 158 | </sizepolicy> | ||
536 | 159 | </property> | ||
537 | 160 | <property name="text"> | ||
538 | 161 | <string/> | ||
539 | 162 | </property> | ||
540 | 163 | <property name="pixmap"> | ||
541 | 164 | <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap> | ||
542 | 165 | </property> | ||
543 | 166 | </widget> | ||
544 | 167 | </item> | ||
545 | 168 | <item> | ||
546 | 169 | <widget class="QLabel" name="choose_services_label"> | ||
547 | 170 | <property name="enabled"> | ||
548 | 171 | <bool>true</bool> | ||
549 | 172 | </property> | ||
550 | 173 | <property name="text"> | ||
551 | 174 | <string>Choose services</string> | ||
552 | 175 | </property> | ||
553 | 176 | </widget> | ||
554 | 177 | </item> | ||
555 | 178 | </layout> | ||
556 | 179 | </item> | ||
557 | 180 | <item> | ||
558 | 181 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
559 | 182 | <property name="spacing"> | ||
560 | 183 | <number>7</number> | ||
561 | 184 | </property> | ||
562 | 185 | <item> | ||
563 | 186 | <widget class="QLabel" name="folders_icon_label"> | ||
564 | 187 | <property name="sizePolicy"> | ||
565 | 188 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
566 | 189 | <horstretch>0</horstretch> | ||
567 | 190 | <verstretch>0</verstretch> | ||
568 | 191 | </sizepolicy> | ||
569 | 192 | </property> | ||
570 | 193 | <property name="text"> | ||
571 | 194 | <string/> | ||
572 | 195 | </property> | ||
573 | 196 | <property name="pixmap"> | ||
574 | 197 | <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap> | ||
575 | 198 | </property> | ||
576 | 199 | </widget> | ||
577 | 200 | </item> | ||
578 | 201 | <item> | ||
579 | 202 | <widget class="QLabel" name="select_folders_label"> | ||
580 | 203 | <property name="enabled"> | ||
581 | 204 | <bool>true</bool> | ||
582 | 205 | </property> | ||
583 | 206 | <property name="text"> | ||
584 | 207 | <string>Select sync folders</string> | ||
585 | 208 | </property> | ||
586 | 209 | </widget> | ||
587 | 210 | </item> | ||
588 | 211 | </layout> | ||
589 | 212 | </item> | ||
590 | 213 | <item> | ||
591 | 214 | <layout class="QHBoxLayout" name="horizontalLayout_5"> | ||
592 | 215 | <property name="spacing"> | ||
593 | 216 | <number>7</number> | ||
594 | 217 | </property> | ||
595 | 218 | <item> | ||
596 | 219 | <widget class="QLabel" name="sync_icon_label"> | ||
597 | 220 | <property name="sizePolicy"> | ||
598 | 221 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
599 | 222 | <horstretch>0</horstretch> | ||
600 | 223 | <verstretch>0</verstretch> | ||
601 | 224 | </sizepolicy> | ||
602 | 225 | </property> | ||
603 | 226 | <property name="text"> | ||
604 | 227 | <string/> | ||
605 | 228 | </property> | ||
606 | 229 | <property name="pixmap"> | ||
607 | 230 | <pixmap resource="images.qrc">:/progress_finish_grey.png</pixmap> | ||
608 | 231 | </property> | ||
609 | 232 | </widget> | ||
610 | 233 | </item> | ||
611 | 234 | <item> | ||
612 | 235 | <widget class="QLabel" name="sync_label"> | ||
613 | 236 | <property name="enabled"> | ||
614 | 237 | <bool>true</bool> | ||
615 | 238 | </property> | ||
616 | 239 | <property name="text"> | ||
617 | 240 | <string>Sync, stream, share!</string> | ||
618 | 241 | </property> | ||
619 | 242 | </widget> | ||
620 | 243 | </item> | ||
621 | 244 | </layout> | ||
622 | 245 | </item> | ||
623 | 246 | </layout> | ||
624 | 75 | </widget> | 247 | </widget> |
625 | 76 | </item> | 248 | </item> |
626 | 77 | <item> | 249 | <item> |
627 | @@ -82,13 +254,15 @@ | |||
628 | 82 | <property name="sizeHint" stdset="0"> | 254 | <property name="sizeHint" stdset="0"> |
629 | 83 | <size> | 255 | <size> |
630 | 84 | <width>20</width> | 256 | <width>20</width> |
632 | 85 | <height>292</height> | 257 | <height>40</height> |
633 | 86 | </size> | 258 | </size> |
634 | 87 | </property> | 259 | </property> |
635 | 88 | </spacer> | 260 | </spacer> |
636 | 89 | </item> | 261 | </item> |
637 | 90 | </layout> | 262 | </layout> |
638 | 91 | </widget> | 263 | </widget> |
640 | 92 | <resources/> | 264 | <resources> |
641 | 265 | <include location="images.qrc"/> | ||
642 | 266 | </resources> | ||
643 | 93 | <connections/> | 267 | <connections/> |
644 | 94 | </ui> | 268 | </ui> |
645 | 95 | 269 | ||
646 | === added file 'data/qt/ubuntuone.qss' | |||
647 | --- data/qt/ubuntuone.qss 1970-01-01 00:00:00 +0000 | |||
648 | +++ data/qt/ubuntuone.qss 2011-07-22 16:39:49 +0000 | |||
649 | @@ -0,0 +1,96 @@ | |||
650 | 1 | QFrame#SideWidget { | ||
651 | 2 | background-color: white; | ||
652 | 3 | border-style: dotted; | ||
653 | 4 | border-color: #939389; | ||
654 | 5 | border-right-width: 1px; | ||
655 | 6 | color: white; | ||
656 | 7 | min-height: 100px; | ||
657 | 8 | margin-left: 10px; | ||
658 | 9 | } | ||
659 | 10 | |||
660 | 11 | QWizard, | ||
661 | 12 | QDialog{ | ||
662 | 13 | background-color: white; | ||
663 | 14 | } | ||
664 | 15 | |||
665 | 16 | QLabel#name_assistance, | ||
666 | 17 | QLabel#email_assistance, | ||
667 | 18 | QLabel#confirm_email_assistance, | ||
668 | 19 | QLabel#password_assistance, | ||
669 | 20 | QLabel#refresh_label{ | ||
670 | 21 | border-image: url(":/balloon_shape.png"); | ||
671 | 22 | padding-right: 2px; | ||
672 | 23 | } | ||
673 | 24 | |||
674 | 25 | QLabel#install_label, | ||
675 | 26 | QLabel#sign_in_label, | ||
676 | 27 | QLabel#choose_services_label, | ||
677 | 28 | QLabel#select_folders_label, | ||
678 | 29 | QLabel#sync_label{ | ||
679 | 30 | font-size: 14px; | ||
680 | 31 | } | ||
681 | 32 | |||
682 | 33 | QTextEdit{ | ||
683 | 34 | background-color: #ffffff; | ||
684 | 35 | border: none; | ||
685 | 36 | } | ||
686 | 37 | |||
687 | 38 | QPushButton[enabled="false"] { | ||
688 | 39 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, | ||
689 | 40 | stop: 0 #fecfc2,stop: 1.0 #df4d1a); | ||
690 | 41 | border-radius: 5px; | ||
691 | 42 | border-style: solid; | ||
692 | 43 | padding: 6px; | ||
693 | 44 | padding-left: 20px; | ||
694 | 45 | padding-right: 20px; | ||
695 | 46 | color: white; | ||
696 | 47 | border-color: #939389; | ||
697 | 48 | border-width: 1px; | ||
698 | 49 | height: 14px; | ||
699 | 50 | font-size: 12px; | ||
700 | 51 | } | ||
701 | 52 | |||
702 | 53 | QPushButton[enabled="true"] { | ||
703 | 54 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, | ||
704 | 55 | stop: 0 #eaeaea, stop: 1.0 #cacaca); | ||
705 | 56 | border-radius: 5px; | ||
706 | 57 | border-style: solid; | ||
707 | 58 | padding: 6px; | ||
708 | 59 | padding-left: 20px; | ||
709 | 60 | padding-right: 20px; | ||
710 | 61 | color: #595959; | ||
711 | 62 | border-color: #939389; | ||
712 | 63 | border-width: 1px; | ||
713 | 64 | height: 14px; | ||
714 | 65 | font-size: 12px; | ||
715 | 66 | } | ||
716 | 67 | |||
717 | 68 | QPushButton:hover { | ||
718 | 69 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, | ||
719 | 70 | stop: 0 #feae99,stop: 1.0 #df4e1c); | ||
720 | 71 | border-radius: 5px; | ||
721 | 72 | border-style: solid; | ||
722 | 73 | padding: 6px; | ||
723 | 74 | color: white; | ||
724 | 75 | border-color: #939389; | ||
725 | 76 | border-width: 1px; | ||
726 | 77 | height: 12px; | ||
727 | 78 | } | ||
728 | 79 | |||
729 | 80 | QPushButton:pressed { | ||
730 | 81 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, | ||
731 | 82 | stop: 0 #ba3f14,stop: 1.0 #db4714); | ||
732 | 83 | border-radius: 5px; | ||
733 | 84 | border-style: solid; | ||
734 | 85 | padding: 6px; | ||
735 | 86 | color: white; | ||
736 | 87 | border-color: #939389; | ||
737 | 88 | border-width: 1px; | ||
738 | 89 | height: 12px; | ||
739 | 90 | } | ||
740 | 91 | |||
741 | 92 | QWidget{ | ||
742 | 93 | font-family: "Ubuntu"; | ||
743 | 94 | color: #333333; | ||
744 | 95 | font-size: 12px; | ||
745 | 96 | } | ||
746 | 0 | 97 | ||
747 | === added file 'data/u1_logo.png' | |||
748 | 1 | Binary files data/u1_logo.png 1970-01-01 00:00:00 +0000 and data/u1_logo.png 2011-07-22 16:39:49 +0000 differ | 98 | Binary files data/u1_logo.png 1970-01-01 00:00:00 +0000 and data/u1_logo.png 2011-07-22 16:39:49 +0000 differ |
749 | === added file 'data/u1icon.png' | |||
750 | 2 | Binary files data/u1icon.png 1970-01-01 00:00:00 +0000 and data/u1icon.png 2011-07-22 16:39:49 +0000 differ | 99 | Binary files data/u1icon.png 1970-01-01 00:00:00 +0000 and data/u1icon.png 2011-07-22 16:39:49 +0000 differ |
751 | === added file 'data/win_install_img_placeholder.png' | |||
752 | 3 | Binary files data/win_install_img_placeholder.png 1970-01-01 00:00:00 +0000 and data/win_install_img_placeholder.png 2011-07-22 16:39:49 +0000 differ | 100 | Binary files data/win_install_img_placeholder.png 1970-01-01 00:00:00 +0000 and data/win_install_img_placeholder.png 2011-07-22 16:39:49 +0000 differ |
753 | === modified file 'ubuntuone_installer/gui/qt/gui.py' | |||
754 | --- ubuntuone_installer/gui/qt/gui.py 2011-07-19 17:16:11 +0000 | |||
755 | +++ ubuntuone_installer/gui/qt/gui.py 2011-07-22 16:39:49 +0000 | |||
756 | @@ -66,6 +66,12 @@ | |||
757 | 66 | license_ui, | 66 | license_ui, |
758 | 67 | setup_account_ui, | 67 | setup_account_ui, |
759 | 68 | ) | 68 | ) |
760 | 69 | |||
761 | 70 | # Module used to include the resources into this file | ||
762 | 71 | # pylint: disable=W0611 | ||
763 | 72 | from ubuntuone_installer.gui.qt.ui import images_rc | ||
764 | 73 | # pylint: enable=W0611 | ||
765 | 74 | |||
766 | 69 | from ubuntuone_installer.gui.qt.are_you_sure import AreYouSure | 75 | from ubuntuone_installer.gui.qt.are_you_sure import AreYouSure |
767 | 70 | from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage | 76 | from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage |
768 | 71 | from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage | 77 | from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage |
769 | @@ -77,6 +83,7 @@ | |||
770 | 77 | SIGN_IN = _("Sign in to Ubuntu One") | 83 | SIGN_IN = _("Sign in to Ubuntu One") |
771 | 78 | SIGN_IN_SUBTITLE = _("Sign in with your existing Ubuntu One" | 84 | SIGN_IN_SUBTITLE = _("Sign in with your existing Ubuntu One" |
772 | 79 | " username and password.") | 85 | " username and password.") |
773 | 86 | TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>" | ||
774 | 80 | 87 | ||
775 | 81 | # Invalid name logger | 88 | # Invalid name logger |
776 | 82 | # pylint: disable=C0103 | 89 | # pylint: disable=C0103 |
777 | @@ -114,9 +121,9 @@ | |||
778 | 114 | self.wizard().customButtonClicked.connect(self.print_document) | 121 | self.wizard().customButtonClicked.connect(self.print_document) |
779 | 115 | 122 | ||
780 | 116 | self.wizard().setButtonLayout([ | 123 | self.wizard().setButtonLayout([ |
781 | 124 | QtGui.QWizard.CancelButton, | ||
782 | 125 | QtGui.QWizard.Stretch, | ||
783 | 117 | QtGui.QWizard.CustomButton1, | 126 | QtGui.QWizard.CustomButton1, |
784 | 118 | QtGui.QWizard.Stretch, | ||
785 | 119 | QtGui.QWizard.CancelButton, | ||
786 | 120 | QtGui.QWizard.BackButton, | 127 | QtGui.QWizard.BackButton, |
787 | 121 | QtGui.QWizard.NextButton, | 128 | QtGui.QWizard.NextButton, |
788 | 122 | QtGui.QWizard.FinishButton, | 129 | QtGui.QWizard.FinishButton, |
789 | @@ -194,9 +201,9 @@ | |||
790 | 194 | # Layout without custom button 1, | 201 | # Layout without custom button 1, |
791 | 195 | # without finish button | 202 | # without finish button |
792 | 196 | self.wizard().setButtonLayout([ | 203 | self.wizard().setButtonLayout([ |
793 | 204 | QtGui.QWizard.CancelButton, | ||
794 | 197 | QtGui.QWizard.Stretch, | 205 | QtGui.QWizard.Stretch, |
795 | 198 | QtGui.QWizard.BackButton, | 206 | QtGui.QWizard.BackButton, |
796 | 199 | QtGui.QWizard.CancelButton, | ||
797 | 200 | ]) | 207 | ]) |
798 | 201 | 208 | ||
799 | 202 | 209 | ||
800 | @@ -287,6 +294,10 @@ | |||
801 | 287 | self.help_text = "" | 294 | self.help_text = "" |
802 | 288 | 295 | ||
803 | 289 | super(MainWindow, self).__init__() | 296 | super(MainWindow, self).__init__() |
804 | 297 | self.setWindowTitle(APP_NAME) | ||
805 | 298 | self.setMinimumHeight(630) | ||
806 | 299 | self.setMinimumWidth(800) | ||
807 | 300 | self.setTitleFormat(QtCore.Qt.RichText) | ||
808 | 290 | self.setWizardStyle(self.ModernStyle) | 301 | self.setWizardStyle(self.ModernStyle) |
809 | 291 | self.close_callback = close_callback | 302 | self.close_callback = close_callback |
810 | 292 | 303 | ||
811 | @@ -300,7 +311,9 @@ | |||
812 | 300 | self.LICENSE_PAGE = self.addPage(LicensePage()) | 311 | self.LICENSE_PAGE = self.addPage(LicensePage()) |
813 | 301 | 312 | ||
814 | 302 | #SSO Pages | 313 | #SSO Pages |
816 | 303 | self.sign_in_controller = ChooseSignInController(title=SIGN_IN) | 314 | title_page = TITLE_STYLE % SIGN_IN |
817 | 315 | self.sign_in_controller = ChooseSignInController( | ||
818 | 316 | title=title_page) | ||
819 | 304 | self.sign_in_page = SignInPage( | 317 | self.sign_in_page = SignInPage( |
820 | 305 | ui=choose_sign_in_ui.Ui_ChooseSignInPage(), | 318 | ui=choose_sign_in_ui.Ui_ChooseSignInPage(), |
821 | 306 | controller=self.sign_in_controller, | 319 | controller=self.sign_in_controller, |
822 | @@ -310,15 +323,17 @@ | |||
823 | 310 | setup_account_ui.Ui_SetUpAccountPage(), | 323 | setup_account_ui.Ui_SetUpAccountPage(), |
824 | 311 | self.setup_controller, | 324 | self.setup_controller, |
825 | 312 | parent=self) | 325 | parent=self) |
826 | 326 | title_page = TITLE_STYLE % _("Ubuntu One Terms of Service") | ||
827 | 313 | self.tos = TosPage(Ui_TosPage(), | 327 | self.tos = TosPage(Ui_TosPage(), |
828 | 314 | TosController(tos_url=TC_URL, | 328 | TosController(tos_url=TC_URL, |
830 | 315 | title=_("Ubuntu One Terms of Service")), | 329 | title=title_page), |
831 | 316 | parent=self) | 330 | parent=self) |
832 | 317 | self.email_verification = EmailVerificationPage( | 331 | self.email_verification = EmailVerificationPage( |
833 | 318 | Ui_EmailVerificationPage(), | 332 | Ui_EmailVerificationPage(), |
834 | 319 | EmailVerificationController()) | 333 | EmailVerificationController()) |
835 | 334 | title_page = TITLE_STYLE % SIGN_IN | ||
836 | 320 | self.current_user_controller = CurrentUserController( | 335 | self.current_user_controller = CurrentUserController( |
838 | 321 | title=SIGN_IN, subtitle=SIGN_IN_SUBTITLE) | 336 | title=title_page, subtitle=SIGN_IN_SUBTITLE) |
839 | 322 | self.current_user = CurrentUserSignInPage(Ui_CurrentUserSignInPage(), | 337 | self.current_user = CurrentUserSignInPage(Ui_CurrentUserSignInPage(), |
840 | 323 | self.current_user_controller, | 338 | self.current_user_controller, |
841 | 324 | parent=self) | 339 | parent=self) |
842 | @@ -396,8 +411,10 @@ | |||
843 | 396 | def on_currentIdChanged(self, page_id): | 411 | def on_currentIdChanged(self, page_id): |
844 | 397 | """The current page changed.""" | 412 | """The current page changed.""" |
845 | 398 | if page_id < self.SIGNIN_PAGE: | 413 | if page_id < self.SIGNIN_PAGE: |
846 | 414 | self.sideWidget().ui.states_frame.hide() | ||
847 | 399 | self.sideWidget().set_stage(0) | 415 | self.sideWidget().set_stage(0) |
848 | 400 | elif page_id < self.local_folders_page_id: | 416 | elif page_id < self.local_folders_page_id: |
849 | 417 | self.sideWidget().ui.states_frame.show() | ||
850 | 401 | self.sideWidget().set_stage(1) | 418 | self.sideWidget().set_stage(1) |
851 | 402 | elif page_id < self.CONGRATULATIONS_PAGE: | 419 | elif page_id < self.CONGRATULATIONS_PAGE: |
852 | 403 | self.sideWidget().set_stage(3) | 420 | self.sideWidget().set_stage(3) |
853 | 404 | 421 | ||
854 | === modified file 'ubuntuone_installer/gui/qt/local_folders.py' | |||
855 | --- ubuntuone_installer/gui/qt/local_folders.py 2011-07-19 00:38:27 +0000 | |||
856 | +++ ubuntuone_installer/gui/qt/local_folders.py 2011-07-22 16:39:49 +0000 | |||
857 | @@ -1,173 +1,173 @@ | |||
965 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
966 | 2 | 2 | ||
967 | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> |
968 | 4 | # | 4 | # |
969 | 5 | # Copyright 2011 Canonical Ltd. | 5 | # Copyright 2011 Canonical Ltd. |
970 | 6 | # | 6 | # |
971 | 7 | # This program is free software: you can redistribute it and/or modify it | 7 | # This program is free software: you can redistribute it and/or modify it |
972 | 8 | # under the terms of the GNU General Public License version 3, as published | 8 | # under the terms of the GNU General Public License version 3, as published |
973 | 9 | # by the Free Software Foundation. | 9 | # by the Free Software Foundation. |
974 | 10 | # | 10 | # |
975 | 11 | # This program is distributed in the hope that it will be useful, but | 11 | # This program is distributed in the hope that it will be useful, but |
976 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
977 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
978 | 14 | # PURPOSE. See the GNU General Public License for more details. | 14 | # PURPOSE. See the GNU General Public License for more details. |
979 | 15 | # | 15 | # |
980 | 16 | # You should have received a copy of the GNU General Public License along | 16 | # You should have received a copy of the GNU General Public License along |
981 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
982 | 18 | 18 | ||
983 | 19 | """Widget to create UDFs in the Windows Install Wizard.""" | 19 | """Widget to create UDFs in the Windows Install Wizard.""" |
984 | 20 | 20 | ||
985 | 21 | import ctypes | 21 | import ctypes |
986 | 22 | import os | 22 | import os |
987 | 23 | import sys | 23 | import sys |
988 | 24 | import threading | 24 | import threading |
989 | 25 | import Queue | 25 | import Queue |
990 | 26 | 26 | ||
991 | 27 | from PyQt4 import QtCore, QtGui | 27 | from PyQt4 import QtCore, QtGui |
992 | 28 | 28 | ||
993 | 29 | from ubuntuone.controlpanel.gui import humanize | 29 | from ubuntuone.controlpanel.gui import humanize |
994 | 30 | 30 | ||
995 | 31 | from ubuntuone_installer.gui.qt.ui import local_folders_ui | 31 | from ubuntuone_installer.gui.qt.ui import local_folders_ui |
996 | 32 | from ubuntuone_installer.gui import ( | 32 | from ubuntuone_installer.gui import ( |
997 | 33 | LOCAL_FOLDERS_TITLE, | 33 | LOCAL_FOLDERS_TITLE, |
998 | 34 | LOCAL_FOLDERS_SPACE_HEADER, | 34 | LOCAL_FOLDERS_SPACE_HEADER, |
999 | 35 | LOCAL_FOLDERS_OFFER_LABEL, | 35 | LOCAL_FOLDERS_OFFER_LABEL, |
1000 | 36 | LOCAL_FOLDERS_CALCULATING, | 36 | LOCAL_FOLDERS_CALCULATING, |
1001 | 37 | ) | 37 | ) |
1002 | 38 | 38 | ||
1003 | 39 | 39 | ||
1004 | 40 | class FolderItem(QtGui.QTreeWidgetItem): | 40 | class FolderItem(QtGui.QTreeWidgetItem): |
1005 | 41 | """Class representing a folder in the folder list UI.""" | 41 | """Class representing a folder in the folder list UI.""" |
1006 | 42 | def __init__(self, strings, path=None, queue=None): | 42 | def __init__(self, strings, path=None, queue=None): |
1007 | 43 | super(FolderItem, self).__init__(strings) | 43 | super(FolderItem, self).__init__(strings) |
1008 | 44 | self.thread = CalculateSize(path, queue) | 44 | self.thread = CalculateSize(path, queue) |
1009 | 45 | self.thread.start() | 45 | self.thread.start() |
1010 | 46 | self.size = None | 46 | self.size = None |
1011 | 47 | self.path = path | 47 | self.path = path |
1012 | 48 | 48 | ||
1013 | 49 | 49 | ||
1014 | 50 | class CalculateSize(threading.Thread): | 50 | class CalculateSize(threading.Thread): |
1015 | 51 | """Class to calculate the size of a folder in the background.""" | 51 | """Class to calculate the size of a folder in the background.""" |
1016 | 52 | def __init__(self, path_name, queue): | 52 | def __init__(self, path_name, queue): |
1017 | 53 | self.path_name = path_name | 53 | self.path_name = path_name |
1018 | 54 | self.queue = queue | 54 | self.queue = queue |
1019 | 55 | self._stop = False | 55 | self._stop = False |
1020 | 56 | super(CalculateSize, self).__init__() | 56 | super(CalculateSize, self).__init__() |
1021 | 57 | self.daemon = True | 57 | self.daemon = True |
1022 | 58 | 58 | ||
1023 | 59 | def run(self): | 59 | def run(self): |
1024 | 60 | total_size = 0 | 60 | total_size = 0 |
1025 | 61 | for dirpath, _, filenames in os.walk(self.path_name): | 61 | for dirpath, _, filenames in os.walk(self.path_name): |
1026 | 62 | for f in filenames: | 62 | for f in filenames: |
1027 | 63 | fp = os.path.join(dirpath, f) | 63 | fp = os.path.join(dirpath, f) |
1028 | 64 | total_size += os.path.getsize(fp) | 64 | total_size += os.path.getsize(fp) |
1029 | 65 | self.queue.put([self.path_name, total_size]) | 65 | self.queue.put([self.path_name, total_size]) |
1030 | 66 | 66 | ||
1031 | 67 | 67 | ||
1032 | 68 | class LocalFoldersPage(QtGui.QWizardPage): | 68 | class LocalFoldersPage(QtGui.QWizardPage): |
1033 | 69 | """Wizard page to create UDFs in the Windows Installer.""" | 69 | """Wizard page to create UDFs in the Windows Installer.""" |
1034 | 70 | 70 | ||
1035 | 71 | def __init__(self, parent=None): | 71 | def __init__(self, parent=None): |
1036 | 72 | super(LocalFoldersPage, self).__init__(parent) | 72 | super(LocalFoldersPage, self).__init__(parent) |
1037 | 73 | self.setTitle(LOCAL_FOLDERS_TITLE) | 73 | self.setTitle(LOCAL_FOLDERS_TITLE) |
1038 | 74 | self.ui = local_folders_ui.Ui_Form() | 74 | self.ui = local_folders_ui.Ui_Form() |
1039 | 75 | self.ui.setupUi(self) | 75 | self.ui.setupUi(self) |
1040 | 76 | 76 | ||
1041 | 77 | header_view = self.ui.folder_list.header() | 77 | header_view = self.ui.folder_list.header() |
1042 | 78 | header_view.setResizeMode(0, header_view.Stretch) | 78 | header_view.setResizeMode(0, header_view.Stretch) |
1043 | 79 | 79 | ||
1044 | 80 | self.queue = Queue.Queue() | 80 | self.queue = Queue.Queue() |
1045 | 81 | self.timer = QtCore.QTimer() | 81 | self.timer = QtCore.QTimer() |
1046 | 82 | self.items = {} | 82 | self.items = {} |
1047 | 83 | for folder_name in self.default_folders(): | 83 | for folder_name in self.default_folders(): |
1048 | 84 | self.add_folder(folder_name) | 84 | self.add_folder(folder_name) |
1049 | 85 | self.update_sizes() | 85 | self.update_sizes() |
1050 | 86 | self.timer.start(2000) | 86 | self.timer.start(2000) |
1051 | 87 | self.timer.timeout.connect(self.update_sizes) | 87 | self.timer.timeout.connect(self.update_sizes) |
1052 | 88 | 88 | ||
1053 | 89 | # initializePage is inherited | 89 | # initializePage is inherited |
1054 | 90 | # pylint: disable=C0103 | 90 | # pylint: disable=C0103 |
1055 | 91 | def initializePage(self): | 91 | def initializePage(self): |
1056 | 92 | """UI details.""" | 92 | """UI details.""" |
1057 | 93 | self.wizard()._next_id = None | 93 | self.wizard()._next_id = None |
1058 | 94 | 94 | ||
1059 | 95 | def quota(self): | 95 | def quota(self): |
1060 | 96 | """The quota available to the user.""" | 96 | """The quota available to the user.""" |
1061 | 97 | # FIXME: get this from real life | 97 | # FIXME: get this from real life |
1062 | 98 | return 2 * 1024 * 1024 | 98 | return 2 * 1024 * 1024 |
1063 | 99 | 99 | ||
1064 | 100 | def default_folders(self): | 100 | def default_folders(self): |
1065 | 101 | """Return a list of the folders to add by default.""" | 101 | """Return a list of the folders to add by default.""" |
1066 | 102 | if sys.platform == 'win32': | 102 | if sys.platform == 'win32': |
1067 | 103 | # Special Folder "My Documents" | 103 | # Special Folder "My Documents" |
1068 | 104 | dll = ctypes.windll.shell32 | 104 | dll = ctypes.windll.shell32 |
1069 | 105 | buf = ctypes.create_string_buffer(300) | 105 | buf = ctypes.create_string_buffer(300) |
1070 | 106 | dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False) | 106 | dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False) |
1071 | 107 | result = [buf.value, ] | 107 | result = [buf.value, ] |
1072 | 108 | else: | 108 | else: |
1073 | 109 | result = ['To be implemented'] | 109 | result = ['To be implemented'] |
1138 | 110 | return result | 110 | return result |
1139 | 111 | 111 | ||
1140 | 112 | def add_folder(self, path): | 112 | def add_folder(self, path): |
1141 | 113 | """Add a folder to the list.""" | 113 | """Add a folder to the list.""" |
1142 | 114 | if path in self.items: | 114 | if path in self.items: |
1143 | 115 | return None | 115 | return None |
1144 | 116 | # FIXME: the path should actually be sent to u1cp to verify as valid | 116 | # FIXME: the path should actually be sent to u1cp to verify as valid |
1145 | 117 | item = FolderItem([path, "", "remove"], path=path, queue=self.queue) | 117 | item = FolderItem([path, "", "remove"], path=path, queue=self.queue) |
1146 | 118 | self.ui.folder_list.addTopLevelItem(item) | 118 | self.ui.folder_list.addTopLevelItem(item) |
1147 | 119 | self.items[path] = item | 119 | self.items[path] = item |
1148 | 120 | return item | 120 | return item |
1149 | 121 | 121 | ||
1150 | 122 | def update_sizes(self): | 122 | def update_sizes(self): |
1151 | 123 | """Poll the queue were the threads put the size info.""" | 123 | """Poll the queue were the threads put the size info.""" |
1152 | 124 | try: | 124 | try: |
1153 | 125 | path, size = self.queue.get(False) | 125 | path, size = self.queue.get(False) |
1154 | 126 | item = self.items.get(path) | 126 | item = self.items.get(path) |
1155 | 127 | if item: | 127 | if item: |
1156 | 128 | item.size = size | 128 | item.size = size |
1157 | 129 | item.setText(1, humanize(size)) | 129 | item.setText(1, humanize(size)) |
1158 | 130 | except Queue.Empty: | 130 | except Queue.Empty: |
1159 | 131 | pass | 131 | pass |
1160 | 132 | total = 0 | 132 | total = 0 |
1161 | 133 | for path, item in self.items.items(): | 133 | for path, item in self.items.items(): |
1162 | 134 | if item.size is None: | 134 | if item.size is None: |
1163 | 135 | total = LOCAL_FOLDERS_CALCULATING | 135 | total = LOCAL_FOLDERS_CALCULATING |
1164 | 136 | break | 136 | break |
1165 | 137 | total += item.size | 137 | total += item.size |
1166 | 138 | 138 | ||
1167 | 139 | if isinstance(total, long): | 139 | if isinstance(total, long): |
1168 | 140 | self.show_hide_offer(total) | 140 | self.show_hide_offer(total) |
1169 | 141 | total = humanize(total) | 141 | total = humanize(total) |
1170 | 142 | else: | 142 | else: |
1171 | 143 | self.show_hide_offer(0) | 143 | self.show_hide_offer(0) |
1172 | 144 | self.ui.folder_list.headerItem().setText( | 144 | self.ui.folder_list.headerItem().setText( |
1173 | 145 | 1, LOCAL_FOLDERS_SPACE_HEADER % total) | 145 | 1, LOCAL_FOLDERS_SPACE_HEADER % total) |
1174 | 146 | 146 | ||
1175 | 147 | def show_hide_offer(self, cur_size): | 147 | def show_hide_offer(self, cur_size): |
1176 | 148 | """Show or hide the offer to buy space according to the total size.""" | 148 | """Show or hide the offer to buy space according to the total size.""" |
1177 | 149 | quota = self.quota() | 149 | quota = self.quota() |
1178 | 150 | 150 | ||
1179 | 151 | if cur_size > quota: | 151 | if cur_size > quota: |
1180 | 152 | self.ui.offer_frame.setVisible(True) | 152 | self.ui.offer_frame.setVisible(True) |
1181 | 153 | else: | 153 | else: |
1182 | 154 | self.ui.offer_frame.setVisible(False) | 154 | self.ui.offer_frame.setVisible(False) |
1183 | 155 | 155 | ||
1184 | 156 | self.ui.offer_label.setText(LOCAL_FOLDERS_OFFER_LABEL % | 156 | self.ui.offer_label.setText(LOCAL_FOLDERS_OFFER_LABEL % |
1185 | 157 | {"quota": humanize(quota)}) | 157 | {"quota": humanize(quota)}) |
1186 | 158 | 158 | ||
1187 | 159 | def stop_threads(self): | 159 | def stop_threads(self): |
1188 | 160 | """Stop all pending threads.""" | 160 | """Stop all pending threads.""" |
1189 | 161 | for _, item in self.items: | 161 | for _, item in self.items: |
1190 | 162 | item.thread._stop = True | 162 | item.thread._stop = True |
1191 | 163 | 163 | ||
1192 | 164 | # itemClicked is a Qt signal name. | 164 | # itemClicked is a Qt signal name. |
1193 | 165 | # pylint: disable=C0103 | 165 | # pylint: disable=C0103 |
1194 | 166 | def on_folder_list_itemClicked(self, item, column): | 166 | def on_folder_list_itemClicked(self, item, column): |
1195 | 167 | """Delete folder from the list.""" | 167 | """Delete folder from the list.""" |
1196 | 168 | if column == 2: | 168 | if column == 2: |
1197 | 169 | del(self.items[item.path]) | 169 | del(self.items[item.path]) |
1198 | 170 | item.thread._stop = True | 170 | item.thread._stop = True |
1199 | 171 | self.ui.folder_list.takeTopLevelItem( | 171 | self.ui.folder_list.takeTopLevelItem( |
1200 | 172 | self.ui.folder_list.indexOfTopLevelItem(item)) | 172 | self.ui.folder_list.indexOfTopLevelItem(item)) |
1201 | 173 | self.update_sizes() | 173 | self.update_sizes() |
1202 | 174 | 174 | ||
1203 | === modified file 'ubuntuone_installer/gui/qt/setup_account.py' | |||
1204 | --- ubuntuone_installer/gui/qt/setup_account.py 2011-07-07 20:32:17 +0000 | |||
1205 | +++ ubuntuone_installer/gui/qt/setup_account.py 2011-07-22 16:39:49 +0000 | |||
1206 | @@ -1,156 +1,158 @@ | |||
1363 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1364 | 2 | 2 | ||
1365 | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> |
1366 | 4 | # | 4 | # |
1367 | 5 | # Copyright 2011 Canonical Ltd. | 5 | # Copyright 2011 Canonical Ltd. |
1368 | 6 | # | 6 | # |
1369 | 7 | # This program is free software: you can redistribute it and/or modify it | 7 | # This program is free software: you can redistribute it and/or modify it |
1370 | 8 | # under the terms of the GNU General Public License version 3, as published | 8 | # under the terms of the GNU General Public License version 3, as published |
1371 | 9 | # by the Free Software Foundation. | 9 | # by the Free Software Foundation. |
1372 | 10 | # | 10 | # |
1373 | 11 | # This program is distributed in the hope that it will be useful, but | 11 | # This program is distributed in the hope that it will be useful, but |
1374 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
1375 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1376 | 14 | # PURPOSE. See the GNU General Public License for more details. | 14 | # PURPOSE. See the GNU General Public License for more details. |
1377 | 15 | # | 15 | # |
1378 | 16 | # You should have received a copy of the GNU General Public License along | 16 | # You should have received a copy of the GNU General Public License along |
1379 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
1380 | 18 | 18 | ||
1381 | 19 | """Customized Setup Account page for SSO.""" | 19 | """Customized Setup Account page for SSO.""" |
1382 | 20 | 20 | ||
1383 | 21 | import gettext | 21 | import gettext |
1384 | 22 | import re | 22 | import re |
1385 | 23 | 23 | ||
1386 | 24 | from PyQt4 import QtGui | 24 | from PyQt4 import QtGui |
1387 | 25 | 25 | ||
1388 | 26 | from ubuntu_sso.qt import gui as sso_gui | 26 | from ubuntu_sso.qt import gui as sso_gui |
1389 | 27 | 27 | ||
1390 | 28 | _ = gettext.gettext | 28 | _ = gettext.gettext |
1391 | 29 | 29 | ||
1392 | 30 | # pylint: disable=C0103 | 30 | # pylint: disable=C0103 |
1393 | 31 | BAD = u'<font color="red"> %s </font>' | 31 | BAD = u'<img src=":/password_hint_warning.png" /><font color="red"> %s </font>' |
1394 | 32 | GOOD = u'<font color="green"> %s </font>' | 32 | GOOD = u'<img src=":/password_hint_ok.png" /><font color="green"> %s </font>' |
1395 | 33 | 33 | TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>" | |
1396 | 34 | EMPTY_NAME = _("Please enter your name") | 34 | |
1397 | 35 | INVALID_EMAIL = _("Please enter a valid email address") | 35 | EMPTY_NAME = _("Please enter your name") |
1398 | 36 | EMAIL_MATCH = _("The email addresses do not match") | 36 | INVALID_EMAIL = _("Please enter a valid email address") |
1399 | 37 | PASSWORD_LENGTH = _("At least 8 characters") | 37 | EMAIL_MATCH = _("The email addresses do not match") |
1400 | 38 | PASSWORD_DIGIT = _("At least one number") | 38 | PASSWORD_LENGTH = _("At least 8 characters") |
1401 | 39 | PASSWORD_UPPER = _("At least one uppercase letter") | 39 | PASSWORD_DIGIT = _("At least one number") |
1402 | 40 | PASSWORD_MATCH = _("Passwords don't match") | 40 | PASSWORD_UPPER = _("At least one uppercase letter") |
1403 | 41 | 41 | PASSWORD_MATCH = _("Passwords don't match") | |
1404 | 42 | 42 | ||
1405 | 43 | class SetupAccountPage(sso_gui.SetupAccountPage): | 43 | |
1406 | 44 | 44 | class SetupAccountPage(sso_gui.SetupAccountPage): | |
1407 | 45 | """Customized Setup Account page for SSO""" | 45 | |
1408 | 46 | 46 | """Customized Setup Account page for SSO""" | |
1409 | 47 | def initializePage(self): | 47 | |
1410 | 48 | """Setup UI details.""" | 48 | def initializePage(self): |
1411 | 49 | # We need to override some texts from SSO | 49 | """Setup UI details.""" |
1412 | 50 | # to match our spec | 50 | # We need to override some texts from SSO |
1413 | 51 | self.setTitle(_("Sign Up to Ubuntu One")) | 51 | # to match our spec |
1414 | 52 | self.setSubTitle(_("You only need to set up your account " | 52 | title_page = TITLE_STYLE % _("Sign Up to Ubuntu One") |
1415 | 53 | "once to get access to Ubuntu One across your devices.")) | 53 | self.setTitle(title_page) |
1416 | 54 | 54 | self.setSubTitle(_("You only need to set up your account " | |
1417 | 55 | self.ui.name_label.setText(_("Name")) | 55 | "once to get access to Ubuntu One across your devices.")) |
1418 | 56 | self.ui.email_label.setText(_("Email")) | 56 | |
1419 | 57 | self.ui.confirm_email_label.setText(_("Retype email")) | 57 | self.ui.name_label.setText(_("Name")) |
1420 | 58 | self.ui.password_label.setText(_("Create a password")) | 58 | self.ui.email_label.setText(_("Email")) |
1421 | 59 | self.ui.confirm_password_label.setText(_("Retype password")) | 59 | self.ui.confirm_email_label.setText(_("Retype email")) |
1422 | 60 | self.ui.terms_checkbox.setText( | 60 | self.ui.password_label.setText(_("Create a password")) |
1423 | 61 | _("By signing up to Ubuntu One you agree to our Terms " | 61 | self.ui.confirm_password_label.setText(_("Retype password")) |
1424 | 62 | "of Service and Privacy Policy")) | 62 | self.ui.terms_checkbox.setText( |
1425 | 63 | self.ui.terms_button.setText(_("Show Terms of Service")) | 63 | _("By signing up to Ubuntu One you agree to our Terms " |
1426 | 64 | self.ui.password_info_label.hide() | 64 | "of Service and Privacy Policy")) |
1427 | 65 | 65 | self.ui.terms_button.setText(_("Show Terms of Service")) | |
1428 | 66 | # Button setup | 66 | self.ui.password_info_label.hide() |
1429 | 67 | self.wizard().setButtonLayout([ | 67 | |
1430 | 68 | QtGui.QWizard.Stretch, | 68 | # Button setup |
1431 | 69 | QtGui.QWizard.BackButton, | 69 | self.wizard().setButtonLayout([ |
1432 | 70 | QtGui.QWizard.CancelButton, | 70 | QtGui.QWizard.Stretch, |
1433 | 71 | ]) | 71 | QtGui.QWizard.BackButton, |
1434 | 72 | 72 | QtGui.QWizard.CancelButton, | |
1435 | 73 | self.ui.name_edit.textEdited.connect(self.name_assistance) | 73 | ]) |
1436 | 74 | self.name_assistance() | 74 | |
1437 | 75 | self.ui.email_edit.textEdited.connect(self.email_assistance) | 75 | self.ui.name_edit.textEdited.connect(self.name_assistance) |
1438 | 76 | self.ui.email_edit.textEdited.connect(self.confirm_email_assistance) | 76 | self.name_assistance() |
1439 | 77 | self.email_assistance() | 77 | self.ui.email_edit.textEdited.connect(self.email_assistance) |
1440 | 78 | self.ui.confirm_email_edit.textEdited.connect( | 78 | self.ui.email_edit.textEdited.connect(self.confirm_email_assistance) |
1441 | 79 | self.confirm_email_assistance) | 79 | self.email_assistance() |
1442 | 80 | self.confirm_email_assistance() | 80 | self.ui.confirm_email_edit.textEdited.connect( |
1443 | 81 | self.ui.password_edit.textEdited.connect(self.password_assistance) | 81 | self.confirm_email_assistance) |
1444 | 82 | self.ui.confirm_password_edit.textEdited.connect( | 82 | self.confirm_email_assistance() |
1445 | 83 | self.password_assistance) | 83 | self.ui.password_edit.textEdited.connect(self.password_assistance) |
1446 | 84 | self.password_assistance() | 84 | self.ui.confirm_password_edit.textEdited.connect( |
1447 | 85 | 85 | self.password_assistance) | |
1448 | 86 | def name_assistance(self): | 86 | self.password_assistance() |
1449 | 87 | """Show help for the name field.""" | 87 | |
1450 | 88 | text = unicode(self.ui.name_edit.text()) | 88 | def name_assistance(self): |
1451 | 89 | if not text.strip(): | 89 | """Show help for the name field.""" |
1452 | 90 | self.ui.name_assistance.setVisible(True) | 90 | text = unicode(self.ui.name_edit.text()) |
1453 | 91 | self.ui.name_assistance.setText(BAD % EMPTY_NAME) | 91 | if not text.strip(): |
1454 | 92 | else: | 92 | self.ui.name_assistance.setVisible(True) |
1455 | 93 | self.ui.name_assistance.setVisible(False) | 93 | self.ui.name_assistance.setText(BAD % EMPTY_NAME) |
1456 | 94 | 94 | else: | |
1457 | 95 | def email_assistance(self): | 95 | self.ui.name_assistance.setVisible(False) |
1458 | 96 | """Show help for the email field.""" | 96 | |
1459 | 97 | text = unicode(self.ui.email_edit.text()) | 97 | def email_assistance(self): |
1460 | 98 | if not is_correct_email(text): | 98 | """Show help for the email field.""" |
1461 | 99 | self.ui.email_assistance.setText(BAD % INVALID_EMAIL) | 99 | text = unicode(self.ui.email_edit.text()) |
1462 | 100 | self.ui.email_assistance.setVisible(True) | 100 | if not is_correct_email(text): |
1463 | 101 | else: | 101 | self.ui.email_assistance.setText(BAD % INVALID_EMAIL) |
1464 | 102 | self.ui.email_assistance.setVisible(False) | 102 | self.ui.email_assistance.setVisible(True) |
1465 | 103 | 103 | else: | |
1466 | 104 | def confirm_email_assistance(self): | 104 | self.ui.email_assistance.setVisible(False) |
1467 | 105 | """Show help for the confirm email field.""" | 105 | |
1468 | 106 | text1 = unicode(self.ui.email_edit.text()) | 106 | def confirm_email_assistance(self): |
1469 | 107 | text2 = unicode(self.ui.confirm_email_edit.text()) | 107 | """Show help for the confirm email field.""" |
1470 | 108 | if text1 != text2: | 108 | text1 = unicode(self.ui.email_edit.text()) |
1471 | 109 | self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH) | 109 | text2 = unicode(self.ui.confirm_email_edit.text()) |
1472 | 110 | self.ui.confirm_email_assistance.setVisible(True) | 110 | if text1 != text2: |
1473 | 111 | else: | 111 | self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH) |
1474 | 112 | self.ui.confirm_email_assistance.setVisible(False) | 112 | self.ui.confirm_email_assistance.setVisible(True) |
1475 | 113 | 113 | else: | |
1476 | 114 | def password_assistance(self): | 114 | self.ui.confirm_email_assistance.setVisible(False) |
1477 | 115 | """Show help for the password field.""" | 115 | |
1478 | 116 | text1 = unicode(self.ui.password_edit.text()) | 116 | def password_assistance(self): |
1479 | 117 | text2 = unicode(self.ui.confirm_password_edit.text()) | 117 | """Show help for the password field.""" |
1480 | 118 | label_text = [_("Your password must contain"), ] | 118 | text1 = unicode(self.ui.password_edit.text()) |
1481 | 119 | 119 | text2 = unicode(self.ui.confirm_password_edit.text()) | |
1482 | 120 | if len(text1) < 8: | 120 | label_text = ["<b>%s</b>" % _("Your password must contain"), ] |
1483 | 121 | sign = BAD | 121 | |
1484 | 122 | else: | 122 | if len(text1) < 8: |
1485 | 123 | sign = GOOD | 123 | sign = BAD |
1486 | 124 | label_text.append(sign % PASSWORD_LENGTH) | 124 | else: |
1487 | 125 | 125 | sign = GOOD | |
1488 | 126 | if re.search('[A-Z]', text1) is None: | 126 | label_text.append(sign % PASSWORD_LENGTH) |
1489 | 127 | sign = BAD | 127 | |
1490 | 128 | else: | 128 | if re.search('[A-Z]', text1) is None: |
1491 | 129 | sign = GOOD | 129 | sign = BAD |
1492 | 130 | label_text.append(sign % PASSWORD_UPPER) | 130 | else: |
1493 | 131 | 131 | sign = GOOD | |
1494 | 132 | if re.search('[\d+]', text1) is None: | 132 | label_text.append(sign % PASSWORD_UPPER) |
1495 | 133 | sign = BAD | 133 | |
1496 | 134 | else: | 134 | if re.search('[\d+]', text1) is None: |
1497 | 135 | sign = GOOD | 135 | sign = BAD |
1498 | 136 | label_text.append(sign % PASSWORD_DIGIT) | 136 | else: |
1499 | 137 | 137 | sign = GOOD | |
1500 | 138 | if text1 != text2: | 138 | label_text.append(sign % PASSWORD_DIGIT) |
1501 | 139 | label_text.append(BAD % PASSWORD_MATCH) | 139 | |
1502 | 140 | 140 | if text1 != text2: | |
1503 | 141 | self.ui.password_assistance.setText("<br>".join(label_text)) | 141 | label_text.append(BAD % PASSWORD_MATCH) |
1504 | 142 | 142 | ||
1505 | 143 | 143 | self.ui.password_assistance.setText("<br>".join(label_text)) | |
1506 | 144 | def is_min_required_password(password): | 144 | |
1507 | 145 | """Return if the password meets the minimum requirements.""" | 145 | |
1508 | 146 | if (len(password) < 8 or | 146 | def is_min_required_password(password): |
1509 | 147 | re.search('[A-Z]', password) is None or | 147 | """Return if the password meets the minimum requirements.""" |
1510 | 148 | re.search('\d+', password) is None): | 148 | if (len(password) < 8 or |
1511 | 149 | return False | 149 | re.search('[A-Z]', password) is None or |
1512 | 150 | return True | 150 | re.search('\d+', password) is None): |
1513 | 151 | 151 | return False | |
1514 | 152 | 152 | return True | |
1515 | 153 | # FIXME: this should do the same check as SSO's server side | 153 | |
1516 | 154 | def is_correct_email(email_address): | 154 | |
1517 | 155 | """Return if the email is correct.""" | 155 | # FIXME: this should do the same check as SSO's server side |
1518 | 156 | return '@' in email_address | 156 | def is_correct_email(email_address): |
1519 | 157 | """Return if the email is correct.""" | ||
1520 | 158 | return '@' in email_address | ||
1521 | 157 | 159 | ||
1522 | === modified file 'ubuntuone_installer/gui/qt/side_widget.py' | |||
1523 | --- ubuntuone_installer/gui/qt/side_widget.py 2011-07-04 18:15:56 +0000 | |||
1524 | +++ ubuntuone_installer/gui/qt/side_widget.py 2011-07-22 16:39:49 +0000 | |||
1525 | @@ -1,49 +1,73 @@ | |||
1575 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1576 | 2 | 2 | ||
1577 | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> |
1578 | 4 | # | 4 | # |
1579 | 5 | # Copyright 2011 Canonical Ltd. | 5 | # Copyright 2011 Canonical Ltd. |
1580 | 6 | # | 6 | # |
1581 | 7 | # This program is free software: you can redistribute it and/or modify it | 7 | # This program is free software: you can redistribute it and/or modify it |
1582 | 8 | # under the terms of the GNU General Public License version 3, as published | 8 | # under the terms of the GNU General Public License version 3, as published |
1583 | 9 | # by the Free Software Foundation. | 9 | # by the Free Software Foundation. |
1584 | 10 | # | 10 | # |
1585 | 11 | # This program is distributed in the hope that it will be useful, but | 11 | # This program is distributed in the hope that it will be useful, but |
1586 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
1587 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1588 | 14 | # PURPOSE. See the GNU General Public License for more details. | 14 | # PURPOSE. See the GNU General Public License for more details. |
1589 | 15 | # | 15 | # |
1590 | 16 | # You should have received a copy of the GNU General Public License along | 16 | # You should have received a copy of the GNU General Public License along |
1591 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
1592 | 18 | 18 | ||
1593 | 19 | """Wizard's side widget.""" | 19 | """Wizard's side widget.""" |
1594 | 20 | 20 | ||
1595 | 21 | from PyQt4 import QtGui | 21 | from PyQt4 import QtGui |
1596 | 22 | 22 | ||
1597 | 23 | from ubuntuone_installer.gui.qt.ui import side_widget_ui | 23 | from ubuntuone_installer.gui.qt.ui import side_widget_ui |
1598 | 24 | 24 | # Module used ti include the resources into this file | |
1599 | 25 | 25 | # pylint: disable=W0611 | |
1600 | 26 | class SideWidget(QtGui.QWidget): | 26 | from ubuntuone_installer.gui.qt.ui import images_rc |
1601 | 27 | 27 | # pylint: enable=W0611 | |
1602 | 28 | """Wizard's side widget.""" | 28 | |
1603 | 29 | 29 | ||
1604 | 30 | install_stage = 0 | 30 | class SideWidget(QtGui.QFrame): |
1605 | 31 | signin_stage = 1 | 31 | |
1606 | 32 | choose_services_stage = 2 | 32 | """Wizard's side widget.""" |
1607 | 33 | select_sync_folders_stage = 3 | 33 | |
1608 | 34 | sync_stage = 4 | 34 | install_stage = 0 |
1609 | 35 | 35 | signin_stage = 1 | |
1610 | 36 | def __init__(self, *args, **kwargs): | 36 | choose_services_stage = 2 |
1611 | 37 | super(SideWidget, self).__init__(*args, **kwargs) | 37 | select_sync_folders_stage = 3 |
1612 | 38 | self.ui = side_widget_ui.Ui_Form() | 38 | sync_stage = 4 |
1613 | 39 | self.ui.setupUi(self) | 39 | |
1614 | 40 | self.stage = 0 | 40 | def __init__(self, *args, **kwargs): |
1615 | 41 | 41 | super(SideWidget, self).__init__(*args, **kwargs) | |
1616 | 42 | def set_stage(self, stage): | 42 | self.ui = side_widget_ui.Ui_SideWidget() |
1617 | 43 | """Switch to the desired stage.""" | 43 | self.ui.setupUi(self) |
1618 | 44 | self.stage = stage | 44 | self.stage = 0 |
1619 | 45 | self.ui.install_label.setEnabled(stage >= 0) | 45 | |
1620 | 46 | self.ui.sign_in_label.setEnabled(stage >= 1) | 46 | def set_stage(self, stage): |
1621 | 47 | self.ui.choose_services_label.setEnabled(stage >= 2) | 47 | """Switch to the desired stage.""" |
1622 | 48 | self.ui.select_folders_label.setEnabled(stage >= 3) | 48 | self.stage = stage |
1623 | 49 | self.ui.sync_label.setEnabled(stage >= 4) | 49 | self.ui.install_label.setEnabled(stage >= 0) |
1624 | 50 | self.ui.sign_in_label.setEnabled(stage >= 1) | ||
1625 | 51 | self.ui.choose_services_label.setEnabled(stage >= 2) | ||
1626 | 52 | self.ui.select_folders_label.setEnabled(stage >= 3) | ||
1627 | 53 | self.ui.sync_label.setEnabled(stage >= 4) | ||
1628 | 54 | self.set_stage_icon(self.ui.install_icon_label, self.install_stage) | ||
1629 | 55 | self.set_stage_icon(self.ui.sign_icon_label, self.signin_stage) | ||
1630 | 56 | self.set_stage_icon(self.ui.choose_icon_label, | ||
1631 | 57 | self.choose_services_stage) | ||
1632 | 58 | self.set_stage_icon(self.ui.folders_icon_label, | ||
1633 | 59 | self.select_sync_folders_stage) | ||
1634 | 60 | self.set_stage_icon(self.ui.sync_icon_label, self.sync_stage) | ||
1635 | 61 | |||
1636 | 62 | def set_stage_icon(self, label, label_stage): | ||
1637 | 63 | """Set the label icon depending on the proper state.""" | ||
1638 | 64 | if self.stage == label_stage and label == self.ui.sync_icon_label: | ||
1639 | 65 | label.setPixmap(QtGui.QPixmap(":/progress_finish_orange.png")) | ||
1640 | 66 | elif self.stage == label_stage: | ||
1641 | 67 | label.setPixmap(QtGui.QPixmap(":/progress_arrow_orange.png")) | ||
1642 | 68 | elif self.stage > label_stage: | ||
1643 | 69 | label.setPixmap(QtGui.QPixmap(":/progress_tick.png")) | ||
1644 | 70 | elif label == self.ui.sync_icon_label: | ||
1645 | 71 | label.setPixmap(QtGui.QPixmap(":/progress_finish_grey.png")) | ||
1646 | 72 | else: | ||
1647 | 73 | label.setPixmap(QtGui.QPixmap(":/progress_arrow_grey.png")) | ||
1648 | 50 | 74 | ||
1649 | === modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py' | |||
1650 | --- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-19 17:16:11 +0000 | |||
1651 | +++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-22 16:39:49 +0000 | |||
1652 | @@ -114,6 +114,10 @@ | |||
1653 | 114 | self.ui.done(result=0) | 114 | self.ui.done(result=0) |
1654 | 115 | # world did not explode | 115 | # world did not explode |
1655 | 116 | 116 | ||
1656 | 117 | def test_main_window_general_config(self): | ||
1657 | 118 | """Check if the main properties of the windows are set.""" | ||
1658 | 119 | self.assertEqual(self.ui.windowTitle(), APP_NAME) | ||
1659 | 120 | |||
1660 | 117 | def test_start_control_panel_on_finishing(self): | 121 | def test_start_control_panel_on_finishing(self): |
1661 | 118 | """Calling done with result=1, the control panel should be called.""" | 122 | """Calling done with result=1, the control panel should be called.""" |
1662 | 119 | gui.AreYouSure.result = 0 | 123 | gui.AreYouSure.result = 0 |
1663 | @@ -188,7 +192,7 @@ | |||
1664 | 188 | def test_current_user_controller_parameters(self): | 192 | def test_current_user_controller_parameters(self): |
1665 | 189 | """Compare controller parameters with expected values.""" | 193 | """Compare controller parameters with expected values.""" |
1666 | 190 | self.assertEqual(self.ui.current_user_controller.args, | 194 | self.assertEqual(self.ui.current_user_controller.args, |
1668 | 191 | ((), {'title': gui.SIGN_IN, | 195 | ((), {'title': gui.TITLE_STYLE % gui.SIGN_IN, |
1669 | 192 | 'subtitle': gui.SIGN_IN_SUBTITLE})) | 196 | 'subtitle': gui.SIGN_IN_SUBTITLE})) |
1670 | 193 | 197 | ||
1671 | 194 | def test_stage_progression_1(self): | 198 | def test_stage_progression_1(self): |
1672 | @@ -652,3 +656,24 @@ | |||
1673 | 652 | setup_account.BAD % setup_account.PASSWORD_MATCH in | 656 | setup_account.BAD % setup_account.PASSWORD_MATCH in |
1674 | 653 | unicode(self.ui.ui.password_assistance.text()), | 657 | unicode(self.ui.ui.password_assistance.text()), |
1675 | 654 | ) | 658 | ) |
1676 | 659 | |||
1677 | 660 | def test_side_widget_state(self): | ||
1678 | 661 | """Test if the side widget of the wizard has state frame visible.""" | ||
1679 | 662 | if type(self.ui) != gui.MainWindow: | ||
1680 | 663 | return | ||
1681 | 664 | self.ui.on_currentIdChanged(self.ui.LICENSE_PAGE) | ||
1682 | 665 | self.assertEqual( | ||
1683 | 666 | True, | ||
1684 | 667 | sideWidget().ui.states_frame.isVisible()) | ||
1685 | 668 | self.ui.on_currentIdChanged(self.ui.SIGNIN_PAGE) | ||
1686 | 669 | self.assertEqual( | ||
1687 | 670 | True, | ||
1688 | 671 | sideWidget().ui.states_frame.isVisible()) | ||
1689 | 672 | self.ui.on_currentIdChanged(self.ui.local_folders_page_id) | ||
1690 | 673 | self.assertEqual( | ||
1691 | 674 | True, | ||
1692 | 675 | sideWidget().ui.states_frame.isVisible()) | ||
1693 | 676 | self.ui.on_currentIdChanged(self.ui.CONGRATULATIONS_PAGE) | ||
1694 | 677 | self.assertEqual( | ||
1695 | 678 | True, | ||
1696 | 679 | sideWidget().ui.states_frame.isVisible()) | ||
1697 | 655 | 680 | ||
1698 | === modified file 'ubuntuone_installer/gui/qt/tests/test_side_widget.py' | |||
1699 | --- ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-07-07 13:08:24 +0000 | |||
1700 | +++ ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-07-22 16:39:49 +0000 | |||
1701 | @@ -1,100 +1,155 @@ | |||
1802 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
1803 | 2 | 2 | ||
1804 | 3 | # Authors: Alejandro J. Cura <alecu@canonical.com> | 3 | # Authors: Alejandro J. Cura <alecu@canonical.com> |
1805 | 4 | # Roberto Alsina <roberto.alsina@canonical.com> | 4 | # Roberto Alsina <roberto.alsina@canonical.com> |
1806 | 5 | # | 5 | # |
1807 | 6 | # Copyright 2011 Canonical Ltd. | 6 | # Copyright 2011 Canonical Ltd. |
1808 | 7 | # | 7 | # |
1809 | 8 | # This program is free software: you can redistribute it and/or modify it | 8 | # This program is free software: you can redistribute it and/or modify it |
1810 | 9 | # under the terms of the GNU General Public License version 3, as published | 9 | # under the terms of the GNU General Public License version 3, as published |
1811 | 10 | # by the Free Software Foundation. | 10 | # by the Free Software Foundation. |
1812 | 11 | # | 11 | # |
1813 | 12 | # This program is distributed in the hope that it will be useful, but | 12 | # This program is distributed in the hope that it will be useful, but |
1814 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
1815 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1816 | 15 | # PURPOSE. See the GNU General Public License for more details. | 15 | # PURPOSE. See the GNU General Public License for more details. |
1817 | 16 | # | 16 | # |
1818 | 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 |
1819 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
1820 | 19 | 19 | ||
1821 | 20 | """Tests for the Qt UI.""" | 20 | """Tests for the Qt UI.""" |
1822 | 21 | 21 | ||
1823 | 22 | from ubuntuone_installer.gui.qt.tests import BaseTestCase | 22 | from PyQt4 import QtGui, QtCore |
1824 | 23 | from ubuntuone_installer.gui.qt.side_widget import SideWidget | 23 | |
1825 | 24 | 24 | from ubuntuone_installer.gui.qt.tests import BaseTestCase | |
1826 | 25 | 25 | from ubuntuone_installer.gui.qt.side_widget import SideWidget | |
1827 | 26 | class SideWidgetTestCase(BaseTestCase): | 26 | # Module used ti include the resources into this file |
1828 | 27 | 27 | # pylint: disable=W0611 | |
1829 | 28 | """Test the qt main window.""" | 28 | from ubuntuone_installer.gui.qt.ui import images_rc |
1830 | 29 | 29 | # pylint: enable=W0611 | |
1831 | 30 | class_ui = SideWidget | 30 | |
1832 | 31 | 31 | ||
1833 | 32 | def test_stage_0(self): | 32 | class SideWidgetTestCase(BaseTestCase): |
1834 | 33 | """Check that each stage in the widget enables the right labels.""" | 33 | |
1835 | 34 | self.ui.set_stage(0) | 34 | """Test the qt main window.""" |
1836 | 35 | self.assertEqual( | 35 | |
1837 | 36 | self.ui.ui.install_label.isEnabled(), True) | 36 | class_ui = SideWidget |
1838 | 37 | self.assertEqual( | 37 | |
1839 | 38 | self.ui.ui.sign_in_label.isEnabled(), False) | 38 | def test_stage_0(self): |
1840 | 39 | self.assertEqual( | 39 | """Check that each stage in the widget enables the right labels.""" |
1841 | 40 | self.ui.ui.choose_services_label.isEnabled(), False) | 40 | self.ui.set_stage(0) |
1842 | 41 | self.assertEqual( | 41 | self.assertEqual( |
1843 | 42 | self.ui.ui.select_folders_label.isEnabled(), False) | 42 | self.ui.ui.install_label.isEnabled(), True) |
1844 | 43 | self.assertEqual( | 43 | self.assertEqual( |
1845 | 44 | self.ui.ui.sync_label.isEnabled(), False) | 44 | self.ui.ui.sign_in_label.isEnabled(), False) |
1846 | 45 | 45 | self.assertEqual( | |
1847 | 46 | def test_stage_1(self): | 46 | self.ui.ui.choose_services_label.isEnabled(), False) |
1848 | 47 | """Check that each stage in the widget enables the right labels.""" | 47 | self.assertEqual( |
1849 | 48 | self.ui.set_stage(1) | 48 | self.ui.ui.select_folders_label.isEnabled(), False) |
1850 | 49 | self.assertEqual( | 49 | self.assertEqual( |
1851 | 50 | self.ui.ui.install_label.isEnabled(), True) | 50 | self.ui.ui.sync_label.isEnabled(), False) |
1852 | 51 | self.assertEqual( | 51 | self.check_state_pixmap(0) |
1853 | 52 | self.ui.ui.sign_in_label.isEnabled(), True) | 52 | |
1854 | 53 | self.assertEqual( | 53 | def test_stage_1(self): |
1855 | 54 | self.ui.ui.choose_services_label.isEnabled(), False) | 54 | """Check that each stage in the widget enables the right labels.""" |
1856 | 55 | self.assertEqual( | 55 | self.ui.set_stage(1) |
1857 | 56 | self.ui.ui.select_folders_label.isEnabled(), False) | 56 | self.assertEqual( |
1858 | 57 | self.assertEqual( | 57 | self.ui.ui.install_label.isEnabled(), True) |
1859 | 58 | self.ui.ui.sync_label.isEnabled(), False) | 58 | self.assertEqual( |
1860 | 59 | 59 | self.ui.ui.sign_in_label.isEnabled(), True) | |
1861 | 60 | def test_stage_2(self): | 60 | self.assertEqual( |
1862 | 61 | """Check that each stage in the widget enables the right labels.""" | 61 | self.ui.ui.choose_services_label.isEnabled(), False) |
1863 | 62 | self.ui.set_stage(2) | 62 | self.assertEqual( |
1864 | 63 | self.assertEqual( | 63 | self.ui.ui.select_folders_label.isEnabled(), False) |
1865 | 64 | self.ui.ui.install_label.isEnabled(), True) | 64 | self.assertEqual( |
1866 | 65 | self.assertEqual( | 65 | self.ui.ui.sync_label.isEnabled(), False) |
1867 | 66 | self.ui.ui.sign_in_label.isEnabled(), True) | 66 | self.check_state_pixmap(1) |
1868 | 67 | self.assertEqual( | 67 | |
1869 | 68 | self.ui.ui.choose_services_label.isEnabled(), True) | 68 | def test_stage_2(self): |
1870 | 69 | self.assertEqual( | 69 | """Check that each stage in the widget enables the right labels.""" |
1871 | 70 | self.ui.ui.select_folders_label.isEnabled(), False) | 70 | self.ui.set_stage(2) |
1872 | 71 | self.assertEqual( | 71 | self.assertEqual( |
1873 | 72 | self.ui.ui.sync_label.isEnabled(), False) | 72 | self.ui.ui.install_label.isEnabled(), True) |
1874 | 73 | 73 | self.assertEqual( | |
1875 | 74 | def test_stage_3(self): | 74 | self.ui.ui.sign_in_label.isEnabled(), True) |
1876 | 75 | """Check that each stage in the widget enables the right labels.""" | 75 | self.assertEqual( |
1877 | 76 | self.ui.set_stage(3) | 76 | self.ui.ui.choose_services_label.isEnabled(), True) |
1878 | 77 | self.assertEqual( | 77 | self.assertEqual( |
1879 | 78 | self.ui.ui.install_label.isEnabled(), True) | 78 | self.ui.ui.select_folders_label.isEnabled(), False) |
1880 | 79 | self.assertEqual( | 79 | self.assertEqual( |
1881 | 80 | self.ui.ui.sign_in_label.isEnabled(), True) | 80 | self.ui.ui.sync_label.isEnabled(), False) |
1882 | 81 | self.assertEqual( | 81 | self.check_state_pixmap(2) |
1883 | 82 | self.ui.ui.choose_services_label.isEnabled(), True) | 82 | |
1884 | 83 | self.assertEqual( | 83 | def test_stage_3(self): |
1885 | 84 | self.ui.ui.select_folders_label.isEnabled(), True) | 84 | """Check that each stage in the widget enables the right labels.""" |
1886 | 85 | self.assertEqual( | 85 | self.ui.set_stage(3) |
1887 | 86 | self.ui.ui.sync_label.isEnabled(), False) | 86 | self.assertEqual( |
1888 | 87 | 87 | self.ui.ui.install_label.isEnabled(), True) | |
1889 | 88 | def test_stage_4(self): | 88 | self.assertEqual( |
1890 | 89 | """Check that each stage in the widget enables the right labels.""" | 89 | self.ui.ui.sign_in_label.isEnabled(), True) |
1891 | 90 | self.ui.set_stage(4) | 90 | self.assertEqual( |
1892 | 91 | self.assertEqual( | 91 | self.ui.ui.choose_services_label.isEnabled(), True) |
1893 | 92 | self.ui.ui.install_label.isEnabled(), True) | 92 | self.assertEqual( |
1894 | 93 | self.assertEqual( | 93 | self.ui.ui.select_folders_label.isEnabled(), True) |
1895 | 94 | self.ui.ui.sign_in_label.isEnabled(), True) | 94 | self.assertEqual( |
1896 | 95 | self.assertEqual( | 95 | self.ui.ui.sync_label.isEnabled(), False) |
1897 | 96 | self.ui.ui.choose_services_label.isEnabled(), True) | 96 | self.check_state_pixmap(3) |
1898 | 97 | self.assertEqual( | 97 | |
1899 | 98 | self.ui.ui.select_folders_label.isEnabled(), True) | 98 | def test_stage_4(self): |
1900 | 99 | self.assertEqual( | 99 | """Check that each stage in the widget enables the right labels.""" |
1901 | 100 | self.ui.ui.sync_label.isEnabled(), True) | 100 | self.ui.set_stage(4) |
1902 | 101 | self.assertEqual( | ||
1903 | 102 | self.ui.ui.install_label.isEnabled(), True) | ||
1904 | 103 | self.assertEqual( | ||
1905 | 104 | self.ui.ui.sign_in_label.isEnabled(), True) | ||
1906 | 105 | self.assertEqual( | ||
1907 | 106 | self.ui.ui.choose_services_label.isEnabled(), True) | ||
1908 | 107 | self.assertEqual( | ||
1909 | 108 | self.ui.ui.select_folders_label.isEnabled(), True) | ||
1910 | 109 | self.assertEqual( | ||
1911 | 110 | self.ui.ui.sync_label.isEnabled(), True) | ||
1912 | 111 | self.check_state_pixmap(4) | ||
1913 | 112 | |||
1914 | 113 | def get_pixmap_data(self, pixmap): | ||
1915 | 114 | """Get the raw data of a QPixmap.""" | ||
1916 | 115 | byte_array = QtCore.QByteArray() | ||
1917 | 116 | array_buffer = QtCore.QBuffer(byte_array) | ||
1918 | 117 | pixmap.save(array_buffer, "PNG") | ||
1919 | 118 | return byte_array | ||
1920 | 119 | |||
1921 | 120 | # Invalid name "assertEqualPixmap" | ||
1922 | 121 | # pylint: disable=C0103 | ||
1923 | 122 | |||
1924 | 123 | def assertEqualPixmaps(self, pixmap1, pixmap2): | ||
1925 | 124 | """Compare two Qt pixmaps.""" | ||
1926 | 125 | d1 = self.get_pixmap_data(pixmap1) | ||
1927 | 126 | d2 = self.get_pixmap_data(pixmap2) | ||
1928 | 127 | self.assertEqual(d1, d2) | ||
1929 | 128 | |||
1930 | 129 | def check_state_pixmap(self, stage): | ||
1931 | 130 | """Check if each label has the proper pixmap depending on the state.""" | ||
1932 | 131 | print stage | ||
1933 | 132 | active_pixmap = QtGui.QPixmap(":/progress_arrow_orange.png") | ||
1934 | 133 | no_active_pixmap = QtGui.QPixmap(":/progress_arrow_grey.png") | ||
1935 | 134 | complete_pixmap = QtGui.QPixmap(":/progress_tick.png") | ||
1936 | 135 | sync_active_pixmap = QtGui.QPixmap(":/progress_finish_orange.png") | ||
1937 | 136 | sync_no_active_pixmap = QtGui.QPixmap(":/progress_finish_grey.png") | ||
1938 | 137 | labels = ( | ||
1939 | 138 | self.ui.ui.install_icon_label, | ||
1940 | 139 | self.ui.ui.sign_icon_label, | ||
1941 | 140 | self.ui.ui.choose_icon_label, | ||
1942 | 141 | self.ui.ui.folders_icon_label, | ||
1943 | 142 | self.ui.ui.sync_icon_label) | ||
1944 | 143 | |||
1945 | 144 | for item in labels[:stage]: | ||
1946 | 145 | self.assertEqualPixmaps(complete_pixmap, item.pixmap()) | ||
1947 | 146 | |||
1948 | 147 | if stage != 4: | ||
1949 | 148 | self.assertEqualPixmaps(active_pixmap, labels[stage].pixmap()) | ||
1950 | 149 | else: | ||
1951 | 150 | self.assertEqualPixmaps(sync_active_pixmap, labels[4].pixmap()) | ||
1952 | 151 | |||
1953 | 152 | if stage < 4: | ||
1954 | 153 | for item in labels[stage + 1:len(labels) - 1]: | ||
1955 | 154 | self.assertEqualPixmaps(no_active_pixmap, item.pixmap()) | ||
1956 | 155 | self.assertEqualPixmaps(sync_no_active_pixmap, labels[4].pixmap()) |
This branch had 2 approves when it was proposed by Diego, this MP is exactly the same, but with two conflicts resolved.