Merge lp:~ralsina/ubuntuone-windows-installer/diego-installer-ui into lp:ubuntuone-windows-installer

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
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.
Revision history for this message
Roberto Alsina (ralsina) wrote :

This branch had 2 approves when it was proposed by Diego, this MP is exactly the same, but with two conflicts resolved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'data/Ubuntu-R.ttf'
0Binary files data/Ubuntu-R.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-R.ttf 2011-07-22 16:39:49 +0000 differ0Binary 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
=== added file 'data/balloon_shape.png'
1Binary files data/balloon_shape.png 1970-01-01 00:00:00 +0000 and data/balloon_shape.png 2011-07-22 16:39:49 +0000 differ1Binary 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
=== added file 'data/password_hint_ok.png'
2Binary 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 differ2Binary 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
=== added file 'data/password_hint_warning.png'
3Binary 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 differ3Binary 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
=== added file 'data/progress_arrow_grey.png'
4Binary 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 differ4Binary 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
=== added file 'data/progress_arrow_orange.png'
5Binary 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 differ5Binary 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
=== added file 'data/progress_finish_grey.png'
6Binary 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 differ6Binary 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
=== added file 'data/progress_finish_orange.png'
7Binary 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 differ7Binary 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
=== added file 'data/progress_tick.png'
8Binary files data/progress_tick.png 1970-01-01 00:00:00 +0000 and data/progress_tick.png 2011-07-22 16:39:49 +0000 differ8Binary 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
=== modified file 'data/qt/choose_sign_in.ui'
--- data/qt/choose_sign_in.ui 2011-07-02 01:20:51 +0000
+++ data/qt/choose_sign_in.ui 2011-07-22 16:39:49 +0000
@@ -44,13 +44,14 @@
44 </size>44 </size>
45 </property>45 </property>
46 <property name="text">46 <property name="text">
47 <string>image47 <string/>
48
49[This will be the same image as appears on Ubuntu One Home page on the web - in production]</string>
50 </property>48 </property>
51 <property name="textFormat">49 <property name="textFormat">
52 <enum>Qt::PlainText</enum>50 <enum>Qt::PlainText</enum>
53 </property>51 </property>
52 <property name="pixmap">
53 <pixmap resource="images.qrc">:/win_install_img_placeholder.png</pixmap>
54 </property>
54 <property name="alignment">55 <property name="alignment">
55 <set>Qt::AlignCenter</set>56 <set>Qt::AlignCenter</set>
56 </property>57 </property>
@@ -93,7 +94,7 @@
93 </property>94 </property>
94 <property name="sizeHint" stdset="0">95 <property name="sizeHint" stdset="0">
95 <size>96 <size>
96 <width>40</width>97 <width>20</width>
97 <height>20</height>98 <height>20</height>
98 </size>99 </size>
99 </property>100 </property>
@@ -129,9 +130,12 @@
129 <property name="orientation">130 <property name="orientation">
130 <enum>Qt::Horizontal</enum>131 <enum>Qt::Horizontal</enum>
131 </property>132 </property>
133 <property name="sizeType">
134 <enum>QSizePolicy::Expanding</enum>
135 </property>
132 <property name="sizeHint" stdset="0">136 <property name="sizeHint" stdset="0">
133 <size>137 <size>
134 <width>40</width>138 <width>20</width>
135 <height>20</height>139 <height>20</height>
136 </size>140 </size>
137 </property>141 </property>
@@ -154,6 +158,8 @@
154 </item>158 </item>
155 </layout>159 </layout>
156 </widget>160 </widget>
157 <resources/>161 <resources>
162 <include location="images.qrc"/>
163 </resources>
158 <connections/>164 <connections/>
159</ui>165</ui>
160166
=== added file 'data/qt/images.qrc'
--- data/qt/images.qrc 1970-01-01 00:00:00 +0000
+++ data/qt/images.qrc 2011-07-22 16:39:49 +0000
@@ -0,0 +1,17 @@
1<RCC>
2 <qresource prefix="/">
3 <file>../balloon_shape.png</file>
4 <file>../password_hint_ok.png</file>
5 <file>../password_hint_warning.png</file>
6 <file>../Ubuntu-R.ttf</file>
7 <file>ubuntuone.qss</file>
8 <file>../progress_arrow_grey.png</file>
9 <file>../u1_logo.png</file>
10 <file>../progress_arrow_orange.png</file>
11 <file>../progress_finish_grey.png</file>
12 <file>../progress_finish_orange.png</file>
13 <file>../progress_tick.png</file>
14 <file>../u1icon.png</file>
15 <file>../win_install_img_placeholder.png</file>
16 </qresource>
17</RCC>
018
=== modified file 'data/qt/license.ui'
--- data/qt/license.ui 2011-06-21 18:45:09 +0000
+++ data/qt/license.ui 2011-07-22 16:39:49 +0000
@@ -20,14 +20,14 @@
20 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;20 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
21&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;21&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
22p, li { white-space: pre-wrap; }22p, li { white-space: pre-wrap; }
23&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;23&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
24&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:14pt; font-weight:600;&quot;&gt;License Agreement&lt;/span&gt;&lt;/p&gt;24&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:600;&quot;&gt;License Agreement&lt;/span&gt;&lt;/p&gt;
25&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;25&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;
26&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;26&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;
27&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;27&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;
28&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Ubuntu One Basic is free, while additional service add-ons may be paid for services.&lt;/span&gt;&lt;/p&gt;28&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Ubuntu One Basic is free, while additional service add-ons may be paid for services.&lt;/span&gt;&lt;/p&gt;
29&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;29&lt;p style=&quot;-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;&quot;&gt;&lt;/p&gt;
30&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;As free software, this programme is distributed without warranty. See the GNU General Public License for more details at &lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/licenses&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>30&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;As free software, this programme is distributed without warranty. See the GNU General Public License for more details at &lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/licenses&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#dd4814;&quot;&gt;http://www.gnu.org/licenses&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
31 </property>31 </property>
32 <property name="openExternalLinks">32 <property name="openExternalLinks">
33 <bool>true</bool>33 <bool>true</bool>
3434
=== modified file 'data/qt/setup_account.ui'
--- data/qt/setup_account.ui 2011-07-01 20:33:17 +0000
+++ data/qt/setup_account.ui 2011-07-22 16:39:49 +0000
@@ -6,8 +6,8 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>482</width>9 <width>631</width>
10 <height>514</height>10 <height>527</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="windowTitle">13 <property name="windowTitle">
@@ -15,7 +15,7 @@
15 </property>15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">16 <layout class="QVBoxLayout" name="verticalLayout">
17 <item>17 <item>
18 <layout class="QGridLayout" name="gridLayout">18 <layout class="QGridLayout" name="gridLayout" columnminimumwidth="1,250">
19 <item row="0" column="0">19 <item row="0" column="0">
20 <widget class="QLabel" name="password_info_label">20 <widget class="QLabel" name="password_info_label">
21 <property name="sizePolicy">21 <property name="sizePolicy">
@@ -25,7 +25,7 @@
25 </sizepolicy>25 </sizepolicy>
26 </property>26 </property>
27 <property name="text">27 <property name="text">
28 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>28 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
29 </property>29 </property>
30 <property name="wordWrap">30 <property name="wordWrap">
31 <bool>true</bool>31 <bool>true</bool>
@@ -35,7 +35,7 @@
35 <item row="1" column="0">35 <item row="1" column="0">
36 <widget class="QLabel" name="name_label">36 <widget class="QLabel" name="name_label">
37 <property name="text">37 <property name="text">
38 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>38 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
39 </property>39 </property>
40 </widget>40 </widget>
41 </item>41 </item>
@@ -49,14 +49,17 @@
49 <item row="2" column="1">49 <item row="2" column="1">
50 <widget class="QLabel" name="name_assistance">50 <widget class="QLabel" name="name_assistance">
51 <property name="text">51 <property name="text">
52 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>52 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
53 </property>
54 <property name="indent">
55 <number>20</number>
53 </property>56 </property>
54 </widget>57 </widget>
55 </item>58 </item>
56 <item row="3" column="0">59 <item row="3" column="0">
57 <widget class="QLabel" name="email_label">60 <widget class="QLabel" name="email_label">
58 <property name="text">61 <property name="text">
59 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>62 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
60 </property>63 </property>
61 </widget>64 </widget>
62 </item>65 </item>
@@ -70,14 +73,17 @@
70 <item row="4" column="1">73 <item row="4" column="1">
71 <widget class="QLabel" name="email_assistance">74 <widget class="QLabel" name="email_assistance">
72 <property name="text">75 <property name="text">
73 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>76 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
77 </property>
78 <property name="indent">
79 <number>20</number>
74 </property>80 </property>
75 </widget>81 </widget>
76 </item>82 </item>
77 <item row="5" column="0">83 <item row="5" column="0">
78 <widget class="QLabel" name="confirm_email_label">84 <widget class="QLabel" name="confirm_email_label">
79 <property name="text">85 <property name="text">
80 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>86 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
81 </property>87 </property>
82 </widget>88 </widget>
83 </item>89 </item>
@@ -91,14 +97,17 @@
91 <item row="6" column="1">97 <item row="6" column="1">
92 <widget class="QLabel" name="confirm_email_assistance">98 <widget class="QLabel" name="confirm_email_assistance">
93 <property name="text">99 <property name="text">
94 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>100 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
101 </property>
102 <property name="indent">
103 <number>20</number>
95 </property>104 </property>
96 </widget>105 </widget>
97 </item>106 </item>
98 <item row="7" column="0">107 <item row="7" column="0">
99 <widget class="QLabel" name="password_label">108 <widget class="QLabel" name="password_label">
100 <property name="text">109 <property name="text">
101 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>110 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
102 </property>111 </property>
103 </widget>112 </widget>
104 </item>113 </item>
@@ -121,14 +130,17 @@
121 <item row="9" column="0">130 <item row="9" column="0">
122 <widget class="QLabel" name="confirm_password_label">131 <widget class="QLabel" name="confirm_password_label">
123 <property name="text">132 <property name="text">
124 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>133 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
125 </property>134 </property>
126 </widget>135 </widget>
127 </item>136 </item>
128 <item row="8" column="1" rowspan="3">137 <item row="8" column="1" rowspan="3">
129 <widget class="QLabel" name="password_assistance">138 <widget class="QLabel" name="password_assistance">
130 <property name="text">139 <property name="text">
131 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>140 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
141 </property>
142 <property name="indent">
143 <number>20</number>
132 </property>144 </property>
133 </widget>145 </widget>
134 </item>146 </item>
@@ -163,26 +175,7 @@
163 <enum>QFrame::Box</enum>175 <enum>QFrame::Box</enum>
164 </property>176 </property>
165 <property name="text">177 <property name="text">
166 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>178 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
167 </property>
168 </widget>
169 </item>
170 <item row="11" column="1">
171 <widget class="QLabel" name="refresh_label">
172 <property name="sizePolicy">
173 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
174 <horstretch>0</horstretch>
175 <verstretch>0</verstretch>
176 </sizepolicy>
177 </property>
178 <property name="locale">
179 <locale language="English" country="UnitedStates"/>
180 </property>
181 <property name="text">
182 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
183 </property>
184 <property name="wordWrap">
185 <bool>true</bool>
186 </property>179 </property>
187 </widget>180 </widget>
188 </item>181 </item>
@@ -202,6 +195,28 @@
202 </property>195 </property>
203 </widget>196 </widget>
204 </item>197 </item>
198 <item row="11" column="1">
199 <widget class="QLabel" name="refresh_label">
200 <property name="sizePolicy">
201 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
202 <horstretch>0</horstretch>
203 <verstretch>0</verstretch>
204 </sizepolicy>
205 </property>
206 <property name="locale">
207 <locale language="English" country="UnitedStates"/>
208 </property>
209 <property name="text">
210 <string>If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
211 </property>
212 <property name="wordWrap">
213 <bool>true</bool>
214 </property>
215 <property name="indent">
216 <number>20</number>
217 </property>
218 </widget>
219 </item>
205 </layout>220 </layout>
206 </item>221 </item>
207 <item>222 <item>
@@ -250,6 +265,8 @@
250 </item>265 </item>
251 </layout>266 </layout>
252 </widget>267 </widget>
253 <resources/>268 <resources>
269 <include location="images.qrc"/>
270 </resources>
254 <connections/>271 <connections/>
255</ui>272</ui>
256273
=== modified file 'data/qt/side_widget.ui'
--- data/qt/side_widget.ui 2011-07-04 17:39:31 +0000
+++ data/qt/side_widget.ui 2011-07-22 16:39:49 +0000
@@ -1,77 +1,249 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">2<ui version="4.0">
3 <class>Form</class>3 <class>SideWidget</class>
4 <widget class="QWidget" name="Form">4 <widget class="QFrame" name="SideWidget">
5 <property name="geometry">5 <property name="geometry">
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>185</width>9 <width>200</width>
10 <height>511</height>10 <height>563</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="sizePolicy">
14 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
15 <horstretch>0</horstretch>
16 <verstretch>0</verstretch>
17 </sizepolicy>
18 </property>
19 <property name="minimumSize">
20 <size>
21 <width>200</width>
22 <height>0</height>
23 </size>
24 </property>
13 <property name="windowTitle">25 <property name="windowTitle">
14 <string>Form</string>26 <string>Frame</string>
27 </property>
28 <property name="frameShape">
29 <enum>QFrame::StyledPanel</enum>
30 </property>
31 <property name="frameShadow">
32 <enum>QFrame::Raised</enum>
15 </property>33 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">34 <layout class="QVBoxLayout" name="verticalLayout">
17 <property name="spacing">35 <property name="spacing">
18 <number>20</number>36 <number>40</number>
19 </property>37 </property>
20 <item>38 <property name="margin">
21 <widget class="QLabel" name="label">39 <number>10</number>
22 <property name="text">40 </property>
23 <string>Ubuntu One logo</string>41 <item>
24 </property>42 <widget class="QLabel" name="ubuntu_one_logo_label">
25 </widget>43 <property name="sizePolicy">
26 </item>44 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
27 <item>45 <horstretch>0</horstretch>
28 <widget class="QLabel" name="install_label">46 <verstretch>0</verstretch>
29 <property name="enabled">47 </sizepolicy>
30 <bool>true</bool>48 </property>
31 </property>49 <property name="text">
32 <property name="text">50 <string/>
33 <string>Install</string>51 </property>
34 </property>52 <property name="pixmap">
35 </widget>53 <pixmap resource="images.qrc">:/u1_logo.png</pixmap>
36 </item>54 </property>
37 <item>55 </widget>
38 <widget class="QLabel" name="sign_in_label">56 </item>
39 <property name="enabled">57 <item>
40 <bool>true</bool>58 <widget class="QFrame" name="states_frame">
41 </property>59 <property name="sizePolicy">
42 <property name="text">60 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
43 <string>Sign In</string>61 <horstretch>0</horstretch>
44 </property>62 <verstretch>0</verstretch>
45 </widget>63 </sizepolicy>
46 </item>64 </property>
47 <item>65 <property name="frameShape">
48 <widget class="QLabel" name="choose_services_label">66 <enum>QFrame::StyledPanel</enum>
49 <property name="enabled">67 </property>
50 <bool>true</bool>68 <property name="frameShadow">
51 </property>69 <enum>QFrame::Raised</enum>
52 <property name="text">70 </property>
53 <string>Choose services</string>71 <layout class="QVBoxLayout" name="verticalLayout_2">
54 </property>72 <property name="spacing">
55 </widget>73 <number>20</number>
56 </item>74 </property>
57 <item>75 <property name="margin">
58 <widget class="QLabel" name="select_folders_label">76 <number>0</number>
59 <property name="enabled">77 </property>
60 <bool>true</bool>78 <item>
61 </property>79 <layout class="QHBoxLayout" name="horizontalLayout">
62 <property name="text">80 <property name="spacing">
63 <string>Select sync folders</string>81 <number>7</number>
64 </property>82 </property>
65 </widget>83 <item>
66 </item>84 <widget class="QLabel" name="install_icon_label">
67 <item>85 <property name="sizePolicy">
68 <widget class="QLabel" name="sync_label">86 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
69 <property name="enabled">87 <horstretch>0</horstretch>
70 <bool>true</bool>88 <verstretch>0</verstretch>
71 </property>89 </sizepolicy>
72 <property name="text">90 </property>
73 <string>Sync, stream, share!</string>91 <property name="text">
74 </property>92 <string/>
93 </property>
94 <property name="pixmap">
95 <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap>
96 </property>
97 </widget>
98 </item>
99 <item>
100 <widget class="QLabel" name="install_label">
101 <property name="enabled">
102 <bool>true</bool>
103 </property>
104 <property name="text">
105 <string>Install</string>
106 </property>
107 </widget>
108 </item>
109 </layout>
110 </item>
111 <item>
112 <layout class="QHBoxLayout" name="horizontalLayout_2">
113 <property name="spacing">
114 <number>7</number>
115 </property>
116 <property name="sizeConstraint">
117 <enum>QLayout::SetDefaultConstraint</enum>
118 </property>
119 <item>
120 <widget class="QLabel" name="sign_icon_label">
121 <property name="sizePolicy">
122 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
123 <horstretch>0</horstretch>
124 <verstretch>0</verstretch>
125 </sizepolicy>
126 </property>
127 <property name="text">
128 <string/>
129 </property>
130 <property name="pixmap">
131 <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap>
132 </property>
133 </widget>
134 </item>
135 <item>
136 <widget class="QLabel" name="sign_in_label">
137 <property name="enabled">
138 <bool>true</bool>
139 </property>
140 <property name="text">
141 <string>Sign In</string>
142 </property>
143 </widget>
144 </item>
145 </layout>
146 </item>
147 <item>
148 <layout class="QHBoxLayout" name="horizontalLayout_3">
149 <property name="spacing">
150 <number>7</number>
151 </property>
152 <item>
153 <widget class="QLabel" name="choose_icon_label">
154 <property name="sizePolicy">
155 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
156 <horstretch>0</horstretch>
157 <verstretch>0</verstretch>
158 </sizepolicy>
159 </property>
160 <property name="text">
161 <string/>
162 </property>
163 <property name="pixmap">
164 <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap>
165 </property>
166 </widget>
167 </item>
168 <item>
169 <widget class="QLabel" name="choose_services_label">
170 <property name="enabled">
171 <bool>true</bool>
172 </property>
173 <property name="text">
174 <string>Choose services</string>
175 </property>
176 </widget>
177 </item>
178 </layout>
179 </item>
180 <item>
181 <layout class="QHBoxLayout" name="horizontalLayout_4">
182 <property name="spacing">
183 <number>7</number>
184 </property>
185 <item>
186 <widget class="QLabel" name="folders_icon_label">
187 <property name="sizePolicy">
188 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
189 <horstretch>0</horstretch>
190 <verstretch>0</verstretch>
191 </sizepolicy>
192 </property>
193 <property name="text">
194 <string/>
195 </property>
196 <property name="pixmap">
197 <pixmap resource="images.qrc">:/progress_arrow_grey.png</pixmap>
198 </property>
199 </widget>
200 </item>
201 <item>
202 <widget class="QLabel" name="select_folders_label">
203 <property name="enabled">
204 <bool>true</bool>
205 </property>
206 <property name="text">
207 <string>Select sync folders</string>
208 </property>
209 </widget>
210 </item>
211 </layout>
212 </item>
213 <item>
214 <layout class="QHBoxLayout" name="horizontalLayout_5">
215 <property name="spacing">
216 <number>7</number>
217 </property>
218 <item>
219 <widget class="QLabel" name="sync_icon_label">
220 <property name="sizePolicy">
221 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
222 <horstretch>0</horstretch>
223 <verstretch>0</verstretch>
224 </sizepolicy>
225 </property>
226 <property name="text">
227 <string/>
228 </property>
229 <property name="pixmap">
230 <pixmap resource="images.qrc">:/progress_finish_grey.png</pixmap>
231 </property>
232 </widget>
233 </item>
234 <item>
235 <widget class="QLabel" name="sync_label">
236 <property name="enabled">
237 <bool>true</bool>
238 </property>
239 <property name="text">
240 <string>Sync, stream, share!</string>
241 </property>
242 </widget>
243 </item>
244 </layout>
245 </item>
246 </layout>
75 </widget>247 </widget>
76 </item>248 </item>
77 <item>249 <item>
@@ -82,13 +254,15 @@
82 <property name="sizeHint" stdset="0">254 <property name="sizeHint" stdset="0">
83 <size>255 <size>
84 <width>20</width>256 <width>20</width>
85 <height>292</height>257 <height>40</height>
86 </size>258 </size>
87 </property>259 </property>
88 </spacer>260 </spacer>
89 </item>261 </item>
90 </layout>262 </layout>
91 </widget>263 </widget>
92 <resources/>264 <resources>
265 <include location="images.qrc"/>
266 </resources>
93 <connections/>267 <connections/>
94</ui>268</ui>
95269
=== added file 'data/qt/ubuntuone.qss'
--- data/qt/ubuntuone.qss 1970-01-01 00:00:00 +0000
+++ data/qt/ubuntuone.qss 2011-07-22 16:39:49 +0000
@@ -0,0 +1,96 @@
1QFrame#SideWidget {
2 background-color: white;
3 border-style: dotted;
4 border-color: #939389;
5 border-right-width: 1px;
6 color: white;
7 min-height: 100px;
8 margin-left: 10px;
9}
10
11QWizard,
12QDialog{
13 background-color: white;
14}
15
16QLabel#name_assistance,
17QLabel#email_assistance,
18QLabel#confirm_email_assistance,
19QLabel#password_assistance,
20QLabel#refresh_label{
21 border-image: url(":/balloon_shape.png");
22 padding-right: 2px;
23}
24
25QLabel#install_label,
26QLabel#sign_in_label,
27QLabel#choose_services_label,
28QLabel#select_folders_label,
29QLabel#sync_label{
30 font-size: 14px;
31}
32
33QTextEdit{
34 background-color: #ffffff;
35 border: none;
36}
37
38QPushButton[enabled="false"] {
39 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
40 stop: 0 #fecfc2,stop: 1.0 #df4d1a);
41 border-radius: 5px;
42 border-style: solid;
43 padding: 6px;
44 padding-left: 20px;
45 padding-right: 20px;
46 color: white;
47 border-color: #939389;
48 border-width: 1px;
49 height: 14px;
50 font-size: 12px;
51}
52
53QPushButton[enabled="true"] {
54 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
55 stop: 0 #eaeaea, stop: 1.0 #cacaca);
56 border-radius: 5px;
57 border-style: solid;
58 padding: 6px;
59 padding-left: 20px;
60 padding-right: 20px;
61 color: #595959;
62 border-color: #939389;
63 border-width: 1px;
64 height: 14px;
65 font-size: 12px;
66}
67
68QPushButton:hover {
69 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
70 stop: 0 #feae99,stop: 1.0 #df4e1c);
71 border-radius: 5px;
72 border-style: solid;
73 padding: 6px;
74 color: white;
75 border-color: #939389;
76 border-width: 1px;
77 height: 12px;
78}
79
80QPushButton:pressed {
81 background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
82 stop: 0 #ba3f14,stop: 1.0 #db4714);
83 border-radius: 5px;
84 border-style: solid;
85 padding: 6px;
86 color: white;
87 border-color: #939389;
88 border-width: 1px;
89 height: 12px;
90}
91
92QWidget{
93 font-family: "Ubuntu";
94 color: #333333;
95 font-size: 12px;
96}
097
=== added file 'data/u1_logo.png'
1Binary files data/u1_logo.png 1970-01-01 00:00:00 +0000 and data/u1_logo.png 2011-07-22 16:39:49 +0000 differ98Binary 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
=== added file 'data/u1icon.png'
2Binary files data/u1icon.png 1970-01-01 00:00:00 +0000 and data/u1icon.png 2011-07-22 16:39:49 +0000 differ99Binary files data/u1icon.png 1970-01-01 00:00:00 +0000 and data/u1icon.png 2011-07-22 16:39:49 +0000 differ
=== added file 'data/win_install_img_placeholder.png'
3Binary 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 differ100Binary 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
=== modified file 'ubuntuone_installer/gui/qt/gui.py'
--- ubuntuone_installer/gui/qt/gui.py 2011-07-19 17:16:11 +0000
+++ ubuntuone_installer/gui/qt/gui.py 2011-07-22 16:39:49 +0000
@@ -66,6 +66,12 @@
66 license_ui,66 license_ui,
67 setup_account_ui,67 setup_account_ui,
68)68)
69
70# Module used to include the resources into this file
71# pylint: disable=W0611
72from ubuntuone_installer.gui.qt.ui import images_rc
73# pylint: enable=W0611
74
69from ubuntuone_installer.gui.qt.are_you_sure import AreYouSure75from ubuntuone_installer.gui.qt.are_you_sure import AreYouSure
70from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage76from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage
71from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage77from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage
@@ -77,6 +83,7 @@
77SIGN_IN = _("Sign in to Ubuntu One")83SIGN_IN = _("Sign in to Ubuntu One")
78SIGN_IN_SUBTITLE = _("Sign in with your existing Ubuntu One"84SIGN_IN_SUBTITLE = _("Sign in with your existing Ubuntu One"
79 " username and password.")85 " username and password.")
86TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>"
8087
81# Invalid name logger88# Invalid name logger
82# pylint: disable=C010389# pylint: disable=C0103
@@ -114,9 +121,9 @@
114 self.wizard().customButtonClicked.connect(self.print_document)121 self.wizard().customButtonClicked.connect(self.print_document)
115122
116 self.wizard().setButtonLayout([123 self.wizard().setButtonLayout([
124 QtGui.QWizard.CancelButton,
125 QtGui.QWizard.Stretch,
117 QtGui.QWizard.CustomButton1,126 QtGui.QWizard.CustomButton1,
118 QtGui.QWizard.Stretch,
119 QtGui.QWizard.CancelButton,
120 QtGui.QWizard.BackButton,127 QtGui.QWizard.BackButton,
121 QtGui.QWizard.NextButton,128 QtGui.QWizard.NextButton,
122 QtGui.QWizard.FinishButton,129 QtGui.QWizard.FinishButton,
@@ -194,9 +201,9 @@
194 # Layout without custom button 1,201 # Layout without custom button 1,
195 # without finish button202 # without finish button
196 self.wizard().setButtonLayout([203 self.wizard().setButtonLayout([
204 QtGui.QWizard.CancelButton,
197 QtGui.QWizard.Stretch,205 QtGui.QWizard.Stretch,
198 QtGui.QWizard.BackButton,206 QtGui.QWizard.BackButton,
199 QtGui.QWizard.CancelButton,
200 ])207 ])
201208
202209
@@ -287,6 +294,10 @@
287 self.help_text = ""294 self.help_text = ""
288295
289 super(MainWindow, self).__init__()296 super(MainWindow, self).__init__()
297 self.setWindowTitle(APP_NAME)
298 self.setMinimumHeight(630)
299 self.setMinimumWidth(800)
300 self.setTitleFormat(QtCore.Qt.RichText)
290 self.setWizardStyle(self.ModernStyle)301 self.setWizardStyle(self.ModernStyle)
291 self.close_callback = close_callback302 self.close_callback = close_callback
292303
@@ -300,7 +311,9 @@
300 self.LICENSE_PAGE = self.addPage(LicensePage())311 self.LICENSE_PAGE = self.addPage(LicensePage())
301312
302 #SSO Pages313 #SSO Pages
303 self.sign_in_controller = ChooseSignInController(title=SIGN_IN)314 title_page = TITLE_STYLE % SIGN_IN
315 self.sign_in_controller = ChooseSignInController(
316 title=title_page)
304 self.sign_in_page = SignInPage(317 self.sign_in_page = SignInPage(
305 ui=choose_sign_in_ui.Ui_ChooseSignInPage(),318 ui=choose_sign_in_ui.Ui_ChooseSignInPage(),
306 controller=self.sign_in_controller,319 controller=self.sign_in_controller,
@@ -310,15 +323,17 @@
310 setup_account_ui.Ui_SetUpAccountPage(),323 setup_account_ui.Ui_SetUpAccountPage(),
311 self.setup_controller,324 self.setup_controller,
312 parent=self)325 parent=self)
326 title_page = TITLE_STYLE % _("Ubuntu One Terms of Service")
313 self.tos = TosPage(Ui_TosPage(),327 self.tos = TosPage(Ui_TosPage(),
314 TosController(tos_url=TC_URL,328 TosController(tos_url=TC_URL,
315 title=_("Ubuntu One Terms of Service")),329 title=title_page),
316 parent=self)330 parent=self)
317 self.email_verification = EmailVerificationPage(331 self.email_verification = EmailVerificationPage(
318 Ui_EmailVerificationPage(),332 Ui_EmailVerificationPage(),
319 EmailVerificationController())333 EmailVerificationController())
334 title_page = TITLE_STYLE % SIGN_IN
320 self.current_user_controller = CurrentUserController(335 self.current_user_controller = CurrentUserController(
321 title=SIGN_IN, subtitle=SIGN_IN_SUBTITLE)336 title=title_page, subtitle=SIGN_IN_SUBTITLE)
322 self.current_user = CurrentUserSignInPage(Ui_CurrentUserSignInPage(),337 self.current_user = CurrentUserSignInPage(Ui_CurrentUserSignInPage(),
323 self.current_user_controller,338 self.current_user_controller,
324 parent=self)339 parent=self)
@@ -396,8 +411,10 @@
396 def on_currentIdChanged(self, page_id):411 def on_currentIdChanged(self, page_id):
397 """The current page changed."""412 """The current page changed."""
398 if page_id < self.SIGNIN_PAGE:413 if page_id < self.SIGNIN_PAGE:
414 self.sideWidget().ui.states_frame.hide()
399 self.sideWidget().set_stage(0)415 self.sideWidget().set_stage(0)
400 elif page_id < self.local_folders_page_id:416 elif page_id < self.local_folders_page_id:
417 self.sideWidget().ui.states_frame.show()
401 self.sideWidget().set_stage(1)418 self.sideWidget().set_stage(1)
402 elif page_id < self.CONGRATULATIONS_PAGE:419 elif page_id < self.CONGRATULATIONS_PAGE:
403 self.sideWidget().set_stage(3)420 self.sideWidget().set_stage(3)
404421
=== modified file 'ubuntuone_installer/gui/qt/local_folders.py'
--- ubuntuone_installer/gui/qt/local_folders.py 2011-07-19 00:38:27 +0000
+++ ubuntuone_installer/gui/qt/local_folders.py 2011-07-22 16:39:49 +0000
@@ -1,173 +1,173 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
22
3# Authors: Roberto Alsina <roberto.alsina@canonical.com>3# Authors: Roberto Alsina <roberto.alsina@canonical.com>
4#4#
5# Copyright 2011 Canonical Ltd.5# Copyright 2011 Canonical Ltd.
6#6#
7# This program is free software: you can redistribute it and/or modify it7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.9# by the Free Software Foundation.
10#10#
11# This program is distributed in the hope that it will be useful, but11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.14# PURPOSE. See the GNU General Public License for more details.
15#15#
16# You should have received a copy of the GNU General Public License along16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.17# with this program. If not, see <http://www.gnu.org/licenses/>.
1818
19"""Widget to create UDFs in the Windows Install Wizard."""19"""Widget to create UDFs in the Windows Install Wizard."""
2020
21import ctypes21import ctypes
22import os22import os
23import sys23import sys
24import threading24import threading
25import Queue25import Queue
2626
27from PyQt4 import QtCore, QtGui27from PyQt4 import QtCore, QtGui
2828
29from ubuntuone.controlpanel.gui import humanize29from ubuntuone.controlpanel.gui import humanize
3030
31from ubuntuone_installer.gui.qt.ui import local_folders_ui31from ubuntuone_installer.gui.qt.ui import local_folders_ui
32from ubuntuone_installer.gui import (32from ubuntuone_installer.gui import (
33 LOCAL_FOLDERS_TITLE,33 LOCAL_FOLDERS_TITLE,
34 LOCAL_FOLDERS_SPACE_HEADER,34 LOCAL_FOLDERS_SPACE_HEADER,
35 LOCAL_FOLDERS_OFFER_LABEL,35 LOCAL_FOLDERS_OFFER_LABEL,
36 LOCAL_FOLDERS_CALCULATING,36 LOCAL_FOLDERS_CALCULATING,
37)37)
3838
3939
40class FolderItem(QtGui.QTreeWidgetItem):40class FolderItem(QtGui.QTreeWidgetItem):
41 """Class representing a folder in the folder list UI."""41 """Class representing a folder in the folder list UI."""
42 def __init__(self, strings, path=None, queue=None):42 def __init__(self, strings, path=None, queue=None):
43 super(FolderItem, self).__init__(strings)43 super(FolderItem, self).__init__(strings)
44 self.thread = CalculateSize(path, queue)44 self.thread = CalculateSize(path, queue)
45 self.thread.start()45 self.thread.start()
46 self.size = None46 self.size = None
47 self.path = path47 self.path = path
4848
4949
50class CalculateSize(threading.Thread):50class CalculateSize(threading.Thread):
51 """Class to calculate the size of a folder in the background."""51 """Class to calculate the size of a folder in the background."""
52 def __init__(self, path_name, queue):52 def __init__(self, path_name, queue):
53 self.path_name = path_name53 self.path_name = path_name
54 self.queue = queue54 self.queue = queue
55 self._stop = False55 self._stop = False
56 super(CalculateSize, self).__init__()56 super(CalculateSize, self).__init__()
57 self.daemon = True57 self.daemon = True
5858
59 def run(self):59 def run(self):
60 total_size = 060 total_size = 0
61 for dirpath, _, filenames in os.walk(self.path_name):61 for dirpath, _, filenames in os.walk(self.path_name):
62 for f in filenames:62 for f in filenames:
63 fp = os.path.join(dirpath, f)63 fp = os.path.join(dirpath, f)
64 total_size += os.path.getsize(fp)64 total_size += os.path.getsize(fp)
65 self.queue.put([self.path_name, total_size])65 self.queue.put([self.path_name, total_size])
6666
6767
68class LocalFoldersPage(QtGui.QWizardPage):68class LocalFoldersPage(QtGui.QWizardPage):
69 """Wizard page to create UDFs in the Windows Installer."""69 """Wizard page to create UDFs in the Windows Installer."""
7070
71 def __init__(self, parent=None):71 def __init__(self, parent=None):
72 super(LocalFoldersPage, self).__init__(parent)72 super(LocalFoldersPage, self).__init__(parent)
73 self.setTitle(LOCAL_FOLDERS_TITLE)73 self.setTitle(LOCAL_FOLDERS_TITLE)
74 self.ui = local_folders_ui.Ui_Form()74 self.ui = local_folders_ui.Ui_Form()
75 self.ui.setupUi(self)75 self.ui.setupUi(self)
7676
77 header_view = self.ui.folder_list.header()77 header_view = self.ui.folder_list.header()
78 header_view.setResizeMode(0, header_view.Stretch)78 header_view.setResizeMode(0, header_view.Stretch)
7979
80 self.queue = Queue.Queue()80 self.queue = Queue.Queue()
81 self.timer = QtCore.QTimer()81 self.timer = QtCore.QTimer()
82 self.items = {}82 self.items = {}
83 for folder_name in self.default_folders():83 for folder_name in self.default_folders():
84 self.add_folder(folder_name)84 self.add_folder(folder_name)
85 self.update_sizes()85 self.update_sizes()
86 self.timer.start(2000)86 self.timer.start(2000)
87 self.timer.timeout.connect(self.update_sizes)87 self.timer.timeout.connect(self.update_sizes)
8888
89 # initializePage is inherited89 # initializePage is inherited
90 # pylint: disable=C010390 # pylint: disable=C0103
91 def initializePage(self):91 def initializePage(self):
92 """UI details."""92 """UI details."""
93 self.wizard()._next_id = None93 self.wizard()._next_id = None
9494
95 def quota(self):95 def quota(self):
96 """The quota available to the user."""96 """The quota available to the user."""
97 # FIXME: get this from real life97 # FIXME: get this from real life
98 return 2 * 1024 * 102498 return 2 * 1024 * 1024
9999
100 def default_folders(self):100 def default_folders(self):
101 """Return a list of the folders to add by default."""101 """Return a list of the folders to add by default."""
102 if sys.platform == 'win32':102 if sys.platform == 'win32':
103 # Special Folder "My Documents"103 # Special Folder "My Documents"
104 dll = ctypes.windll.shell32104 dll = ctypes.windll.shell32
105 buf = ctypes.create_string_buffer(300)105 buf = ctypes.create_string_buffer(300)
106 dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False)106 dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False)
107 result = [buf.value, ]107 result = [buf.value, ]
108 else:108 else:
109 result = ['To be implemented']109 result = ['To be implemented']
110 return result110 return result
111111
112 def add_folder(self, path):112 def add_folder(self, path):
113 """Add a folder to the list."""113 """Add a folder to the list."""
114 if path in self.items:114 if path in self.items:
115 return None115 return None
116 # FIXME: the path should actually be sent to u1cp to verify as valid116 # FIXME: the path should actually be sent to u1cp to verify as valid
117 item = FolderItem([path, "", "remove"], path=path, queue=self.queue)117 item = FolderItem([path, "", "remove"], path=path, queue=self.queue)
118 self.ui.folder_list.addTopLevelItem(item)118 self.ui.folder_list.addTopLevelItem(item)
119 self.items[path] = item119 self.items[path] = item
120 return item120 return item
121121
122 def update_sizes(self):122 def update_sizes(self):
123 """Poll the queue were the threads put the size info."""123 """Poll the queue were the threads put the size info."""
124 try:124 try:
125 path, size = self.queue.get(False)125 path, size = self.queue.get(False)
126 item = self.items.get(path)126 item = self.items.get(path)
127 if item:127 if item:
128 item.size = size128 item.size = size
129 item.setText(1, humanize(size))129 item.setText(1, humanize(size))
130 except Queue.Empty:130 except Queue.Empty:
131 pass131 pass
132 total = 0132 total = 0
133 for path, item in self.items.items():133 for path, item in self.items.items():
134 if item.size is None:134 if item.size is None:
135 total = LOCAL_FOLDERS_CALCULATING135 total = LOCAL_FOLDERS_CALCULATING
136 break136 break
137 total += item.size137 total += item.size
138138
139 if isinstance(total, long):139 if isinstance(total, long):
140 self.show_hide_offer(total)140 self.show_hide_offer(total)
141 total = humanize(total)141 total = humanize(total)
142 else:142 else:
143 self.show_hide_offer(0)143 self.show_hide_offer(0)
144 self.ui.folder_list.headerItem().setText(144 self.ui.folder_list.headerItem().setText(
145 1, LOCAL_FOLDERS_SPACE_HEADER % total)145 1, LOCAL_FOLDERS_SPACE_HEADER % total)
146146
147 def show_hide_offer(self, cur_size):147 def show_hide_offer(self, cur_size):
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."""
149 quota = self.quota()149 quota = self.quota()
150150
151 if cur_size > quota:151 if cur_size > quota:
152 self.ui.offer_frame.setVisible(True)152 self.ui.offer_frame.setVisible(True)
153 else:153 else:
154 self.ui.offer_frame.setVisible(False)154 self.ui.offer_frame.setVisible(False)
155155
156 self.ui.offer_label.setText(LOCAL_FOLDERS_OFFER_LABEL %156 self.ui.offer_label.setText(LOCAL_FOLDERS_OFFER_LABEL %
157 {"quota": humanize(quota)})157 {"quota": humanize(quota)})
158158
159 def stop_threads(self):159 def stop_threads(self):
160 """Stop all pending threads."""160 """Stop all pending threads."""
161 for _, item in self.items:161 for _, item in self.items:
162 item.thread._stop = True162 item.thread._stop = True
163163
164 # itemClicked is a Qt signal name.164 # itemClicked is a Qt signal name.
165 # pylint: disable=C0103165 # pylint: disable=C0103
166 def on_folder_list_itemClicked(self, item, column):166 def on_folder_list_itemClicked(self, item, column):
167 """Delete folder from the list."""167 """Delete folder from the list."""
168 if column == 2:168 if column == 2:
169 del(self.items[item.path])169 del(self.items[item.path])
170 item.thread._stop = True170 item.thread._stop = True
171 self.ui.folder_list.takeTopLevelItem(171 self.ui.folder_list.takeTopLevelItem(
172 self.ui.folder_list.indexOfTopLevelItem(item))172 self.ui.folder_list.indexOfTopLevelItem(item))
173 self.update_sizes()173 self.update_sizes()
174174
=== modified file 'ubuntuone_installer/gui/qt/setup_account.py'
--- ubuntuone_installer/gui/qt/setup_account.py 2011-07-07 20:32:17 +0000
+++ ubuntuone_installer/gui/qt/setup_account.py 2011-07-22 16:39:49 +0000
@@ -1,156 +1,158 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
22
3# Authors: Roberto Alsina <roberto.alsina@canonical.com>3# Authors: Roberto Alsina <roberto.alsina@canonical.com>
4#4#
5# Copyright 2011 Canonical Ltd.5# Copyright 2011 Canonical Ltd.
6#6#
7# This program is free software: you can redistribute it and/or modify it7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.9# by the Free Software Foundation.
10#10#
11# This program is distributed in the hope that it will be useful, but11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.14# PURPOSE. See the GNU General Public License for more details.
15#15#
16# You should have received a copy of the GNU General Public License along16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.17# with this program. If not, see <http://www.gnu.org/licenses/>.
1818
19"""Customized Setup Account page for SSO."""19"""Customized Setup Account page for SSO."""
2020
21import gettext21import gettext
22import re22import re
2323
24from PyQt4 import QtGui24from PyQt4 import QtGui
2525
26from ubuntu_sso.qt import gui as sso_gui26from ubuntu_sso.qt import gui as sso_gui
2727
28_ = gettext.gettext28_ = gettext.gettext
2929
30# pylint: disable=C010330# pylint: disable=C0103
31BAD = u'<font color="red"> %s </font>'31BAD = u'<img src=":/password_hint_warning.png" /><font color="red"> %s </font>'
32GOOD = u'<font color="green"> %s </font>'32GOOD = u'<img src=":/password_hint_ok.png" /><font color="green"> %s </font>'
3333TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>"
34EMPTY_NAME = _("Please enter your name")34
35INVALID_EMAIL = _("Please enter a valid email address")35EMPTY_NAME = _("Please enter your name")
36EMAIL_MATCH = _("The email addresses do not match")36INVALID_EMAIL = _("Please enter a valid email address")
37PASSWORD_LENGTH = _("At least 8 characters")37EMAIL_MATCH = _("The email addresses do not match")
38PASSWORD_DIGIT = _("At least one number")38PASSWORD_LENGTH = _("At least 8 characters")
39PASSWORD_UPPER = _("At least one uppercase letter")39PASSWORD_DIGIT = _("At least one number")
40PASSWORD_MATCH = _("Passwords don't match")40PASSWORD_UPPER = _("At least one uppercase letter")
4141PASSWORD_MATCH = _("Passwords don't match")
4242
43class SetupAccountPage(sso_gui.SetupAccountPage):43
4444class SetupAccountPage(sso_gui.SetupAccountPage):
45 """Customized Setup Account page for SSO"""45
4646 """Customized Setup Account page for SSO"""
47 def initializePage(self):47
48 """Setup UI details."""48 def initializePage(self):
49 # We need to override some texts from SSO49 """Setup UI details."""
50 # to match our spec50 # We need to override some texts from SSO
51 self.setTitle(_("Sign Up to Ubuntu One"))51 # to match our spec
52 self.setSubTitle(_("You only need to set up your account "52 title_page = TITLE_STYLE % _("Sign Up to Ubuntu One")
53 "once to get access to Ubuntu One across your devices."))53 self.setTitle(title_page)
5454 self.setSubTitle(_("You only need to set up your account "
55 self.ui.name_label.setText(_("Name"))55 "once to get access to Ubuntu One across your devices."))
56 self.ui.email_label.setText(_("Email"))56
57 self.ui.confirm_email_label.setText(_("Retype email"))57 self.ui.name_label.setText(_("Name"))
58 self.ui.password_label.setText(_("Create a password"))58 self.ui.email_label.setText(_("Email"))
59 self.ui.confirm_password_label.setText(_("Retype password"))59 self.ui.confirm_email_label.setText(_("Retype email"))
60 self.ui.terms_checkbox.setText(60 self.ui.password_label.setText(_("Create a password"))
61 _("By signing up to Ubuntu One you agree to our Terms "61 self.ui.confirm_password_label.setText(_("Retype password"))
62 "of Service and Privacy Policy"))62 self.ui.terms_checkbox.setText(
63 self.ui.terms_button.setText(_("Show Terms of Service"))63 _("By signing up to Ubuntu One you agree to our Terms "
64 self.ui.password_info_label.hide()64 "of Service and Privacy Policy"))
6565 self.ui.terms_button.setText(_("Show Terms of Service"))
66 # Button setup66 self.ui.password_info_label.hide()
67 self.wizard().setButtonLayout([67
68 QtGui.QWizard.Stretch,68 # Button setup
69 QtGui.QWizard.BackButton,69 self.wizard().setButtonLayout([
70 QtGui.QWizard.CancelButton,70 QtGui.QWizard.Stretch,
71 ])71 QtGui.QWizard.BackButton,
7272 QtGui.QWizard.CancelButton,
73 self.ui.name_edit.textEdited.connect(self.name_assistance)73 ])
74 self.name_assistance()74
75 self.ui.email_edit.textEdited.connect(self.email_assistance)75 self.ui.name_edit.textEdited.connect(self.name_assistance)
76 self.ui.email_edit.textEdited.connect(self.confirm_email_assistance)76 self.name_assistance()
77 self.email_assistance()77 self.ui.email_edit.textEdited.connect(self.email_assistance)
78 self.ui.confirm_email_edit.textEdited.connect(78 self.ui.email_edit.textEdited.connect(self.confirm_email_assistance)
79 self.confirm_email_assistance)79 self.email_assistance()
80 self.confirm_email_assistance()80 self.ui.confirm_email_edit.textEdited.connect(
81 self.ui.password_edit.textEdited.connect(self.password_assistance)81 self.confirm_email_assistance)
82 self.ui.confirm_password_edit.textEdited.connect(82 self.confirm_email_assistance()
83 self.password_assistance)83 self.ui.password_edit.textEdited.connect(self.password_assistance)
84 self.password_assistance()84 self.ui.confirm_password_edit.textEdited.connect(
8585 self.password_assistance)
86 def name_assistance(self):86 self.password_assistance()
87 """Show help for the name field."""87
88 text = unicode(self.ui.name_edit.text())88 def name_assistance(self):
89 if not text.strip():89 """Show help for the name field."""
90 self.ui.name_assistance.setVisible(True)90 text = unicode(self.ui.name_edit.text())
91 self.ui.name_assistance.setText(BAD % EMPTY_NAME)91 if not text.strip():
92 else:92 self.ui.name_assistance.setVisible(True)
93 self.ui.name_assistance.setVisible(False)93 self.ui.name_assistance.setText(BAD % EMPTY_NAME)
9494 else:
95 def email_assistance(self):95 self.ui.name_assistance.setVisible(False)
96 """Show help for the email field."""96
97 text = unicode(self.ui.email_edit.text())97 def email_assistance(self):
98 if not is_correct_email(text):98 """Show help for the email field."""
99 self.ui.email_assistance.setText(BAD % INVALID_EMAIL)99 text = unicode(self.ui.email_edit.text())
100 self.ui.email_assistance.setVisible(True)100 if not is_correct_email(text):
101 else:101 self.ui.email_assistance.setText(BAD % INVALID_EMAIL)
102 self.ui.email_assistance.setVisible(False)102 self.ui.email_assistance.setVisible(True)
103103 else:
104 def confirm_email_assistance(self):104 self.ui.email_assistance.setVisible(False)
105 """Show help for the confirm email field."""105
106 text1 = unicode(self.ui.email_edit.text())106 def confirm_email_assistance(self):
107 text2 = unicode(self.ui.confirm_email_edit.text())107 """Show help for the confirm email field."""
108 if text1 != text2:108 text1 = unicode(self.ui.email_edit.text())
109 self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH)109 text2 = unicode(self.ui.confirm_email_edit.text())
110 self.ui.confirm_email_assistance.setVisible(True)110 if text1 != text2:
111 else:111 self.ui.confirm_email_assistance.setText(BAD % EMAIL_MATCH)
112 self.ui.confirm_email_assistance.setVisible(False)112 self.ui.confirm_email_assistance.setVisible(True)
113113 else:
114 def password_assistance(self):114 self.ui.confirm_email_assistance.setVisible(False)
115 """Show help for the password field."""115
116 text1 = unicode(self.ui.password_edit.text())116 def password_assistance(self):
117 text2 = unicode(self.ui.confirm_password_edit.text())117 """Show help for the password field."""
118 label_text = [_("Your password must contain"), ]118 text1 = unicode(self.ui.password_edit.text())
119119 text2 = unicode(self.ui.confirm_password_edit.text())
120 if len(text1) < 8:120 label_text = ["<b>%s</b>" % _("Your password must contain"), ]
121 sign = BAD121
122 else:122 if len(text1) < 8:
123 sign = GOOD123 sign = BAD
124 label_text.append(sign % PASSWORD_LENGTH)124 else:
125125 sign = GOOD
126 if re.search('[A-Z]', text1) is None:126 label_text.append(sign % PASSWORD_LENGTH)
127 sign = BAD127
128 else:128 if re.search('[A-Z]', text1) is None:
129 sign = GOOD129 sign = BAD
130 label_text.append(sign % PASSWORD_UPPER)130 else:
131131 sign = GOOD
132 if re.search('[\d+]', text1) is None:132 label_text.append(sign % PASSWORD_UPPER)
133 sign = BAD133
134 else:134 if re.search('[\d+]', text1) is None:
135 sign = GOOD135 sign = BAD
136 label_text.append(sign % PASSWORD_DIGIT)136 else:
137137 sign = GOOD
138 if text1 != text2:138 label_text.append(sign % PASSWORD_DIGIT)
139 label_text.append(BAD % PASSWORD_MATCH)139
140140 if text1 != text2:
141 self.ui.password_assistance.setText("<br>".join(label_text))141 label_text.append(BAD % PASSWORD_MATCH)
142142
143143 self.ui.password_assistance.setText("<br>".join(label_text))
144def is_min_required_password(password):144
145 """Return if the password meets the minimum requirements."""145
146 if (len(password) < 8 or146def is_min_required_password(password):
147 re.search('[A-Z]', password) is None or147 """Return if the password meets the minimum requirements."""
148 re.search('\d+', password) is None):148 if (len(password) < 8 or
149 return False149 re.search('[A-Z]', password) is None or
150 return True150 re.search('\d+', password) is None):
151151 return False
152152 return True
153# FIXME: this should do the same check as SSO's server side153
154def is_correct_email(email_address):154
155 """Return if the email is correct."""155# FIXME: this should do the same check as SSO's server side
156 return '@' in email_address156def is_correct_email(email_address):
157 """Return if the email is correct."""
158 return '@' in email_address
157159
=== modified file 'ubuntuone_installer/gui/qt/side_widget.py'
--- ubuntuone_installer/gui/qt/side_widget.py 2011-07-04 18:15:56 +0000
+++ ubuntuone_installer/gui/qt/side_widget.py 2011-07-22 16:39:49 +0000
@@ -1,49 +1,73 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
22
3# Authors: Roberto Alsina <roberto.alsina@canonical.com>3# Authors: Roberto Alsina <roberto.alsina@canonical.com>
4#4#
5# Copyright 2011 Canonical Ltd.5# Copyright 2011 Canonical Ltd.
6#6#
7# This program is free software: you can redistribute it and/or modify it7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.9# by the Free Software Foundation.
10#10#
11# This program is distributed in the hope that it will be useful, but11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.14# PURPOSE. See the GNU General Public License for more details.
15#15#
16# You should have received a copy of the GNU General Public License along16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.17# with this program. If not, see <http://www.gnu.org/licenses/>.
1818
19"""Wizard's side widget."""19"""Wizard's side widget."""
2020
21from PyQt4 import QtGui21from PyQt4 import QtGui
2222
23from ubuntuone_installer.gui.qt.ui import side_widget_ui23from ubuntuone_installer.gui.qt.ui import side_widget_ui
2424# Module used ti include the resources into this file
2525# pylint: disable=W0611
26class SideWidget(QtGui.QWidget):26from ubuntuone_installer.gui.qt.ui import images_rc
2727# pylint: enable=W0611
28 """Wizard's side widget."""28
2929
30 install_stage = 030class SideWidget(QtGui.QFrame):
31 signin_stage = 131
32 choose_services_stage = 232 """Wizard's side widget."""
33 select_sync_folders_stage = 333
34 sync_stage = 434 install_stage = 0
3535 signin_stage = 1
36 def __init__(self, *args, **kwargs):36 choose_services_stage = 2
37 super(SideWidget, self).__init__(*args, **kwargs)37 select_sync_folders_stage = 3
38 self.ui = side_widget_ui.Ui_Form()38 sync_stage = 4
39 self.ui.setupUi(self)39
40 self.stage = 040 def __init__(self, *args, **kwargs):
4141 super(SideWidget, self).__init__(*args, **kwargs)
42 def set_stage(self, stage):42 self.ui = side_widget_ui.Ui_SideWidget()
43 """Switch to the desired stage."""43 self.ui.setupUi(self)
44 self.stage = stage44 self.stage = 0
45 self.ui.install_label.setEnabled(stage >= 0)45
46 self.ui.sign_in_label.setEnabled(stage >= 1)46 def set_stage(self, stage):
47 self.ui.choose_services_label.setEnabled(stage >= 2)47 """Switch to the desired stage."""
48 self.ui.select_folders_label.setEnabled(stage >= 3)48 self.stage = stage
49 self.ui.sync_label.setEnabled(stage >= 4)49 self.ui.install_label.setEnabled(stage >= 0)
50 self.ui.sign_in_label.setEnabled(stage >= 1)
51 self.ui.choose_services_label.setEnabled(stage >= 2)
52 self.ui.select_folders_label.setEnabled(stage >= 3)
53 self.ui.sync_label.setEnabled(stage >= 4)
54 self.set_stage_icon(self.ui.install_icon_label, self.install_stage)
55 self.set_stage_icon(self.ui.sign_icon_label, self.signin_stage)
56 self.set_stage_icon(self.ui.choose_icon_label,
57 self.choose_services_stage)
58 self.set_stage_icon(self.ui.folders_icon_label,
59 self.select_sync_folders_stage)
60 self.set_stage_icon(self.ui.sync_icon_label, self.sync_stage)
61
62 def set_stage_icon(self, label, label_stage):
63 """Set the label icon depending on the proper state."""
64 if self.stage == label_stage and label == self.ui.sync_icon_label:
65 label.setPixmap(QtGui.QPixmap(":/progress_finish_orange.png"))
66 elif self.stage == label_stage:
67 label.setPixmap(QtGui.QPixmap(":/progress_arrow_orange.png"))
68 elif self.stage > label_stage:
69 label.setPixmap(QtGui.QPixmap(":/progress_tick.png"))
70 elif label == self.ui.sync_icon_label:
71 label.setPixmap(QtGui.QPixmap(":/progress_finish_grey.png"))
72 else:
73 label.setPixmap(QtGui.QPixmap(":/progress_arrow_grey.png"))
5074
=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-19 17:16:11 +0000
+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-22 16:39:49 +0000
@@ -114,6 +114,10 @@
114 self.ui.done(result=0)114 self.ui.done(result=0)
115 # world did not explode115 # world did not explode
116116
117 def test_main_window_general_config(self):
118 """Check if the main properties of the windows are set."""
119 self.assertEqual(self.ui.windowTitle(), APP_NAME)
120
117 def test_start_control_panel_on_finishing(self):121 def test_start_control_panel_on_finishing(self):
118 """Calling done with result=1, the control panel should be called."""122 """Calling done with result=1, the control panel should be called."""
119 gui.AreYouSure.result = 0123 gui.AreYouSure.result = 0
@@ -188,7 +192,7 @@
188 def test_current_user_controller_parameters(self):192 def test_current_user_controller_parameters(self):
189 """Compare controller parameters with expected values."""193 """Compare controller parameters with expected values."""
190 self.assertEqual(self.ui.current_user_controller.args,194 self.assertEqual(self.ui.current_user_controller.args,
191 ((), {'title': gui.SIGN_IN,195 ((), {'title': gui.TITLE_STYLE % gui.SIGN_IN,
192 'subtitle': gui.SIGN_IN_SUBTITLE}))196 'subtitle': gui.SIGN_IN_SUBTITLE}))
193197
194 def test_stage_progression_1(self):198 def test_stage_progression_1(self):
@@ -652,3 +656,24 @@
652 setup_account.BAD % setup_account.PASSWORD_MATCH in656 setup_account.BAD % setup_account.PASSWORD_MATCH in
653 unicode(self.ui.ui.password_assistance.text()),657 unicode(self.ui.ui.password_assistance.text()),
654 )658 )
659
660 def test_side_widget_state(self):
661 """Test if the side widget of the wizard has state frame visible."""
662 if type(self.ui) != gui.MainWindow:
663 return
664 self.ui.on_currentIdChanged(self.ui.LICENSE_PAGE)
665 self.assertEqual(
666 True,
667 sideWidget().ui.states_frame.isVisible())
668 self.ui.on_currentIdChanged(self.ui.SIGNIN_PAGE)
669 self.assertEqual(
670 True,
671 sideWidget().ui.states_frame.isVisible())
672 self.ui.on_currentIdChanged(self.ui.local_folders_page_id)
673 self.assertEqual(
674 True,
675 sideWidget().ui.states_frame.isVisible())
676 self.ui.on_currentIdChanged(self.ui.CONGRATULATIONS_PAGE)
677 self.assertEqual(
678 True,
679 sideWidget().ui.states_frame.isVisible())
655680
=== modified file 'ubuntuone_installer/gui/qt/tests/test_side_widget.py'
--- ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-07-07 13:08:24 +0000
+++ ubuntuone_installer/gui/qt/tests/test_side_widget.py 2011-07-22 16:39:49 +0000
@@ -1,100 +1,155 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
22
3# Authors: Alejandro J. Cura <alecu@canonical.com>3# Authors: Alejandro J. Cura <alecu@canonical.com>
4# Roberto Alsina <roberto.alsina@canonical.com>4# Roberto Alsina <roberto.alsina@canonical.com>
5#5#
6# Copyright 2011 Canonical Ltd.6# Copyright 2011 Canonical Ltd.
7#7#
8# This program is free software: you can redistribute it and/or modify it8# This program is free software: you can redistribute it and/or modify it
9# under the terms of the GNU General Public License version 3, as published9# under the terms of the GNU General Public License version 3, as published
10# by the Free Software Foundation.10# by the Free Software Foundation.
11#11#
12# This program is distributed in the hope that it will be useful, but12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranties of13# WITHOUT ANY WARRANTY; without even the implied warranties of
14# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR14# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15# PURPOSE. See the GNU General Public License for more details.15# PURPOSE. See the GNU General Public License for more details.
16#16#
17# You should have received a copy of the GNU General Public License along17# You should have received a copy of the GNU General Public License along
18# with this program. If not, see <http://www.gnu.org/licenses/>.18# with this program. If not, see <http://www.gnu.org/licenses/>.
1919
20"""Tests for the Qt UI."""20"""Tests for the Qt UI."""
2121
22from ubuntuone_installer.gui.qt.tests import BaseTestCase22from PyQt4 import QtGui, QtCore
23from ubuntuone_installer.gui.qt.side_widget import SideWidget23
2424from ubuntuone_installer.gui.qt.tests import BaseTestCase
2525from ubuntuone_installer.gui.qt.side_widget import SideWidget
26class SideWidgetTestCase(BaseTestCase):26# Module used ti include the resources into this file
2727# pylint: disable=W0611
28 """Test the qt main window."""28from ubuntuone_installer.gui.qt.ui import images_rc
2929# pylint: enable=W0611
30 class_ui = SideWidget30
3131
32 def test_stage_0(self):32class SideWidgetTestCase(BaseTestCase):
33 """Check that each stage in the widget enables the right labels."""33
34 self.ui.set_stage(0)34 """Test the qt main window."""
35 self.assertEqual(35
36 self.ui.ui.install_label.isEnabled(), True)36 class_ui = SideWidget
37 self.assertEqual(37
38 self.ui.ui.sign_in_label.isEnabled(), False)38 def test_stage_0(self):
39 self.assertEqual(39 """Check that each stage in the widget enables the right labels."""
40 self.ui.ui.choose_services_label.isEnabled(), False)40 self.ui.set_stage(0)
41 self.assertEqual(41 self.assertEqual(
42 self.ui.ui.select_folders_label.isEnabled(), False)42 self.ui.ui.install_label.isEnabled(), True)
43 self.assertEqual(43 self.assertEqual(
44 self.ui.ui.sync_label.isEnabled(), False)44 self.ui.ui.sign_in_label.isEnabled(), False)
4545 self.assertEqual(
46 def test_stage_1(self):46 self.ui.ui.choose_services_label.isEnabled(), False)
47 """Check that each stage in the widget enables the right labels."""47 self.assertEqual(
48 self.ui.set_stage(1)48 self.ui.ui.select_folders_label.isEnabled(), False)
49 self.assertEqual(49 self.assertEqual(
50 self.ui.ui.install_label.isEnabled(), True)50 self.ui.ui.sync_label.isEnabled(), False)
51 self.assertEqual(51 self.check_state_pixmap(0)
52 self.ui.ui.sign_in_label.isEnabled(), True)52
53 self.assertEqual(53 def test_stage_1(self):
54 self.ui.ui.choose_services_label.isEnabled(), False)54 """Check that each stage in the widget enables the right labels."""
55 self.assertEqual(55 self.ui.set_stage(1)
56 self.ui.ui.select_folders_label.isEnabled(), False)56 self.assertEqual(
57 self.assertEqual(57 self.ui.ui.install_label.isEnabled(), True)
58 self.ui.ui.sync_label.isEnabled(), False)58 self.assertEqual(
5959 self.ui.ui.sign_in_label.isEnabled(), True)
60 def test_stage_2(self):60 self.assertEqual(
61 """Check that each stage in the widget enables the right labels."""61 self.ui.ui.choose_services_label.isEnabled(), False)
62 self.ui.set_stage(2)62 self.assertEqual(
63 self.assertEqual(63 self.ui.ui.select_folders_label.isEnabled(), False)
64 self.ui.ui.install_label.isEnabled(), True)64 self.assertEqual(
65 self.assertEqual(65 self.ui.ui.sync_label.isEnabled(), False)
66 self.ui.ui.sign_in_label.isEnabled(), True)66 self.check_state_pixmap(1)
67 self.assertEqual(67
68 self.ui.ui.choose_services_label.isEnabled(), True)68 def test_stage_2(self):
69 self.assertEqual(69 """Check that each stage in the widget enables the right labels."""
70 self.ui.ui.select_folders_label.isEnabled(), False)70 self.ui.set_stage(2)
71 self.assertEqual(71 self.assertEqual(
72 self.ui.ui.sync_label.isEnabled(), False)72 self.ui.ui.install_label.isEnabled(), True)
7373 self.assertEqual(
74 def test_stage_3(self):74 self.ui.ui.sign_in_label.isEnabled(), True)
75 """Check that each stage in the widget enables the right labels."""75 self.assertEqual(
76 self.ui.set_stage(3)76 self.ui.ui.choose_services_label.isEnabled(), True)
77 self.assertEqual(77 self.assertEqual(
78 self.ui.ui.install_label.isEnabled(), True)78 self.ui.ui.select_folders_label.isEnabled(), False)
79 self.assertEqual(79 self.assertEqual(
80 self.ui.ui.sign_in_label.isEnabled(), True)80 self.ui.ui.sync_label.isEnabled(), False)
81 self.assertEqual(81 self.check_state_pixmap(2)
82 self.ui.ui.choose_services_label.isEnabled(), True)82
83 self.assertEqual(83 def test_stage_3(self):
84 self.ui.ui.select_folders_label.isEnabled(), True)84 """Check that each stage in the widget enables the right labels."""
85 self.assertEqual(85 self.ui.set_stage(3)
86 self.ui.ui.sync_label.isEnabled(), False)86 self.assertEqual(
8787 self.ui.ui.install_label.isEnabled(), True)
88 def test_stage_4(self):88 self.assertEqual(
89 """Check that each stage in the widget enables the right labels."""89 self.ui.ui.sign_in_label.isEnabled(), True)
90 self.ui.set_stage(4)90 self.assertEqual(
91 self.assertEqual(91 self.ui.ui.choose_services_label.isEnabled(), True)
92 self.ui.ui.install_label.isEnabled(), True)92 self.assertEqual(
93 self.assertEqual(93 self.ui.ui.select_folders_label.isEnabled(), True)
94 self.ui.ui.sign_in_label.isEnabled(), True)94 self.assertEqual(
95 self.assertEqual(95 self.ui.ui.sync_label.isEnabled(), False)
96 self.ui.ui.choose_services_label.isEnabled(), True)96 self.check_state_pixmap(3)
97 self.assertEqual(97
98 self.ui.ui.select_folders_label.isEnabled(), True)98 def test_stage_4(self):
99 self.assertEqual(99 """Check that each stage in the widget enables the right labels."""
100 self.ui.ui.sync_label.isEnabled(), True)100 self.ui.set_stage(4)
101 self.assertEqual(
102 self.ui.ui.install_label.isEnabled(), True)
103 self.assertEqual(
104 self.ui.ui.sign_in_label.isEnabled(), True)
105 self.assertEqual(
106 self.ui.ui.choose_services_label.isEnabled(), True)
107 self.assertEqual(
108 self.ui.ui.select_folders_label.isEnabled(), True)
109 self.assertEqual(
110 self.ui.ui.sync_label.isEnabled(), True)
111 self.check_state_pixmap(4)
112
113 def get_pixmap_data(self, pixmap):
114 """Get the raw data of a QPixmap."""
115 byte_array = QtCore.QByteArray()
116 array_buffer = QtCore.QBuffer(byte_array)
117 pixmap.save(array_buffer, "PNG")
118 return byte_array
119
120 # Invalid name "assertEqualPixmap"
121 # pylint: disable=C0103
122
123 def assertEqualPixmaps(self, pixmap1, pixmap2):
124 """Compare two Qt pixmaps."""
125 d1 = self.get_pixmap_data(pixmap1)
126 d2 = self.get_pixmap_data(pixmap2)
127 self.assertEqual(d1, d2)
128
129 def check_state_pixmap(self, stage):
130 """Check if each label has the proper pixmap depending on the state."""
131 print stage
132 active_pixmap = QtGui.QPixmap(":/progress_arrow_orange.png")
133 no_active_pixmap = QtGui.QPixmap(":/progress_arrow_grey.png")
134 complete_pixmap = QtGui.QPixmap(":/progress_tick.png")
135 sync_active_pixmap = QtGui.QPixmap(":/progress_finish_orange.png")
136 sync_no_active_pixmap = QtGui.QPixmap(":/progress_finish_grey.png")
137 labels = (
138 self.ui.ui.install_icon_label,
139 self.ui.ui.sign_icon_label,
140 self.ui.ui.choose_icon_label,
141 self.ui.ui.folders_icon_label,
142 self.ui.ui.sync_icon_label)
143
144 for item in labels[:stage]:
145 self.assertEqualPixmaps(complete_pixmap, item.pixmap())
146
147 if stage != 4:
148 self.assertEqualPixmaps(active_pixmap, labels[stage].pixmap())
149 else:
150 self.assertEqualPixmaps(sync_active_pixmap, labels[4].pixmap())
151
152 if stage < 4:
153 for item in labels[stage + 1:len(labels) - 1]:
154 self.assertEqualPixmaps(no_active_pixmap, item.pixmap())
155 self.assertEqualPixmaps(sync_no_active_pixmap, labels[4].pixmap())

Subscribers

People subscribed via source and target branches