Merge lp:~nataliabidart/ubuntu/oneiric/ubuntuone-control-panel/ubuntuone-control-panel-2.0.0 into lp:ubuntu/oneiric/ubuntuone-control-panel
- Oneiric (11.10)
- ubuntuone-control-panel-2.0.0
- Merge into oneiric
Status: | Merged |
---|---|
Merged at revision: | 33 |
Proposed branch: | lp:~nataliabidart/ubuntu/oneiric/ubuntuone-control-panel/ubuntuone-control-panel-2.0.0 |
Merge into: | lp:ubuntu/oneiric/ubuntuone-control-panel |
Diff against target: |
30030 lines (+2419/-25703) 78 files modified
MANIFEST (+0/-140) PKG-INFO (+2/-21) bin/ubuntuone-control-panel-qt (+10/-1) data/gtk/overview.ui (+4/-29) data/gtk/services.ui (+16/-86) data/qt/account.ui (+23/-2) data/qt/controlpanel.ui (+228/-191) data/qt/images.qrc (+1/-0) data/qt/preferences.ui (+3/-3) data/qt/signin.ui (+203/-0) data/qt/ubuntuone.qss (+27/-5) debian/changelog (+29/-0) debian/control (+7/-7) debian/ubuntuone-control-panel-gtk.install (+0/-1) docs/ubuntuone-control-panel-gtk.1 (+2/-2) po/POTFILES.in (+0/-1) po/ubuntuone-control-panel.pot (+0/-486) setup.py (+2/-2) ubuntuone-control-panel-gtk.desktop.in (+0/-11) ubuntuone-control-panel.in (+1/-1) ubuntuone/controlpanel/backend.py (+24/-20) ubuntuone/controlpanel/cache.py (+50/-0) ubuntuone/controlpanel/dbus_service.py (+0/-40) ubuntuone/controlpanel/dbustests/test_dbus_service.py (+3/-34) ubuntuone/controlpanel/gui/__init__.py (+5/-5) ubuntuone/controlpanel/gui/gtk/gui.py (+9/-12) ubuntuone/controlpanel/gui/gtk/tests/__init__.py (+3/-3) ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py (+9/-1) ubuntuone/controlpanel/gui/qt/__init__.py (+57/-2) ubuntuone/controlpanel/gui/qt/account.py (+3/-0) ubuntuone/controlpanel/gui/qt/addfolder.py (+11/-9) ubuntuone/controlpanel/gui/qt/controlpanel.py (+73/-30) ubuntuone/controlpanel/gui/qt/device.py (+15/-6) ubuntuone/controlpanel/gui/qt/devices.py (+12/-7) ubuntuone/controlpanel/gui/qt/filesyncstatus.py (+7/-8) ubuntuone/controlpanel/gui/qt/folders.py (+25/-11) ubuntuone/controlpanel/gui/qt/gotoweb.py (+19/-5) ubuntuone/controlpanel/gui/qt/gui.py (+28/-5) ubuntuone/controlpanel/gui/qt/loadingoverlay.py (+6/-4) ubuntuone/controlpanel/gui/qt/main/linux.py (+4/-6) ubuntuone/controlpanel/gui/qt/main/windows.py (+8/-11) ubuntuone/controlpanel/gui/qt/preferences.py (+2/-0) ubuntuone/controlpanel/gui/qt/signin.py (+89/-0) ubuntuone/controlpanel/gui/qt/systray.py (+68/-0) ubuntuone/controlpanel/gui/qt/tests/__init__.py (+93/-33) ubuntuone/controlpanel/gui/qt/tests/test_account.py (+4/-9) ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py (+24/-24) ubuntuone/controlpanel/gui/qt/tests/test_common.py (+210/-0) ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py (+129/-24) ubuntuone/controlpanel/gui/qt/tests/test_device.py (+20/-18) ubuntuone/controlpanel/gui/qt/tests/test_devices.py (+12/-7) ubuntuone/controlpanel/gui/qt/tests/test_folders.py (+27/-38) ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py (+54/-2) ubuntuone/controlpanel/gui/qt/tests/test_gui.py (+7/-0) ubuntuone/controlpanel/gui/qt/tests/test_signin.py (+168/-0) ubuntuone/controlpanel/gui/qt/tests/test_start.py (+91/-0) ubuntuone/controlpanel/gui/qt/tests/test_systray.py (+103/-0) ubuntuone/controlpanel/gui/qt/tests/test_ubuntuonebin.py (+20/-10) ubuntuone/controlpanel/gui/qt/ubuntuonebin.py (+19/-10) ubuntuone/controlpanel/gui/qt/ui/account_ui.py (+0/-84) ubuntuone/controlpanel/gui/qt/ui/controlpanel_ui.py (+0/-208) ubuntuone/controlpanel/gui/qt/ui/device_ui.py (+0/-46) ubuntuone/controlpanel/gui/qt/ui/devices_ui.py (+0/-71) ubuntuone/controlpanel/gui/qt/ui/filesyncstatus_ui.py (+0/-48) ubuntuone/controlpanel/gui/qt/ui/folders_ui.py (+0/-90) ubuntuone/controlpanel/gui/qt/ui/images_rc.py (+0/-23506) ubuntuone/controlpanel/gui/qt/ui/loadingoverlay_ui.py (+0/-59) ubuntuone/controlpanel/gui/qt/ui/mainwindow_ui.py (+0/-54) ubuntuone/controlpanel/gui/qt/ui/preferences_ui.py (+0/-115) ubuntuone/controlpanel/gui/tests/__init__.py (+4/-2) ubuntuone/controlpanel/gui/tests/test_url_sign.py (+2/-2) ubuntuone/controlpanel/logger.py (+5/-1) ubuntuone/controlpanel/replication_client.py (+1/-2) ubuntuone/controlpanel/tests/test_backend.py (+88/-31) ubuntuone/controlpanel/tests/test_cache.py (+58/-0) ubuntuone/controlpanel/web_client/tests/__init__.py (+19/-0) ubuntuone/controlpanel/web_client/tests/test_txwebclient.py (+155/-0) ubuntuone/controlpanel/web_client/txwebclient.py (+18/-1) |
To merge this branch: | bzr merge lp:~nataliabidart/ubuntu/oneiric/ubuntuone-control-panel/ubuntuone-control-panel-2.0.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Sponsors | Pending | ||
Review via email: mp+77034@code.launchpad.net |
Commit message
Description of the change
* New upstream release:
[ Alejandro J. Cura <email address hidden>]
- Do not throw a webclient error when closing
(LP: #845105).
[ Natalia B. Bidart <email address hidden> ]
- Removed all code related to Bookmarks (LP: #850142).
- Replaces references to "Evolution" by "Thunderbird" (LP: #849494).
[ Rodney Dawes <email address hidden> ]
- Don't install a .desktop file for control panel
(part of LP: #838778).
- Point the indicator/Unity API at the installer .desktop file
(part of LP: #838778).
- Set the WMCLASS so Unity will fall back properly
(part of LP: #838778).
- Fix a few grammar mistakes (LP: #835093).
- Don't show the "Get NGB free!" label on "Join now" button at all
(LP: #819955).
* debian/control:
- ubuntuone-
- require ubuntuone-client >= 2.0.0.
- require ubuntu-sso-client >= 1.4.0.
- no longer install a .desktop file (will be installed by ubuntuone-
Sebastien Bacher (seb128) wrote : | # |
Preview Diff
1 | === removed file 'MANIFEST' | |||
2 | --- MANIFEST 2011-08-12 19:12:08 +0000 | |||
3 | +++ MANIFEST 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,140 +0,0 @@ | |||
5 | 1 | # file GENERATED by distutils, do NOT edit | ||
6 | 2 | COPYING | ||
7 | 3 | MANIFEST | ||
8 | 4 | README | ||
9 | 5 | com.ubuntuone.controlpanel.gui.service.in | ||
10 | 6 | com.ubuntuone.controlpanel.service.in | ||
11 | 7 | pylintrc | ||
12 | 8 | run-tests | ||
13 | 9 | run-tests.bat | ||
14 | 10 | setup.py | ||
15 | 11 | ubuntuone-control-panel-gtk.desktop.in | ||
16 | 12 | ubuntuone-control-panel.in | ||
17 | 13 | ubuntuone.controlpanel.pth | ||
18 | 14 | bin/ubuntuone-control-panel-backend | ||
19 | 15 | bin/ubuntuone-control-panel-gtk | ||
20 | 16 | bin/ubuntuone-control-panel-qt | ||
21 | 17 | data/Ubuntu-R.ttf | ||
22 | 18 | data/computer.png | ||
23 | 19 | data/contacts.png | ||
24 | 20 | data/external_icon_orange.png | ||
25 | 21 | data/external_icon_white.png | ||
26 | 22 | data/facebook.png | ||
27 | 23 | data/files.png | ||
28 | 24 | data/folder.png | ||
29 | 25 | data/music-store.png | ||
30 | 26 | data/music-stream.png | ||
31 | 27 | data/notes.png | ||
32 | 28 | data/overview.png | ||
33 | 29 | data/phone.png | ||
34 | 30 | data/services-bookmarks.png | ||
35 | 31 | data/services-contacts.png | ||
36 | 32 | data/services-files-example.png | ||
37 | 33 | data/services-files.png | ||
38 | 34 | data/sync_status_alert.png | ||
39 | 35 | data/sync_status_disconnected.png | ||
40 | 36 | data/sync_status_sync_done.png | ||
41 | 37 | data/sync_status_syncing.png | ||
42 | 38 | data/twitter.png | ||
43 | 39 | data/u1icon.png | ||
44 | 40 | data/gtk/dashboard.ui | ||
45 | 41 | data/gtk/device.ui | ||
46 | 42 | data/gtk/devices.ui | ||
47 | 43 | data/gtk/install.ui | ||
48 | 44 | data/gtk/management.ui | ||
49 | 45 | data/gtk/overview.ui | ||
50 | 46 | data/gtk/services.ui | ||
51 | 47 | data/gtk/volumes.ui | ||
52 | 48 | data/qt/account.ui | ||
53 | 49 | data/qt/controlpanel.ui | ||
54 | 50 | data/qt/device.ui | ||
55 | 51 | data/qt/devices.ui | ||
56 | 52 | data/qt/filesyncstatus.ui | ||
57 | 53 | data/qt/folders.ui | ||
58 | 54 | data/qt/images.qrc | ||
59 | 55 | data/qt/loadingoverlay.ui | ||
60 | 56 | data/qt/mainwindow.ui | ||
61 | 57 | data/qt/preferences.ui | ||
62 | 58 | data/qt/ubuntuone.qss | ||
63 | 59 | docs/ubuntuone-control-panel-gtk.1 | ||
64 | 60 | po/POTFILES.in | ||
65 | 61 | po/ubuntuone-control-panel.pot | ||
66 | 62 | ubuntuone/__init__.py | ||
67 | 63 | ubuntuone/controlpanel/__init__.py | ||
68 | 64 | ubuntuone/controlpanel/backend.py | ||
69 | 65 | ubuntuone/controlpanel/constants.py.in | ||
70 | 66 | ubuntuone/controlpanel/dbus_service.py | ||
71 | 67 | ubuntuone/controlpanel/logger.py | ||
72 | 68 | ubuntuone/controlpanel/login_client.py | ||
73 | 69 | ubuntuone/controlpanel/replication_client.py | ||
74 | 70 | ubuntuone/controlpanel/utils.py | ||
75 | 71 | ubuntuone/controlpanel/dbustests/__init__.py | ||
76 | 72 | ubuntuone/controlpanel/dbustests/test_dbus_service.py | ||
77 | 73 | ubuntuone/controlpanel/dbustests/test_gui_service.py | ||
78 | 74 | ubuntuone/controlpanel/dbustests/test_sd_client/__init__.py | ||
79 | 75 | ubuntuone/controlpanel/dbustests/test_sd_client/test_linux.py | ||
80 | 76 | ubuntuone/controlpanel/gui/__init__.py | ||
81 | 77 | ubuntuone/controlpanel/gui/gtk/__init__.py | ||
82 | 78 | ubuntuone/controlpanel/gui/gtk/gui.py | ||
83 | 79 | ubuntuone/controlpanel/gui/gtk/package_manager.py | ||
84 | 80 | ubuntuone/controlpanel/gui/gtk/widgets.py | ||
85 | 81 | ubuntuone/controlpanel/gui/gtk/tests/__init__.py | ||
86 | 82 | ubuntuone/controlpanel/gui/gtk/tests/test_gui.py | ||
87 | 83 | ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py | ||
88 | 84 | ubuntuone/controlpanel/gui/gtk/tests/test_package_manager.py | ||
89 | 85 | ubuntuone/controlpanel/gui/gtk/tests/test_widgets.py | ||
90 | 86 | ubuntuone/controlpanel/gui/qt/__init__.py | ||
91 | 87 | ubuntuone/controlpanel/gui/qt/account.py | ||
92 | 88 | ubuntuone/controlpanel/gui/qt/addfolder.py | ||
93 | 89 | ubuntuone/controlpanel/gui/qt/controlpanel.py | ||
94 | 90 | ubuntuone/controlpanel/gui/qt/device.py | ||
95 | 91 | ubuntuone/controlpanel/gui/qt/devices.py | ||
96 | 92 | ubuntuone/controlpanel/gui/qt/filesyncstatus.py | ||
97 | 93 | ubuntuone/controlpanel/gui/qt/folders.py | ||
98 | 94 | ubuntuone/controlpanel/gui/qt/gotoweb.py | ||
99 | 95 | ubuntuone/controlpanel/gui/qt/gui.py | ||
100 | 96 | ubuntuone/controlpanel/gui/qt/loadingoverlay.py | ||
101 | 97 | ubuntuone/controlpanel/gui/qt/preferences.py | ||
102 | 98 | ubuntuone/controlpanel/gui/qt/ubuntuonebin.py | ||
103 | 99 | ubuntuone/controlpanel/gui/qt/main/__init__.py | ||
104 | 100 | ubuntuone/controlpanel/gui/qt/main/linux.py | ||
105 | 101 | ubuntuone/controlpanel/gui/qt/main/windows.py | ||
106 | 102 | ubuntuone/controlpanel/gui/qt/tests/__init__.py | ||
107 | 103 | ubuntuone/controlpanel/gui/qt/tests/test_account.py | ||
108 | 104 | ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py | ||
109 | 105 | ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py | ||
110 | 106 | ubuntuone/controlpanel/gui/qt/tests/test_device.py | ||
111 | 107 | ubuntuone/controlpanel/gui/qt/tests/test_devices.py | ||
112 | 108 | ubuntuone/controlpanel/gui/qt/tests/test_filesyncstatus.py | ||
113 | 109 | ubuntuone/controlpanel/gui/qt/tests/test_folders.py | ||
114 | 110 | ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py | ||
115 | 111 | ubuntuone/controlpanel/gui/qt/tests/test_gui.py | ||
116 | 112 | ubuntuone/controlpanel/gui/qt/tests/test_loadingoverlay.py | ||
117 | 113 | ubuntuone/controlpanel/gui/qt/tests/test_preferences.py | ||
118 | 114 | ubuntuone/controlpanel/gui/qt/tests/test_ubuntuonebin.py | ||
119 | 115 | ubuntuone/controlpanel/gui/qt/ui/__init__.py | ||
120 | 116 | ubuntuone/controlpanel/gui/qt/ui/account_ui.py | ||
121 | 117 | ubuntuone/controlpanel/gui/qt/ui/controlpanel_ui.py | ||
122 | 118 | ubuntuone/controlpanel/gui/qt/ui/device_ui.py | ||
123 | 119 | ubuntuone/controlpanel/gui/qt/ui/devices_ui.py | ||
124 | 120 | ubuntuone/controlpanel/gui/qt/ui/filesyncstatus_ui.py | ||
125 | 121 | ubuntuone/controlpanel/gui/qt/ui/folders_ui.py | ||
126 | 122 | ubuntuone/controlpanel/gui/qt/ui/images_rc.py | ||
127 | 123 | ubuntuone/controlpanel/gui/qt/ui/loadingoverlay_ui.py | ||
128 | 124 | ubuntuone/controlpanel/gui/qt/ui/mainwindow_ui.py | ||
129 | 125 | ubuntuone/controlpanel/gui/qt/ui/preferences_ui.py | ||
130 | 126 | ubuntuone/controlpanel/gui/tests/__init__.py | ||
131 | 127 | ubuntuone/controlpanel/gui/tests/test_humanize.py | ||
132 | 128 | ubuntuone/controlpanel/gui/tests/test_url_sign.py | ||
133 | 129 | ubuntuone/controlpanel/sd_client/__init__.py | ||
134 | 130 | ubuntuone/controlpanel/sd_client/linux.py | ||
135 | 131 | ubuntuone/controlpanel/tests/__init__.py | ||
136 | 132 | ubuntuone/controlpanel/tests/test_backend.py | ||
137 | 133 | ubuntuone/controlpanel/tests/test_login_client.py | ||
138 | 134 | ubuntuone/controlpanel/tests/test_replication_client.py | ||
139 | 135 | ubuntuone/controlpanel/tests/test_sd_client.py | ||
140 | 136 | ubuntuone/controlpanel/tests/test_utils.py | ||
141 | 137 | ubuntuone/controlpanel/tests/test_web_client.py | ||
142 | 138 | ubuntuone/controlpanel/web_client/__init__.py | ||
143 | 139 | ubuntuone/controlpanel/web_client/libsoup.py | ||
144 | 140 | ubuntuone/controlpanel/web_client/txwebclient.py | ||
145 | 141 | 0 | ||
146 | === modified file 'PKG-INFO' | |||
147 | --- PKG-INFO 2011-08-25 19:37:14 +0000 | |||
148 | +++ PKG-INFO 2011-09-26 18:38:27 +0000 | |||
149 | @@ -1,30 +1,11 @@ | |||
150 | 1 | Metadata-Version: 1.1 | 1 | Metadata-Version: 1.1 |
151 | 2 | Name: ubuntuone-control-panel | 2 | Name: ubuntuone-control-panel |
153 | 3 | Version: 1.1.3 | 3 | Version: 2.0.0 |
154 | 4 | Summary: Ubuntu One Control Panel | 4 | Summary: Ubuntu One Control Panel |
155 | 5 | Home-page: https://launchpad.net/ubuntuone-control-panel | 5 | Home-page: https://launchpad.net/ubuntuone-control-panel |
156 | 6 | Author: Natalia Bidart | 6 | Author: Natalia Bidart |
157 | 7 | Author-email: natalia.bidart@canonical.com | 7 | Author-email: natalia.bidart@canonical.com |
158 | 8 | License: GPL v3 | 8 | License: GPL v3 |
160 | 9 | Description: Application to manage a Ubuntu One account. Provides a DBus service to query/modify all the Ubuntu One bits. | 9 | Description: Application to manage an Ubuntu One account. Provides a DBus service to query/modify all the Ubuntu One bits. |
161 | 10 | Platform: UNKNOWN | 10 | Platform: UNKNOWN |
162 | 11 | Requires: PyQt4 | ||
163 | 12 | Requires: apt | ||
164 | 13 | Requires: aptdaemon | ||
165 | 14 | Requires: dbus | ||
166 | 15 | Requires: defer | ||
167 | 16 | Requires: desktopcouch.application.replication_services | ||
168 | 17 | Requires: gi.repository | ||
169 | 18 | Requires: gobject | ||
170 | 19 | Requires: gtk | ||
171 | 20 | Requires: mocker | ||
172 | 21 | Requires: oauth | ||
173 | 22 | Requires: pango | ||
174 | 23 | Requires: simplejson | ||
175 | 24 | Requires: twisted.application | ||
176 | 25 | Requires: twisted.internet | ||
177 | 26 | Requires: twisted.python.failure | ||
178 | 27 | Requires: twisted.trial.unittest | ||
179 | 28 | Requires: twisted.web | ||
180 | 29 | Requires: ubuntu_sso | ||
181 | 30 | Provides: ubuntuone | 11 | Provides: ubuntuone |
182 | 31 | 12 | ||
183 | === modified file 'bin/ubuntuone-control-panel-qt' | |||
184 | --- bin/ubuntuone-control-panel-qt 2011-08-25 19:37:14 +0000 | |||
185 | +++ bin/ubuntuone-control-panel-qt 2011-09-26 18:38:27 +0000 | |||
186 | @@ -45,10 +45,19 @@ | |||
187 | 45 | result.add_option("-a", "--alert", dest="alert", action="store_true", | 45 | result.add_option("-a", "--alert", dest="alert", action="store_true", |
188 | 46 | default=False, help="Start Ubuntu One " | 46 | default=False, help="Start Ubuntu One " |
189 | 47 | "alerting the user to its presence.") | 47 | "alerting the user to its presence.") |
190 | 48 | result.add_option("--minimized", dest="minimized", action="store_true", | ||
191 | 49 | default=False, help="Start Ubuntu One " | ||
192 | 50 | "only in the notification area, with no visible window. " | ||
193 | 51 | "Implies --with-icon") | ||
194 | 52 | result.add_option("--with-icon", dest="with_icon", action="store_true", | ||
195 | 53 | default=False, help="Start Ubuntu One " | ||
196 | 54 | "with an icon in the notification area.") | ||
197 | 48 | return result | 55 | return result |
198 | 49 | 56 | ||
199 | 50 | 57 | ||
200 | 51 | if __name__ == "__main__": | 58 | if __name__ == "__main__": |
201 | 52 | parser = parser_options() | 59 | parser = parser_options() |
202 | 53 | (options, args) = parser.parse_args(sys.argv) | 60 | (options, args) = parser.parse_args(sys.argv) |
204 | 54 | main.main(switch_to=options.switch_to, alert=options.alert) | 61 | main.main(switch_to=options.switch_to, |
205 | 62 | alert=options.alert, minimized=options.minimized, | ||
206 | 63 | with_icon=options.with_icon) | ||
207 | 55 | 64 | ||
208 | === added file 'data/Ubuntu-B.ttf' | |||
209 | 56 | Binary files data/Ubuntu-B.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-B.ttf 2011-09-26 18:38:27 +0000 differ | 65 | Binary files data/Ubuntu-B.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-B.ttf 2011-09-26 18:38:27 +0000 differ |
210 | === modified file 'data/gtk/overview.ui' | |||
211 | --- data/gtk/overview.ui 2011-07-22 21:26:48 +0000 | |||
212 | +++ data/gtk/overview.ui 2011-09-26 18:38:27 +0000 | |||
213 | @@ -150,7 +150,7 @@ | |||
214 | 150 | <property name="can_focus">False</property> | 150 | <property name="can_focus">False</property> |
215 | 151 | <property name="xalign">0</property> | 151 | <property name="xalign">0</property> |
216 | 152 | <property name="label" translatable="yes">Stay Productive | 152 | <property name="label" translatable="yes">Stay Productive |
218 | 153 | <span foreground="#909090">Keep your Firefox bookmarks and Tomboy notes synced</span></property> | 153 | <span foreground="#909090">Keep your Tomboy notes synced</span></property> |
219 | 154 | <property name="use_markup">True</property> | 154 | <property name="use_markup">True</property> |
220 | 155 | <property name="wrap">True</property> | 155 | <property name="wrap">True</property> |
221 | 156 | </object> | 156 | </object> |
222 | @@ -251,36 +251,11 @@ | |||
223 | 251 | <property name="use_action_appearance">False</property> | 251 | <property name="use_action_appearance">False</property> |
224 | 252 | <signal name="clicked" handler="on_join_now_button_clicked" swapped="no"/> | 252 | <signal name="clicked" handler="on_join_now_button_clicked" swapped="no"/> |
225 | 253 | <child> | 253 | <child> |
227 | 254 | <object class="GtkVBox" id="vbox4"> | 254 | <object class="GtkLabel" id="label1"> |
228 | 255 | <property name="visible">True</property> | 255 | <property name="visible">True</property> |
229 | 256 | <property name="can_focus">False</property> | 256 | <property name="can_focus">False</property> |
257 | 257 | <property name="spacing">5</property> | 257 | <property name="label" translatable="yes"><span font_size="xx-large" foreground="#4d4d4d">Join now</span></property> |
258 | 258 | <child> | 258 | <property name="use_markup">True</property> |
232 | 259 | <object class="GtkLabel" id="label1"> | ||
233 | 260 | <property name="visible">True</property> | ||
234 | 261 | <property name="can_focus">False</property> | ||
235 | 262 | <property name="label" translatable="yes"><span font_size="xx-large" foreground="#4d4d4d">Join now</span></property> | ||
236 | 263 | <property name="use_markup">True</property> | ||
237 | 264 | </object> | ||
238 | 265 | <packing> | ||
239 | 266 | <property name="expand">True</property> | ||
240 | 267 | <property name="fill">True</property> | ||
241 | 268 | <property name="position">0</property> | ||
242 | 269 | </packing> | ||
243 | 270 | </child> | ||
244 | 271 | <child> | ||
245 | 272 | <object class="GtkLabel" id="label2"> | ||
246 | 273 | <property name="visible">True</property> | ||
247 | 274 | <property name="can_focus">False</property> | ||
248 | 275 | <property name="label" translatable="yes"><span foreground="#909090">2GB of free storage</span></property> | ||
249 | 276 | <property name="use_markup">True</property> | ||
250 | 277 | </object> | ||
251 | 278 | <packing> | ||
252 | 279 | <property name="expand">True</property> | ||
253 | 280 | <property name="fill">True</property> | ||
254 | 281 | <property name="position">1</property> | ||
255 | 282 | </packing> | ||
256 | 283 | </child> | ||
259 | 284 | </object> | 259 | </object> |
260 | 285 | </child> | 260 | </child> |
261 | 286 | </object> | 261 | </object> |
262 | 287 | 262 | ||
263 | === modified file 'data/gtk/services.ui' | |||
264 | --- data/gtk/services.ui 2011-07-22 21:26:48 +0000 | |||
265 | +++ data/gtk/services.ui 2011-09-26 18:38:27 +0000 | |||
266 | @@ -59,16 +59,21 @@ | |||
267 | 59 | <property name="use_action_appearance">False</property> | 59 | <property name="use_action_appearance">False</property> |
268 | 60 | <property name="draw_indicator">True</property> | 60 | <property name="draw_indicator">True</property> |
269 | 61 | </object> | 61 | </object> |
270 | 62 | <packing> | ||
271 | 63 | <property name="x_options"></property> | ||
272 | 64 | <property name="y_options"></property> | ||
273 | 65 | </packing> | ||
274 | 62 | </child> | 66 | </child> |
275 | 63 | <child> | 67 | <child> |
276 | 64 | <object class="GtkImage" id="files_icon"> | 68 | <object class="GtkImage" id="files_icon"> |
277 | 65 | <property name="visible">True</property> | 69 | <property name="visible">True</property> |
278 | 66 | <property name="can_focus">False</property> | 70 | <property name="can_focus">False</property> |
279 | 67 | <property name="xpad">5</property> | ||
280 | 68 | </object> | 71 | </object> |
281 | 69 | <packing> | 72 | <packing> |
282 | 70 | <property name="left_attach">1</property> | 73 | <property name="left_attach">1</property> |
283 | 71 | <property name="right_attach">2</property> | 74 | <property name="right_attach">2</property> |
284 | 75 | <property name="x_options"></property> | ||
285 | 76 | <property name="y_options"></property> | ||
286 | 72 | </packing> | 77 | </packing> |
287 | 73 | </child> | 78 | </child> |
288 | 74 | <child> | 79 | <child> |
289 | @@ -154,8 +159,6 @@ | |||
290 | 154 | <object class="GtkImage" id="files_example"> | 159 | <object class="GtkImage" id="files_example"> |
291 | 155 | <property name="visible">True</property> | 160 | <property name="visible">True</property> |
292 | 156 | <property name="can_focus">False</property> | 161 | <property name="can_focus">False</property> |
293 | 157 | <property name="xpad">5</property> | ||
294 | 158 | <property name="ypad">5</property> | ||
295 | 159 | </object> | 162 | </object> |
296 | 160 | <packing> | 163 | <packing> |
297 | 161 | <property name="expand">False</property> | 164 | <property name="expand">False</property> |
298 | @@ -188,6 +191,7 @@ | |||
299 | 188 | <object class="GtkAlignment" id="alignment3"> | 191 | <object class="GtkAlignment" id="alignment3"> |
300 | 189 | <property name="visible">True</property> | 192 | <property name="visible">True</property> |
301 | 190 | <property name="can_focus">False</property> | 193 | <property name="can_focus">False</property> |
302 | 194 | <property name="top_padding">6</property> | ||
303 | 191 | <child> | 195 | <child> |
304 | 192 | <object class="GtkHBox" id="hbox3"> | 196 | <object class="GtkHBox" id="hbox3"> |
305 | 193 | <property name="visible">True</property> | 197 | <property name="visible">True</property> |
306 | @@ -203,6 +207,7 @@ | |||
307 | 203 | <property name="can_focus">False</property> | 207 | <property name="can_focus">False</property> |
308 | 204 | <property name="n_rows">2</property> | 208 | <property name="n_rows">2</property> |
309 | 205 | <property name="n_columns">3</property> | 209 | <property name="n_columns">3</property> |
310 | 210 | <property name="column_spacing">5</property> | ||
311 | 206 | <property name="row_spacing">5</property> | 211 | <property name="row_spacing">5</property> |
312 | 207 | <child> | 212 | <child> |
313 | 208 | <object class="GtkCheckButton" id="contacts_check"> | 213 | <object class="GtkCheckButton" id="contacts_check"> |
314 | @@ -212,16 +217,21 @@ | |||
315 | 212 | <property name="use_action_appearance">False</property> | 217 | <property name="use_action_appearance">False</property> |
316 | 213 | <property name="draw_indicator">True</property> | 218 | <property name="draw_indicator">True</property> |
317 | 214 | </object> | 219 | </object> |
318 | 220 | <packing> | ||
319 | 221 | <property name="x_options"></property> | ||
320 | 222 | <property name="y_options"></property> | ||
321 | 223 | </packing> | ||
322 | 215 | </child> | 224 | </child> |
323 | 216 | <child> | 225 | <child> |
324 | 217 | <object class="GtkImage" id="contacts_icon"> | 226 | <object class="GtkImage" id="contacts_icon"> |
325 | 218 | <property name="visible">True</property> | 227 | <property name="visible">True</property> |
326 | 219 | <property name="can_focus">False</property> | 228 | <property name="can_focus">False</property> |
327 | 220 | <property name="xpad">5</property> | ||
328 | 221 | </object> | 229 | </object> |
329 | 222 | <packing> | 230 | <packing> |
330 | 223 | <property name="left_attach">1</property> | 231 | <property name="left_attach">1</property> |
331 | 224 | <property name="right_attach">2</property> | 232 | <property name="right_attach">2</property> |
332 | 233 | <property name="x_options"></property> | ||
333 | 234 | <property name="y_options"></property> | ||
334 | 225 | </packing> | 235 | </packing> |
335 | 226 | </child> | 236 | </child> |
336 | 227 | <child> | 237 | <child> |
337 | @@ -245,7 +255,6 @@ | |||
338 | 245 | <property name="label" translatable="yes"><span font_size="small">Once enabled, visit the <a href="https://one.ubuntu.com">Ubuntu One website</a> to manage your contacts, including Gmail and Facebook import</span></property> | 255 | <property name="label" translatable="yes"><span font_size="small">Once enabled, visit the <a href="https://one.ubuntu.com">Ubuntu One website</a> to manage your contacts, including Gmail and Facebook import</span></property> |
339 | 246 | <property name="use_markup">True</property> | 256 | <property name="use_markup">True</property> |
340 | 247 | <property name="wrap">True</property> | 257 | <property name="wrap">True</property> |
341 | 248 | <property name="width_chars">35</property> | ||
342 | 249 | </object> | 258 | </object> |
343 | 250 | <packing> | 259 | <packing> |
344 | 251 | <property name="left_attach">2</property> | 260 | <property name="left_attach">2</property> |
345 | @@ -269,92 +278,13 @@ | |||
346 | 269 | </child> | 278 | </child> |
347 | 270 | </object> | 279 | </object> |
348 | 271 | <packing> | 280 | <packing> |
350 | 272 | <property name="expand">False</property> | 281 | <property name="expand">True</property> |
351 | 273 | <property name="fill">True</property> | 282 | <property name="fill">True</property> |
352 | 274 | <property name="position">0</property> | 283 | <property name="position">0</property> |
353 | 275 | </packing> | 284 | </packing> |
354 | 276 | </child> | 285 | </child> |
355 | 277 | <child> | 286 | <child> |
436 | 278 | <object class="GtkVBox" id="bookmarks"> | 287 | <placeholder/> |
357 | 279 | <property name="visible">True</property> | ||
358 | 280 | <property name="can_focus">False</property> | ||
359 | 281 | <child> | ||
360 | 282 | <object class="GtkTable" id="bookmarks_sync"> | ||
361 | 283 | <property name="visible">True</property> | ||
362 | 284 | <property name="can_focus">False</property> | ||
363 | 285 | <property name="n_rows">2</property> | ||
364 | 286 | <property name="n_columns">3</property> | ||
365 | 287 | <property name="row_spacing">5</property> | ||
366 | 288 | <child> | ||
367 | 289 | <object class="GtkCheckButton" id="bookmarks_check"> | ||
368 | 290 | <property name="visible">True</property> | ||
369 | 291 | <property name="can_focus">True</property> | ||
370 | 292 | <property name="receives_default">False</property> | ||
371 | 293 | <property name="use_action_appearance">False</property> | ||
372 | 294 | <property name="draw_indicator">True</property> | ||
373 | 295 | </object> | ||
374 | 296 | </child> | ||
375 | 297 | <child> | ||
376 | 298 | <object class="GtkImage" id="bookmarks_icon"> | ||
377 | 299 | <property name="visible">True</property> | ||
378 | 300 | <property name="can_focus">False</property> | ||
379 | 301 | <property name="xpad">5</property> | ||
380 | 302 | </object> | ||
381 | 303 | <packing> | ||
382 | 304 | <property name="left_attach">1</property> | ||
383 | 305 | <property name="right_attach">2</property> | ||
384 | 306 | </packing> | ||
385 | 307 | </child> | ||
386 | 308 | <child> | ||
387 | 309 | <object class="GtkLabel" id="label6"> | ||
388 | 310 | <property name="visible">True</property> | ||
389 | 311 | <property name="can_focus">False</property> | ||
390 | 312 | <property name="xalign">0</property> | ||
391 | 313 | <property name="label" translatable="yes">Enable Bookmarks Sync</property> | ||
392 | 314 | </object> | ||
393 | 315 | <packing> | ||
394 | 316 | <property name="left_attach">2</property> | ||
395 | 317 | <property name="right_attach">3</property> | ||
396 | 318 | </packing> | ||
397 | 319 | </child> | ||
398 | 320 | <child> | ||
399 | 321 | <object class="GtkLabel" id="label7"> | ||
400 | 322 | <property name="visible">True</property> | ||
401 | 323 | <property name="can_focus">False</property> | ||
402 | 324 | <property name="xalign">0</property> | ||
403 | 325 | <property name="yalign">0</property> | ||
404 | 326 | <property name="label" translatable="yes"><span font_size="small">Bookmarks sync works with Firefox</span></property> | ||
405 | 327 | <property name="use_markup">True</property> | ||
406 | 328 | <property name="wrap">True</property> | ||
407 | 329 | <property name="width_chars">30</property> | ||
408 | 330 | </object> | ||
409 | 331 | <packing> | ||
410 | 332 | <property name="left_attach">2</property> | ||
411 | 333 | <property name="right_attach">3</property> | ||
412 | 334 | <property name="top_attach">1</property> | ||
413 | 335 | <property name="bottom_attach">2</property> | ||
414 | 336 | </packing> | ||
415 | 337 | </child> | ||
416 | 338 | <child> | ||
417 | 339 | <placeholder/> | ||
418 | 340 | </child> | ||
419 | 341 | <child> | ||
420 | 342 | <placeholder/> | ||
421 | 343 | </child> | ||
422 | 344 | </object> | ||
423 | 345 | <packing> | ||
424 | 346 | <property name="expand">False</property> | ||
425 | 347 | <property name="fill">True</property> | ||
426 | 348 | <property name="position">0</property> | ||
427 | 349 | </packing> | ||
428 | 350 | </child> | ||
429 | 351 | </object> | ||
430 | 352 | <packing> | ||
431 | 353 | <property name="expand">False</property> | ||
432 | 354 | <property name="fill">True</property> | ||
433 | 355 | <property name="pack_type">end</property> | ||
434 | 356 | <property name="position">1</property> | ||
435 | 357 | </packing> | ||
437 | 358 | </child> | 288 | </child> |
438 | 359 | </object> | 289 | </object> |
439 | 360 | </child> | 290 | </child> |
440 | 361 | 291 | ||
441 | === modified file 'data/qt/account.ui' | |||
442 | --- data/qt/account.ui 2011-08-25 19:37:14 +0000 | |||
443 | +++ data/qt/account.ui 2011-09-26 18:38:27 +0000 | |||
444 | @@ -35,7 +35,16 @@ | |||
445 | 35 | <string>Your services</string> | 35 | <string>Your services</string> |
446 | 36 | </property> | 36 | </property> |
447 | 37 | <layout class="QVBoxLayout" name="verticalLayout_3"> | 37 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
449 | 38 | <property name="margin"> | 38 | <property name="leftMargin"> |
450 | 39 | <number>10</number> | ||
451 | 40 | </property> | ||
452 | 41 | <property name="topMargin"> | ||
453 | 42 | <number>0</number> | ||
454 | 43 | </property> | ||
455 | 44 | <property name="rightMargin"> | ||
456 | 45 | <number>0</number> | ||
457 | 46 | </property> | ||
458 | 47 | <property name="bottomMargin"> | ||
459 | 39 | <number>0</number> | 48 | <number>0</number> |
460 | 40 | </property> | 49 | </property> |
461 | 41 | <item> | 50 | <item> |
462 | @@ -61,11 +70,23 @@ | |||
463 | 61 | <string>Personal details</string> | 70 | <string>Personal details</string> |
464 | 62 | </property> | 71 | </property> |
465 | 63 | <layout class="QVBoxLayout" name="verticalLayout_4"> | 72 | <layout class="QVBoxLayout" name="verticalLayout_4"> |
467 | 64 | <property name="margin"> | 73 | <property name="leftMargin"> |
468 | 74 | <number>10</number> | ||
469 | 75 | </property> | ||
470 | 76 | <property name="topMargin"> | ||
471 | 77 | <number>0</number> | ||
472 | 78 | </property> | ||
473 | 79 | <property name="rightMargin"> | ||
474 | 80 | <number>0</number> | ||
475 | 81 | </property> | ||
476 | 82 | <property name="bottomMargin"> | ||
477 | 65 | <number>0</number> | 83 | <number>0</number> |
478 | 66 | </property> | 84 | </property> |
479 | 67 | <item> | 85 | <item> |
480 | 68 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 86 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
481 | 87 | <property name="leftMargin"> | ||
482 | 88 | <number>6</number> | ||
483 | 89 | </property> | ||
484 | 69 | <item> | 90 | <item> |
485 | 70 | <widget class="QLabel" name="name_label"> | 91 | <widget class="QLabel" name="name_label"> |
486 | 71 | <property name="text"> | 92 | <property name="text"> |
487 | 72 | 93 | ||
488 | === modified file 'data/qt/controlpanel.ui' | |||
489 | --- data/qt/controlpanel.ui 2011-08-25 19:37:14 +0000 | |||
490 | +++ data/qt/controlpanel.ui 2011-09-26 18:38:27 +0000 | |||
491 | @@ -6,8 +6,8 @@ | |||
492 | 6 | <rect> | 6 | <rect> |
493 | 7 | <x>0</x> | 7 | <x>0</x> |
494 | 8 | <y>0</y> | 8 | <y>0</y> |
497 | 9 | <width>367</width> | 9 | <width>387</width> |
498 | 10 | <height>142</height> | 10 | <height>168</height> |
499 | 11 | </rect> | 11 | </rect> |
500 | 12 | </property> | 12 | </property> |
501 | 13 | <property name="sizePolicy"> | 13 | <property name="sizePolicy"> |
502 | @@ -20,215 +20,247 @@ | |||
503 | 20 | <string notr="true">Form</string> | 20 | <string notr="true">Form</string> |
504 | 21 | </property> | 21 | </property> |
505 | 22 | <layout class="QVBoxLayout" name="verticalLayout"> | 22 | <layout class="QVBoxLayout" name="verticalLayout"> |
506 | 23 | <property name="spacing"> | ||
507 | 24 | <number>3</number> | ||
508 | 25 | </property> | ||
509 | 26 | <property name="margin"> | 23 | <property name="margin"> |
510 | 27 | <number>0</number> | 24 | <number>0</number> |
511 | 28 | </property> | 25 | </property> |
512 | 29 | <item> | 26 | <item> |
586 | 30 | <widget class="QFrame" name="frame_header"> | 27 | <widget class="QStackedWidget" name="switcher"> |
587 | 31 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 28 | <property name="currentIndex"> |
588 | 32 | <property name="spacing"> | 29 | <number>1</number> |
589 | 33 | <number>5</number> | 30 | </property> |
590 | 34 | </property> | 31 | <widget class="QWidget" name="management"> |
591 | 35 | <property name="margin"> | 32 | <property name="sizePolicy"> |
592 | 36 | <number>0</number> | 33 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
593 | 37 | </property> | 34 | <horstretch>0</horstretch> |
594 | 38 | <item> | 35 | <verstretch>0</verstretch> |
595 | 39 | <widget class="QFrame" name="frame_greeting"> | 36 | </sizepolicy> |
596 | 40 | <layout class="QVBoxLayout" name="verticalLayout_4"> | 37 | </property> |
597 | 41 | <property name="margin"> | 38 | <layout class="QVBoxLayout" name="verticalLayout_5"> |
598 | 42 | <number>0</number> | 39 | <property name="margin"> |
599 | 43 | </property> | 40 | <number>0</number> |
600 | 44 | <item> | 41 | </property> |
601 | 45 | <widget class="QLabel" name="greeting_label"> | 42 | <item> |
602 | 46 | <property name="alignment"> | 43 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
603 | 47 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> | 44 | <item> |
604 | 48 | </property> | 45 | <widget class="QFrame" name="frame_header"> |
605 | 49 | </widget> | 46 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |
533 | 50 | </item> | ||
534 | 51 | </layout> | ||
535 | 52 | </widget> | ||
536 | 53 | </item> | ||
537 | 54 | <item> | ||
538 | 55 | <spacer name="horizontalSpacer"> | ||
539 | 56 | <property name="orientation"> | ||
540 | 57 | <enum>Qt::Horizontal</enum> | ||
541 | 58 | </property> | ||
542 | 59 | <property name="sizeType"> | ||
543 | 60 | <enum>QSizePolicy::Fixed</enum> | ||
544 | 61 | </property> | ||
545 | 62 | <property name="sizeHint" stdset="0"> | ||
546 | 63 | <size> | ||
547 | 64 | <width>15</width> | ||
548 | 65 | <height>20</height> | ||
549 | 66 | </size> | ||
550 | 67 | </property> | ||
551 | 68 | </spacer> | ||
552 | 69 | </item> | ||
553 | 70 | <item> | ||
554 | 71 | <widget class="QFrame" name="frame_storage"> | ||
555 | 72 | <property name="sizePolicy"> | ||
556 | 73 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
557 | 74 | <horstretch>0</horstretch> | ||
558 | 75 | <verstretch>0</verstretch> | ||
559 | 76 | </sizepolicy> | ||
560 | 77 | </property> | ||
561 | 78 | <property name="minimumSize"> | ||
562 | 79 | <size> | ||
563 | 80 | <width>165</width> | ||
564 | 81 | <height>0</height> | ||
565 | 82 | </size> | ||
566 | 83 | </property> | ||
567 | 84 | <property name="maximumSize"> | ||
568 | 85 | <size> | ||
569 | 86 | <width>165</width> | ||
570 | 87 | <height>16777215</height> | ||
571 | 88 | </size> | ||
572 | 89 | </property> | ||
573 | 90 | <layout class="QVBoxLayout" name="vLayoutStorage"> | ||
574 | 91 | <property name="spacing"> | ||
575 | 92 | <number>6</number> | ||
576 | 93 | </property> | ||
577 | 94 | <property name="sizeConstraint"> | ||
578 | 95 | <enum>QLayout::SetDefaultConstraint</enum> | ||
579 | 96 | </property> | ||
580 | 97 | <property name="margin"> | ||
581 | 98 | <number>0</number> | ||
582 | 99 | </property> | ||
583 | 100 | <item> | ||
584 | 101 | <widget class="QFrame" name="frame_quota"> | ||
585 | 102 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
606 | 103 | <property name="spacing"> | 47 | <property name="spacing"> |
608 | 104 | <number>2</number> | 48 | <number>5</number> |
609 | 105 | </property> | 49 | </property> |
610 | 106 | <property name="margin"> | 50 | <property name="margin"> |
611 | 107 | <number>0</number> | 51 | <number>0</number> |
612 | 108 | </property> | 52 | </property> |
613 | 109 | <item> | 53 | <item> |
636 | 110 | <widget class="QLabel" name="percentage_usage_label"> | 54 | <widget class="QFrame" name="frame_greeting"> |
637 | 111 | <property name="sizePolicy"> | 55 | <layout class="QVBoxLayout" name="verticalLayout_4"> |
638 | 112 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | 56 | <property name="margin"> |
639 | 113 | <horstretch>0</horstretch> | 57 | <number>0</number> |
640 | 114 | <verstretch>0</verstretch> | 58 | </property> |
641 | 115 | </sizepolicy> | 59 | <item> |
642 | 116 | </property> | 60 | <widget class="QLabel" name="greeting_label"> |
643 | 117 | <property name="text"> | 61 | <property name="alignment"> |
644 | 118 | <string notr="true"/> | 62 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
645 | 119 | </property> | 63 | </property> |
646 | 120 | </widget> | 64 | </widget> |
647 | 121 | </item> | 65 | </item> |
648 | 122 | <item> | 66 | </layout> |
649 | 123 | <widget class="QLabel" name="quota_usage_label"> | 67 | </widget> |
650 | 124 | <property name="font"> | 68 | </item> |
651 | 125 | <font> | 69 | <item> |
652 | 126 | <pointsize>8</pointsize> | 70 | <spacer name="horizontalSpacer"> |
653 | 127 | </font> | 71 | <property name="orientation"> |
654 | 128 | </property> | 72 | <enum>Qt::Horizontal</enum> |
655 | 129 | <property name="text"> | 73 | </property> |
656 | 130 | <string/> | 74 | <property name="sizeType"> |
657 | 131 | </property> | 75 | <enum>QSizePolicy::Fixed</enum> |
658 | 76 | </property> | ||
659 | 77 | <property name="sizeHint" stdset="0"> | ||
660 | 78 | <size> | ||
661 | 79 | <width>15</width> | ||
662 | 80 | <height>20</height> | ||
663 | 81 | </size> | ||
664 | 82 | </property> | ||
665 | 83 | </spacer> | ||
666 | 84 | </item> | ||
667 | 85 | <item> | ||
668 | 86 | <widget class="QFrame" name="frame_storage"> | ||
669 | 87 | <property name="sizePolicy"> | ||
670 | 88 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
671 | 89 | <horstretch>0</horstretch> | ||
672 | 90 | <verstretch>0</verstretch> | ||
673 | 91 | </sizepolicy> | ||
674 | 92 | </property> | ||
675 | 93 | <property name="minimumSize"> | ||
676 | 94 | <size> | ||
677 | 95 | <width>165</width> | ||
678 | 96 | <height>0</height> | ||
679 | 97 | </size> | ||
680 | 98 | </property> | ||
681 | 99 | <property name="maximumSize"> | ||
682 | 100 | <size> | ||
683 | 101 | <width>165</width> | ||
684 | 102 | <height>16777215</height> | ||
685 | 103 | </size> | ||
686 | 104 | </property> | ||
687 | 105 | <layout class="QVBoxLayout" name="vLayoutStorage"> | ||
688 | 106 | <property name="spacing"> | ||
689 | 107 | <number>6</number> | ||
690 | 108 | </property> | ||
691 | 109 | <property name="sizeConstraint"> | ||
692 | 110 | <enum>QLayout::SetFixedSize</enum> | ||
693 | 111 | </property> | ||
694 | 112 | <property name="margin"> | ||
695 | 113 | <number>0</number> | ||
696 | 114 | </property> | ||
697 | 115 | <item> | ||
698 | 116 | <widget class="QFrame" name="frame_quota"> | ||
699 | 117 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
700 | 118 | <property name="spacing"> | ||
701 | 119 | <number>2</number> | ||
702 | 120 | </property> | ||
703 | 121 | <property name="margin"> | ||
704 | 122 | <number>0</number> | ||
705 | 123 | </property> | ||
706 | 124 | <item> | ||
707 | 125 | <widget class="QLabel" name="percentage_usage_label"> | ||
708 | 126 | <property name="sizePolicy"> | ||
709 | 127 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
710 | 128 | <horstretch>0</horstretch> | ||
711 | 129 | <verstretch>0</verstretch> | ||
712 | 130 | </sizepolicy> | ||
713 | 131 | </property> | ||
714 | 132 | <property name="text"> | ||
715 | 133 | <string notr="true"/> | ||
716 | 134 | </property> | ||
717 | 135 | <property name="OverQuota" stdset="0"> | ||
718 | 136 | <bool>false</bool> | ||
719 | 137 | </property> | ||
720 | 138 | </widget> | ||
721 | 139 | </item> | ||
722 | 140 | <item> | ||
723 | 141 | <widget class="QLabel" name="quota_usage_label"> | ||
724 | 142 | <property name="font"> | ||
725 | 143 | <font> | ||
726 | 144 | <pointsize>8</pointsize> | ||
727 | 145 | </font> | ||
728 | 146 | </property> | ||
729 | 147 | <property name="text"> | ||
730 | 148 | <string/> | ||
731 | 149 | </property> | ||
732 | 150 | <property name="OverQuota" stdset="0"> | ||
733 | 151 | <bool>false</bool> | ||
734 | 152 | </property> | ||
735 | 153 | </widget> | ||
736 | 154 | </item> | ||
737 | 155 | </layout> | ||
738 | 156 | <zorder>quota_usage_label</zorder> | ||
739 | 157 | <zorder>percentage_usage_label</zorder> | ||
740 | 158 | </widget> | ||
741 | 159 | </item> | ||
742 | 160 | <item> | ||
743 | 161 | <widget class="GoToWebButton" name="get_more_space_button"> | ||
744 | 162 | <property name="text"> | ||
745 | 163 | <string>Get more storage</string> | ||
746 | 164 | </property> | ||
747 | 165 | </widget> | ||
748 | 166 | </item> | ||
749 | 167 | </layout> | ||
750 | 168 | </widget> | ||
751 | 169 | </item> | ||
752 | 170 | <item> | ||
753 | 171 | <widget class="QFrame" name="frame_status"> | ||
754 | 172 | <property name="sizePolicy"> | ||
755 | 173 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
756 | 174 | <horstretch>0</horstretch> | ||
757 | 175 | <verstretch>0</verstretch> | ||
758 | 176 | </sizepolicy> | ||
759 | 177 | </property> | ||
760 | 178 | <property name="minimumSize"> | ||
761 | 179 | <size> | ||
762 | 180 | <width>165</width> | ||
763 | 181 | <height>0</height> | ||
764 | 182 | </size> | ||
765 | 183 | </property> | ||
766 | 184 | <property name="maximumSize"> | ||
767 | 185 | <size> | ||
768 | 186 | <width>165</width> | ||
769 | 187 | <height>16777215</height> | ||
770 | 188 | </size> | ||
771 | 189 | </property> | ||
772 | 190 | <layout class="QHBoxLayout" name="horizontalLayout_8"> | ||
773 | 191 | <property name="sizeConstraint"> | ||
774 | 192 | <enum>QLayout::SetMinimumSize</enum> | ||
775 | 193 | </property> | ||
776 | 194 | <property name="margin"> | ||
777 | 195 | <number>0</number> | ||
778 | 196 | </property> | ||
779 | 197 | <item> | ||
780 | 198 | <widget class="FileSyncStatus" name="file_sync_status" native="true"> | ||
781 | 199 | <property name="sizePolicy"> | ||
782 | 200 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
783 | 201 | <horstretch>0</horstretch> | ||
784 | 202 | <verstretch>0</verstretch> | ||
785 | 203 | </sizepolicy> | ||
786 | 204 | </property> | ||
787 | 205 | <property name="minimumSize"> | ||
788 | 206 | <size> | ||
789 | 207 | <width>0</width> | ||
790 | 208 | <height>0</height> | ||
791 | 209 | </size> | ||
792 | 210 | </property> | ||
793 | 211 | <property name="maximumSize"> | ||
794 | 212 | <size> | ||
795 | 213 | <width>165</width> | ||
796 | 214 | <height>16777215</height> | ||
797 | 215 | </size> | ||
798 | 216 | </property> | ||
799 | 217 | </widget> | ||
800 | 218 | </item> | ||
801 | 219 | </layout> | ||
802 | 132 | </widget> | 220 | </widget> |
803 | 133 | </item> | 221 | </item> |
804 | 134 | </layout> | 222 | </layout> |
845 | 135 | <zorder>quota_usage_label</zorder> | 223 | </widget> |
846 | 136 | <zorder>percentage_usage_label</zorder> | 224 | </item> |
847 | 137 | </widget> | 225 | <item> |
848 | 138 | </item> | 226 | <widget class="QTabWidget" name="tab_widget"> |
809 | 139 | <item> | ||
810 | 140 | <widget class="GoToWebButton" name="get_more_space_button"> | ||
811 | 141 | <property name="text"> | ||
812 | 142 | <string>Get more storage</string> | ||
813 | 143 | </property> | ||
814 | 144 | </widget> | ||
815 | 145 | </item> | ||
816 | 146 | </layout> | ||
817 | 147 | </widget> | ||
818 | 148 | </item> | ||
819 | 149 | <item> | ||
820 | 150 | <widget class="QFrame" name="frame_status"> | ||
821 | 151 | <property name="sizePolicy"> | ||
822 | 152 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | ||
823 | 153 | <horstretch>0</horstretch> | ||
824 | 154 | <verstretch>0</verstretch> | ||
825 | 155 | </sizepolicy> | ||
826 | 156 | </property> | ||
827 | 157 | <property name="minimumSize"> | ||
828 | 158 | <size> | ||
829 | 159 | <width>165</width> | ||
830 | 160 | <height>0</height> | ||
831 | 161 | </size> | ||
832 | 162 | </property> | ||
833 | 163 | <property name="maximumSize"> | ||
834 | 164 | <size> | ||
835 | 165 | <width>165</width> | ||
836 | 166 | <height>16777215</height> | ||
837 | 167 | </size> | ||
838 | 168 | </property> | ||
839 | 169 | <layout class="QHBoxLayout" name="horizontalLayout_8"> | ||
840 | 170 | <property name="margin"> | ||
841 | 171 | <number>0</number> | ||
842 | 172 | </property> | ||
843 | 173 | <item> | ||
844 | 174 | <widget class="FileSyncStatus" name="file_sync_status" native="true"> | ||
849 | 175 | <property name="sizePolicy"> | 227 | <property name="sizePolicy"> |
851 | 176 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | 228 | <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> |
852 | 177 | <horstretch>0</horstretch> | 229 | <horstretch>0</horstretch> |
853 | 178 | <verstretch>0</verstretch> | 230 | <verstretch>0</verstretch> |
854 | 179 | </sizepolicy> | 231 | </sizepolicy> |
855 | 180 | </property> | 232 | </property> |
868 | 181 | <property name="minimumSize"> | 233 | <property name="currentIndex"> |
869 | 182 | <size> | 234 | <number>0</number> |
870 | 183 | <width>0</width> | 235 | </property> |
871 | 184 | <height>0</height> | 236 | <widget class="FoldersPanel" name="folders_tab"> |
872 | 185 | </size> | 237 | <attribute name="title"> |
873 | 186 | </property> | 238 | <string>Folders</string> |
874 | 187 | <property name="maximumSize"> | 239 | </attribute> |
875 | 188 | <size> | 240 | </widget> |
876 | 189 | <width>165</width> | 241 | <widget class="DevicesPanel" name="devices_tab"> |
877 | 190 | <height>16777215</height> | 242 | <attribute name="title"> |
878 | 191 | </size> | 243 | <string>Devices</string> |
879 | 192 | </property> | 244 | </attribute> |
880 | 245 | </widget> | ||
881 | 246 | <widget class="PreferencesPanel" name="preferences_tab"> | ||
882 | 247 | <attribute name="title"> | ||
883 | 248 | <string>Settings</string> | ||
884 | 249 | </attribute> | ||
885 | 250 | </widget> | ||
886 | 251 | <widget class="AccountPanel" name="account_tab"> | ||
887 | 252 | <attribute name="title"> | ||
888 | 253 | <string>Account information</string> | ||
889 | 254 | </attribute> | ||
890 | 255 | </widget> | ||
891 | 193 | </widget> | 256 | </widget> |
892 | 194 | </item> | 257 | </item> |
893 | 195 | </layout> | 258 | </layout> |
930 | 196 | </widget> | 259 | </item> |
931 | 197 | </item> | 260 | </layout> |
932 | 198 | </layout> | 261 | </widget> |
933 | 199 | </widget> | 262 | <widget class="QWidget" name="empty"/> |
934 | 200 | </item> | 263 | <widget class="SignInPanel" name="signin"/> |
899 | 201 | <item> | ||
900 | 202 | <widget class="QTabWidget" name="tab_widget"> | ||
901 | 203 | <property name="sizePolicy"> | ||
902 | 204 | <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> | ||
903 | 205 | <horstretch>0</horstretch> | ||
904 | 206 | <verstretch>0</verstretch> | ||
905 | 207 | </sizepolicy> | ||
906 | 208 | </property> | ||
907 | 209 | <property name="currentIndex"> | ||
908 | 210 | <number>0</number> | ||
909 | 211 | </property> | ||
910 | 212 | <widget class="FoldersPanel" name="folders_tab"> | ||
911 | 213 | <attribute name="title"> | ||
912 | 214 | <string>Folders</string> | ||
913 | 215 | </attribute> | ||
914 | 216 | </widget> | ||
915 | 217 | <widget class="DevicesPanel" name="devices_tab"> | ||
916 | 218 | <attribute name="title"> | ||
917 | 219 | <string>Devices</string> | ||
918 | 220 | </attribute> | ||
919 | 221 | </widget> | ||
920 | 222 | <widget class="PreferencesPanel" name="preferences_tab"> | ||
921 | 223 | <attribute name="title"> | ||
922 | 224 | <string>Settings</string> | ||
923 | 225 | </attribute> | ||
924 | 226 | </widget> | ||
925 | 227 | <widget class="AccountPanel" name="account_tab"> | ||
926 | 228 | <attribute name="title"> | ||
927 | 229 | <string>Account information</string> | ||
928 | 230 | </attribute> | ||
929 | 231 | </widget> | ||
935 | 232 | </widget> | 264 | </widget> |
936 | 233 | </item> | 265 | </item> |
937 | 234 | <item> | 266 | <item> |
938 | @@ -371,9 +403,14 @@ | |||
939 | 371 | <header>ubuntuone.controlpanel.gui.qt.account</header> | 403 | <header>ubuntuone.controlpanel.gui.qt.account</header> |
940 | 372 | <container>1</container> | 404 | <container>1</container> |
941 | 373 | </customwidget> | 405 | </customwidget> |
942 | 406 | <customwidget> | ||
943 | 407 | <class>SignInPanel</class> | ||
944 | 408 | <extends>QWidget</extends> | ||
945 | 409 | <header>ubuntuone.controlpanel.gui.qt.signin</header> | ||
946 | 410 | <container>1</container> | ||
947 | 411 | </customwidget> | ||
948 | 374 | </customwidgets> | 412 | </customwidgets> |
949 | 375 | <tabstops> | 413 | <tabstops> |
950 | 376 | <tabstop>tab_widget</tabstop> | ||
951 | 377 | <tabstop>help_button</tabstop> | 414 | <tabstop>help_button</tabstop> |
952 | 378 | <tabstop>twitter_button</tabstop> | 415 | <tabstop>twitter_button</tabstop> |
953 | 379 | <tabstop>facebook_button</tabstop> | 416 | <tabstop>facebook_button</tabstop> |
954 | 380 | 417 | ||
955 | === modified file 'data/qt/images.qrc' | |||
956 | --- data/qt/images.qrc 2011-08-25 19:37:14 +0000 | |||
957 | +++ data/qt/images.qrc 2011-09-26 18:38:27 +0000 | |||
958 | @@ -15,6 +15,7 @@ | |||
959 | 15 | <file>../facebook.png</file> | 15 | <file>../facebook.png</file> |
960 | 16 | <file>../external_icon_white.png</file> | 16 | <file>../external_icon_white.png</file> |
961 | 17 | <file>../Ubuntu-R.ttf</file> | 17 | <file>../Ubuntu-R.ttf</file> |
962 | 18 | <file>../Ubuntu-B.ttf</file> | ||
963 | 18 | <file>ubuntuone.qss</file> | 19 | <file>ubuntuone.qss</file> |
964 | 19 | </qresource> | 20 | </qresource> |
965 | 20 | </RCC> | 21 | </RCC> |
966 | 21 | 22 | ||
967 | === modified file 'data/qt/preferences.ui' | |||
968 | --- data/qt/preferences.ui 2011-08-25 19:37:14 +0000 | |||
969 | +++ data/qt/preferences.ui 2011-09-26 18:38:27 +0000 | |||
970 | @@ -6,7 +6,7 @@ | |||
971 | 6 | <rect> | 6 | <rect> |
972 | 7 | <x>0</x> | 7 | <x>0</x> |
973 | 8 | <y>0</y> | 8 | <y>0</y> |
975 | 9 | <width>433</width> | 9 | <width>512</width> |
976 | 10 | <height>328</height> | 10 | <height>328</height> |
977 | 11 | </rect> | 11 | </rect> |
978 | 12 | </property> | 12 | </property> |
979 | @@ -138,14 +138,14 @@ | |||
980 | 138 | <item> | 138 | <item> |
981 | 139 | <widget class="QCheckBox" name="udf_autosubscribe_checkbox"> | 139 | <widget class="QCheckBox" name="udf_autosubscribe_checkbox"> |
982 | 140 | <property name="text"> | 140 | <property name="text"> |
984 | 141 | <string>Automatically sync all selected folders on this computer to the cloud</string> | 141 | <string>Automatically sync all new cloud folders to this computer</string> |
985 | 142 | </property> | 142 | </property> |
986 | 143 | </widget> | 143 | </widget> |
987 | 144 | </item> | 144 | </item> |
988 | 145 | <item> | 145 | <item> |
989 | 146 | <widget class="QCheckBox" name="share_autosubscribe_checkbox"> | 146 | <widget class="QCheckBox" name="share_autosubscribe_checkbox"> |
990 | 147 | <property name="text"> | 147 | <property name="text"> |
992 | 148 | <string>Automatically sync all folders shared with me by other to this computer</string> | 148 | <string>Automatically sync all folders shared with me to this computer</string> |
993 | 149 | </property> | 149 | </property> |
994 | 150 | </widget> | 150 | </widget> |
995 | 151 | </item> | 151 | </item> |
996 | 152 | 152 | ||
997 | === added file 'data/qt/signin.ui' | |||
998 | --- data/qt/signin.ui 1970-01-01 00:00:00 +0000 | |||
999 | +++ data/qt/signin.ui 2011-09-26 18:38:27 +0000 | |||
1000 | @@ -0,0 +1,203 @@ | |||
1001 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
1002 | 2 | <ui version="4.0"> | ||
1003 | 3 | <class>Form</class> | ||
1004 | 4 | <widget class="QWidget" name="Form"> | ||
1005 | 5 | <property name="geometry"> | ||
1006 | 6 | <rect> | ||
1007 | 7 | <x>0</x> | ||
1008 | 8 | <y>0</y> | ||
1009 | 9 | <width>344</width> | ||
1010 | 10 | <height>312</height> | ||
1011 | 11 | </rect> | ||
1012 | 12 | </property> | ||
1013 | 13 | <property name="windowTitle"> | ||
1014 | 14 | <string>Form</string> | ||
1015 | 15 | </property> | ||
1016 | 16 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
1017 | 17 | <property name="margin"> | ||
1018 | 18 | <number>0</number> | ||
1019 | 19 | </property> | ||
1020 | 20 | <item> | ||
1021 | 21 | <widget class="QFrame" name="signin"> | ||
1022 | 22 | <layout class="QVBoxLayout" name="sign_in"> | ||
1023 | 23 | <property name="spacing"> | ||
1024 | 24 | <number>15</number> | ||
1025 | 25 | </property> | ||
1026 | 26 | <property name="margin"> | ||
1027 | 27 | <number>3</number> | ||
1028 | 28 | </property> | ||
1029 | 29 | <item> | ||
1030 | 30 | <widget class="QLabel" name="sign_in_label"> | ||
1031 | 31 | <property name="text"> | ||
1032 | 32 | <string>Sign in to Ubuntu One</string> | ||
1033 | 33 | </property> | ||
1034 | 34 | </widget> | ||
1035 | 35 | </item> | ||
1036 | 36 | <item> | ||
1037 | 37 | <widget class="QLabel" name="description_label"> | ||
1038 | 38 | <property name="text"> | ||
1039 | 39 | <string>Sign in with yur existing Ubuntu One username and password.</string> | ||
1040 | 40 | </property> | ||
1041 | 41 | </widget> | ||
1042 | 42 | </item> | ||
1043 | 43 | <item> | ||
1044 | 44 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
1045 | 45 | <item> | ||
1046 | 46 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
1047 | 47 | <property name="spacing"> | ||
1048 | 48 | <number>15</number> | ||
1049 | 49 | </property> | ||
1050 | 50 | <item> | ||
1051 | 51 | <layout class="QVBoxLayout" name="verticalLayout_4"> | ||
1052 | 52 | <property name="spacing"> | ||
1053 | 53 | <number>0</number> | ||
1054 | 54 | </property> | ||
1055 | 55 | <item> | ||
1056 | 56 | <widget class="QLabel" name="email_label"> | ||
1057 | 57 | <property name="text"> | ||
1058 | 58 | <string>Email address</string> | ||
1059 | 59 | </property> | ||
1060 | 60 | </widget> | ||
1061 | 61 | </item> | ||
1062 | 62 | <item> | ||
1063 | 63 | <widget class="QLineEdit" name="email_entry"> | ||
1064 | 64 | <property name="text"> | ||
1065 | 65 | <string/> | ||
1066 | 66 | </property> | ||
1067 | 67 | </widget> | ||
1068 | 68 | </item> | ||
1069 | 69 | </layout> | ||
1070 | 70 | </item> | ||
1071 | 71 | <item> | ||
1072 | 72 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
1073 | 73 | <property name="spacing"> | ||
1074 | 74 | <number>0</number> | ||
1075 | 75 | </property> | ||
1076 | 76 | <item> | ||
1077 | 77 | <widget class="QLabel" name="password_label"> | ||
1078 | 78 | <property name="text"> | ||
1079 | 79 | <string>Password</string> | ||
1080 | 80 | </property> | ||
1081 | 81 | </widget> | ||
1082 | 82 | </item> | ||
1083 | 83 | <item> | ||
1084 | 84 | <widget class="QLineEdit" name="password_entry"> | ||
1085 | 85 | <property name="echoMode"> | ||
1086 | 86 | <enum>QLineEdit::Password</enum> | ||
1087 | 87 | </property> | ||
1088 | 88 | </widget> | ||
1089 | 89 | </item> | ||
1090 | 90 | </layout> | ||
1091 | 91 | </item> | ||
1092 | 92 | <item> | ||
1093 | 93 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
1094 | 94 | <item> | ||
1095 | 95 | <widget class="QPushButton" name="signin_button"> | ||
1096 | 96 | <property name="text"> | ||
1097 | 97 | <string>Sign in</string> | ||
1098 | 98 | </property> | ||
1099 | 99 | <property name="default"> | ||
1100 | 100 | <bool>true</bool> | ||
1101 | 101 | </property> | ||
1102 | 102 | </widget> | ||
1103 | 103 | </item> | ||
1104 | 104 | <item> | ||
1105 | 105 | <widget class="QPushButton" name="cancel_button"> | ||
1106 | 106 | <property name="text"> | ||
1107 | 107 | <string>Cancel</string> | ||
1108 | 108 | </property> | ||
1109 | 109 | <property name="secondary" stdset="0"> | ||
1110 | 110 | <bool>true</bool> | ||
1111 | 111 | </property> | ||
1112 | 112 | </widget> | ||
1113 | 113 | </item> | ||
1114 | 114 | <item> | ||
1115 | 115 | <spacer name="horizontalSpacer"> | ||
1116 | 116 | <property name="orientation"> | ||
1117 | 117 | <enum>Qt::Horizontal</enum> | ||
1118 | 118 | </property> | ||
1119 | 119 | <property name="sizeHint" stdset="0"> | ||
1120 | 120 | <size> | ||
1121 | 121 | <width>40</width> | ||
1122 | 122 | <height>20</height> | ||
1123 | 123 | </size> | ||
1124 | 124 | </property> | ||
1125 | 125 | </spacer> | ||
1126 | 126 | </item> | ||
1127 | 127 | </layout> | ||
1128 | 128 | </item> | ||
1129 | 129 | <item> | ||
1130 | 130 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
1131 | 131 | <item> | ||
1132 | 132 | <widget class="GoToWebButton" name="forgot_password_button"> | ||
1133 | 133 | <property name="sizePolicy"> | ||
1134 | 134 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1135 | 135 | <horstretch>0</horstretch> | ||
1136 | 136 | <verstretch>0</verstretch> | ||
1137 | 137 | </sizepolicy> | ||
1138 | 138 | </property> | ||
1139 | 139 | <property name="text"> | ||
1140 | 140 | <string>Forgot your password?</string> | ||
1141 | 141 | </property> | ||
1142 | 142 | </widget> | ||
1143 | 143 | </item> | ||
1144 | 144 | <item> | ||
1145 | 145 | <spacer name="horizontalSpacer_3"> | ||
1146 | 146 | <property name="orientation"> | ||
1147 | 147 | <enum>Qt::Horizontal</enum> | ||
1148 | 148 | </property> | ||
1149 | 149 | <property name="sizeHint" stdset="0"> | ||
1150 | 150 | <size> | ||
1151 | 151 | <width>40</width> | ||
1152 | 152 | <height>20</height> | ||
1153 | 153 | </size> | ||
1154 | 154 | </property> | ||
1155 | 155 | </spacer> | ||
1156 | 156 | </item> | ||
1157 | 157 | </layout> | ||
1158 | 158 | </item> | ||
1159 | 159 | </layout> | ||
1160 | 160 | </item> | ||
1161 | 161 | <item> | ||
1162 | 162 | <spacer name="horizontalSpacer_2"> | ||
1163 | 163 | <property name="orientation"> | ||
1164 | 164 | <enum>Qt::Horizontal</enum> | ||
1165 | 165 | </property> | ||
1166 | 166 | <property name="sizeHint" stdset="0"> | ||
1167 | 167 | <size> | ||
1168 | 168 | <width>40</width> | ||
1169 | 169 | <height>20</height> | ||
1170 | 170 | </size> | ||
1171 | 171 | </property> | ||
1172 | 172 | </spacer> | ||
1173 | 173 | </item> | ||
1174 | 174 | </layout> | ||
1175 | 175 | </item> | ||
1176 | 176 | <item> | ||
1177 | 177 | <spacer name="verticalSpacer"> | ||
1178 | 178 | <property name="orientation"> | ||
1179 | 179 | <enum>Qt::Vertical</enum> | ||
1180 | 180 | </property> | ||
1181 | 181 | <property name="sizeHint" stdset="0"> | ||
1182 | 182 | <size> | ||
1183 | 183 | <width>20</width> | ||
1184 | 184 | <height>40</height> | ||
1185 | 185 | </size> | ||
1186 | 186 | </property> | ||
1187 | 187 | </spacer> | ||
1188 | 188 | </item> | ||
1189 | 189 | </layout> | ||
1190 | 190 | </widget> | ||
1191 | 191 | </item> | ||
1192 | 192 | </layout> | ||
1193 | 193 | </widget> | ||
1194 | 194 | <customwidgets> | ||
1195 | 195 | <customwidget> | ||
1196 | 196 | <class>GoToWebButton</class> | ||
1197 | 197 | <extends>QPushButton</extends> | ||
1198 | 198 | <header>ubuntuone.controlpanel.gui.qt.gotoweb</header> | ||
1199 | 199 | </customwidget> | ||
1200 | 200 | </customwidgets> | ||
1201 | 201 | <resources/> | ||
1202 | 202 | <connections/> | ||
1203 | 203 | </ui> | ||
1204 | 0 | 204 | ||
1205 | === modified file 'data/qt/ubuntuone.qss' | |||
1206 | --- data/qt/ubuntuone.qss 2011-08-25 19:37:14 +0000 | |||
1207 | +++ data/qt/ubuntuone.qss 2011-09-26 18:38:27 +0000 | |||
1208 | @@ -1,5 +1,5 @@ | |||
1209 | 1 | QMainWindow { | 1 | QMainWindow { |
1211 | 2 | background-color: #dd4814; | 2 | background-color: #aea79f; |
1212 | 3 | } | 3 | } |
1213 | 4 | 4 | ||
1214 | 5 | QWidget { | 5 | QWidget { |
1215 | @@ -12,6 +12,7 @@ | |||
1216 | 12 | border: none; | 12 | border: none; |
1217 | 13 | } | 13 | } |
1218 | 14 | 14 | ||
1219 | 15 | QFrame#signin, | ||
1220 | 15 | QFrame#frame_header { | 16 | QFrame#frame_header { |
1221 | 16 | background: #ffffff; | 17 | background: #ffffff; |
1222 | 17 | border-radius: 5px; | 18 | border-radius: 5px; |
1223 | @@ -137,6 +138,7 @@ | |||
1224 | 137 | border: none; | 138 | border: none; |
1225 | 138 | } | 139 | } |
1226 | 139 | 140 | ||
1227 | 141 | GoToWebButton#forgot_password_button, | ||
1228 | 140 | GoToWebButton#share_publish_button { | 142 | GoToWebButton#share_publish_button { |
1229 | 141 | background: transparent; | 143 | background: transparent; |
1230 | 142 | border: none; | 144 | border: none; |
1231 | @@ -216,11 +218,8 @@ | |||
1232 | 216 | padding-top: 30px; | 218 | padding-top: 30px; |
1233 | 217 | border: none; | 219 | border: none; |
1234 | 218 | margin-top: 1ex; | 220 | margin-top: 1ex; |
1235 | 219 | } | ||
1236 | 220 | |||
1237 | 221 | QGroupBox::title { | ||
1238 | 222 | color: #333333; | 221 | color: #333333; |
1240 | 223 | font: bold 15px; | 222 | font: bold 14px; |
1241 | 224 | } | 223 | } |
1242 | 225 | 224 | ||
1243 | 226 | QGroupBox#profile, | 225 | QGroupBox#profile, |
1244 | @@ -228,6 +227,11 @@ | |||
1245 | 228 | padding-left: 5px; | 227 | padding-left: 5px; |
1246 | 229 | } | 228 | } |
1247 | 230 | 229 | ||
1248 | 230 | QGroupBox#bandwidth_settings, | ||
1249 | 231 | QGroupBox#file_sync_settings { | ||
1250 | 232 | padding-left: 20px; | ||
1251 | 233 | } | ||
1252 | 234 | |||
1253 | 231 | QListWidget { | 235 | QListWidget { |
1254 | 232 | background: #f7f6f5; | 236 | background: #f7f6f5; |
1255 | 233 | alternate-background-color: #efedec; | 237 | alternate-background-color: #efedec; |
1256 | @@ -237,6 +241,10 @@ | |||
1257 | 237 | min-height: 48px; | 241 | min-height: 48px; |
1258 | 238 | } | 242 | } |
1259 | 239 | 243 | ||
1260 | 244 | QLabel[OverQuota="false"] { | ||
1261 | 245 | color: #333333; | ||
1262 | 246 | } | ||
1263 | 247 | |||
1264 | 240 | QLabel#other_devices_label { | 248 | QLabel#other_devices_label { |
1265 | 241 | font: bold 16px; | 249 | font: bold 16px; |
1266 | 242 | } | 250 | } |
1267 | @@ -249,6 +257,20 @@ | |||
1268 | 249 | color: white; | 257 | color: white; |
1269 | 250 | } | 258 | } |
1270 | 251 | 259 | ||
1271 | 260 | QLabel#sign_in_label { | ||
1272 | 261 | font: 16px; | ||
1273 | 262 | } | ||
1274 | 263 | |||
1275 | 264 | QLabel#email_label, | ||
1276 | 265 | QLabel#password_label { | ||
1277 | 266 | font-size: 10px; | ||
1278 | 267 | } | ||
1279 | 268 | |||
1280 | 269 | QLabel[OverQuota="true"], | ||
1281 | 270 | QLabel#warning_label { | ||
1282 | 271 | color: #df2d1f; | ||
1283 | 272 | } | ||
1284 | 273 | |||
1285 | 252 | QAbstractItemView { | 274 | QAbstractItemView { |
1286 | 253 | border-style: solid; | 275 | border-style: solid; |
1287 | 254 | border-color: #898989; | 276 | border-color: #898989; |
1288 | 255 | 277 | ||
1289 | === modified file 'debian/changelog' | |||
1290 | --- debian/changelog 2011-09-07 13:35:18 +0000 | |||
1291 | +++ debian/changelog 2011-09-26 18:38:27 +0000 | |||
1292 | @@ -1,3 +1,32 @@ | |||
1293 | 1 | ubuntuone-control-panel (2.0.0-0ubuntu1) UNRELEASED; urgency=low | ||
1294 | 2 | |||
1295 | 3 | * New upstream release: | ||
1296 | 4 | |||
1297 | 5 | [ Alejandro J. Cura <alecu@canonical.com>] | ||
1298 | 6 | - Do not throw a webclient error when closing | ||
1299 | 7 | (LP: #845105). | ||
1300 | 8 | [ Natalia B. Bidart <natalia.bidart@canonical.com> ] | ||
1301 | 9 | - Removed all code related to Bookmarks (LP: #850142). | ||
1302 | 10 | - Replaces references to "Evolution" by "Thunderbird" (LP: #849494). | ||
1303 | 11 | [ Rodney Dawes <rodney.dawes@canonical.com> ] | ||
1304 | 12 | - Don't install a .desktop file for control panel | ||
1305 | 13 | (part of LP: #838778). | ||
1306 | 14 | - Point the indicator/Unity API at the installer .desktop file | ||
1307 | 15 | (part of LP: #838778). | ||
1308 | 16 | - Set the WMCLASS so Unity will fall back properly | ||
1309 | 17 | (part of LP: #838778). | ||
1310 | 18 | - Fix a few grammar mistakes (LP: #835093). | ||
1311 | 19 | - Don't show the "Get NGB free!" label on "Join now" button at all | ||
1312 | 20 | (LP: #819955). | ||
1313 | 21 | |||
1314 | 22 | * debian/control: | ||
1315 | 23 | - ubuntuone-control-panel-gtk depends now on ubuntuone-installer >= 2.0.0. | ||
1316 | 24 | - require ubuntuone-client >= 2.0.0. | ||
1317 | 25 | - require ubuntu-sso-client >= 1.4.0. | ||
1318 | 26 | - no longer install a .desktop file (will be installed by ubuntuone-installer). | ||
1319 | 27 | |||
1320 | 28 | -- Natalia Bidart (nessita) <natalia.bidart@canonical.com> Mon, 26 Sep 2011 14:55:15 -0300 | ||
1321 | 29 | |||
1322 | 1 | ubuntuone-control-panel (1.1.3-0ubuntu2) UNRELEASED; urgency=low | 30 | ubuntuone-control-panel (1.1.3-0ubuntu2) UNRELEASED; urgency=low |
1323 | 2 | 31 | ||
1324 | 3 | [ Paul Stewart ] | 32 | [ Paul Stewart ] |
1325 | 4 | 33 | ||
1326 | === modified file 'debian/control' | |||
1327 | --- debian/control 2011-08-26 21:22:36 +0000 | |||
1328 | +++ debian/control 2011-09-26 18:38:27 +0000 | |||
1329 | @@ -17,7 +17,7 @@ | |||
1330 | 17 | ${python:Depends}, | 17 | ${python:Depends}, |
1331 | 18 | python, | 18 | python, |
1332 | 19 | python-ubuntuone-control-panel (= ${binary:Version}), | 19 | python-ubuntuone-control-panel (= ${binary:Version}), |
1334 | 20 | ubuntuone-client (>= 1.7.1), | 20 | ubuntuone-client (>= 2.0.0), |
1335 | 21 | Recommends: ubuntuone-control-panel-gui | 21 | Recommends: ubuntuone-control-panel-gui |
1336 | 22 | Description: Ubuntu One Control Panel | 22 | Description: Ubuntu One Control Panel |
1337 | 23 | Desktop application to manage an Ubuntu One account. | 23 | Desktop application to manage an Ubuntu One account. |
1338 | @@ -37,8 +37,8 @@ | |||
1339 | 37 | python-simplejson, | 37 | python-simplejson, |
1340 | 38 | python-twisted-core, | 38 | python-twisted-core, |
1341 | 39 | python-twisted-web, | 39 | python-twisted-web, |
1344 | 40 | python-ubuntuone-client (>= 1.7.1), | 40 | python-ubuntuone-client (>= 2.0.0), |
1345 | 41 | ubuntu-sso-client (>= 1.2.0), | 41 | ubuntu-sso-client (>= 1.4.0), |
1346 | 42 | Description: Ubuntu One Control Panel Python Libraries | 42 | Description: Ubuntu One Control Panel Python Libraries |
1347 | 43 | Ubuntu One Control Panel provides a Python library to manage an Ubuntu One | 43 | Ubuntu One Control Panel provides a Python library to manage an Ubuntu One |
1348 | 44 | account. | 44 | account. |
1349 | @@ -55,11 +55,11 @@ | |||
1350 | 55 | python-defer | python-aptdaemon, | 55 | python-defer | python-aptdaemon, |
1351 | 56 | python-gobject (>= 2.21.5), | 56 | python-gobject (>= 2.21.5), |
1352 | 57 | python-gtk2, | 57 | python-gtk2, |
1356 | 58 | python-ubuntuone-client (>= 1.7.1), | 58 | python-ubuntuone-client (>= 2.0.0), |
1357 | 59 | ubuntu-sso-client (>= 1.2.0), | 59 | ubuntu-sso-client (>= 1.4.0), |
1358 | 60 | ubuntuone-client (>= 1.7.1), | 60 | ubuntuone-client (>= 2.0.0), |
1359 | 61 | ubuntuone-control-panel (= ${binary:Version}), | 61 | ubuntuone-control-panel (= ${binary:Version}), |
1360 | 62 | ubuntuone-installer (>= 2.0.0), | ||
1361 | 62 | Provides: ubuntuone-control-panel-gui | 63 | Provides: ubuntuone-control-panel-gui |
1362 | 63 | Description: Ubuntu One Control Panel | 64 | Description: Ubuntu One Control Panel |
1363 | 64 | GTK+ desktop application to manage an Ubuntu One account. | 65 | GTK+ desktop application to manage an Ubuntu One account. |
1364 | 65 | |||
1365 | 66 | 66 | ||
1366 | === modified file 'debian/ubuntuone-control-panel-gtk.install' | |||
1367 | --- debian/ubuntuone-control-panel-gtk.install 2011-07-22 21:45:30 +0000 | |||
1368 | +++ debian/ubuntuone-control-panel-gtk.install 2011-09-26 18:38:27 +0000 | |||
1369 | @@ -1,7 +1,6 @@ | |||
1370 | 1 | debian/tmp/usr/bin/ubuntuone-control-panel-gtk | 1 | debian/tmp/usr/bin/ubuntuone-control-panel-gtk |
1371 | 2 | debian/tmp/usr/share/dbus-1/services/com.ubuntuone.controlpanel.gui.service | 2 | debian/tmp/usr/share/dbus-1/services/com.ubuntuone.controlpanel.gui.service |
1372 | 3 | debian/tmp/usr/share/indicators/messages/applications/ubuntuone-control-panel | 3 | debian/tmp/usr/share/indicators/messages/applications/ubuntuone-control-panel |
1373 | 4 | debian/tmp/usr/share/applications/ubuntuone-control-panel-gtk.desktop | ||
1374 | 5 | debian/tmp/usr/share/ubuntuone-control-panel/gtk/*.ui | 4 | debian/tmp/usr/share/ubuntuone-control-panel/gtk/*.ui |
1375 | 6 | debian/tmp/usr/share/ubuntuone-control-panel/*.png | 5 | debian/tmp/usr/share/ubuntuone-control-panel/*.png |
1376 | 7 | debian/tmp/usr/share/man/man1/ubuntuone-control-panel-gtk.* | 6 | debian/tmp/usr/share/man/man1/ubuntuone-control-panel-gtk.* |
1377 | 8 | 7 | ||
1378 | === modified file 'docs/ubuntuone-control-panel-gtk.1' | |||
1379 | --- docs/ubuntuone-control-panel-gtk.1 2010-12-06 12:27:11 +0000 | |||
1380 | +++ docs/ubuntuone-control-panel-gtk.1 2011-09-26 18:38:27 +0000 | |||
1381 | @@ -1,7 +1,7 @@ | |||
1382 | 1 | .TH UBUNTUONE-CONTROL-PANEL-GTK 1 | 1 | .TH UBUNTUONE-CONTROL-PANEL-GTK 1 |
1383 | 2 | 2 | ||
1384 | 3 | .SH NAME | 3 | .SH NAME |
1386 | 4 | ubuntuone-control-panel-gtk \- A GTK UI for managing a Ubuntu One account | 4 | ubuntuone-control-panel-gtk \- A GTK UI for managing an Ubuntu One account |
1387 | 5 | 5 | ||
1388 | 6 | .SH SYNOPSYS | 6 | .SH SYNOPSYS |
1389 | 7 | .B ubutuone-control-panel-gtk | 7 | .B ubutuone-control-panel-gtk |
1390 | @@ -9,7 +9,7 @@ | |||
1391 | 9 | .SH DESCRIPTION | 9 | .SH DESCRIPTION |
1392 | 10 | This manual page briefly documents the | 10 | This manual page briefly documents the |
1393 | 11 | .BR ubuntuone-control-panel-gtk | 11 | .BR ubuntuone-control-panel-gtk |
1395 | 12 | process, which provides a desktop application to manage a Ubuntu One account. | 12 | process, which provides a desktop application to manage an Ubuntu One account. |
1396 | 13 | 13 | ||
1397 | 14 | .SH AUTHOR | 14 | .SH AUTHOR |
1398 | 15 | This manual page was written by Natalia Bidart <natalia.bidart@canonical.com> | 15 | This manual page was written by Natalia Bidart <natalia.bidart@canonical.com> |
1399 | 16 | 16 | ||
1400 | === modified file 'po/POTFILES.in' | |||
1401 | --- po/POTFILES.in 2011-07-22 21:26:48 +0000 | |||
1402 | +++ po/POTFILES.in 2011-09-26 18:38:27 +0000 | |||
1403 | @@ -1,4 +1,3 @@ | |||
1404 | 1 | ubuntuone-control-panel-gtk.desktop.in | ||
1405 | 2 | ubuntuone/controlpanel/gui/__init__.py | 1 | ubuntuone/controlpanel/gui/__init__.py |
1406 | 3 | [type: gettext/glade] data/gtk/dashboard.ui | 2 | [type: gettext/glade] data/gtk/dashboard.ui |
1407 | 4 | [type: gettext/glade] data/gtk/device.ui | 3 | [type: gettext/glade] data/gtk/device.ui |
1408 | 5 | 4 | ||
1409 | === removed file 'po/ubuntuone-control-panel.pot' | |||
1410 | --- po/ubuntuone-control-panel.pot 2011-08-25 19:37:14 +0000 | |||
1411 | +++ po/ubuntuone-control-panel.pot 1970-01-01 00:00:00 +0000 | |||
1412 | @@ -1,486 +0,0 @@ | |||
1413 | 1 | # SOME DESCRIPTIVE TITLE. | ||
1414 | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
1415 | 3 | # This file is distributed under the same license as the PACKAGE package. | ||
1416 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
1417 | 5 | # | ||
1418 | 6 | #, fuzzy | ||
1419 | 7 | msgid "" | ||
1420 | 8 | msgstr "" | ||
1421 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | ||
1422 | 10 | "Report-Msgid-Bugs-To: \n" | ||
1423 | 11 | "POT-Creation-Date: 2011-08-25 15:26-0400\n" | ||
1424 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
1425 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
1426 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | ||
1427 | 15 | "Language: \n" | ||
1428 | 16 | "MIME-Version: 1.0\n" | ||
1429 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | ||
1430 | 18 | "Content-Transfer-Encoding: 8bit\n" | ||
1431 | 19 | |||
1432 | 20 | #: ../ubuntuone-control-panel-gtk.desktop.in.h:1 | ||
1433 | 21 | msgid "Configure and manage your Ubuntu One account" | ||
1434 | 22 | msgstr "" | ||
1435 | 23 | |||
1436 | 24 | #: ../ubuntuone/controlpanel/gui/__init__.py:72 | ||
1437 | 25 | msgid "Always in sync" | ||
1438 | 26 | msgstr "" | ||
1439 | 27 | |||
1440 | 28 | #: ../ubuntuone/controlpanel/gui/__init__.py:73 | ||
1441 | 29 | msgid "Firefox extension" | ||
1442 | 30 | msgstr "" | ||
1443 | 31 | |||
1444 | 32 | #: ../ubuntuone/controlpanel/gui/__init__.py:74 | ||
1445 | 33 | msgid "Connect to Ubuntu One" | ||
1446 | 34 | msgstr "" | ||
1447 | 35 | |||
1448 | 36 | #: ../ubuntuone/controlpanel/gui/__init__.py:75 | ||
1449 | 37 | msgid "Evolution plug-in" | ||
1450 | 38 | msgstr "" | ||
1451 | 39 | |||
1452 | 40 | #: ../ubuntuone/controlpanel/gui/__init__.py:76 | ||
1453 | 41 | msgid "There was a problem while retrieving the credentials." | ||
1454 | 42 | msgstr "" | ||
1455 | 43 | |||
1456 | 44 | #: ../ubuntuone/controlpanel/gui/__init__.py:77 | ||
1457 | 45 | msgid "View your personal details and service summary" | ||
1458 | 46 | msgstr "" | ||
1459 | 47 | |||
1460 | 48 | #: ../ubuntuone/controlpanel/gui/__init__.py:79 | ||
1461 | 49 | msgid "Welcome to Ubuntu One!" | ||
1462 | 50 | msgstr "" | ||
1463 | 51 | |||
1464 | 52 | #: ../ubuntuone/controlpanel/gui/__init__.py:80 | ||
1465 | 53 | msgid "" | ||
1466 | 54 | "The information could not be retrieved. Maybe your internet connection is " | ||
1467 | 55 | "down?" | ||
1468 | 56 | msgstr "" | ||
1469 | 57 | |||
1470 | 58 | #: ../ubuntuone/controlpanel/gui/__init__.py:83 | ||
1471 | 59 | #: ../ubuntuone/controlpanel/gui/__init__.py:156 | ||
1472 | 60 | msgid "" | ||
1473 | 61 | "The settings could not be changed,\n" | ||
1474 | 62 | "previous values were restored." | ||
1475 | 63 | msgstr "" | ||
1476 | 64 | |||
1477 | 65 | #: ../ubuntuone/controlpanel/gui/__init__.py:85 | ||
1478 | 66 | msgid "Are you sure you want to remove this device from Ubuntu One?" | ||
1479 | 67 | msgstr "" | ||
1480 | 68 | |||
1481 | 69 | #: ../ubuntuone/controlpanel/gui/__init__.py:88 | ||
1482 | 70 | msgid "The device could not be removed." | ||
1483 | 71 | msgstr "" | ||
1484 | 72 | |||
1485 | 73 | #: ../ubuntuone/controlpanel/gui/__init__.py:89 | ||
1486 | 74 | msgid "Manage devices registered with your personal cloud" | ||
1487 | 75 | msgstr "" | ||
1488 | 76 | |||
1489 | 77 | #: ../ubuntuone/controlpanel/gui/__init__.py:91 | ||
1490 | 78 | msgid "The devices connected with your personal cloud are listed below." | ||
1491 | 79 | msgstr "" | ||
1492 | 80 | |||
1493 | 81 | #: ../ubuntuone/controlpanel/gui/__init__.py:93 | ||
1494 | 82 | msgid "Explore" | ||
1495 | 83 | msgstr "" | ||
1496 | 84 | |||
1497 | 85 | #: ../ubuntuone/controlpanel/gui/__init__.py:94 | ||
1498 | 86 | #, python-format | ||
1499 | 87 | msgid "<i>%(package_name)s</i> could not be installed" | ||
1500 | 88 | msgstr "" | ||
1501 | 89 | |||
1502 | 90 | #: ../ubuntuone/controlpanel/gui/__init__.py:95 | ||
1503 | 91 | msgid "Sync another folder with your cloud" | ||
1504 | 92 | msgstr "" | ||
1505 | 93 | |||
1506 | 94 | #: ../ubuntuone/controlpanel/gui/__init__.py:96 | ||
1507 | 95 | #, python-format | ||
1508 | 96 | msgid "" | ||
1509 | 97 | "The chosen directory \"%(folder_path)s\" is not valid. \n" | ||
1510 | 98 | "\n" | ||
1511 | 99 | "Please choose a folder inside your \"%(home_folder)s\" directory, and not " | ||
1512 | 100 | "overlapping with any existing cloud folder." | ||
1513 | 101 | msgstr "" | ||
1514 | 102 | |||
1515 | 103 | #: ../ubuntuone/controlpanel/gui/__init__.py:101 | ||
1516 | 104 | msgid "My personal folders" | ||
1517 | 105 | msgstr "" | ||
1518 | 106 | |||
1519 | 107 | #: ../ubuntuone/controlpanel/gui/__init__.py:102 | ||
1520 | 108 | #, python-format | ||
1521 | 109 | msgid "Shared by %(other_user_display_name)s" | ||
1522 | 110 | msgstr "" | ||
1523 | 111 | |||
1524 | 112 | #: ../ubuntuone/controlpanel/gui/__init__.py:103 | ||
1525 | 113 | #, python-format | ||
1526 | 114 | msgid "" | ||
1527 | 115 | "The contents of your cloud folder will be merged with your local folder " | ||
1528 | 116 | "\"%(folder_path)s\" when subscribing.\n" | ||
1529 | 117 | "Do you want to subscribe to this cloud folder?" | ||
1530 | 118 | msgstr "" | ||
1531 | 119 | |||
1532 | 120 | #: ../ubuntuone/controlpanel/gui/__init__.py:107 | ||
1533 | 121 | msgid "Manage your cloud folders" | ||
1534 | 122 | msgstr "" | ||
1535 | 123 | |||
1536 | 124 | #: ../ubuntuone/controlpanel/gui/__init__.py:109 | ||
1537 | 125 | msgid "" | ||
1538 | 126 | "Select which folders from your cloud you want to sync with this computer" | ||
1539 | 127 | msgstr "" | ||
1540 | 128 | |||
1541 | 129 | #: ../ubuntuone/controlpanel/gui/__init__.py:111 | ||
1542 | 130 | msgid "Connect" | ||
1543 | 131 | msgstr "" | ||
1544 | 132 | |||
1545 | 133 | #: ../ubuntuone/controlpanel/gui/__init__.py:112 | ||
1546 | 134 | msgid "Connect the file sync service with your personal cloud" | ||
1547 | 135 | msgstr "" | ||
1548 | 136 | |||
1549 | 137 | #: ../ubuntuone/controlpanel/gui/__init__.py:114 | ||
1550 | 138 | msgid "File Sync is disabled." | ||
1551 | 139 | msgstr "" | ||
1552 | 140 | |||
1553 | 141 | #: ../ubuntuone/controlpanel/gui/__init__.py:115 | ||
1554 | 142 | msgid "Disconnect" | ||
1555 | 143 | msgstr "" | ||
1556 | 144 | |||
1557 | 145 | #: ../ubuntuone/controlpanel/gui/__init__.py:116 | ||
1558 | 146 | msgid "Disconnect the file sync service from your personal cloud" | ||
1559 | 147 | msgstr "" | ||
1560 | 148 | |||
1561 | 149 | #: ../ubuntuone/controlpanel/gui/__init__.py:118 | ||
1562 | 150 | msgid "File Sync is disconnected." | ||
1563 | 151 | msgstr "" | ||
1564 | 152 | |||
1565 | 153 | #: ../ubuntuone/controlpanel/gui/__init__.py:119 | ||
1566 | 154 | msgid "Enable" | ||
1567 | 155 | msgstr "" | ||
1568 | 156 | |||
1569 | 157 | #: ../ubuntuone/controlpanel/gui/__init__.py:120 | ||
1570 | 158 | msgid "Enable the file sync service" | ||
1571 | 159 | msgstr "" | ||
1572 | 160 | |||
1573 | 161 | #: ../ubuntuone/controlpanel/gui/__init__.py:121 | ||
1574 | 162 | msgid "File Sync error." | ||
1575 | 163 | msgstr "" | ||
1576 | 164 | |||
1577 | 165 | #: ../ubuntuone/controlpanel/gui/__init__.py:122 | ||
1578 | 166 | msgid "File Sync is up-to-date." | ||
1579 | 167 | msgstr "" | ||
1580 | 168 | |||
1581 | 169 | #: ../ubuntuone/controlpanel/gui/__init__.py:123 | ||
1582 | 170 | msgid "Restart" | ||
1583 | 171 | msgstr "" | ||
1584 | 172 | |||
1585 | 173 | #: ../ubuntuone/controlpanel/gui/__init__.py:124 | ||
1586 | 174 | msgid "Restart the file sync service" | ||
1587 | 175 | msgstr "" | ||
1588 | 176 | |||
1589 | 177 | #: ../ubuntuone/controlpanel/gui/__init__.py:125 | ||
1590 | 178 | msgid "File Sync" | ||
1591 | 179 | msgstr "" | ||
1592 | 180 | |||
1593 | 181 | #: ../ubuntuone/controlpanel/gui/__init__.py:126 | ||
1594 | 182 | msgid "Start" | ||
1595 | 183 | msgstr "" | ||
1596 | 184 | |||
1597 | 185 | #: ../ubuntuone/controlpanel/gui/__init__.py:127 | ||
1598 | 186 | msgid "Start the file sync service" | ||
1599 | 187 | msgstr "" | ||
1600 | 188 | |||
1601 | 189 | #: ../ubuntuone/controlpanel/gui/__init__.py:128 | ||
1602 | 190 | msgid "File Sync starting..." | ||
1603 | 191 | msgstr "" | ||
1604 | 192 | |||
1605 | 193 | #: ../ubuntuone/controlpanel/gui/__init__.py:129 | ||
1606 | 194 | msgid "Stop" | ||
1607 | 195 | msgstr "" | ||
1608 | 196 | |||
1609 | 197 | #: ../ubuntuone/controlpanel/gui/__init__.py:130 | ||
1610 | 198 | msgid "Stop the file sync service" | ||
1611 | 199 | msgstr "" | ||
1612 | 200 | |||
1613 | 201 | #: ../ubuntuone/controlpanel/gui/__init__.py:131 | ||
1614 | 202 | msgid "File Sync is stopped." | ||
1615 | 203 | msgstr "" | ||
1616 | 204 | |||
1617 | 205 | #: ../ubuntuone/controlpanel/gui/__init__.py:132 | ||
1618 | 206 | msgid "File Sync in progress..." | ||
1619 | 207 | msgstr "" | ||
1620 | 208 | |||
1621 | 209 | #: ../ubuntuone/controlpanel/gui/__init__.py:133 | ||
1622 | 210 | #, python-format | ||
1623 | 211 | msgid "%(free_space)s available storage" | ||
1624 | 212 | msgstr "" | ||
1625 | 213 | |||
1626 | 214 | #: ../ubuntuone/controlpanel/gui/__init__.py:134 | ||
1627 | 215 | #, python-format | ||
1628 | 216 | msgid "Hi %(user_display_name)s" | ||
1629 | 217 | msgstr "" | ||
1630 | 218 | |||
1631 | 219 | #: ../ubuntuone/controlpanel/gui/__init__.py:135 | ||
1632 | 220 | #, python-format | ||
1633 | 221 | msgid "" | ||
1634 | 222 | "You need to install the package <i>%(package_name)s</i> in order to enable " | ||
1635 | 223 | "more sync services." | ||
1636 | 224 | msgstr "" | ||
1637 | 225 | |||
1638 | 226 | #: ../ubuntuone/controlpanel/gui/__init__.py:137 | ||
1639 | 227 | #, python-format | ||
1640 | 228 | msgid "Install the %(plugin_name)s for the sync service: %(service_name)s" | ||
1641 | 229 | msgstr "" | ||
1642 | 230 | |||
1643 | 231 | #: ../ubuntuone/controlpanel/gui/__init__.py:139 | ||
1644 | 232 | #, python-format | ||
1645 | 233 | msgid "Installation of <i>%(package_name)s</i> in progress" | ||
1646 | 234 | msgstr "" | ||
1647 | 235 | |||
1648 | 236 | #: ../ubuntuone/controlpanel/gui/__init__.py:140 | ||
1649 | 237 | msgid "Loading..." | ||
1650 | 238 | msgstr "" | ||
1651 | 239 | |||
1652 | 240 | #: ../ubuntuone/controlpanel/gui/__init__.py:141 | ||
1653 | 241 | #, python-format | ||
1654 | 242 | msgid "%(app_name)s Control Panel" | ||
1655 | 243 | msgstr "" | ||
1656 | 244 | |||
1657 | 245 | #: ../ubuntuone/controlpanel/gui/__init__.py:142 | ||
1658 | 246 | msgid "My folders" | ||
1659 | 247 | msgstr "" | ||
1660 | 248 | |||
1661 | 249 | #: ../ubuntuone/controlpanel/gui/__init__.py:143 | ||
1662 | 250 | msgid "[unknown user name]" | ||
1663 | 251 | msgstr "" | ||
1664 | 252 | |||
1665 | 253 | #: ../ubuntuone/controlpanel/gui/__init__.py:144 | ||
1666 | 254 | msgid "Purchased Music" | ||
1667 | 255 | msgstr "" | ||
1668 | 256 | |||
1669 | 257 | #: ../ubuntuone/controlpanel/gui/__init__.py:146 | ||
1670 | 258 | #, python-format | ||
1671 | 259 | msgid "An internet connection is required to join or sign in to %(app_name)s." | ||
1672 | 260 | msgstr "" | ||
1673 | 261 | |||
1674 | 262 | #: ../ubuntuone/controlpanel/gui/__init__.py:148 | ||
1675 | 263 | msgid "No devices to show." | ||
1676 | 264 | msgstr "" | ||
1677 | 265 | |||
1678 | 266 | #: ../ubuntuone/controlpanel/gui/__init__.py:149 | ||
1679 | 267 | msgid "No folders to show." | ||
1680 | 268 | msgstr "" | ||
1681 | 269 | |||
1682 | 270 | #: ../ubuntuone/controlpanel/gui/__init__.py:150 | ||
1683 | 271 | msgid "There is no Ubuntu One pairing record." | ||
1684 | 272 | msgstr "" | ||
1685 | 273 | |||
1686 | 274 | #: ../ubuntuone/controlpanel/gui/__init__.py:151 | ||
1687 | 275 | #, python-format | ||
1688 | 276 | msgid "%(percentage)s used" | ||
1689 | 277 | msgstr "" | ||
1690 | 278 | |||
1691 | 279 | #: ../ubuntuone/controlpanel/gui/__init__.py:152 | ||
1692 | 280 | #, python-format | ||
1693 | 281 | msgid "Using %(used)s of %(total)s (%(percentage).0f%%)" | ||
1694 | 282 | msgstr "" | ||
1695 | 283 | |||
1696 | 284 | #: ../ubuntuone/controlpanel/gui/__init__.py:153 | ||
1697 | 285 | #, python-format | ||
1698 | 286 | msgid "%(used)s of %(total)s" | ||
1699 | 287 | msgstr "" | ||
1700 | 288 | |||
1701 | 289 | #: ../ubuntuone/controlpanel/gui/__init__.py:154 | ||
1702 | 290 | msgid "Manage the sync services" | ||
1703 | 291 | msgstr "" | ||
1704 | 292 | |||
1705 | 293 | #: ../ubuntuone/controlpanel/gui/__init__.py:155 | ||
1706 | 294 | msgid "Enable the sync services for this computer." | ||
1707 | 295 | msgstr "" | ||
1708 | 296 | |||
1709 | 297 | #: ../ubuntuone/controlpanel/gui/__init__.py:158 | ||
1710 | 298 | msgid "Manage the shares offered to others" | ||
1711 | 299 | msgstr "" | ||
1712 | 300 | |||
1713 | 301 | #: ../ubuntuone/controlpanel/gui/__init__.py:159 | ||
1714 | 302 | msgid "Manage permissions for shares made to other users." | ||
1715 | 303 | msgstr "" | ||
1716 | 304 | |||
1717 | 305 | #: ../ubuntuone/controlpanel/gui/__init__.py:160 | ||
1718 | 306 | #, python-format | ||
1719 | 307 | msgid "<i>%(package_name)s</i> was successfully installed" | ||
1720 | 308 | msgstr "" | ||
1721 | 309 | |||
1722 | 310 | #: ../ubuntuone/controlpanel/gui/__init__.py:161 ../data/gtk/volumes.ui.h:1 | ||
1723 | 311 | msgid "Sync locally?" | ||
1724 | 312 | msgstr "" | ||
1725 | 313 | |||
1726 | 314 | #: ../ubuntuone/controlpanel/gui/__init__.py:162 | ||
1727 | 315 | msgid "Value could not be retrieved." | ||
1728 | 316 | msgstr "" | ||
1729 | 317 | |||
1730 | 318 | #: ../ubuntuone/controlpanel/gui/__init__.py:163 | ||
1731 | 319 | msgid "Unknown error" | ||
1732 | 320 | msgstr "" | ||
1733 | 321 | |||
1734 | 322 | #: ../data/gtk/dashboard.ui.h:1 | ||
1735 | 323 | msgid "<b>Personal details</b>" | ||
1736 | 324 | msgstr "" | ||
1737 | 325 | |||
1738 | 326 | #: ../data/gtk/dashboard.ui.h:2 | ||
1739 | 327 | msgid "<b>Your services</b>" | ||
1740 | 328 | msgstr "" | ||
1741 | 329 | |||
1742 | 330 | #: ../data/gtk/dashboard.ui.h:3 | ||
1743 | 331 | msgid "Buy storage and plans" | ||
1744 | 332 | msgstr "" | ||
1745 | 333 | |||
1746 | 334 | #: ../data/gtk/dashboard.ui.h:4 | ||
1747 | 335 | msgid "Edit account details" | ||
1748 | 336 | msgstr "" | ||
1749 | 337 | |||
1750 | 338 | #: ../data/gtk/device.ui.h:1 | ||
1751 | 339 | msgid "KiB/s" | ||
1752 | 340 | msgstr "" | ||
1753 | 341 | |||
1754 | 342 | #: ../data/gtk/device.ui.h:2 | ||
1755 | 343 | msgid "Limit file sync bandwidth usage" | ||
1756 | 344 | msgstr "" | ||
1757 | 345 | |||
1758 | 346 | #: ../data/gtk/device.ui.h:3 | ||
1759 | 347 | msgid "Max download speed:" | ||
1760 | 348 | msgstr "" | ||
1761 | 349 | |||
1762 | 350 | #: ../data/gtk/device.ui.h:4 | ||
1763 | 351 | msgid "Max upload speed:" | ||
1764 | 352 | msgstr "" | ||
1765 | 353 | |||
1766 | 354 | #: ../data/gtk/device.ui.h:5 | ||
1767 | 355 | msgid "Show activity notifications" | ||
1768 | 356 | msgstr "" | ||
1769 | 357 | |||
1770 | 358 | #: ../data/gtk/install.ui.h:1 | ||
1771 | 359 | msgid "_Install now" | ||
1772 | 360 | msgstr "" | ||
1773 | 361 | |||
1774 | 362 | #: ../data/gtk/management.ui.h:1 | ||
1775 | 363 | msgid "Account" | ||
1776 | 364 | msgstr "" | ||
1777 | 365 | |||
1778 | 366 | #: ../data/gtk/management.ui.h:2 | ||
1779 | 367 | msgid "Cloud Folders" | ||
1780 | 368 | msgstr "" | ||
1781 | 369 | |||
1782 | 370 | #: ../data/gtk/management.ui.h:3 | ||
1783 | 371 | msgid "Community Support" | ||
1784 | 372 | msgstr "" | ||
1785 | 373 | |||
1786 | 374 | #: ../data/gtk/management.ui.h:4 | ||
1787 | 375 | msgid "Devices" | ||
1788 | 376 | msgstr "" | ||
1789 | 377 | |||
1790 | 378 | #: ../data/gtk/management.ui.h:5 | ||
1791 | 379 | msgid "Official Support" | ||
1792 | 380 | msgstr "" | ||
1793 | 381 | |||
1794 | 382 | #: ../data/gtk/management.ui.h:6 | ||
1795 | 383 | msgid "Services" | ||
1796 | 384 | msgstr "" | ||
1797 | 385 | |||
1798 | 386 | #: ../data/gtk/management.ui.h:7 | ||
1799 | 387 | msgid "Shares" | ||
1800 | 388 | msgstr "" | ||
1801 | 389 | |||
1802 | 390 | #: ../data/gtk/management.ui.h:8 | ||
1803 | 391 | msgid "Talk to us on:" | ||
1804 | 392 | msgstr "" | ||
1805 | 393 | |||
1806 | 394 | #: ../data/gtk/management.ui.h:9 | ||
1807 | 395 | msgid "http://twitter.com/ubuntuone" | ||
1808 | 396 | msgstr "" | ||
1809 | 397 | |||
1810 | 398 | #: ../data/gtk/management.ui.h:10 | ||
1811 | 399 | msgid "http://www.facebook.com/ubuntuone" | ||
1812 | 400 | msgstr "" | ||
1813 | 401 | |||
1814 | 402 | #: ../data/gtk/overview.ui.h:1 | ||
1815 | 403 | msgid "" | ||
1816 | 404 | "<span font=\"24\" foreground=\"#4d4d4d\">The Power of Your Personal Cloud</" | ||
1817 | 405 | "span>" | ||
1818 | 406 | msgstr "" | ||
1819 | 407 | |||
1820 | 408 | #: ../data/gtk/overview.ui.h:2 | ||
1821 | 409 | msgid "<span font_size=\"xx-large\" foreground=\"#4d4d4d\">Join now</span>" | ||
1822 | 410 | msgstr "" | ||
1823 | 411 | |||
1824 | 412 | #: ../data/gtk/overview.ui.h:3 | ||
1825 | 413 | msgid "<span foreground=\"#909090\">2GB of free storage</span>" | ||
1826 | 414 | msgstr "" | ||
1827 | 415 | |||
1828 | 416 | #: ../data/gtk/overview.ui.h:4 | ||
1829 | 417 | msgid "<span foreground=\"#909090\">Learn More</span>" | ||
1830 | 418 | msgstr "" | ||
1831 | 419 | |||
1832 | 420 | #: ../data/gtk/overview.ui.h:5 | ||
1833 | 421 | msgid "" | ||
1834 | 422 | "Files Anywhere\n" | ||
1835 | 423 | "<span foreground=\"#909090\">Back up and access your files from Ubuntu, " | ||
1836 | 424 | "Windows, Web or Mobile</span>" | ||
1837 | 425 | msgstr "" | ||
1838 | 426 | |||
1839 | 427 | #: ../data/gtk/overview.ui.h:7 | ||
1840 | 428 | msgid "I already have an account!" | ||
1841 | 429 | msgstr "" | ||
1842 | 430 | |||
1843 | 431 | #: ../data/gtk/overview.ui.h:8 | ||
1844 | 432 | msgid "" | ||
1845 | 433 | "Keep Connected\n" | ||
1846 | 434 | "<span foreground=\"#909090\">Unify your contacts across Desktop, Mobile and " | ||
1847 | 435 | "Web</span>" | ||
1848 | 436 | msgstr "" | ||
1849 | 437 | |||
1850 | 438 | #: ../data/gtk/overview.ui.h:10 | ||
1851 | 439 | msgid "" | ||
1852 | 440 | "Rock Out\n" | ||
1853 | 441 | "<span foreground=\"#909090\">Your entire collection follows you around with " | ||
1854 | 442 | "music streaming to Android and iPhone</span>" | ||
1855 | 443 | msgstr "" | ||
1856 | 444 | |||
1857 | 445 | #: ../data/gtk/overview.ui.h:12 | ||
1858 | 446 | msgid "" | ||
1859 | 447 | "Stay Productive\n" | ||
1860 | 448 | "<span foreground=\"#909090\">Keep your Firefox bookmarks and Tomboy notes " | ||
1861 | 449 | "synced</span>" | ||
1862 | 450 | msgstr "" | ||
1863 | 451 | |||
1864 | 452 | #: ../data/gtk/services.ui.h:1 | ||
1865 | 453 | msgid "<span font_size=\"small\">Bookmarks sync works with Firefox</span>" | ||
1866 | 454 | msgstr "" | ||
1867 | 455 | |||
1868 | 456 | #: ../data/gtk/services.ui.h:2 | ||
1869 | 457 | msgid "" | ||
1870 | 458 | "<span font_size=\"small\">Enable and then choose which folders you want to " | ||
1871 | 459 | "access from the Web or any device you connected to Ubuntu One\n" | ||
1872 | 460 | "\n" | ||
1873 | 461 | "Simply drag and drop any file or folder to your Ubuntu One folder on this " | ||
1874 | 462 | "computer</span>" | ||
1875 | 463 | msgstr "" | ||
1876 | 464 | |||
1877 | 465 | #: ../data/gtk/services.ui.h:5 | ||
1878 | 466 | msgid "" | ||
1879 | 467 | "<span font_size=\"small\">Once enabled, visit the <a href=\"https://one." | ||
1880 | 468 | "ubuntu.com\">Ubuntu One website</a> to manage your contacts, including Gmail " | ||
1881 | 469 | "and Facebook import</span>" | ||
1882 | 470 | msgstr "" | ||
1883 | 471 | |||
1884 | 472 | #: ../data/gtk/services.ui.h:6 | ||
1885 | 473 | msgid "Enable Bookmarks Sync" | ||
1886 | 474 | msgstr "" | ||
1887 | 475 | |||
1888 | 476 | #: ../data/gtk/services.ui.h:7 | ||
1889 | 477 | msgid "Enable Contacts Sync" | ||
1890 | 478 | msgstr "" | ||
1891 | 479 | |||
1892 | 480 | #: ../data/gtk/services.ui.h:8 | ||
1893 | 481 | msgid "Enable File Sync" | ||
1894 | 482 | msgstr "" | ||
1895 | 483 | |||
1896 | 484 | #: ../data/gtk/services.ui.h:9 | ||
1897 | 485 | msgid "_Show me my Ubuntu One folder" | ||
1898 | 486 | msgstr "" | ||
1899 | 487 | 0 | ||
1900 | === modified file 'setup.py' | |||
1901 | --- setup.py 2011-08-25 19:37:14 +0000 | |||
1902 | +++ setup.py 2011-09-26 18:38:27 +0000 | |||
1903 | @@ -229,12 +229,12 @@ | |||
1904 | 229 | 229 | ||
1905 | 230 | DistUtilsExtra.auto.setup( | 230 | DistUtilsExtra.auto.setup( |
1906 | 231 | name='ubuntuone-control-panel', | 231 | name='ubuntuone-control-panel', |
1908 | 232 | version='1.1.3', | 232 | version='2.0.0', |
1909 | 233 | license='GPL v3', | 233 | license='GPL v3', |
1910 | 234 | author='Natalia Bidart', | 234 | author='Natalia Bidart', |
1911 | 235 | author_email='natalia.bidart@canonical.com', | 235 | author_email='natalia.bidart@canonical.com', |
1912 | 236 | description='Ubuntu One Control Panel', | 236 | description='Ubuntu One Control Panel', |
1914 | 237 | long_description='Application to manage a Ubuntu One account. Provides' \ | 237 | long_description='Application to manage an Ubuntu One account. Provides' \ |
1915 | 238 | ' a DBus service to query/modify all the Ubuntu One bits.', | 238 | ' a DBus service to query/modify all the Ubuntu One bits.', |
1916 | 239 | url='https://launchpad.net/ubuntuone-control-panel', | 239 | url='https://launchpad.net/ubuntuone-control-panel', |
1917 | 240 | packages=[ | 240 | packages=[ |
1918 | 241 | 241 | ||
1919 | === removed file 'ubuntuone-control-panel-gtk.desktop.in' | |||
1920 | --- ubuntuone-control-panel-gtk.desktop.in 2011-07-22 21:26:48 +0000 | |||
1921 | +++ ubuntuone-control-panel-gtk.desktop.in 1970-01-01 00:00:00 +0000 | |||
1922 | @@ -1,11 +0,0 @@ | |||
1923 | 1 | [Desktop Entry] | ||
1924 | 2 | Name=Ubuntu One | ||
1925 | 3 | _Comment=Configure and manage your Ubuntu One account | ||
1926 | 4 | Exec=ubuntuone-control-panel-gtk | ||
1927 | 5 | Icon=ubuntuone | ||
1928 | 6 | Terminal=false | ||
1929 | 7 | Type=Application | ||
1930 | 8 | Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-PersonalSettings | ||
1931 | 9 | StartupNotify=true | ||
1932 | 10 | X-Ayatana-Appmenu-Show-Stubs=False | ||
1933 | 11 | X-GNOME-Settings-Panel=ubuntuone | ||
1934 | 12 | 0 | ||
1935 | === modified file 'ubuntuone-control-panel.in' | |||
1936 | --- ubuntuone-control-panel.in 2011-01-27 22:10:30 +0000 | |||
1937 | +++ ubuntuone-control-panel.in 2011-09-26 18:38:27 +0000 | |||
1938 | @@ -1,1 +1,1 @@ | |||
1940 | 1 | @prefix@/share/applications/ubuntuone-control-panel-gtk.desktop | 1 | @prefix@/share/applications/ubuntuone-installer.desktop |
1941 | 2 | 2 | ||
1942 | === modified file 'ubuntuone/controlpanel/backend.py' | |||
1943 | --- ubuntuone/controlpanel/backend.py 2011-08-25 19:37:14 +0000 | |||
1944 | +++ ubuntuone/controlpanel/backend.py 2011-09-26 18:38:27 +0000 | |||
1945 | @@ -67,8 +67,7 @@ | |||
1946 | 67 | MSG_KEY = 'message' | 67 | MSG_KEY = 'message' |
1947 | 68 | STATUS_KEY = 'status' | 68 | STATUS_KEY = 'status' |
1948 | 69 | 69 | ||
1951 | 70 | BOOKMARKS_PKG = 'xul-ext-bindwood' | 70 | CONTACTS_PKG = 'thunderbird-couchdb' |
1950 | 71 | CONTACTS_PKG = 'evolution-couchdb' | ||
1952 | 72 | 71 | ||
1953 | 73 | 72 | ||
1954 | 74 | def append_path_sep(path): | 73 | def append_path_sep(path): |
1955 | @@ -99,7 +98,7 @@ | |||
1956 | 99 | result = yield f(instance, *args, **kwargs) | 98 | result = yield f(instance, *args, **kwargs) |
1957 | 100 | except UnauthorizedError, e: | 99 | except UnauthorizedError, e: |
1958 | 101 | logger.exception('process_unauthorized (clearing credentials):') | 100 | logger.exception('process_unauthorized (clearing credentials):') |
1960 | 102 | yield instance.login_client.clear_credentials() | 101 | yield instance.clear_credentials() |
1961 | 103 | raise e | 102 | raise e |
1962 | 104 | 103 | ||
1963 | 105 | returnValue(result) | 104 | returnValue(result) |
1964 | @@ -138,6 +137,8 @@ | |||
1965 | 138 | self.sd_client = sd_client.SyncDaemonClient() | 137 | self.sd_client = sd_client.SyncDaemonClient() |
1966 | 139 | self.wc = web_client_factory(self.get_credentials) | 138 | self.wc = web_client_factory(self.get_credentials) |
1967 | 140 | 139 | ||
1968 | 140 | logger.info('ControlBackend: instance started.') | ||
1969 | 141 | |||
1970 | 141 | def _process_file_sync_status(self, status): | 142 | def _process_file_sync_status(self, status): |
1971 | 142 | """Process raw file sync status into custom format. | 143 | """Process raw file sync status into custom format. |
1972 | 143 | 144 | ||
1973 | @@ -297,16 +298,32 @@ | |||
1974 | 297 | @inlineCallbacks | 298 | @inlineCallbacks |
1975 | 298 | def get_credentials(self): | 299 | def get_credentials(self): |
1976 | 299 | """Find credentials.""" | 300 | """Find credentials.""" |
1978 | 300 | if self._credentials is None: | 301 | if not self._credentials: |
1979 | 301 | self._credentials = yield self.login_client.find_credentials() | 302 | self._credentials = yield self.login_client.find_credentials() |
1980 | 302 | returnValue(self._credentials) | 303 | returnValue(self._credentials) |
1981 | 303 | 304 | ||
1982 | 304 | @inlineCallbacks | 305 | @inlineCallbacks |
1983 | 306 | def clear_credentials(self): | ||
1984 | 307 | """Clear the credentials.""" | ||
1985 | 308 | self._credentials = None | ||
1986 | 309 | yield self.login_client.clear_credentials() | ||
1987 | 310 | |||
1988 | 311 | @inlineCallbacks | ||
1989 | 305 | def get_token(self): | 312 | def get_token(self): |
1990 | 306 | """Return the token from the credentials.""" | 313 | """Return the token from the credentials.""" |
1991 | 307 | credentials = yield self.get_credentials() | 314 | credentials = yield self.get_credentials() |
1992 | 308 | returnValue(credentials["token"]) | 315 | returnValue(credentials["token"]) |
1993 | 309 | 316 | ||
1994 | 317 | @log_call(logger.debug, with_args=False) | ||
1995 | 318 | @inlineCallbacks | ||
1996 | 319 | def login(self, email, password): | ||
1997 | 320 | """Login using 'email' and 'password'.""" | ||
1998 | 321 | result = yield self.login_client.login_email_password( | ||
1999 | 322 | email=email, password=password) | ||
2000 | 323 | # cache credentils | ||
2001 | 324 | self._credentials = result | ||
2002 | 325 | returnValue(result) | ||
2003 | 326 | |||
2004 | 310 | @inlineCallbacks | 327 | @inlineCallbacks |
2005 | 311 | def device_is_local(self, device_id): | 328 | def device_is_local(self, device_id): |
2006 | 312 | """Return whether 'device_id' is the local devicew or not.""" | 329 | """Return whether 'device_id' is the local devicew or not.""" |
2007 | @@ -480,7 +497,7 @@ | |||
2008 | 480 | if is_local: | 497 | if is_local: |
2009 | 481 | logger.warning('remove_device: device is local! removing and ' | 498 | logger.warning('remove_device: device is local! removing and ' |
2010 | 482 | 'clearing credentials.') | 499 | 'clearing credentials.') |
2012 | 483 | yield self.login_client.clear_credentials() | 500 | yield self.clear_credentials() |
2013 | 484 | 501 | ||
2014 | 485 | returnValue(device_id) | 502 | returnValue(device_id) |
2015 | 486 | 503 | ||
2016 | @@ -580,6 +597,7 @@ | |||
2017 | 580 | 'list (%r).', vid, self._volumes[vid]) | 597 | 'list (%r).', vid, self._volumes[vid]) |
2018 | 581 | self._volumes[vid] = share | 598 | self._volumes[vid] = share |
2019 | 582 | 599 | ||
2020 | 600 | share[u'realpath'] = share[u'path'] | ||
2021 | 583 | nicer_path = share[u'path'].replace(shares_dir, shares_dir_link) | 601 | nicer_path = share[u'path'].replace(shares_dir, shares_dir_link) |
2022 | 584 | share[u'path'] = nicer_path | 602 | share[u'path'] = nicer_path |
2023 | 585 | share[u'subscribed'] = bool(share[u'subscribed']) | 603 | share[u'subscribed'] = bool(share[u'subscribed']) |
2024 | @@ -690,9 +708,7 @@ | |||
2025 | 690 | result = [] | 708 | result = [] |
2026 | 691 | for rep in replications: | 709 | for rep in replications: |
2027 | 692 | dependency = '' | 710 | dependency = '' |
2031 | 693 | if rep == replication_client.BOOKMARKS: | 711 | if rep == replication_client.CONTACTS: |
2029 | 694 | dependency = BOOKMARKS_PKG | ||
2030 | 695 | elif rep == replication_client.CONTACTS: | ||
2032 | 696 | dependency = CONTACTS_PKG | 712 | dependency = CONTACTS_PKG |
2033 | 697 | 713 | ||
2034 | 698 | repd = { | 714 | repd = { |
2035 | @@ -717,18 +733,6 @@ | |||
2036 | 717 | returnValue(replication_id) | 733 | returnValue(replication_id) |
2037 | 718 | 734 | ||
2038 | 719 | @log_call(logger.debug) | 735 | @log_call(logger.debug) |
2039 | 720 | def query_bookmark_extension(self): | ||
2040 | 721 | """True if the bookmark extension has been installed.""" | ||
2041 | 722 | # still pending (LP: #673672) | ||
2042 | 723 | returnValue(False) | ||
2043 | 724 | |||
2044 | 725 | @log_call(logger.debug) | ||
2045 | 726 | def install_bookmarks_extension(self): | ||
2046 | 727 | """Install the extension to sync bookmarks.""" | ||
2047 | 728 | # still pending (LP: #673673) | ||
2048 | 729 | returnValue(None) | ||
2049 | 730 | |||
2050 | 731 | @log_call(logger.debug) | ||
2051 | 732 | @inlineCallbacks | 736 | @inlineCallbacks |
2052 | 733 | def file_sync_settings_info(self): | 737 | def file_sync_settings_info(self): |
2053 | 734 | """Get the file sync settings info.""" | 738 | """Get the file sync settings info.""" |
2054 | 735 | 739 | ||
2055 | === added file 'ubuntuone/controlpanel/cache.py' | |||
2056 | --- ubuntuone/controlpanel/cache.py 1970-01-01 00:00:00 +0000 | |||
2057 | +++ ubuntuone/controlpanel/cache.py 2011-09-26 18:38:27 +0000 | |||
2058 | @@ -0,0 +1,50 @@ | |||
2059 | 1 | # -*- coding: utf-8 -*- | ||
2060 | 2 | |||
2061 | 3 | # Authors: Natalia B Bidart <natalia.bidart@canonical.com> | ||
2062 | 4 | # | ||
2063 | 5 | # Copyright 2011 Canonical Ltd. | ||
2064 | 6 | # | ||
2065 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
2066 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
2067 | 9 | # by the Free Software Foundation. | ||
2068 | 10 | # | ||
2069 | 11 | # This program is distributed in the hope that it will be useful, but | ||
2070 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2071 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2072 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
2073 | 15 | # | ||
2074 | 16 | # You should have received a copy of the GNU General Public License along | ||
2075 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2076 | 18 | |||
2077 | 19 | """The base object that holds a backend instance.""" | ||
2078 | 20 | |||
2079 | 21 | from ubuntuone.controlpanel import backend | ||
2080 | 22 | |||
2081 | 23 | |||
2082 | 24 | class Cache(object): | ||
2083 | 25 | """The base object that caches stuff.""" | ||
2084 | 26 | |||
2085 | 27 | logger = None | ||
2086 | 28 | _shared_objects = {} | ||
2087 | 29 | |||
2088 | 30 | def __init__(self, *args, **kwargs): | ||
2089 | 31 | """Initialize the object using 'backend' as backend.""" | ||
2090 | 32 | super(Cache, self).__init__() | ||
2091 | 33 | if self.logger is not None: | ||
2092 | 34 | self.logger.debug('%s: started.', self.__class__.__name__) | ||
2093 | 35 | |||
2094 | 36 | def get_backend(self): | ||
2095 | 37 | """A cached ControlBackend instance.""" | ||
2096 | 38 | if not self._shared_objects: | ||
2097 | 39 | self._shared_objects['backend'] = backend.ControlBackend() | ||
2098 | 40 | return self._shared_objects['backend'] | ||
2099 | 41 | |||
2100 | 42 | def set_backend(self, new_value): | ||
2101 | 43 | """Set a new ControlBackend instance.""" | ||
2102 | 44 | self._shared_objects['backend'] = new_value | ||
2103 | 45 | |||
2104 | 46 | backend = property(fget=get_backend, fset=set_backend) | ||
2105 | 47 | |||
2106 | 48 | def clear(self): | ||
2107 | 49 | """Clear all cached objects.""" | ||
2108 | 50 | self._shared_objects = {} | ||
2109 | 0 | 51 | ||
2110 | === modified file 'ubuntuone/controlpanel/dbus_service.py' | |||
2111 | --- ubuntuone/controlpanel/dbus_service.py 2011-08-25 19:37:14 +0000 | |||
2112 | +++ ubuntuone/controlpanel/dbus_service.py 2011-09-26 18:38:27 +0000 | |||
2113 | @@ -563,46 +563,6 @@ | |||
2114 | 563 | 563 | ||
2115 | 564 | #--- | 564 | #--- |
2116 | 565 | 565 | ||
2117 | 566 | @log_call(logger.debug) | ||
2118 | 567 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | ||
2119 | 568 | def query_bookmark_extension(self): | ||
2120 | 569 | """Check if the extension to sync bookmarks is installed.""" | ||
2121 | 570 | d = self.backend.query_bookmark_extension() | ||
2122 | 571 | d.addCallback(self.QueryBookmarksResult) | ||
2123 | 572 | d.addErrback(self.transform(self.QueryBookmarksError)) | ||
2124 | 573 | |||
2125 | 574 | @log_call(logger.debug) | ||
2126 | 575 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="b") | ||
2127 | 576 | def QueryBookmarksResult(self, enabled): | ||
2128 | 577 | """The bookmark extension is or is not installed.""" | ||
2129 | 578 | |||
2130 | 579 | @log_call(logger.error) | ||
2131 | 580 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | ||
2132 | 581 | def QueryBookmarksError(self, error): | ||
2133 | 582 | """Problem getting the status of the extension.""" | ||
2134 | 583 | |||
2135 | 584 | #--- | ||
2136 | 585 | |||
2137 | 586 | @log_call(logger.info) | ||
2138 | 587 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | ||
2139 | 588 | def install_bookmarks_extension(self): | ||
2140 | 589 | """Install the extension to sync bookmarks.""" | ||
2141 | 590 | d = self.backend.install_bookmarks_extension() | ||
2142 | 591 | d.addCallback(lambda _: self.InstallBookmarksSuccess()) | ||
2143 | 592 | d.addErrback(self.transform(self.InstallBookmarksError)) | ||
2144 | 593 | |||
2145 | 594 | @log_call(logger.info) | ||
2146 | 595 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="") | ||
2147 | 596 | def InstallBookmarksSuccess(self): | ||
2148 | 597 | """The extension to sync bookmarks has been installed.""" | ||
2149 | 598 | |||
2150 | 599 | @log_call(logger.error) | ||
2151 | 600 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | ||
2152 | 601 | def InstallBookmarksError(self, error): | ||
2153 | 602 | """Problem installing the extension to sync bookmarks.""" | ||
2154 | 603 | |||
2155 | 604 | #--- | ||
2156 | 605 | |||
2157 | 606 | @log_call(logger.info) | 566 | @log_call(logger.info) |
2158 | 607 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 567 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
2159 | 608 | def shutdown(self): | 568 | def shutdown(self): |
2160 | 609 | 569 | ||
2161 | === modified file 'ubuntuone/controlpanel/dbustests/test_dbus_service.py' | |||
2162 | --- ubuntuone/controlpanel/dbustests/test_dbus_service.py 2011-08-25 19:37:14 +0000 | |||
2163 | +++ ubuntuone/controlpanel/dbustests/test_dbus_service.py 2011-09-26 18:38:27 +0000 | |||
2164 | @@ -50,7 +50,7 @@ | |||
2165 | 50 | "limit_bandwidth": True, | 50 | "limit_bandwidth": True, |
2166 | 51 | "max_upload_speed": 12345, | 51 | "max_upload_speed": 12345, |
2167 | 52 | "max_download_speed": 54321, | 52 | "max_download_speed": 54321, |
2169 | 53 | "available_services": "files, contacts, music, bookmarks", | 53 | "available_services": "files, contacts, music", |
2170 | 54 | "enabled_services": "files, music", | 54 | "enabled_services": "files, music", |
2171 | 55 | }, | 55 | }, |
2172 | 56 | { | 56 | { |
2173 | @@ -59,8 +59,8 @@ | |||
2174 | 59 | "date_added": "2010-09-22T20:45:38.0", | 59 | "date_added": "2010-09-22T20:45:38.0", |
2175 | 60 | "type": "computer", | 60 | "type": "computer", |
2176 | 61 | "configurable": False, | 61 | "configurable": False, |
2179 | 62 | "available_services": "files, contacts, bookmarks", | 62 | "available_services": "files, contacts", |
2180 | 63 | "enabled_services": "files, bookmarks", | 63 | "enabled_services": "files", |
2181 | 64 | }, | 64 | }, |
2182 | 65 | ] | 65 | ] |
2183 | 66 | 66 | ||
2184 | @@ -244,14 +244,6 @@ | |||
2185 | 244 | """Configure a given replication.""" | 244 | """Configure a given replication.""" |
2186 | 245 | return self._process(replication_id) | 245 | return self._process(replication_id) |
2187 | 246 | 246 | ||
2188 | 247 | def query_bookmark_extension(self): | ||
2189 | 248 | """True if the bookmark extension has been installed.""" | ||
2190 | 249 | return self._process(False) | ||
2191 | 250 | |||
2192 | 251 | def install_bookmarks_extension(self): | ||
2193 | 252 | """Install the extension to sync bookmarks.""" | ||
2194 | 253 | return self._process(None) | ||
2195 | 254 | |||
2196 | 255 | def shutdown(self): | 247 | def shutdown(self): |
2197 | 256 | """Stop this service.""" | 248 | """Stop this service.""" |
2198 | 257 | self.shutdown_func() | 249 | self.shutdown_func() |
2199 | @@ -616,29 +608,6 @@ | |||
2200 | 616 | expected_replication_id, {'enabled': ''}) | 608 | expected_replication_id, {'enabled': ''}) |
2201 | 617 | return self.assert_correct_method_call(*args) | 609 | return self.assert_correct_method_call(*args) |
2202 | 618 | 610 | ||
2203 | 619 | def test_query_bookmarks_extension(self): | ||
2204 | 620 | """The bookmarks extension is queried.""" | ||
2205 | 621 | |||
2206 | 622 | def got_signal(enabled): | ||
2207 | 623 | """The correct status was received.""" | ||
2208 | 624 | self.assertEqual(enabled, False) | ||
2209 | 625 | self.deferred.callback("success") | ||
2210 | 626 | |||
2211 | 627 | args = ("QueryBookmarksResult", "QueryBookmarksError", got_signal, | ||
2212 | 628 | self.backend.query_bookmark_extension) | ||
2213 | 629 | return self.assert_correct_method_call(*args) | ||
2214 | 630 | |||
2215 | 631 | def test_install_bookmarks_extension(self): | ||
2216 | 632 | """The bookmarks extension is installed.""" | ||
2217 | 633 | |||
2218 | 634 | def got_signal(): | ||
2219 | 635 | """The extension was installed.""" | ||
2220 | 636 | self.deferred.callback("success") | ||
2221 | 637 | |||
2222 | 638 | args = ("InstallBookmarksSuccess", "InstallBookmarksError", got_signal, | ||
2223 | 639 | self.backend.install_bookmarks_extension) | ||
2224 | 640 | return self.assert_correct_method_call(*args) | ||
2225 | 641 | |||
2226 | 642 | 611 | ||
2227 | 643 | class OperationsErrorTestCase(OperationsTestCase): | 612 | class OperationsErrorTestCase(OperationsTestCase): |
2228 | 644 | """Test for the DBus service operations when there is an error.""" | 613 | """Test for the DBus service operations when there is an error.""" |
2229 | 645 | 614 | ||
2230 | === modified file 'ubuntuone/controlpanel/gui/__init__.py' | |||
2231 | --- ubuntuone/controlpanel/gui/__init__.py 2011-08-12 19:12:08 +0000 | |||
2232 | +++ ubuntuone/controlpanel/gui/__init__.py 2011-09-26 18:38:27 +0000 | |||
2233 | @@ -51,28 +51,29 @@ | |||
2234 | 51 | MUSIC_STORE_ICON = 'music-store.png' | 51 | MUSIC_STORE_ICON = 'music-store.png' |
2235 | 52 | MUSIC_STREAM_ICON = 'music-stream.png' | 52 | MUSIC_STREAM_ICON = 'music-stream.png' |
2236 | 53 | NOTES_ICON = 'notes.png' | 53 | NOTES_ICON = 'notes.png' |
2237 | 54 | SERVICES_BOOKMARKS_ICON = 'services-bookmarks.png' | ||
2238 | 55 | SERVICES_CONTACTS_ICON = 'services-contacts.png' | 54 | SERVICES_CONTACTS_ICON = 'services-contacts.png' |
2239 | 56 | SERVICES_FILES_EXAMPLE = 'services-files-example.png' | 55 | SERVICES_FILES_EXAMPLE = 'services-files-example.png' |
2240 | 57 | SERVICES_FILES_ICON = 'services-files.png' | 56 | SERVICES_FILES_ICON = 'services-files.png' |
2241 | 58 | 57 | ||
2242 | 59 | FILE_URI_PREFIX = 'file://' | 58 | FILE_URI_PREFIX = 'file://' |
2243 | 59 | UBUNTUONE_FROM_OAUTH = 'https://one.ubuntu.com/api/1.0/from_oauth/' | ||
2244 | 60 | UBUNTUONE_LINK = 'https://one.ubuntu.com/' | 60 | UBUNTUONE_LINK = 'https://one.ubuntu.com/' |
2245 | 61 | 61 | ||
2246 | 62 | CONTACTS_LINK = UBUNTUONE_LINK | 62 | CONTACTS_LINK = UBUNTUONE_LINK |
2247 | 63 | EDIT_ACCOUNT_LINK = UBUNTUONE_LINK + 'account/' | 63 | EDIT_ACCOUNT_LINK = UBUNTUONE_LINK + 'account/' |
2248 | 64 | EDIT_DEVICES_LINK = EDIT_ACCOUNT_LINK + 'machines/' | 64 | EDIT_DEVICES_LINK = EDIT_ACCOUNT_LINK + 'machines/' |
2249 | 65 | EDIT_PROFILE_LINK = 'https://login.ubuntu.com/' | 65 | EDIT_PROFILE_LINK = 'https://login.ubuntu.com/' |
2250 | 66 | EDIT_SERVICES_LINK = UBUNTUONE_LINK + 'services' | ||
2251 | 66 | FACEBOOK_LINK = 'http://www.facebook.com/ubuntuone/' | 67 | FACEBOOK_LINK = 'http://www.facebook.com/ubuntuone/' |
2252 | 67 | GET_SUPPORT_LINK = UBUNTUONE_LINK + 'support/' | 68 | GET_SUPPORT_LINK = UBUNTUONE_LINK + 'support/' |
2253 | 68 | LEARN_MORE_LINK = UBUNTUONE_LINK | 69 | LEARN_MORE_LINK = UBUNTUONE_LINK |
2254 | 69 | MANAGE_FILES_LINK = UBUNTUONE_LINK + 'files/' | 70 | MANAGE_FILES_LINK = UBUNTUONE_LINK + 'files/' |
2255 | 71 | RESET_PASSWORD_LINK = EDIT_PROFILE_LINK + '+forgot_password' | ||
2256 | 70 | TWITTER_LINK = 'http://twitter.com/ubuntuone/' | 72 | TWITTER_LINK = 'http://twitter.com/ubuntuone/' |
2257 | 71 | 73 | ||
2258 | 72 | ALWAYS_SUBSCRIBED = _('Always in sync') | 74 | ALWAYS_SUBSCRIBED = _('Always in sync') |
2259 | 73 | BOOKMARKS = _('Firefox extension') | ||
2260 | 74 | CONNECT_BUTTON_LABEL = _('Connect to Ubuntu One') | 75 | CONNECT_BUTTON_LABEL = _('Connect to Ubuntu One') |
2262 | 75 | CONTACTS = _('Evolution plug-in') | 76 | CONTACTS = _('Thunderbird plug-in') |
2263 | 76 | CREDENTIALS_ERROR = _('There was a problem while retrieving the credentials.') | 77 | CREDENTIALS_ERROR = _('There was a problem while retrieving the credentials.') |
2264 | 77 | DASHBOARD_BUTTON_TOOLTIP = _('View your personal details and service ' | 78 | DASHBOARD_BUTTON_TOOLTIP = _('View your personal details and service ' |
2265 | 78 | 'summary') | 79 | 'summary') |
2266 | @@ -188,9 +189,8 @@ | |||
2267 | 188 | credentials["consumer_secret"]) | 189 | credentials["consumer_secret"]) |
2268 | 189 | token = oauth.OAuthToken(credentials["token"], | 190 | token = oauth.OAuthToken(credentials["token"], |
2269 | 190 | credentials["token_secret"]) | 191 | credentials["token_secret"]) |
2270 | 191 | uri = 'https://one.ubuntu.com/api/1.0/from_oauth/' | ||
2271 | 192 | request = oauth.OAuthRequest.from_consumer_and_token( | 192 | request = oauth.OAuthRequest.from_consumer_and_token( |
2273 | 193 | http_url=uri, http_method='GET', | 193 | http_url=UBUNTUONE_FROM_OAUTH, http_method='GET', |
2274 | 194 | oauth_consumer=consumer, token=token, | 194 | oauth_consumer=consumer, token=token, |
2275 | 195 | parameters={'next': url}) | 195 | parameters={'next': url}) |
2276 | 196 | sig_method = oauth.OAuthSignatureMethod_HMAC_SHA1() | 196 | sig_method = oauth.OAuthSignatureMethod_HMAC_SHA1() |
2277 | 197 | 197 | ||
2278 | === modified file 'ubuntuone/controlpanel/gui/gtk/gui.py' | |||
2279 | --- ubuntuone/controlpanel/gui/gtk/gui.py 2011-08-25 19:37:14 +0000 | |||
2280 | +++ ubuntuone/controlpanel/gui/gtk/gui.py 2011-09-26 18:38:27 +0000 | |||
2281 | @@ -62,7 +62,7 @@ | |||
2282 | 62 | try: | 62 | try: |
2283 | 63 | from gi.repository import Unity # pylint: disable=E0611 | 63 | from gi.repository import Unity # pylint: disable=E0611 |
2284 | 64 | USE_LIBUNITY = True | 64 | USE_LIBUNITY = True |
2286 | 65 | U1_DOTDESKTOP = "ubuntuone-control-panel-gtk.desktop" | 65 | U1_DOTDESKTOP = "ubuntuone-installer.desktop" |
2287 | 66 | except ImportError: | 66 | except ImportError: |
2288 | 67 | USE_LIBUNITY = False | 67 | USE_LIBUNITY = False |
2289 | 68 | 68 | ||
2290 | @@ -71,6 +71,9 @@ | |||
2291 | 71 | 71 | ||
2292 | 72 | WARNING_MARKUP = '<span foreground="%s"><b>%%s</b></span>' % ERROR_COLOR | 72 | WARNING_MARKUP = '<span foreground="%s"><b>%%s</b></span>' % ERROR_COLOR |
2293 | 73 | 73 | ||
2294 | 74 | CP_WMCLASS_NAME = 'ubuntuone-control-panel-gtk' | ||
2295 | 75 | CP_WMCLASS_CLASS = 'ubuntuone-installer' | ||
2296 | 76 | |||
2297 | 74 | 77 | ||
2298 | 75 | def error_handler(*args, **kwargs): | 78 | def error_handler(*args, **kwargs): |
2299 | 76 | """Log errors when calling D-Bus methods in a async way.""" | 79 | """Log errors when calling D-Bus methods in a async way.""" |
2300 | @@ -1118,11 +1121,8 @@ | |||
2301 | 1118 | self.files_icon.set_from_file(get_data_file(SERVICES_FILES_ICON)) | 1121 | self.files_icon.set_from_file(get_data_file(SERVICES_FILES_ICON)) |
2302 | 1119 | self.files_example.set_from_file(get_data_file(SERVICES_FILES_EXAMPLE)) | 1122 | self.files_example.set_from_file(get_data_file(SERVICES_FILES_EXAMPLE)) |
2303 | 1120 | self.contacts_icon.set_from_file(get_data_file(SERVICES_CONTACTS_ICON)) | 1123 | self.contacts_icon.set_from_file(get_data_file(SERVICES_CONTACTS_ICON)) |
2304 | 1121 | icon = get_data_file(SERVICES_BOOKMARKS_ICON) | ||
2305 | 1122 | self.bookmarks_icon.set_from_file(icon) | ||
2306 | 1123 | 1124 | ||
2309 | 1124 | self.plugin_names = {'contacts': CONTACTS, | 1125 | self.plugin_names = {'contacts': CONTACTS} |
2308 | 1125 | 'bookmarks': BOOKMARKS} | ||
2310 | 1126 | 1126 | ||
2311 | 1127 | self.package_manager = package_manager.PackageManager() | 1127 | self.package_manager = package_manager.PackageManager() |
2312 | 1128 | self.install_box = None | 1128 | self.install_box = None |
2313 | @@ -1161,13 +1161,6 @@ | |||
2314 | 1161 | """ | 1161 | """ |
2315 | 1162 | uri_hook(None, CONTACTS) | 1162 | uri_hook(None, CONTACTS) |
2316 | 1163 | 1163 | ||
2317 | 1164 | def on_bookmarks_button_clicked(self, *args, **kwargs): | ||
2318 | 1165 | """The bookmarks button was clicked. | ||
2319 | 1166 | |||
2320 | 1167 | XXX: this should be part of the DesktopcouchService widget. | ||
2321 | 1168 | |||
2322 | 1169 | """ | ||
2323 | 1170 | |||
2324 | 1171 | @log_call(logger.debug) | 1164 | @log_call(logger.debug) |
2325 | 1172 | def load(self): | 1165 | def load(self): |
2326 | 1173 | """Load info.""" | 1166 | """Load info.""" |
2327 | @@ -1614,6 +1607,10 @@ | |||
2328 | 1614 | def __init__(self, switch_to='', alert=False): | 1607 | def __init__(self, switch_to='', alert=False): |
2329 | 1615 | super(ControlPanelWindow, self).__init__() | 1608 | super(ControlPanelWindow, self).__init__() |
2330 | 1616 | 1609 | ||
2331 | 1610 | # We need to set WMCLASS so Unity falls back and we only get one | ||
2332 | 1611 | # launcher on the launcher panel | ||
2333 | 1612 | self.set_wmclass(CP_WMCLASS_NAME, CP_WMCLASS_CLASS) | ||
2334 | 1613 | |||
2335 | 1617 | self.connect('focus-in-event', self.remove_urgency) | 1614 | self.connect('focus-in-event', self.remove_urgency) |
2336 | 1618 | self.set_title(MAIN_WINDOW_TITLE % {'app_name': U1_APP_NAME}) | 1615 | self.set_title(MAIN_WINDOW_TITLE % {'app_name': U1_APP_NAME}) |
2337 | 1619 | self.set_position(gtk.WIN_POS_CENTER_ALWAYS) | 1616 | self.set_position(gtk.WIN_POS_CENTER_ALWAYS) |
2338 | 1620 | 1617 | ||
2339 | === modified file 'ubuntuone/controlpanel/gui/gtk/tests/__init__.py' | |||
2340 | --- ubuntuone/controlpanel/gui/gtk/tests/__init__.py 2011-08-25 19:37:14 +0000 | |||
2341 | +++ ubuntuone/controlpanel/gui/gtk/tests/__init__.py 2011-09-26 18:38:27 +0000 | |||
2342 | @@ -109,8 +109,8 @@ | |||
2343 | 109 | ] | 109 | ] |
2344 | 110 | 110 | ||
2345 | 111 | 111 | ||
2348 | 112 | class FakeControlPanelBackend(FakedDBusBackend): | 112 | class FakedGUIBackend(FakedDBusBackend): |
2349 | 113 | """Fake a Control Panel Service, act as a dbus.Interface.""" | 113 | """Fake a Control Panel GUI Service, act as a dbus.Interface.""" |
2350 | 114 | 114 | ||
2351 | 115 | bus_name = gui.DBUS_BUS_NAME_GUI | 115 | bus_name = gui.DBUS_BUS_NAME_GUI |
2352 | 116 | object_path = gui.DBUS_PATH_GUI | 116 | object_path = gui.DBUS_PATH_GUI |
2353 | @@ -135,7 +135,7 @@ | |||
2354 | 135 | return FakedControlPanelBackend(obj, dbus_interface, | 135 | return FakedControlPanelBackend(obj, dbus_interface, |
2355 | 136 | *args, **kwargs) | 136 | *args, **kwargs) |
2356 | 137 | if dbus_interface == gui.DBUS_IFACE_GUI: | 137 | if dbus_interface == gui.DBUS_IFACE_GUI: |
2358 | 138 | return FakeControlPanelBackend( | 138 | return FakedGUIBackend( |
2359 | 139 | obj, dbus_interface, *args, **kwargs) | 139 | obj, dbus_interface, *args, **kwargs) |
2360 | 140 | 140 | ||
2361 | 141 | 141 | ||
2362 | 142 | 142 | ||
2363 | === modified file 'ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py' | |||
2364 | --- ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py 2011-08-25 19:37:14 +0000 | |||
2365 | +++ ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py 2011-09-26 18:38:27 +0000 | |||
2366 | @@ -122,6 +122,14 @@ | |||
2367 | 122 | self.assertEqual( | 122 | self.assertEqual( |
2368 | 123 | self._called, ((), {}), 'gtk.main_quit was not called.') | 123 | self._called, ((), {}), 'gtk.main_quit was not called.') |
2369 | 124 | 124 | ||
2370 | 125 | def test_wmclass_is_correct(self): | ||
2371 | 126 | """Test that the WMCLASS is set.""" | ||
2372 | 127 | self.patch(gui.ControlPanelWindow, 'set_wmclass', self._set_called) | ||
2373 | 128 | cp = gui.ControlPanelWindow() | ||
2374 | 129 | cp.destroy() | ||
2375 | 130 | expected = ((gui.CP_WMCLASS_NAME, gui.CP_WMCLASS_CLASS), {}) | ||
2376 | 131 | self.assertEqual(self._called, expected) | ||
2377 | 132 | |||
2378 | 125 | def test_title_is_correct(self): | 133 | def test_title_is_correct(self): |
2379 | 126 | """The window title is correct.""" | 134 | """The window title is correct.""" |
2380 | 127 | expected = gui.MAIN_WINDOW_TITLE % {'app_name': gui.U1_APP_NAME} | 135 | expected = gui.MAIN_WINDOW_TITLE % {'app_name': gui.U1_APP_NAME} |
2381 | @@ -315,7 +323,7 @@ | |||
2382 | 315 | 323 | ||
2383 | 316 | 324 | ||
2384 | 317 | class UbuntuOneBinTestCase(BaseTestCase): | 325 | class UbuntuOneBinTestCase(BaseTestCase): |
2386 | 318 | """The test suite for a Ubuntu One panel.""" | 326 | """The test suite for the Ubuntu One panel.""" |
2387 | 319 | 327 | ||
2388 | 320 | klass = gui.UbuntuOneBin | 328 | klass = gui.UbuntuOneBin |
2389 | 321 | kwargs = {'title': 'Something old, something new and something blue.'} | 329 | kwargs = {'title': 'Something old, something new and something blue.'} |
2390 | 322 | 330 | ||
2391 | === modified file 'ubuntuone/controlpanel/gui/qt/__init__.py' | |||
2392 | --- ubuntuone/controlpanel/gui/qt/__init__.py 2011-07-22 21:26:48 +0000 | |||
2393 | +++ ubuntuone/controlpanel/gui/qt/__init__.py 2011-09-26 18:38:27 +0000 | |||
2394 | @@ -18,13 +18,25 @@ | |||
2395 | 18 | 18 | ||
2396 | 19 | """The Qt graphical interface for the control panel for Ubuntu One.""" | 19 | """The Qt graphical interface for the control panel for Ubuntu One.""" |
2397 | 20 | 20 | ||
2398 | 21 | import collections | ||
2399 | 22 | import logging | ||
2400 | 23 | |||
2401 | 24 | from functools import wraps | ||
2402 | 25 | |||
2403 | 21 | from PyQt4 import QtGui, QtCore | 26 | from PyQt4 import QtGui, QtCore |
2404 | 27 | from twisted.internet import defer | ||
2405 | 28 | |||
2406 | 29 | from ubuntuone.controlpanel.gui import FILE_URI_PREFIX | ||
2407 | 22 | 30 | ||
2408 | 23 | 31 | ||
2409 | 24 | def uri_hook(uri): | 32 | def uri_hook(uri): |
2410 | 25 | """Open an URI using the default browser/file manager.""" | 33 | """Open an URI using the default browser/file manager.""" |
2413 | 26 | url = QtCore.QString(uri) | 34 | if uri.startswith(FILE_URI_PREFIX): |
2414 | 27 | QtGui.QDesktopServices.openUrl(QtCore.QUrl(url)) | 35 | url = QtCore.QUrl(uri) |
2415 | 36 | else: | ||
2416 | 37 | url = QtCore.QUrl() | ||
2417 | 38 | url.setEncodedUrl(uri) | ||
2418 | 39 | QtGui.QDesktopServices.openUrl(url) | ||
2419 | 28 | 40 | ||
2420 | 29 | 41 | ||
2421 | 30 | def pixmap_from_name(icon_name): | 42 | def pixmap_from_name(icon_name): |
2422 | @@ -52,3 +64,46 @@ | |||
2423 | 52 | icon.icon_name = icon_name | 64 | icon.icon_name = icon_name |
2424 | 53 | 65 | ||
2425 | 54 | return icon | 66 | return icon |
2426 | 67 | |||
2427 | 68 | |||
2428 | 69 | def handle_errors(error_handler=None, logger=None): | ||
2429 | 70 | """Decorator to handle errors when calling a function. | ||
2430 | 71 | |||
2431 | 72 | if 'error_handler' is not None, it will be yielded on if any error happens. | ||
2432 | 73 | |||
2433 | 74 | """ | ||
2434 | 75 | if logger is None: | ||
2435 | 76 | logger = logging.getLogger() | ||
2436 | 77 | |||
2437 | 78 | def middle(f): | ||
2438 | 79 | """Decorator to handle errors when calling 'f'.""" | ||
2439 | 80 | |||
2440 | 81 | @defer.inlineCallbacks | ||
2441 | 82 | @wraps(f) | ||
2442 | 83 | def inner(*args, **kwargs): | ||
2443 | 84 | """Call 'f' passing 'args' and 'kwargs'. | ||
2444 | 85 | |||
2445 | 86 | Catch any error and show a error message. | ||
2446 | 87 | |||
2447 | 88 | """ | ||
2448 | 89 | try: | ||
2449 | 90 | res = yield f(*args, **kwargs) | ||
2450 | 91 | except Exception, e: # pylint: disable=W0703 | ||
2451 | 92 | logger.exception(f.__name__) | ||
2452 | 93 | else: | ||
2453 | 94 | defer.returnValue(res) | ||
2454 | 95 | |||
2455 | 96 | # this code will only be executed if there was an exception | ||
2456 | 97 | if error_handler is not None: | ||
2457 | 98 | yield error_handler() | ||
2458 | 99 | |||
2459 | 100 | if len(e.args) > 0 and isinstance(e.args[0], collections.Mapping): | ||
2460 | 101 | msgs = e.args[0].itervalues() | ||
2461 | 102 | else: | ||
2462 | 103 | msgs = [e.__class__.__name__] + map(repr, e.args) | ||
2463 | 104 | msg = '\n'.join(msgs) | ||
2464 | 105 | QtGui.QMessageBox.warning(None, '', msg, QtGui.QMessageBox.Close) | ||
2465 | 106 | |||
2466 | 107 | return inner | ||
2467 | 108 | |||
2468 | 109 | return middle | ||
2469 | 55 | 110 | ||
2470 | === modified file 'ubuntuone/controlpanel/gui/qt/account.py' | |||
2471 | --- ubuntuone/controlpanel/gui/qt/account.py 2011-07-22 21:26:48 +0000 | |||
2472 | +++ ubuntuone/controlpanel/gui/qt/account.py 2011-09-26 18:38:27 +0000 | |||
2473 | @@ -37,12 +37,15 @@ | |||
2474 | 37 | """The Account Tab Panel widget""" | 37 | """The Account Tab Panel widget""" |
2475 | 38 | 38 | ||
2476 | 39 | ui_class = account_ui | 39 | ui_class = account_ui |
2477 | 40 | logger = logger | ||
2478 | 40 | 41 | ||
2479 | 41 | def _setup(self): | 42 | def _setup(self): |
2480 | 42 | """Do some extra setupping for the UI.""" | 43 | """Do some extra setupping for the UI.""" |
2481 | 44 | super(AccountPanel, self)._setup() | ||
2482 | 43 | self.ui.edit_profile_button.uri = EDIT_PROFILE_LINK | 45 | self.ui.edit_profile_button.uri = EDIT_PROFILE_LINK |
2483 | 44 | self.ui.edit_services_button.uri = EDIT_ACCOUNT_LINK | 46 | self.ui.edit_services_button.uri = EDIT_ACCOUNT_LINK |
2484 | 45 | 47 | ||
2485 | 48 | # pylint: disable=E0202 | ||
2486 | 46 | @defer.inlineCallbacks | 49 | @defer.inlineCallbacks |
2487 | 47 | def load(self): | 50 | def load(self): |
2488 | 48 | """Load info.""" | 51 | """Load info.""" |
2489 | 49 | 52 | ||
2490 | === modified file 'ubuntuone/controlpanel/gui/qt/addfolder.py' | |||
2491 | --- ubuntuone/controlpanel/gui/qt/addfolder.py 2011-07-22 21:26:48 +0000 | |||
2492 | +++ ubuntuone/controlpanel/gui/qt/addfolder.py 2011-09-26 18:38:27 +0000 | |||
2493 | @@ -25,11 +25,10 @@ | |||
2494 | 25 | from PyQt4 import QtGui, QtCore | 25 | from PyQt4 import QtGui, QtCore |
2495 | 26 | from twisted.internet import defer | 26 | from twisted.internet import defer |
2496 | 27 | 27 | ||
2498 | 28 | from ubuntuone.controlpanel import backend | 28 | from ubuntuone.controlpanel import cache |
2499 | 29 | from ubuntuone.controlpanel.logger import setup_logging | 29 | from ubuntuone.controlpanel.logger import setup_logging |
2503 | 30 | from ubuntuone.controlpanel.gui import ( | 30 | from ubuntuone.controlpanel.gui import FOLDER_INVALID_PATH |
2504 | 31 | FOLDER_INVALID_PATH, | 31 | from ubuntuone.controlpanel.gui.qt import handle_errors |
2502 | 32 | ) | ||
2505 | 33 | 32 | ||
2506 | 34 | 33 | ||
2507 | 35 | logger = setup_logging('qt.addfolder') | 34 | logger = setup_logging('qt.addfolder') |
2508 | @@ -37,9 +36,11 @@ | |||
2509 | 37 | CLOSE = QtGui.QMessageBox.Close | 36 | CLOSE = QtGui.QMessageBox.Close |
2510 | 38 | 37 | ||
2511 | 39 | 38 | ||
2513 | 40 | class AddFolderButton(QtGui.QPushButton): | 39 | class AddFolderButton(cache.Cache, QtGui.QPushButton): |
2514 | 41 | """The AddFolderButton widget""" | 40 | """The AddFolderButton widget""" |
2515 | 42 | 41 | ||
2516 | 42 | logger = logger | ||
2517 | 43 | |||
2518 | 43 | folderCreated = QtCore.pyqtSignal(unicode) | 44 | folderCreated = QtCore.pyqtSignal(unicode) |
2519 | 44 | folderCreationCanceled = QtCore.pyqtSignal() | 45 | folderCreationCanceled = QtCore.pyqtSignal() |
2520 | 45 | 46 | ||
2521 | @@ -47,16 +48,17 @@ | |||
2522 | 47 | """Initialize the UI of the widget.""" | 48 | """Initialize the UI of the widget.""" |
2523 | 48 | super(AddFolderButton, self).__init__(*args, **kwargs) | 49 | super(AddFolderButton, self).__init__(*args, **kwargs) |
2524 | 49 | self.cloud_folders = [] | 50 | self.cloud_folders = [] |
2525 | 50 | self.backend = backend.ControlBackend() | ||
2526 | 51 | self.clicked.connect(self.on_clicked) | 51 | self.clicked.connect(self.on_clicked) |
2527 | 52 | logger.debug('%s: started.', self.__class__.__name__) | ||
2528 | 53 | 52 | ||
2529 | 54 | @QtCore.pyqtSlot() | 53 | @QtCore.pyqtSlot() |
2530 | 54 | @handle_errors(logger=logger) | ||
2531 | 55 | @defer.inlineCallbacks | 55 | @defer.inlineCallbacks |
2532 | 56 | def on_clicked(self): | 56 | def on_clicked(self): |
2533 | 57 | """The 'Sync another folder' button was clicked.""" | 57 | """The 'Sync another folder' button was clicked.""" |
2536 | 58 | folder = QtGui.QFileDialog.getExistingDirectory(parent=self) | 58 | # The options argument is because of LP: #835013 |
2537 | 59 | folder = unicode(folder) | 59 | folder = QtGui.QFileDialog.getExistingDirectory( |
2538 | 60 | parent=self, options=QtGui.QFileDialog.DontUseNativeDialog) | ||
2539 | 61 | folder = unicode(QtCore.QDir.toNativeSeparators(folder)) | ||
2540 | 60 | logger.debug('on_add_folder_button_clicked: user requested folder ' | 62 | logger.debug('on_add_folder_button_clicked: user requested folder ' |
2541 | 61 | 'creation for path %r', folder) | 63 | 'creation for path %r', folder) |
2542 | 62 | if folder == '': | 64 | if folder == '': |
2543 | 63 | 65 | ||
2544 | === modified file 'ubuntuone/controlpanel/gui/qt/controlpanel.py' | |||
2545 | --- ubuntuone/controlpanel/gui/qt/controlpanel.py 2011-08-12 19:12:08 +0000 | |||
2546 | +++ ubuntuone/controlpanel/gui/qt/controlpanel.py 2011-09-26 18:38:27 +0000 | |||
2547 | @@ -21,62 +21,79 @@ | |||
2548 | 21 | 21 | ||
2549 | 22 | from __future__ import division | 22 | from __future__ import division |
2550 | 23 | 23 | ||
2552 | 24 | from PyQt4 import QtGui, QtCore | 24 | from PyQt4 import QtCore |
2553 | 25 | from twisted.internet import defer | 25 | from twisted.internet import defer |
2554 | 26 | 26 | ||
2556 | 27 | from ubuntuone.controlpanel import backend | 27 | from ubuntuone.controlpanel.backend import AUTOCONNECT_KEY |
2557 | 28 | from ubuntuone.controlpanel.logger import setup_logging, log_call | 28 | from ubuntuone.controlpanel.logger import setup_logging, log_call |
2558 | 29 | from ubuntuone.controlpanel.gui import ( | 29 | from ubuntuone.controlpanel.gui import ( |
2559 | 30 | humanize, | 30 | humanize, |
2561 | 31 | EDIT_ACCOUNT_LINK, | 31 | EDIT_SERVICES_LINK, |
2562 | 32 | FACEBOOK_LINK, | 32 | FACEBOOK_LINK, |
2563 | 33 | GET_SUPPORT_LINK, | 33 | GET_SUPPORT_LINK, |
2564 | 34 | GREETING, | 34 | GREETING, |
2565 | 35 | PERCENTAGE_LABEL, | 35 | PERCENTAGE_LABEL, |
2566 | 36 | QUOTA_THRESHOLD, | ||
2567 | 36 | TWITTER_LINK, | 37 | TWITTER_LINK, |
2568 | 37 | USAGE_LABEL, | 38 | USAGE_LABEL, |
2569 | 38 | ) | 39 | ) |
2571 | 39 | from ubuntuone.controlpanel.gui.qt import uri_hook | 40 | from ubuntuone.controlpanel.gui import qt |
2572 | 41 | from ubuntuone.controlpanel.gui.qt.ubuntuonebin import UbuntuOneBin | ||
2573 | 40 | from ubuntuone.controlpanel.gui.qt.ui import controlpanel_ui | 42 | from ubuntuone.controlpanel.gui.qt.ui import controlpanel_ui |
2574 | 41 | 43 | ||
2575 | 42 | 44 | ||
2576 | 43 | logger = setup_logging('qt.controlpanel') | 45 | logger = setup_logging('qt.controlpanel') |
2577 | 44 | 46 | ||
2579 | 45 | NAME_STYLE = '<br><span style=" font-size:24pt;">%s!</span>' | 47 | NAME_STYLE = '<br><span style=" font-size:16pt;">%s!</span>' |
2580 | 46 | PERCENTAGE_STYLE = '<span style=" font-size:16pt;">%.0f%%</span>' | 48 | PERCENTAGE_STYLE = '<span style=" font-size:16pt;">%.0f%%</span>' |
2581 | 47 | 49 | ||
2582 | 48 | 50 | ||
2584 | 49 | class ControlPanel(QtGui.QWidget): | 51 | class ControlPanel(UbuntuOneBin): |
2585 | 50 | """The Control Panel widget""" | 52 | """The Control Panel widget""" |
2586 | 51 | 53 | ||
2596 | 52 | def __init__(self, parent=None): | 54 | ui_class = controlpanel_ui |
2597 | 53 | """Initialize the UI of the widget.""" | 55 | logger = logger |
2589 | 54 | QtGui.QWidget.__init__(self, parent) | ||
2590 | 55 | self.ui = controlpanel_ui.Ui_Form() | ||
2591 | 56 | self.ui.setupUi(self) | ||
2592 | 57 | |||
2593 | 58 | self.backend = backend.ControlBackend() | ||
2594 | 59 | self._setup() | ||
2595 | 60 | logger.debug('%s: started.', self.__class__.__name__) | ||
2598 | 61 | 56 | ||
2599 | 62 | def _setup(self): | 57 | def _setup(self): |
2600 | 63 | """Do some extra setupping for the UI.""" | 58 | """Do some extra setupping for the UI.""" |
2602 | 64 | self.ui.get_more_space_button.uri = EDIT_ACCOUNT_LINK | 59 | self.ui.get_more_space_button.uri = EDIT_SERVICES_LINK |
2603 | 65 | self.ui.help_button.uri = GET_SUPPORT_LINK | 60 | self.ui.help_button.uri = GET_SUPPORT_LINK |
2613 | 66 | 61 | self.ui.devices_tab.localDeviceRemoved.connect( | |
2614 | 67 | # Invalid name "showEvent" | 62 | self.on_credentials_not_found) |
2615 | 68 | # pylint: disable=C0103 | 63 | self.ui.signin.credentialsFound.connect(lambda creds: self.load()) |
2616 | 69 | 64 | ||
2617 | 70 | def showEvent(self, event): | 65 | @defer.inlineCallbacks |
2618 | 71 | """Load info.""" | 66 | def connect_file_sync(self): |
2619 | 72 | self.load() | 67 | """Connect file sync service if the setting autoconnect is enabled.""" |
2620 | 73 | event.accept() | 68 | settings = yield self.backend.file_sync_settings_info() |
2621 | 74 | 69 | if AUTOCONNECT_KEY in settings and settings[AUTOCONNECT_KEY]: | |
2622 | 70 | yield self.backend.connect_files() | ||
2623 | 71 | |||
2624 | 72 | @log_call(logger.debug) | ||
2625 | 73 | def on_credentials_not_found(self): | ||
2626 | 74 | """Credentials are not found or were removed.""" | ||
2627 | 75 | self.ui.switcher.setCurrentWidget(self.ui.signin) | ||
2628 | 76 | self.is_processing = False | ||
2629 | 77 | |||
2630 | 78 | @log_call(logger.debug) | ||
2631 | 79 | def on_credentials_found(self): | ||
2632 | 80 | """Credentials are not found or were removed.""" | ||
2633 | 81 | self.ui.switcher.setCurrentWidget(self.ui.management) | ||
2634 | 82 | self.connect_file_sync() | ||
2635 | 83 | self.is_processing = False | ||
2636 | 84 | |||
2637 | 85 | # pylint: disable=E0202 | ||
2638 | 75 | @defer.inlineCallbacks | 86 | @defer.inlineCallbacks |
2639 | 76 | def load(self): | 87 | def load(self): |
2640 | 77 | """Load info.""" | 88 | """Load info.""" |
2643 | 78 | info = yield self.backend.account_info() | 89 | self.is_processing = True |
2644 | 79 | self.process_info(info) | 90 | credentials = yield self.backend.get_credentials() |
2645 | 91 | if not credentials: | ||
2646 | 92 | self.on_credentials_not_found() | ||
2647 | 93 | else: | ||
2648 | 94 | self.on_credentials_found() | ||
2649 | 95 | info = yield self.backend.account_info() | ||
2650 | 96 | self.process_info(info) | ||
2651 | 80 | 97 | ||
2652 | 81 | @log_call(logger.debug) | 98 | @log_call(logger.debug) |
2653 | 82 | def process_info(self, info): | 99 | def process_info(self, info): |
2654 | @@ -86,17 +103,43 @@ | |||
2655 | 86 | 103 | ||
2656 | 87 | used = int(info['quota_used']) | 104 | used = int(info['quota_used']) |
2657 | 88 | total = int(info['quota_total']) | 105 | total = int(info['quota_total']) |
2659 | 89 | percentage = {'percentage': PERCENTAGE_STYLE % ((used / total) * 100)} | 106 | percentage_value = ((used / total) * 100) |
2660 | 107 | percentage = {'percentage': PERCENTAGE_STYLE % percentage_value} | ||
2661 | 90 | data = {'used': humanize(used), 'total': humanize(total)} | 108 | data = {'used': humanize(used), 'total': humanize(total)} |
2662 | 91 | self.ui.percentage_usage_label.setText(PERCENTAGE_LABEL % percentage) | 109 | self.ui.percentage_usage_label.setText(PERCENTAGE_LABEL % percentage) |
2663 | 92 | self.ui.quota_usage_label.setText(USAGE_LABEL % data) | 110 | self.ui.quota_usage_label.setText(USAGE_LABEL % data) |
2664 | 111 | self._update_quota({'percentage': percentage_value}) | ||
2665 | 112 | |||
2666 | 113 | @log_call(logger.debug) | ||
2667 | 114 | def _update_quota(self, data=None): | ||
2668 | 115 | """Update the quota info.""" | ||
2669 | 116 | fraction = 0.0 | ||
2670 | 117 | if data is not None: | ||
2671 | 118 | fraction = data.get('percentage', 0.0) / 100 | ||
2672 | 119 | if fraction > 0 and fraction < 0.05: | ||
2673 | 120 | fraction = 0.05 | ||
2674 | 121 | else: | ||
2675 | 122 | fraction = round(fraction, 2) | ||
2676 | 123 | |||
2677 | 124 | logger.debug('ManagementPanel: updating quota to %r.', fraction) | ||
2678 | 125 | self.ui.percentage_usage_label.setProperty("OverQuota", | ||
2679 | 126 | fraction >= QUOTA_THRESHOLD) | ||
2680 | 127 | self.ui.quota_usage_label.setProperty("OverQuota", | ||
2681 | 128 | fraction >= QUOTA_THRESHOLD) | ||
2682 | 129 | self.ui.percentage_usage_label.style().unpolish( | ||
2683 | 130 | self.ui.percentage_usage_label) | ||
2684 | 131 | self.ui.percentage_usage_label.style().polish( | ||
2685 | 132 | self.ui.percentage_usage_label) | ||
2686 | 133 | self.ui.quota_usage_label.style().unpolish( | ||
2687 | 134 | self.ui.quota_usage_label) | ||
2688 | 135 | self.ui.quota_usage_label.style().polish(self.ui.quota_usage_label) | ||
2689 | 93 | 136 | ||
2690 | 94 | @QtCore.pyqtSlot() | 137 | @QtCore.pyqtSlot() |
2691 | 95 | def on_twitter_button_clicked(self): | 138 | def on_twitter_button_clicked(self): |
2692 | 96 | """The twitter button was clicked.""" | 139 | """The twitter button was clicked.""" |
2694 | 97 | uri_hook(TWITTER_LINK) | 140 | qt.uri_hook(TWITTER_LINK) |
2695 | 98 | 141 | ||
2696 | 99 | @QtCore.pyqtSlot() | 142 | @QtCore.pyqtSlot() |
2697 | 100 | def on_facebook_button_clicked(self): | 143 | def on_facebook_button_clicked(self): |
2698 | 101 | """The facebook button was clicked.""" | 144 | """The facebook button was clicked.""" |
2700 | 102 | uri_hook(FACEBOOK_LINK) | 145 | qt.uri_hook(FACEBOOK_LINK) |
2701 | 103 | 146 | ||
2702 | === modified file 'ubuntuone/controlpanel/gui/qt/device.py' | |||
2703 | --- ubuntuone/controlpanel/gui/qt/device.py 2011-07-22 21:26:48 +0000 | |||
2704 | +++ ubuntuone/controlpanel/gui/qt/device.py 2011-09-26 18:38:27 +0000 | |||
2705 | @@ -25,9 +25,15 @@ | |||
2706 | 25 | DEVICE_TYPE_COMPUTER, | 25 | DEVICE_TYPE_COMPUTER, |
2707 | 26 | DEVICE_TYPE_PHONE, | 26 | DEVICE_TYPE_PHONE, |
2708 | 27 | ) | 27 | ) |
2709 | 28 | from ubuntuone.controlpanel import cache | ||
2710 | 28 | from ubuntuone.controlpanel.gui import DEVICE_CONFIRM_REMOVE | 29 | from ubuntuone.controlpanel.gui import DEVICE_CONFIRM_REMOVE |
2712 | 29 | from ubuntuone.controlpanel.gui.qt import icon_from_name, pixmap_from_name | 30 | from ubuntuone.controlpanel.gui.qt import ( |
2713 | 31 | handle_errors, | ||
2714 | 32 | icon_from_name, | ||
2715 | 33 | pixmap_from_name, | ||
2716 | 34 | ) | ||
2717 | 30 | from ubuntuone.controlpanel.gui.qt.ui import device_ui | 35 | from ubuntuone.controlpanel.gui.qt.ui import device_ui |
2718 | 36 | from ubuntuone.controlpanel.logger import setup_logging | ||
2719 | 31 | 37 | ||
2720 | 32 | COMPUTER_ICON = "computer" | 38 | COMPUTER_ICON = "computer" |
2721 | 33 | PHONE_ICON = "phone" | 39 | PHONE_ICON = "phone" |
2722 | @@ -43,25 +49,27 @@ | |||
2723 | 43 | YES = QtGui.QMessageBox.Yes | 49 | YES = QtGui.QMessageBox.Yes |
2724 | 44 | 50 | ||
2725 | 45 | 51 | ||
2726 | 52 | logger = setup_logging('qt.device') | ||
2727 | 53 | |||
2728 | 54 | |||
2729 | 46 | def icon_name_from_type(device_type): | 55 | def icon_name_from_type(device_type): |
2730 | 47 | """Get the icon name for the device.""" | 56 | """Get the icon name for the device.""" |
2731 | 48 | icon_name = DEVICE_TYPE_TO_ICON_MAP.get(device_type, DEFAULT_ICON) | 57 | icon_name = DEVICE_TYPE_TO_ICON_MAP.get(device_type, DEFAULT_ICON) |
2732 | 49 | return icon_name | 58 | return icon_name |
2733 | 50 | 59 | ||
2734 | 51 | 60 | ||
2736 | 52 | class DeviceWidget(QtGui.QWidget): | 61 | class DeviceWidget(cache.Cache, QtGui.QWidget): |
2737 | 53 | """The widget for each device in the control panel.""" | 62 | """The widget for each device in the control panel.""" |
2738 | 54 | 63 | ||
2739 | 55 | removed = QtCore.pyqtSignal() | 64 | removed = QtCore.pyqtSignal() |
2740 | 56 | removeCanceled = QtCore.pyqtSignal() | 65 | removeCanceled = QtCore.pyqtSignal() |
2741 | 57 | 66 | ||
2743 | 58 | def __init__(self, backend, device_id, **kwargs): | 67 | def __init__(self, device_id, *args, **kwargs): |
2744 | 59 | """Initialize the UI of the widget.""" | 68 | """Initialize the UI of the widget.""" |
2746 | 60 | QtGui.QWidget.__init__(self, **kwargs) | 69 | super(DeviceWidget, self).__init__(*args, **kwargs) |
2747 | 61 | self.ui = device_ui.Ui_Form() | 70 | self.ui = device_ui.Ui_Form() |
2748 | 62 | self.ui.setupUi(self) | 71 | self.ui.setupUi(self) |
2749 | 63 | self.id = device_id | 72 | self.id = device_id |
2750 | 64 | self.backend = backend | ||
2751 | 65 | 73 | ||
2752 | 66 | def update_device_info(self, device_info): | 74 | def update_device_info(self, device_info): |
2753 | 67 | """Update the device info.""" | 75 | """Update the device info.""" |
2754 | @@ -70,8 +78,9 @@ | |||
2755 | 70 | pixmap = pixmap_from_name(icon_name) | 78 | pixmap = pixmap_from_name(icon_name) |
2756 | 71 | self.ui.device_icon_label.setPixmap(pixmap) | 79 | self.ui.device_icon_label.setPixmap(pixmap) |
2757 | 72 | 80 | ||
2758 | 81 | @QtCore.pyqtSlot() | ||
2759 | 82 | @handle_errors(logger=logger) | ||
2760 | 73 | @defer.inlineCallbacks | 83 | @defer.inlineCallbacks |
2761 | 74 | @QtCore.pyqtSlot() | ||
2762 | 75 | def on_remove_device_button_clicked(self): | 84 | def on_remove_device_button_clicked(self): |
2763 | 76 | """The user wants to remove this device.""" | 85 | """The user wants to remove this device.""" |
2764 | 77 | msg = DEVICE_CONFIRM_REMOVE | 86 | msg = DEVICE_CONFIRM_REMOVE |
2765 | 78 | 87 | ||
2766 | === modified file 'ubuntuone/controlpanel/gui/qt/devices.py' | |||
2767 | --- ubuntuone/controlpanel/gui/qt/devices.py 2011-07-22 21:26:48 +0000 | |||
2768 | +++ ubuntuone/controlpanel/gui/qt/devices.py 2011-09-26 18:38:27 +0000 | |||
2769 | @@ -18,8 +18,6 @@ | |||
2770 | 18 | 18 | ||
2771 | 19 | """The user interface for the control panel for Ubuntu One.""" | 19 | """The user interface for the control panel for Ubuntu One.""" |
2772 | 20 | 20 | ||
2773 | 21 | from gettext import gettext as _ | ||
2774 | 22 | |||
2775 | 23 | # Unused import QtGui | 21 | # Unused import QtGui |
2776 | 24 | # pylint: disable=W0611 | 22 | # pylint: disable=W0611 |
2777 | 25 | from PyQt4 import QtGui, QtCore | 23 | from PyQt4 import QtGui, QtCore |
2778 | @@ -39,13 +37,17 @@ | |||
2779 | 39 | class DevicesPanel(UbuntuOneBin): | 37 | class DevicesPanel(UbuntuOneBin): |
2780 | 40 | """The DevicesFolders Tab Panel widget""" | 38 | """The DevicesFolders Tab Panel widget""" |
2781 | 41 | 39 | ||
2782 | 42 | title = _('This device') | ||
2783 | 43 | ui_class = devices_ui | 40 | ui_class = devices_ui |
2784 | 41 | logger = logger | ||
2785 | 42 | |||
2786 | 43 | localDeviceRemoved = QtCore.pyqtSignal() | ||
2787 | 44 | 44 | ||
2788 | 45 | def _setup(self): | 45 | def _setup(self): |
2789 | 46 | """Do some extra setupping for the UI.""" | 46 | """Do some extra setupping for the UI.""" |
2790 | 47 | super(DevicesPanel, self)._setup() | ||
2791 | 47 | self.ui.manage_devices_button.uri = EDIT_DEVICES_LINK | 48 | self.ui.manage_devices_button.uri = EDIT_DEVICES_LINK |
2792 | 48 | 49 | ||
2793 | 50 | # pylint: disable=E0202 | ||
2794 | 49 | @defer.inlineCallbacks | 51 | @defer.inlineCallbacks |
2795 | 50 | def load(self): | 52 | def load(self): |
2796 | 51 | """Load info.""" | 53 | """Load info.""" |
2797 | @@ -64,6 +66,11 @@ | |||
2798 | 64 | 66 | ||
2799 | 65 | self.is_processing = False | 67 | self.is_processing = False |
2800 | 66 | 68 | ||
2801 | 69 | def on_local_device_removed(self): | ||
2802 | 70 | """When the local device is removed, clear the box and emit signal.""" | ||
2803 | 71 | self.clear_device_info(self.ui.local_device_box) | ||
2804 | 72 | self.localDeviceRemoved.emit() | ||
2805 | 73 | |||
2806 | 67 | def clear_device_info(self, box): | 74 | def clear_device_info(self, box): |
2807 | 68 | """Clear all the device info.""" | 75 | """Clear all the device info.""" |
2808 | 69 | children = box.count() | 76 | children = box.count() |
2809 | @@ -84,11 +91,9 @@ | |||
2810 | 84 | 91 | ||
2811 | 85 | def update_local_device(self, device_info): | 92 | def update_local_device(self, device_info): |
2812 | 86 | """Update the info for the local device.""" | 93 | """Update the info for the local device.""" |
2815 | 87 | device_widget = device.DeviceWidget(backend=self.backend, | 94 | device_widget = device.DeviceWidget(device_id=device_info['device_id']) |
2814 | 88 | device_id=device_info['device_id']) | ||
2816 | 89 | device_widget.update_device_info(device_info) | 95 | device_widget.update_device_info(device_info) |
2819 | 90 | f = lambda: self.clear_device_info(self.ui.local_device_box) | 96 | device_widget.removed.connect(self.on_local_device_removed) |
2818 | 91 | device_widget.removed.connect(f) | ||
2820 | 92 | 97 | ||
2821 | 93 | self.ui.local_device_box.addWidget(device_widget) | 98 | self.ui.local_device_box.addWidget(device_widget) |
2822 | 94 | 99 | ||
2823 | 95 | 100 | ||
2824 | === modified file 'ubuntuone/controlpanel/gui/qt/filesyncstatus.py' | |||
2825 | --- ubuntuone/controlpanel/gui/qt/filesyncstatus.py 2011-08-25 19:37:14 +0000 | |||
2826 | +++ ubuntuone/controlpanel/gui/qt/filesyncstatus.py 2011-09-26 18:38:27 +0000 | |||
2827 | @@ -21,7 +21,7 @@ | |||
2828 | 21 | from PyQt4 import QtGui, QtCore | 21 | from PyQt4 import QtGui, QtCore |
2829 | 22 | from twisted.internet import defer | 22 | from twisted.internet import defer |
2830 | 23 | 23 | ||
2832 | 24 | from ubuntuone.controlpanel import backend | 24 | from ubuntuone.controlpanel import backend, cache |
2833 | 25 | from ubuntuone.controlpanel.logger import setup_logging, log_call | 25 | from ubuntuone.controlpanel.logger import setup_logging, log_call |
2834 | 26 | from ubuntuone.controlpanel.gui import ( | 26 | from ubuntuone.controlpanel.gui import ( |
2835 | 27 | ERROR_COLOR, | 27 | ERROR_COLOR, |
2836 | @@ -108,27 +108,26 @@ | |||
2837 | 108 | return icon_name | 108 | return icon_name |
2838 | 109 | 109 | ||
2839 | 110 | 110 | ||
2841 | 111 | class FileSyncStatus(QtGui.QWidget): | 111 | class FileSyncStatus(cache.Cache, QtGui.QWidget): |
2842 | 112 | """The FileSyncStatus widget""" | 112 | """The FileSyncStatus widget""" |
2843 | 113 | 113 | ||
2845 | 114 | def __init__(self, parent=None): | 114 | def __init__(self, *args, **kwargs): |
2846 | 115 | """Initialize the UI of the widget.""" | 115 | """Initialize the UI of the widget.""" |
2848 | 116 | QtGui.QWidget.__init__(self, parent) | 116 | super(FileSyncStatus, self).__init__(*args, **kwargs) |
2849 | 117 | self.ui = filesyncstatus_ui.Ui_Form() | 117 | self.ui = filesyncstatus_ui.Ui_Form() |
2850 | 118 | self.ui.setupUi(self) | 118 | self.ui.setupUi(self) |
2851 | 119 | 119 | ||
2852 | 120 | self._backend_method = None | 120 | self._backend_method = None |
2853 | 121 | self.backend = backend.ControlBackend() | ||
2854 | 122 | |||
2855 | 123 | logger.debug('%s: started.', self.__class__.__name__) | ||
2856 | 124 | 121 | ||
2857 | 125 | # Invalid name "showEvent" | 122 | # Invalid name "showEvent" |
2858 | 126 | # pylint: disable=C0103 | 123 | # pylint: disable=C0103 |
2859 | 127 | 124 | ||
2860 | 128 | def showEvent(self, event): | 125 | def showEvent(self, event): |
2861 | 129 | """Load info.""" | 126 | """Load info.""" |
2862 | 127 | super(FileSyncStatus, self).showEvent(event) | ||
2863 | 130 | self.load() | 128 | self.load() |
2865 | 131 | event.accept() | 129 | |
2866 | 130 | # pylint: enable=C0103 | ||
2867 | 132 | 131 | ||
2868 | 133 | @defer.inlineCallbacks | 132 | @defer.inlineCallbacks |
2869 | 134 | def load(self): | 133 | def load(self): |
2870 | 135 | 134 | ||
2871 | === modified file 'ubuntuone/controlpanel/gui/qt/folders.py' | |||
2872 | --- ubuntuone/controlpanel/gui/qt/folders.py 2011-08-12 19:12:08 +0000 | |||
2873 | +++ ubuntuone/controlpanel/gui/qt/folders.py 2011-09-26 18:38:27 +0000 | |||
2874 | @@ -29,7 +29,6 @@ | |||
2875 | 29 | from ubuntuone.controlpanel.gui import ( | 29 | from ubuntuone.controlpanel.gui import ( |
2876 | 30 | ALWAYS_SUBSCRIBED, | 30 | ALWAYS_SUBSCRIBED, |
2877 | 31 | EXPLORE, | 31 | EXPLORE, |
2878 | 32 | FILE_URI_PREFIX, | ||
2879 | 33 | FOLDER_ICON_NAME, | 32 | FOLDER_ICON_NAME, |
2880 | 34 | FOLDER_OWNED_BY, | 33 | FOLDER_OWNED_BY, |
2881 | 35 | FOLDER_SHARED_BY, | 34 | FOLDER_SHARED_BY, |
2882 | @@ -65,11 +64,12 @@ | |||
2883 | 65 | """The Folders Tab Panel widget""" | 64 | """The Folders Tab Panel widget""" |
2884 | 66 | 65 | ||
2885 | 67 | ui_class = folders_ui | 66 | ui_class = folders_ui |
2886 | 67 | logger = logger | ||
2887 | 68 | 68 | ||
2888 | 69 | def _setup(self): | 69 | def _setup(self): |
2889 | 70 | """Do some extra setupping for the UI.""" | 70 | """Do some extra setupping for the UI.""" |
2892 | 71 | load_info = lambda *a, **kw: self.load() | 71 | super(FoldersPanel, self)._setup() |
2893 | 72 | self.ui.add_folder_button.folderCreated.connect(load_info) | 72 | self.ui.add_folder_button.folderCreated.connect(self.on_folder_created) |
2894 | 73 | 73 | ||
2895 | 74 | headers = self.ui.folders.header() | 74 | headers = self.ui.folders.header() |
2896 | 75 | headers.setResizeMode(FOLDER_NAME_COL, headers.Stretch) | 75 | headers.setResizeMode(FOLDER_NAME_COL, headers.Stretch) |
2897 | @@ -81,8 +81,16 @@ | |||
2898 | 81 | icon = icon_from_name('external_icon_orange') | 81 | icon = icon_from_name('external_icon_orange') |
2899 | 82 | self.ui.share_publish_button.setIcon(icon) | 82 | self.ui.share_publish_button.setIcon(icon) |
2900 | 83 | 83 | ||
2902 | 84 | logger.debug('%s: started.', self.__class__.__name__) | 84 | @log_call(logger.info) |
2903 | 85 | def on_folder_created(self, new_folder): | ||
2904 | 86 | """Reload folder info after folder creation.""" | ||
2905 | 87 | self.is_processing = True | ||
2906 | 88 | # hack to ensure that syncdaemon updates the folder list. | ||
2907 | 89 | # pylint: disable=W0404, E1101 | ||
2908 | 90 | from twisted.internet import reactor | ||
2909 | 91 | reactor.callLater(2, self.load) | ||
2910 | 85 | 92 | ||
2911 | 93 | # pylint: disable=E0202 | ||
2912 | 86 | @defer.inlineCallbacks | 94 | @defer.inlineCallbacks |
2913 | 87 | def load(self): | 95 | def load(self): |
2914 | 88 | """Load specific tab info.""" | 96 | """Load specific tab info.""" |
2915 | @@ -124,9 +132,15 @@ | |||
2916 | 124 | self.ui.folders.addTopLevelItem(item) | 132 | self.ui.folders.addTopLevelItem(item) |
2917 | 125 | 133 | ||
2918 | 126 | for volume in volumes: | 134 | for volume in volumes: |
2919 | 135 | is_root = volume[u'type'] == self.backend.ROOT_TYPE | ||
2920 | 136 | is_share = volume[u'type'] == self.backend.SHARE_TYPE | ||
2921 | 137 | |||
2922 | 127 | child = QtGui.QTreeWidgetItem() | 138 | child = QtGui.QTreeWidgetItem() |
2923 | 128 | child.setSizeHint(FOLDER_NAME_COL, QtCore.QSize(-1, 35)) | 139 | child.setSizeHint(FOLDER_NAME_COL, QtCore.QSize(-1, 35)) |
2925 | 129 | child.volume_path = volume['path'] | 140 | if is_share and 'realpath' in volume: |
2926 | 141 | child.volume_path = volume['realpath'] | ||
2927 | 142 | else: | ||
2928 | 143 | child.volume_path = volume['path'] | ||
2929 | 130 | child.volume_id = volume['volume_id'] | 144 | child.volume_id = volume['volume_id'] |
2930 | 131 | 145 | ||
2931 | 132 | name = self._process_name(volume[u'display_name']) | 146 | name = self._process_name(volume[u'display_name']) |
2932 | @@ -134,9 +148,6 @@ | |||
2933 | 134 | child.setToolTip(FOLDER_NAME_COL, name) | 148 | child.setToolTip(FOLDER_NAME_COL, name) |
2934 | 135 | child.setToolTip(EXPLORE_COL, EXPLORE) | 149 | child.setToolTip(EXPLORE_COL, EXPLORE) |
2935 | 136 | 150 | ||
2936 | 137 | is_root = volume[u'type'] == self.backend.ROOT_TYPE | ||
2937 | 138 | is_share = volume[u'type'] == self.backend.SHARE_TYPE | ||
2938 | 139 | |||
2939 | 140 | icon_name = FOLDER_ICON_NAME | 151 | icon_name = FOLDER_ICON_NAME |
2940 | 141 | if is_share: | 152 | if is_share: |
2941 | 142 | icon_name = SHARE_ICON_NAME | 153 | icon_name = SHARE_ICON_NAME |
2942 | @@ -173,12 +184,14 @@ | |||
2943 | 173 | policy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, | 184 | policy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, |
2944 | 174 | QtGui.QSizePolicy.Fixed) | 185 | QtGui.QSizePolicy.Fixed) |
2945 | 175 | button.setSizePolicy(policy) | 186 | button.setSizePolicy(policy) |
2946 | 187 | button.setEnabled(bool(volume[u'subscribed'])) | ||
2947 | 176 | 188 | ||
2948 | 177 | # Operator not preceded by a space | 189 | # Operator not preceded by a space |
2949 | 178 | # pylint: disable=C0322 | 190 | # pylint: disable=C0322 |
2951 | 179 | cb = lambda item=child: self.on_folders_itemActivated(item) | 191 | cb = lambda checked, item=child: \ |
2952 | 192 | self.on_folders_itemActivated(item) | ||
2953 | 180 | # pylint: enable=C0322 | 193 | # pylint: enable=C0322 |
2955 | 181 | QtCore.QObject.connect(button, QtCore.SIGNAL('clicked()'), cb) | 194 | button.clicked.connect(cb) |
2956 | 182 | self.ui.folders.setIndexWidget(model_index, button) | 195 | self.ui.folders.setIndexWidget(model_index, button) |
2957 | 183 | 196 | ||
2958 | 184 | self.ui.folders.expandAll() | 197 | self.ui.folders.expandAll() |
2959 | @@ -196,7 +209,7 @@ | |||
2960 | 196 | logger.warning('on_folders_itemActivated: stored path %r ' | 209 | logger.warning('on_folders_itemActivated: stored path %r ' |
2961 | 197 | 'does not exist.', volume_path) | 210 | 'does not exist.', volume_path) |
2962 | 198 | else: | 211 | else: |
2964 | 199 | uri = FILE_URI_PREFIX + volume_path | 212 | uri = unicode(QtCore.QUrl.fromLocalFile(volume_path).toString()) |
2965 | 200 | uri_hook(uri) | 213 | uri_hook(uri) |
2966 | 201 | 214 | ||
2967 | 202 | @defer.inlineCallbacks | 215 | @defer.inlineCallbacks |
2968 | @@ -230,6 +243,7 @@ | |||
2969 | 230 | # user accepted, merge the folder content | 243 | # user accepted, merge the folder content |
2970 | 231 | yield self.backend.change_volume_settings(volume_id, | 244 | yield self.backend.change_volume_settings(volume_id, |
2971 | 232 | {'subscribed': subscribed}) | 245 | {'subscribed': subscribed}) |
2972 | 246 | self.load() | ||
2973 | 233 | else: | 247 | else: |
2974 | 234 | # restore old value | 248 | # restore old value |
2975 | 235 | old = UNCHECKED if subscribed else CHECKED | 249 | old = UNCHECKED if subscribed else CHECKED |
2976 | 236 | 250 | ||
2977 | === modified file 'ubuntuone/controlpanel/gui/qt/gotoweb.py' | |||
2978 | --- ubuntuone/controlpanel/gui/qt/gotoweb.py 2011-07-22 21:26:48 +0000 | |||
2979 | +++ ubuntuone/controlpanel/gui/qt/gotoweb.py 2011-09-26 18:38:27 +0000 | |||
2980 | @@ -20,10 +20,13 @@ | |||
2981 | 20 | 20 | ||
2982 | 21 | from PyQt4 import QtGui, QtCore | 21 | from PyQt4 import QtGui, QtCore |
2983 | 22 | 22 | ||
2988 | 23 | from ubuntuone.controlpanel.gui import qt | 23 | from twisted.internet import defer |
2989 | 24 | 24 | ||
2990 | 25 | 25 | from ubuntuone.controlpanel import cache | |
2991 | 26 | class GoToWebButton(QtGui.QPushButton): | 26 | from ubuntuone.controlpanel.gui import qt, sign_url, UBUNTUONE_LINK |
2992 | 27 | |||
2993 | 28 | |||
2994 | 29 | class GoToWebButton(cache.Cache, QtGui.QPushButton): | ||
2995 | 27 | """The GoToWebButton widget""" | 30 | """The GoToWebButton widget""" |
2996 | 28 | 31 | ||
2997 | 29 | def __init__(self, *args, **kwargs): | 32 | def __init__(self, *args, **kwargs): |
2998 | @@ -33,9 +36,20 @@ | |||
2999 | 33 | self.setIcon(qt.icon_from_name('external_icon_white')) | 36 | self.setIcon(qt.icon_from_name('external_icon_white')) |
3000 | 34 | self.setLayoutDirection(QtCore.Qt.RightToLeft) | 37 | self.setLayoutDirection(QtCore.Qt.RightToLeft) |
3001 | 35 | self.clicked.connect(self.on_clicked) | 38 | self.clicked.connect(self.on_clicked) |
3002 | 39 | self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) | ||
3003 | 36 | 40 | ||
3004 | 41 | @defer.inlineCallbacks | ||
3005 | 37 | @QtCore.pyqtSlot() | 42 | @QtCore.pyqtSlot() |
3006 | 38 | def on_clicked(self): | 43 | def on_clicked(self): |
3007 | 39 | """Open self.uri if not None, do nothing otherwise.""" | 44 | """Open self.uri if not None, do nothing otherwise.""" |
3008 | 40 | if self.uri is not None: | 45 | if self.uri is not None: |
3010 | 41 | qt.uri_hook(self.uri) | 46 | |
3011 | 47 | credentials = None | ||
3012 | 48 | if self.uri.startswith(UBUNTUONE_LINK): | ||
3013 | 49 | credentials = yield self.backend.get_credentials() | ||
3014 | 50 | |||
3015 | 51 | uri = self.uri | ||
3016 | 52 | if credentials: | ||
3017 | 53 | uri = sign_url(uri, credentials) | ||
3018 | 54 | |||
3019 | 55 | qt.uri_hook(uri) | ||
3020 | 42 | 56 | ||
3021 | === modified file 'ubuntuone/controlpanel/gui/qt/gui.py' | |||
3022 | --- ubuntuone/controlpanel/gui/qt/gui.py 2011-07-22 21:26:48 +0000 | |||
3023 | +++ ubuntuone/controlpanel/gui/qt/gui.py 2011-09-26 18:38:27 +0000 | |||
3024 | @@ -21,22 +21,24 @@ | |||
3025 | 21 | 21 | ||
3026 | 22 | from PyQt4 import QtGui | 22 | from PyQt4 import QtGui |
3027 | 23 | 23 | ||
3029 | 24 | from ubuntuone.controlpanel.logger import setup_logging | 24 | from ubuntuone.controlpanel.gui.qt.systray import TrayIcon |
3030 | 25 | from ubuntuone.controlpanel.gui.qt.ui import mainwindow_ui | 25 | from ubuntuone.controlpanel.gui.qt.ui import mainwindow_ui |
3031 | 26 | 26 | ||
3032 | 27 | 27 | ||
3033 | 28 | logger = setup_logging('qt.gui') | ||
3034 | 29 | |||
3035 | 30 | |||
3036 | 31 | class MainWindow(QtGui.QMainWindow): | 28 | class MainWindow(QtGui.QMainWindow): |
3037 | 32 | """The Main Window of the Control Panel.""" | 29 | """The Main Window of the Control Panel.""" |
3038 | 33 | 30 | ||
3039 | 34 | def __init__(self, close_callback=None): | 31 | def __init__(self, close_callback=None): |
3040 | 35 | """Initialize this instance with the UI layout.""" | 32 | """Initialize this instance with the UI layout.""" |
3042 | 36 | QtGui.QMainWindow.__init__(self) | 33 | super(MainWindow, self).__init__() |
3043 | 37 | self.ui = mainwindow_ui.Ui_MainWindow() | 34 | self.ui = mainwindow_ui.Ui_MainWindow() |
3044 | 38 | self.ui.setupUi(self) | 35 | self.ui.setupUi(self) |
3045 | 39 | self.close_callback = close_callback | 36 | self.close_callback = close_callback |
3046 | 37 | self._setup() | ||
3047 | 38 | |||
3048 | 39 | def _setup(self): | ||
3049 | 40 | """Do some extra setupping for the UI.""" | ||
3050 | 41 | self.ui.control_panel.ui.signin.signinCanceled.connect(self.close) | ||
3051 | 40 | 42 | ||
3052 | 41 | # Invalid name "closeEvent" | 43 | # Invalid name "closeEvent" |
3053 | 42 | # pylint: disable=C0103 | 44 | # pylint: disable=C0103 |
3054 | @@ -46,3 +48,24 @@ | |||
3055 | 46 | if self.close_callback is not None: | 48 | if self.close_callback is not None: |
3056 | 47 | self.close_callback() | 49 | self.close_callback() |
3057 | 48 | event.accept() | 50 | event.accept() |
3058 | 51 | |||
3059 | 52 | # pylint: enable=C0103 | ||
3060 | 53 | |||
3061 | 54 | |||
3062 | 55 | def start(stop, minimized=False, with_icon=False): | ||
3063 | 56 | """Show the UI elements.""" | ||
3064 | 57 | # pylint: disable=W0404, F0401 | ||
3065 | 58 | if not minimized: | ||
3066 | 59 | if with_icon or minimized: | ||
3067 | 60 | window = MainWindow() | ||
3068 | 61 | else: | ||
3069 | 62 | window = MainWindow(close_callback=stop) | ||
3070 | 63 | window.show() | ||
3071 | 64 | else: | ||
3072 | 65 | window = None | ||
3073 | 66 | if with_icon or minimized: | ||
3074 | 67 | QtGui.QApplication.instance().setQuitOnLastWindowClosed(False) | ||
3075 | 68 | icon = TrayIcon(window=window) | ||
3076 | 69 | else: | ||
3077 | 70 | icon = None | ||
3078 | 71 | return icon, window | ||
3079 | 49 | 72 | ||
3080 | === modified file 'ubuntuone/controlpanel/gui/qt/loadingoverlay.py' | |||
3081 | --- ubuntuone/controlpanel/gui/qt/loadingoverlay.py 2011-08-12 19:12:08 +0000 | |||
3082 | +++ ubuntuone/controlpanel/gui/qt/loadingoverlay.py 2011-09-26 18:38:27 +0000 | |||
3083 | @@ -18,8 +18,7 @@ | |||
3084 | 18 | 18 | ||
3085 | 19 | """Loading animation over a widget.""" | 19 | """Loading animation over a widget.""" |
3086 | 20 | 20 | ||
3089 | 21 | from PyQt4 import QtGui | 21 | from PyQt4 import QtGui, QtCore |
3088 | 22 | from PyQt4 import QtCore | ||
3090 | 23 | 22 | ||
3091 | 24 | from ubuntuone.controlpanel.gui.qt.ui import loadingoverlay_ui | 23 | from ubuntuone.controlpanel.gui.qt.ui import loadingoverlay_ui |
3092 | 25 | 24 | ||
3093 | @@ -29,12 +28,15 @@ | |||
3094 | 29 | 28 | ||
3095 | 30 | In order to have this working, the Widget which is going to use this | 29 | In order to have this working, the Widget which is going to use this |
3096 | 31 | overlay has to reimplement the resizeEvent as follows: | 30 | overlay has to reimplement the resizeEvent as follows: |
3097 | 31 | |||
3098 | 32 | def resizeEvent(self, event): | 32 | def resizeEvent(self, event): |
3099 | 33 | self.overlay.resize(event.size()) | 33 | self.overlay.resize(event.size()) |
3101 | 34 | event.accept()""" | 34 | event.accept() |
3102 | 35 | |||
3103 | 36 | """ | ||
3104 | 35 | 37 | ||
3105 | 36 | def __init__(self, parent=None): | 38 | def __init__(self, parent=None): |
3107 | 37 | QtGui.QFrame.__init__(self, parent) | 39 | super(LoadingOverlay, self).__init__(parent=parent) |
3108 | 38 | self.ui = loadingoverlay_ui.Ui_Form() | 40 | self.ui = loadingoverlay_ui.Ui_Form() |
3109 | 39 | self.ui.setupUi(self) | 41 | self.ui.setupUi(self) |
3110 | 40 | 42 | ||
3111 | 41 | 43 | ||
3112 | === modified file 'ubuntuone/controlpanel/gui/qt/main/linux.py' | |||
3113 | --- ubuntuone/controlpanel/gui/qt/main/linux.py 2011-07-22 21:26:48 +0000 | |||
3114 | +++ ubuntuone/controlpanel/gui/qt/main/linux.py 2011-09-26 18:38:27 +0000 | |||
3115 | @@ -29,7 +29,7 @@ | |||
3116 | 29 | # pylint: enable=W0611 | 29 | # pylint: enable=W0611 |
3117 | 30 | 30 | ||
3118 | 31 | 31 | ||
3120 | 32 | def main(switch_to='', alert=False): | 32 | def main(switch_to='', alert=False, minimized=False, with_icon=False): |
3121 | 33 | """Start the Qt reactor and open the main window.""" | 33 | """Start the Qt reactor and open the main window.""" |
3122 | 34 | 34 | ||
3123 | 35 | # The DBus main loop MUST be initialized before importing the reactor | 35 | # The DBus main loop MUST be initialized before importing the reactor |
3124 | @@ -49,11 +49,9 @@ | |||
3125 | 49 | from qtreactor import qt4reactor | 49 | from qtreactor import qt4reactor |
3126 | 50 | qt4reactor.install() | 50 | qt4reactor.install() |
3127 | 51 | from twisted.internet import reactor | 51 | from twisted.internet import reactor |
3128 | 52 | from ubuntuone.controlpanel.gui.qt.gui import start | ||
3129 | 52 | 53 | ||
3130 | 53 | # pylint believes that reactor has no run nor stop methods. Silence it. | ||
3131 | 54 | # pylint: disable=E1101 | 54 | # pylint: disable=E1101 |
3136 | 55 | from ubuntuone.controlpanel.gui.qt.gui import MainWindow | 55 | icon, window = start(reactor.stop, |
3137 | 56 | window = MainWindow(close_callback=reactor.stop) | 56 | minimized=minimized, with_icon=with_icon) |
3134 | 57 | window.show() | ||
3135 | 58 | |||
3138 | 59 | reactor.run() | 57 | reactor.run() |
3139 | 60 | 58 | ||
3140 | === modified file 'ubuntuone/controlpanel/gui/qt/main/windows.py' | |||
3141 | --- ubuntuone/controlpanel/gui/qt/main/windows.py 2011-07-22 21:26:48 +0000 | |||
3142 | +++ ubuntuone/controlpanel/gui/qt/main/windows.py 2011-09-26 18:38:27 +0000 | |||
3143 | @@ -27,7 +27,7 @@ | |||
3144 | 27 | # pylint: enable=W0611 | 27 | # pylint: enable=W0611 |
3145 | 28 | 28 | ||
3146 | 29 | 29 | ||
3148 | 30 | def main(switch_to='', alert=False): | 30 | def main(switch_to='', alert=False, minimized=False, with_icon=False): |
3149 | 31 | """Start the Qt reactor and open the main window.""" | 31 | """Start the Qt reactor and open the main window.""" |
3150 | 32 | 32 | ||
3151 | 33 | # The following cannot be imported outside this function | 33 | # The following cannot be imported outside this function |
3152 | @@ -35,25 +35,22 @@ | |||
3153 | 35 | # pylint: disable=F0401, W0404 | 35 | # pylint: disable=F0401, W0404 |
3154 | 36 | import qtreactor.qt4reactor | 36 | import qtreactor.qt4reactor |
3155 | 37 | qtreactor.qt4reactor.install() | 37 | qtreactor.qt4reactor.install() |
3156 | 38 | from twisted.internet import reactor | ||
3157 | 39 | from ubuntuone.controlpanel.gui.qt.gui import start | ||
3158 | 38 | 40 | ||
3159 | 39 | # The main loop MUST be initialized before importing the reactor | 41 | # The main loop MUST be initialized before importing the reactor |
3160 | 40 | # pylint: disable=W0612 | 42 | # pylint: disable=W0612 |
3161 | 41 | app = Qt.QApplication(sys.argv) | 43 | app = Qt.QApplication(sys.argv) |
3162 | 44 | # Apply font to the entire application | ||
3163 | 45 | QtGui.QFontDatabase.addApplicationFont(':/Ubuntu-R.ttf') | ||
3164 | 46 | QtGui.QFontDatabase.addApplicationFont(':/Ubuntu-B.ttf') | ||
3165 | 42 | # Apply Style Sheet | 47 | # Apply Style Sheet |
3166 | 43 | qss_file = QtCore.QFile(":/ubuntuone.qss") | 48 | qss_file = QtCore.QFile(":/ubuntuone.qss") |
3167 | 44 | qss_file.open(QtCore.QFile.ReadOnly) | 49 | qss_file.open(QtCore.QFile.ReadOnly) |
3168 | 45 | stylesheet = QtCore.QLatin1String(qss_file.readAll()) | 50 | stylesheet = QtCore.QLatin1String(qss_file.readAll()) |
3169 | 46 | app.setStyleSheet(stylesheet) | 51 | app.setStyleSheet(stylesheet) |
3170 | 47 | 52 | ||
3181 | 48 | # Apply font to the entire application | 53 | icon, window = start(reactor.stop, |
3182 | 49 | QtGui.QFontDatabase.addApplicationFont(':/Ubuntu-R.ttf') | 54 | minimized=minimized, with_icon=with_icon) |
3173 | 50 | |||
3174 | 51 | # pylint: disable=W0404, F0401 | ||
3175 | 52 | from twisted.internet import reactor | ||
3176 | 53 | |||
3177 | 54 | from ubuntuone.controlpanel.gui.qt.gui import MainWindow | ||
3178 | 55 | window = MainWindow(close_callback=reactor.stop) | ||
3179 | 56 | window.show() | ||
3180 | 57 | |||
3183 | 58 | # pylint: disable=E1101 | 55 | # pylint: disable=E1101 |
3184 | 59 | reactor.run() | 56 | reactor.run() |
3185 | 60 | 57 | ||
3186 | === modified file 'ubuntuone/controlpanel/gui/qt/preferences.py' | |||
3187 | --- ubuntuone/controlpanel/gui/qt/preferences.py 2011-07-22 21:26:48 +0000 | |||
3188 | +++ ubuntuone/controlpanel/gui/qt/preferences.py 2011-09-26 18:38:27 +0000 | |||
3189 | @@ -62,7 +62,9 @@ | |||
3190 | 62 | """The Preferences Tab Panel widget""" | 62 | """The Preferences Tab Panel widget""" |
3191 | 63 | 63 | ||
3192 | 64 | ui_class = preferences_ui | 64 | ui_class = preferences_ui |
3193 | 65 | logger = logger | ||
3194 | 65 | 66 | ||
3195 | 67 | # pylint: disable=E0202 | ||
3196 | 66 | @defer.inlineCallbacks | 68 | @defer.inlineCallbacks |
3197 | 67 | def load(self): | 69 | def load(self): |
3198 | 68 | """Load info.""" | 70 | """Load info.""" |
3199 | 69 | 71 | ||
3200 | === added file 'ubuntuone/controlpanel/gui/qt/signin.py' | |||
3201 | --- ubuntuone/controlpanel/gui/qt/signin.py 1970-01-01 00:00:00 +0000 | |||
3202 | +++ ubuntuone/controlpanel/gui/qt/signin.py 2011-09-26 18:38:27 +0000 | |||
3203 | @@ -0,0 +1,89 @@ | |||
3204 | 1 | # -*- coding: utf-8 -*- | ||
3205 | 2 | |||
3206 | 3 | # Authors: Natalia B Bidart <natalia.bidart@canonical.com> | ||
3207 | 4 | # | ||
3208 | 5 | # Copyright 2011 Canonical Ltd. | ||
3209 | 6 | # | ||
3210 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
3211 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
3212 | 9 | # by the Free Software Foundation. | ||
3213 | 10 | # | ||
3214 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3215 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3216 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3217 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
3218 | 15 | # | ||
3219 | 16 | # You should have received a copy of the GNU General Public License along | ||
3220 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3221 | 18 | |||
3222 | 19 | """The signin page.""" | ||
3223 | 20 | |||
3224 | 21 | from PyQt4 import QtCore | ||
3225 | 22 | from twisted.internet import defer | ||
3226 | 23 | |||
3227 | 24 | from ubuntuone.controlpanel.gui import RESET_PASSWORD_LINK | ||
3228 | 25 | from ubuntuone.controlpanel.gui.qt import icon_from_name, handle_errors | ||
3229 | 26 | from ubuntuone.controlpanel.gui.qt.ubuntuonebin import UbuntuOneBin | ||
3230 | 27 | from ubuntuone.controlpanel.gui.qt.ui import signin_ui | ||
3231 | 28 | from ubuntuone.controlpanel.logger import setup_logging, log_call | ||
3232 | 29 | |||
3233 | 30 | |||
3234 | 31 | logger = setup_logging('qt.signin') | ||
3235 | 32 | |||
3236 | 33 | |||
3237 | 34 | class SignInPanel(UbuntuOneBin): | ||
3238 | 35 | """The widget for signing in.""" | ||
3239 | 36 | |||
3240 | 37 | ui_class = signin_ui | ||
3241 | 38 | logger = logger | ||
3242 | 39 | |||
3243 | 40 | signinCanceled = QtCore.pyqtSignal() | ||
3244 | 41 | credentialsFound = QtCore.pyqtSignal(dict) | ||
3245 | 42 | |||
3246 | 43 | def _setup(self): | ||
3247 | 44 | """Do some extra setupping for the UI.""" | ||
3248 | 45 | super(SignInPanel, self)._setup() | ||
3249 | 46 | |||
3250 | 47 | self.ui.forgot_password_button.uri = RESET_PASSWORD_LINK | ||
3251 | 48 | icon = icon_from_name('external_icon_orange') | ||
3252 | 49 | self.ui.forgot_password_button.setIcon(icon) | ||
3253 | 50 | |||
3254 | 51 | self.ui.signin_button.setEnabled(False) | ||
3255 | 52 | for entry in (self.ui.email_entry, self.ui.password_entry): | ||
3256 | 53 | entry.textChanged.connect(self.validate) | ||
3257 | 54 | entry.returnPressed.connect(self.ui.signin_button.click) | ||
3258 | 55 | |||
3259 | 56 | def validate(self, *a, **kw): | ||
3260 | 57 | """Enable sign in button only if email and password are non empty.""" | ||
3261 | 58 | email = unicode(self.ui.email_entry.text()) | ||
3262 | 59 | password = unicode(self.ui.password_entry.text()) | ||
3263 | 60 | self.ui.signin_button.setEnabled(bool(email and password)) | ||
3264 | 61 | self.ui.signin_button.style().unpolish(self.ui.signin_button) | ||
3265 | 62 | self.ui.signin_button.style().polish(self.ui.signin_button) | ||
3266 | 63 | |||
3267 | 64 | # pylint: disable=E0202 | ||
3268 | 65 | @defer.inlineCallbacks | ||
3269 | 66 | def load(self): | ||
3270 | 67 | """Load specific tab info.""" | ||
3271 | 68 | yield self.backend.get_credentials() | ||
3272 | 69 | |||
3273 | 70 | @QtCore.pyqtSlot() | ||
3274 | 71 | @handle_errors(logger=logger) | ||
3275 | 72 | @log_call(logger.debug) | ||
3276 | 73 | @defer.inlineCallbacks | ||
3277 | 74 | def on_signin_button_clicked(self): | ||
3278 | 75 | """The 'Sign in' button was clicked.""" | ||
3279 | 76 | email = unicode(self.ui.email_entry.text()) | ||
3280 | 77 | password = unicode(self.ui.password_entry.text()) | ||
3281 | 78 | self.is_processing = True | ||
3282 | 79 | try: | ||
3283 | 80 | result = yield self.backend.login(email=email, password=password) | ||
3284 | 81 | logger.info('Emitting credentialsFound for email %r.', email) | ||
3285 | 82 | self.credentialsFound.emit(result) | ||
3286 | 83 | finally: | ||
3287 | 84 | self.is_processing = False | ||
3288 | 85 | |||
3289 | 86 | @QtCore.pyqtSlot() | ||
3290 | 87 | def on_cancel_button_clicked(self): | ||
3291 | 88 | """The 'Cancel' button was clicked.""" | ||
3292 | 89 | self.signinCanceled.emit() | ||
3293 | 0 | 90 | ||
3294 | === added file 'ubuntuone/controlpanel/gui/qt/systray.py' | |||
3295 | --- ubuntuone/controlpanel/gui/qt/systray.py 1970-01-01 00:00:00 +0000 | |||
3296 | +++ ubuntuone/controlpanel/gui/qt/systray.py 2011-09-26 18:38:27 +0000 | |||
3297 | @@ -0,0 +1,68 @@ | |||
3298 | 1 | # -*- coding: utf-8 -*- | ||
3299 | 2 | |||
3300 | 3 | # Authors: Roberto Alsina <roberto.alsina@canonical.com> | ||
3301 | 4 | # | ||
3302 | 5 | # Copyright 2011 Canonical Ltd. | ||
3303 | 6 | # | ||
3304 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
3305 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
3306 | 9 | # by the Free Software Foundation. | ||
3307 | 10 | # | ||
3308 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3309 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3310 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3311 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
3312 | 15 | # | ||
3313 | 16 | # You should have received a copy of the GNU General Public License along | ||
3314 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3315 | 18 | """System notification area icon.""" | ||
3316 | 19 | |||
3317 | 20 | from PyQt4 import QtGui | ||
3318 | 21 | |||
3319 | 22 | |||
3320 | 23 | class TrayIcon(QtGui.QSystemTrayIcon): | ||
3321 | 24 | |||
3322 | 25 | """System notification icon.""" | ||
3323 | 26 | |||
3324 | 27 | def __init__(self, window=None): | ||
3325 | 28 | super(TrayIcon, self).__init__(None) | ||
3326 | 29 | self.setIcon(QtGui.QIcon(":/u1icon.png")) | ||
3327 | 30 | self.setVisible(True) | ||
3328 | 31 | self.window = window | ||
3329 | 32 | self.activated.connect(self.on_activated) | ||
3330 | 33 | self.context_menu = QtGui.QMenu() | ||
3331 | 34 | self.restore = QtGui.QAction("Restore", self, | ||
3332 | 35 | triggered=self.restore_window) | ||
3333 | 36 | self.quit = QtGui.QAction("Quit Ubuntu One", self, | ||
3334 | 37 | triggered=self.stop) | ||
3335 | 38 | self.context_menu.addAction(self.restore) | ||
3336 | 39 | self.context_menu.addSeparator() | ||
3337 | 40 | self.context_menu.addAction(self.quit) | ||
3338 | 41 | self.setContextMenu(self.context_menu) | ||
3339 | 42 | |||
3340 | 43 | def on_activated(self, reason): | ||
3341 | 44 | """The user activated the icon.""" | ||
3342 | 45 | if reason == self.Trigger: # Left-click | ||
3343 | 46 | self.restore_window() | ||
3344 | 47 | |||
3345 | 48 | def restore_window(self): | ||
3346 | 49 | """Show the main window.""" | ||
3347 | 50 | if self.window is None: | ||
3348 | 51 | # pylint: disable=W0404 | ||
3349 | 52 | from ubuntuone.controlpanel.gui.qt.gui import MainWindow | ||
3350 | 53 | # pylint: enable=W0404 | ||
3351 | 54 | self.window = MainWindow(close_callback=self.delete_window) | ||
3352 | 55 | self.window.show() | ||
3353 | 56 | |||
3354 | 57 | def delete_window(self): | ||
3355 | 58 | """Close and remove the main window.""" | ||
3356 | 59 | if self.window is not None: | ||
3357 | 60 | self.window.close() | ||
3358 | 61 | self.window = None | ||
3359 | 62 | |||
3360 | 63 | def stop(self): | ||
3361 | 64 | """Stop the application.""" | ||
3362 | 65 | # pylint: disable=W0404 | ||
3363 | 66 | from twisted.internet import reactor | ||
3364 | 67 | # pylint: enable=W0404 | ||
3365 | 68 | reactor.stop() | ||
3366 | 0 | 69 | ||
3367 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/__init__.py' | |||
3368 | --- ubuntuone/controlpanel/gui/qt/tests/__init__.py 2011-07-22 21:26:48 +0000 | |||
3369 | +++ ubuntuone/controlpanel/gui/qt/tests/__init__.py 2011-09-26 18:38:27 +0000 | |||
3370 | @@ -18,12 +18,16 @@ | |||
3371 | 18 | 18 | ||
3372 | 19 | """The test suite for the Qt UI for the control panel for Ubuntu One.""" | 19 | """The test suite for the Qt UI for the control panel for Ubuntu One.""" |
3373 | 20 | 20 | ||
3374 | 21 | import logging | ||
3375 | 21 | import os | 22 | import os |
3381 | 22 | 23 | import urllib | |
3382 | 23 | from PyQt4 import QtCore | 24 | |
3383 | 24 | 25 | from PyQt4 import QtGui, QtCore | |
3384 | 25 | from ubuntuone.controlpanel import backend | 26 | from ubuntuone.devtools.handlers import MementoHandler |
3385 | 26 | from ubuntuone.controlpanel.tests import TestCase, EXPECTED_ACCOUNT_INFO | 27 | |
3386 | 28 | from ubuntuone.controlpanel import backend, cache | ||
3387 | 29 | from ubuntuone.controlpanel.tests import TestCase, EXPECTED_ACCOUNT_INFO, TOKEN | ||
3388 | 30 | from ubuntuone.controlpanel.gui import qt, UBUNTUONE_FROM_OAUTH | ||
3389 | 27 | from ubuntuone.controlpanel.gui.tests import FakedObject, USER_HOME | 31 | from ubuntuone.controlpanel.gui.tests import FakedObject, USER_HOME |
3390 | 28 | 32 | ||
3391 | 29 | # Attribute 'yyy' defined outside __init__, access to a protected member | 33 | # Attribute 'yyy' defined outside __init__, access to a protected member |
3392 | @@ -76,21 +80,6 @@ | |||
3393 | 76 | return folder | 80 | return folder |
3394 | 77 | 81 | ||
3395 | 78 | 82 | ||
3396 | 79 | def skip_if_abstract_class(test): | ||
3397 | 80 | """Decorator to skip a test if is an abstract class.""" | ||
3398 | 81 | |||
3399 | 82 | def inner(instance): | ||
3400 | 83 | """Skip a test if is an abstract class.""" | ||
3401 | 84 | abstract = instance.class_ui is None | ||
3402 | 85 | result = None | ||
3403 | 86 | if not abstract: | ||
3404 | 87 | result = test(instance) | ||
3405 | 88 | |||
3406 | 89 | return result | ||
3407 | 90 | |||
3408 | 91 | return inner | ||
3409 | 92 | |||
3410 | 93 | |||
3411 | 94 | class FakeUi(FakedObject): | 83 | class FakeUi(FakedObject): |
3412 | 95 | """A fake Ui object.""" | 84 | """A fake Ui object.""" |
3413 | 96 | 85 | ||
3414 | @@ -114,7 +103,7 @@ | |||
3415 | 114 | backend.UPLOAD_KEY: -1, # no limit | 103 | backend.UPLOAD_KEY: -1, # no limit |
3416 | 115 | } | 104 | } |
3417 | 116 | 105 | ||
3419 | 117 | next_result = object() | 106 | next_result = [] |
3420 | 118 | exposed_methods = [ | 107 | exposed_methods = [ |
3421 | 119 | 'account_info', # account | 108 | 'account_info', # account |
3422 | 120 | 'devices_info', 'device_names_info', # devices | 109 | 'devices_info', 'device_names_info', # devices |
3423 | @@ -128,13 +117,41 @@ | |||
3424 | 128 | 'file_sync_settings_info', | 117 | 'file_sync_settings_info', |
3425 | 129 | 'change_file_sync_settings', | 118 | 'change_file_sync_settings', |
3426 | 130 | 'restore_file_sync_settings', | 119 | 'restore_file_sync_settings', |
3428 | 131 | 'shutdown', | 120 | 'shutdown', 'login', |
3429 | 132 | ] | 121 | ] |
3430 | 133 | 122 | ||
3433 | 134 | 123 | def get_credentials(self): | |
3434 | 135 | class FakedConfirmDialog(object): | 124 | """Fake credentials retrieval.""" |
3435 | 125 | self._called['get_credentials'] = ((), {}) | ||
3436 | 126 | return TOKEN | ||
3437 | 127 | |||
3438 | 128 | |||
3439 | 129 | class CrashyBackendException(Exception): | ||
3440 | 130 | """A faked backend crash.""" | ||
3441 | 131 | |||
3442 | 132 | |||
3443 | 133 | class CrashyBackend(FakedControlPanelBackend): | ||
3444 | 134 | """A faked backend that crashes.""" | ||
3445 | 135 | |||
3446 | 136 | def __init__(self, *args, **kwargs): | ||
3447 | 137 | super(CrashyBackend, self).__init__(*args, **kwargs) | ||
3448 | 138 | for i in self.exposed_methods + ['get_credentials']: | ||
3449 | 139 | setattr(self, i, self._fail(i)) | ||
3450 | 140 | |||
3451 | 141 | def _fail(self, f): | ||
3452 | 142 | """Crash boom bang.""" | ||
3453 | 143 | |||
3454 | 144 | def inner(*args, **kwargs): | ||
3455 | 145 | """Raise a custom exception.""" | ||
3456 | 146 | raise CrashyBackendException(f) | ||
3457 | 147 | |||
3458 | 148 | return inner | ||
3459 | 149 | |||
3460 | 150 | |||
3461 | 151 | class FakedDialog(object): | ||
3462 | 136 | """Fake a confirmation dialog.""" | 152 | """Fake a confirmation dialog.""" |
3463 | 137 | 153 | ||
3464 | 154 | Close = 0 | ||
3465 | 138 | response = args = kwargs = None | 155 | response = args = kwargs = None |
3466 | 139 | 156 | ||
3467 | 140 | @classmethod | 157 | @classmethod |
3468 | @@ -149,6 +166,7 @@ | |||
3469 | 149 | """Fake a file chooser dialog.""" | 166 | """Fake a file chooser dialog.""" |
3470 | 150 | 167 | ||
3471 | 151 | response = args = kwargs = None | 168 | response = args = kwargs = None |
3472 | 169 | DontUseNativeDialog = 4 | ||
3473 | 152 | 170 | ||
3474 | 153 | # Invalid name "getExistingDirectory" | 171 | # Invalid name "getExistingDirectory" |
3475 | 154 | # pylint: disable=C0103 | 172 | # pylint: disable=C0103 |
3476 | @@ -168,19 +186,43 @@ | |||
3477 | 168 | innerclass_name = None | 186 | innerclass_name = None |
3478 | 169 | class_ui = None | 187 | class_ui = None |
3479 | 170 | kwargs = {} | 188 | kwargs = {} |
3480 | 189 | logger = None | ||
3481 | 171 | 190 | ||
3482 | 172 | @skip_if_abstract_class | ||
3483 | 173 | def setUp(self): | 191 | def setUp(self): |
3484 | 192 | cache.Cache._shared_objects = {} | ||
3485 | 174 | super(BaseTestCase, self).setUp() | 193 | super(BaseTestCase, self).setUp() |
3486 | 175 | self.patch(backend, 'ControlBackend', FakedControlPanelBackend) | 194 | self.patch(backend, 'ControlBackend', FakedControlPanelBackend) |
3495 | 176 | # self.class_ui is not callable | 195 | |
3496 | 177 | # pylint: disable=E1102 | 196 | self.ui = None |
3497 | 178 | self.ui = self.class_ui(**self.kwargs) | 197 | if self.class_ui is not None: |
3498 | 179 | self.addCleanup(self.ui.destroy) | 198 | # self.class_ui is not callable |
3499 | 180 | 199 | # pylint: disable=E1102 | |
3500 | 181 | if hasattr(self.ui, 'backend'): | 200 | self.ui = self.class_ui(**self.kwargs) |
3501 | 182 | # clean backend calls | 201 | # pylint: enable=E1102 |
3502 | 183 | self.ui.backend._called.clear() | 202 | self.addCleanup(self.ui.destroy) |
3503 | 203 | |||
3504 | 204 | if getattr(self.ui, 'backend', None) is not None: | ||
3505 | 205 | self.addCleanup(self.ui.backend._called.clear) | ||
3506 | 206 | |||
3507 | 207 | logger = self.logger if self.logger is not None else \ | ||
3508 | 208 | getattr(self.ui, 'logger', None) | ||
3509 | 209 | self.memento = None | ||
3510 | 210 | if logger is not None: | ||
3511 | 211 | self.memento = MementoHandler() | ||
3512 | 212 | self.memento.setLevel(logging.DEBUG) | ||
3513 | 213 | logger.addHandler(self.memento) | ||
3514 | 214 | self.addCleanup(logger.removeHandler, self.memento) | ||
3515 | 215 | |||
3516 | 216 | # default response if user does nothing | ||
3517 | 217 | FakedFileDialog.response = QtCore.QString('') | ||
3518 | 218 | FakedFileDialog.args = None | ||
3519 | 219 | FakedFileDialog.kwargs = None | ||
3520 | 220 | self.patch(QtGui, 'QFileDialog', FakedFileDialog) | ||
3521 | 221 | |||
3522 | 222 | FakedDialog.response = None | ||
3523 | 223 | FakedDialog.args = None | ||
3524 | 224 | FakedDialog.kwargs = None | ||
3525 | 225 | self.patch(QtGui, 'QMessageBox', FakedDialog) | ||
3526 | 184 | 226 | ||
3527 | 185 | def get_pixmap_data(self, pixmap): | 227 | def get_pixmap_data(self, pixmap): |
3528 | 186 | """Get the raw data of a QPixmap.""" | 228 | """Get the raw data of a QPixmap.""" |
3529 | @@ -202,6 +244,19 @@ | |||
3530 | 202 | self.assertIn(method_name, self.ui.backend._called) | 244 | self.assertIn(method_name, self.ui.backend._called) |
3531 | 203 | self.assertEqual(self.ui.backend._called[method_name], (args, kwargs)) | 245 | self.assertEqual(self.ui.backend._called[method_name], (args, kwargs)) |
3532 | 204 | 246 | ||
3533 | 247 | def assert_uri_hook_called(self, button, url): | ||
3534 | 248 | """Check that uri_hook was called with 'url' when clicking 'button'.""" | ||
3535 | 249 | self.patch(qt, 'uri_hook', self._set_called) | ||
3536 | 250 | button.click() | ||
3537 | 251 | |||
3538 | 252 | self.assertEqual(len(self._called), 2, 'uri_hook must be called.') | ||
3539 | 253 | self.assertEqual(len(self._called[0]), 1, 'uri_hook must be called.') | ||
3540 | 254 | actual_url = self._called[0][0] | ||
3541 | 255 | if actual_url.startswith(UBUNTUONE_FROM_OAUTH): | ||
3542 | 256 | self.assertIn(urllib.urlencode({'next': url}), actual_url) | ||
3543 | 257 | else: | ||
3544 | 258 | self.assertEqual(actual_url, url) | ||
3545 | 259 | |||
3546 | 205 | def test_init_loads_ui(self, expected_setup_ui=None): | 260 | def test_init_loads_ui(self, expected_setup_ui=None): |
3547 | 206 | """The __init__ method loads the ui.""" | 261 | """The __init__ method loads the ui.""" |
3548 | 207 | if self.innerclass_ui is None: | 262 | if self.innerclass_ui is None: |
3549 | @@ -219,3 +274,8 @@ | |||
3550 | 219 | expected_setup_ui = expected_setup_ui(self.ui) | 274 | expected_setup_ui = expected_setup_ui(self.ui) |
3551 | 220 | self.assertEqual(self.ui.ui._called, | 275 | self.assertEqual(self.ui.ui._called, |
3552 | 221 | {'setupUi': ((expected_setup_ui,), {})}) | 276 | {'setupUi': ((expected_setup_ui,), {})}) |
3553 | 277 | |||
3554 | 278 | def test_backend_is_correct(self): | ||
3555 | 279 | """The backend instance is correct.""" | ||
3556 | 280 | if getattr(self.ui, 'backend', None) is not None: | ||
3557 | 281 | self.assertIsInstance(self.ui.backend, FakedControlPanelBackend) | ||
3558 | 222 | 282 | ||
3559 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_account.py' | |||
3560 | --- ubuntuone/controlpanel/gui/qt/tests/test_account.py 2011-07-22 21:26:48 +0000 | |||
3561 | +++ ubuntuone/controlpanel/gui/qt/tests/test_account.py 2011-09-26 18:38:27 +0000 | |||
3562 | @@ -20,7 +20,6 @@ | |||
3563 | 20 | 20 | ||
3564 | 21 | from twisted.internet import defer | 21 | from twisted.internet import defer |
3565 | 22 | 22 | ||
3566 | 23 | from ubuntuone.controlpanel.gui import qt | ||
3567 | 24 | from ubuntuone.controlpanel.gui.qt import account as gui | 23 | from ubuntuone.controlpanel.gui.qt import account as gui |
3568 | 25 | from ubuntuone.controlpanel.gui.qt.tests import ( | 24 | from ubuntuone.controlpanel.gui.qt.tests import ( |
3569 | 26 | SAMPLE_ACCOUNT_INFO, SAMPLE_EMAIL, SAMPLE_NAME, SAMPLE_PLAN, | 25 | SAMPLE_ACCOUNT_INFO, SAMPLE_EMAIL, SAMPLE_NAME, SAMPLE_PLAN, |
3570 | @@ -75,14 +74,10 @@ | |||
3571 | 75 | 74 | ||
3572 | 76 | def test_edit_account_button(self): | 75 | def test_edit_account_button(self): |
3573 | 77 | """When clicking the edit account button, the proper url is opened.""" | 76 | """When clicking the edit account button, the proper url is opened.""" |
3578 | 78 | self.patch(qt, 'uri_hook', self._set_called) | 77 | self.assert_uri_hook_called(self.ui.ui.edit_profile_button, |
3579 | 79 | self.ui.ui.edit_profile_button.click() | 78 | gui.EDIT_PROFILE_LINK) |
3576 | 80 | |||
3577 | 81 | self.assertEqual(self._called, ((gui.EDIT_PROFILE_LINK,), {})) | ||
3580 | 82 | 79 | ||
3581 | 83 | def test_edit_services_button(self): | 80 | def test_edit_services_button(self): |
3582 | 84 | """When clicking the mobile plan button, the proper url is opened.""" | 81 | """When clicking the mobile plan button, the proper url is opened.""" |
3587 | 85 | self.patch(qt, 'uri_hook', self._set_called) | 82 | self.assert_uri_hook_called(self.ui.ui.edit_services_button, |
3588 | 86 | self.ui.ui.edit_services_button.click() | 83 | gui.EDIT_ACCOUNT_LINK) |
3585 | 87 | |||
3586 | 88 | self.assertEqual(self._called, ((gui.EDIT_ACCOUNT_LINK,), {})) | ||
3589 | 89 | 84 | ||
3590 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py' | |||
3591 | --- ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py 2011-07-22 21:26:48 +0000 | |||
3592 | +++ ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py 2011-09-26 18:38:27 +0000 | |||
3593 | @@ -29,7 +29,9 @@ | |||
3594 | 29 | from ubuntuone.controlpanel.gui.qt import addfolder as gui | 29 | from ubuntuone.controlpanel.gui.qt import addfolder as gui |
3595 | 30 | from ubuntuone.controlpanel.gui.qt.tests import ( | 30 | from ubuntuone.controlpanel.gui.qt.tests import ( |
3596 | 31 | BaseTestCase, | 31 | BaseTestCase, |
3598 | 32 | FakedConfirmDialog, | 32 | CrashyBackend, |
3599 | 33 | CrashyBackendException, | ||
3600 | 34 | FakedDialog, | ||
3601 | 33 | FakedFileDialog, | 35 | FakedFileDialog, |
3602 | 34 | set_path_on_file_dialog, | 36 | set_path_on_file_dialog, |
3603 | 35 | ) | 37 | ) |
3604 | @@ -53,20 +55,6 @@ | |||
3605 | 53 | os.environ['HOME'] = USER_HOME | 55 | os.environ['HOME'] = USER_HOME |
3606 | 54 | self.addCleanup(lambda: os.environ.__setitem__('HOME', old_home)) | 56 | self.addCleanup(lambda: os.environ.__setitem__('HOME', old_home)) |
3607 | 55 | 57 | ||
3608 | 56 | # default response if user does nothing | ||
3609 | 57 | FakedFileDialog.response = gui.QtCore.QString('') | ||
3610 | 58 | FakedFileDialog.args = None | ||
3611 | 59 | FakedFileDialog.kwargs = None | ||
3612 | 60 | self.patch(gui.QtGui, 'QFileDialog', FakedFileDialog) | ||
3613 | 61 | |||
3614 | 62 | FakedConfirmDialog.response = None | ||
3615 | 63 | FakedConfirmDialog.args = None | ||
3616 | 64 | FakedConfirmDialog.kwargs = None | ||
3617 | 65 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
3618 | 66 | |||
3619 | 67 | # reset backend state | ||
3620 | 68 | self.ui.backend._called.clear() | ||
3621 | 69 | |||
3622 | 70 | @defer.inlineCallbacks | 58 | @defer.inlineCallbacks |
3623 | 71 | def assert_does_nothing(self, method_call): | 59 | def assert_does_nothing(self, method_call): |
3624 | 72 | """Nothing happens. | 60 | """Nothing happens. |
3625 | @@ -92,7 +80,10 @@ | |||
3626 | 92 | yield self.ui.click() | 80 | yield self.ui.click() |
3627 | 93 | 81 | ||
3628 | 94 | self.assertEqual(FakedFileDialog.args, ()) | 82 | self.assertEqual(FakedFileDialog.args, ()) |
3630 | 95 | self.assertEqual(FakedFileDialog.kwargs, {'parent': self.ui}) | 83 | self.assertEqual(FakedFileDialog.kwargs, { |
3631 | 84 | 'options': gui.QtGui.QFileDialog.DontUseNativeDialog, | ||
3632 | 85 | 'parent': self.ui, | ||
3633 | 86 | }) | ||
3634 | 96 | 87 | ||
3635 | 97 | @defer.inlineCallbacks | 88 | @defer.inlineCallbacks |
3636 | 98 | def test_does_nothing_if_user_closes_file_chooser(self): | 89 | def test_does_nothing_if_user_closes_file_chooser(self): |
3637 | @@ -100,8 +91,8 @@ | |||
3638 | 100 | yield self.assert_does_nothing(self.ui.click) | 91 | yield self.assert_does_nothing(self.ui.click) |
3639 | 101 | 92 | ||
3640 | 102 | # the warning dialog was not opened | 93 | # the warning dialog was not opened |
3643 | 103 | self.assertEqual(FakedConfirmDialog.args, None) | 94 | self.assertEqual(FakedDialog.args, None) |
3644 | 104 | self.assertEqual(FakedConfirmDialog.kwargs, None) | 95 | self.assertEqual(FakedDialog.kwargs, None) |
3645 | 105 | 96 | ||
3646 | 106 | @defer.inlineCallbacks | 97 | @defer.inlineCallbacks |
3647 | 107 | def test_opens_warning_if_folder_path_not_valid(self): | 98 | def test_opens_warning_if_folder_path_not_valid(self): |
3648 | @@ -113,9 +104,9 @@ | |||
3649 | 113 | 104 | ||
3650 | 114 | args = {'folder_path': folder_path, 'home_folder': USER_HOME} | 105 | args = {'folder_path': folder_path, 'home_folder': USER_HOME} |
3651 | 115 | msg = gui.FOLDER_INVALID_PATH % args | 106 | msg = gui.FOLDER_INVALID_PATH % args |
3653 | 116 | self.assertEqual(FakedConfirmDialog.args, | 107 | self.assertEqual(FakedDialog.args, |
3654 | 117 | (self.ui, '', msg, gui.CLOSE)) | 108 | (self.ui, '', msg, gui.CLOSE)) |
3656 | 118 | self.assertEqual(FakedConfirmDialog.kwargs, {}) | 109 | self.assertEqual(FakedDialog.kwargs, {}) |
3657 | 119 | 110 | ||
3658 | 120 | yield self.assert_does_nothing(self.ui.click) | 111 | yield self.assert_does_nothing(self.ui.click) |
3659 | 121 | 112 | ||
3660 | @@ -126,8 +117,8 @@ | |||
3661 | 126 | yield self.ui.click() | 117 | yield self.ui.click() |
3662 | 127 | 118 | ||
3663 | 128 | # no warning | 119 | # no warning |
3666 | 129 | self.assertEqual(FakedConfirmDialog.args, None) | 120 | self.assertEqual(FakedDialog.args, None) |
3667 | 130 | self.assertEqual(FakedConfirmDialog.kwargs, None) | 121 | self.assertEqual(FakedDialog.kwargs, None) |
3668 | 131 | # backend called | 122 | # backend called |
3669 | 132 | self.assert_backend_called('create_folder', folder_path=folder) | 123 | self.assert_backend_called('create_folder', folder_path=folder) |
3670 | 133 | 124 | ||
3671 | @@ -138,8 +129,8 @@ | |||
3672 | 138 | yield self.ui.click() | 129 | yield self.ui.click() |
3673 | 139 | 130 | ||
3674 | 140 | # no warning | 131 | # no warning |
3677 | 141 | self.assertEqual(FakedConfirmDialog.args, None) | 132 | self.assertEqual(FakedDialog.args, None) |
3678 | 142 | self.assertEqual(FakedConfirmDialog.kwargs, None) | 133 | self.assertEqual(FakedDialog.kwargs, None) |
3679 | 143 | # backend called | 134 | # backend called |
3680 | 144 | self.assert_backend_called('create_folder', folder_path=folder) | 135 | self.assert_backend_called('create_folder', folder_path=folder) |
3681 | 145 | 136 | ||
3682 | @@ -167,3 +158,12 @@ | |||
3683 | 167 | yield self.ui.click() | 158 | yield self.ui.click() |
3684 | 168 | 159 | ||
3685 | 169 | self.assertEqual(self._called, ((), {})) | 160 | self.assertEqual(self._called, ((), {})) |
3686 | 161 | |||
3687 | 162 | @defer.inlineCallbacks | ||
3688 | 163 | def test_backend_error_is_handled(self): | ||
3689 | 164 | """Any error from the backend is properly handled.""" | ||
3690 | 165 | set_path_on_file_dialog() | ||
3691 | 166 | self.patch(self.ui, 'backend', CrashyBackend()) | ||
3692 | 167 | yield self.ui.click() | ||
3693 | 168 | |||
3694 | 169 | self.assertTrue(self.memento.check_exception(CrashyBackendException)) | ||
3695 | 170 | 170 | ||
3696 | === added file 'ubuntuone/controlpanel/gui/qt/tests/test_common.py' | |||
3697 | --- ubuntuone/controlpanel/gui/qt/tests/test_common.py 1970-01-01 00:00:00 +0000 | |||
3698 | +++ ubuntuone/controlpanel/gui/qt/tests/test_common.py 2011-09-26 18:38:27 +0000 | |||
3699 | @@ -0,0 +1,210 @@ | |||
3700 | 1 | # -*- coding: utf-8 -*- | ||
3701 | 2 | |||
3702 | 3 | # Authors: Natalia B Bidart <natalia.bidart@canonical.com> | ||
3703 | 4 | # | ||
3704 | 5 | # Copyright 2011 Canonical Ltd. | ||
3705 | 6 | # | ||
3706 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
3707 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
3708 | 9 | # by the Free Software Foundation. | ||
3709 | 10 | # | ||
3710 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3711 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3712 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3713 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
3714 | 15 | # | ||
3715 | 16 | # You should have received a copy of the GNU General Public License along | ||
3716 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3717 | 18 | |||
3718 | 19 | """Tests for the uri_hook helper.""" | ||
3719 | 20 | |||
3720 | 21 | import logging | ||
3721 | 22 | |||
3722 | 23 | from PyQt4 import QtGui, QtCore | ||
3723 | 24 | from twisted.internet import defer | ||
3724 | 25 | |||
3725 | 26 | from ubuntuone.controlpanel.logger import setup_logging | ||
3726 | 27 | from ubuntuone.controlpanel.gui.qt import uri_hook, handle_errors | ||
3727 | 28 | from ubuntuone.controlpanel.gui.qt.tests import ( | ||
3728 | 29 | BaseTestCase, | ||
3729 | 30 | FakedDialog, | ||
3730 | 31 | ) | ||
3731 | 32 | |||
3732 | 33 | |||
3733 | 34 | class UriHookTestCase(BaseTestCase): | ||
3734 | 35 | """The test suite for the uri_hook.""" | ||
3735 | 36 | |||
3736 | 37 | @defer.inlineCallbacks | ||
3737 | 38 | def setUp(self): | ||
3738 | 39 | yield super(UriHookTestCase, self).setUp() | ||
3739 | 40 | self.patch(QtGui.QDesktopServices, 'openUrl', self._set_called) | ||
3740 | 41 | |||
3741 | 42 | def test_opens_url(self): | ||
3742 | 43 | """The url is opened properly.""" | ||
3743 | 44 | expected = 'foo bar' | ||
3744 | 45 | uri_hook(expected) | ||
3745 | 46 | self.assertEqual(self._called, ((QtCore.QUrl(expected),), {})) | ||
3746 | 47 | |||
3747 | 48 | def test_opens_url_encoded(self): | ||
3748 | 49 | """The encoded url is opened properly.""" | ||
3749 | 50 | expected = 'http://foo.bar/?next=https://one.ubuntu.com/' | ||
3750 | 51 | uri_hook(expected) | ||
3751 | 52 | self.assertEqual(self._called, ((QtCore.QUrl(expected),), {})) | ||
3752 | 53 | |||
3753 | 54 | |||
3754 | 55 | class HandleErrorTestCase(BaseTestCase): | ||
3755 | 56 | """Test suite for the generic error handler.""" | ||
3756 | 57 | |||
3757 | 58 | error_handler = None | ||
3758 | 59 | use_logger = False | ||
3759 | 60 | logger = logging.getLogger() # root logger | ||
3760 | 61 | |||
3761 | 62 | @defer.inlineCallbacks | ||
3762 | 63 | def setUp(self): | ||
3763 | 64 | yield super(HandleErrorTestCase, self).setUp() | ||
3764 | 65 | self.called = None | ||
3765 | 66 | self.result = None | ||
3766 | 67 | self.failure = None | ||
3767 | 68 | self.error_handler_called = None | ||
3768 | 69 | |||
3769 | 70 | if self.use_logger: | ||
3770 | 71 | logger = self.logger | ||
3771 | 72 | else: | ||
3772 | 73 | logger = None | ||
3773 | 74 | |||
3774 | 75 | self.decorate_me = handle_errors(error_handler=self.error_handler, | ||
3775 | 76 | logger=logger)(self._decorate_me) | ||
3776 | 77 | |||
3777 | 78 | @defer.inlineCallbacks | ||
3778 | 79 | def _decorate_me(self, *args, **kwargs): | ||
3779 | 80 | """Helper to test thye decorator.""" | ||
3780 | 81 | if self.failure: | ||
3781 | 82 | # Raising only classes, instances or string are allowed | ||
3782 | 83 | # pylint: disable=E0702 | ||
3783 | 84 | raise self.failure | ||
3784 | 85 | |||
3785 | 86 | yield | ||
3786 | 87 | self.called = (args, kwargs) | ||
3787 | 88 | defer.returnValue(self.result) | ||
3788 | 89 | |||
3789 | 90 | @defer.inlineCallbacks | ||
3790 | 91 | def test_is_decorator(self): | ||
3791 | 92 | """Is a decorator.""" | ||
3792 | 93 | yield self.decorate_me() | ||
3793 | 94 | |||
3794 | 95 | @defer.inlineCallbacks | ||
3795 | 96 | def test_params_are_passed(self): | ||
3796 | 97 | """Named and unnamed arguments are passed.""" | ||
3797 | 98 | args = ({}, object(), 'foo') | ||
3798 | 99 | kwargs = {'1': 1, 'test': None, '0': ['a']} | ||
3799 | 100 | yield self.decorate_me(*args, **kwargs) | ||
3800 | 101 | |||
3801 | 102 | self.assertTrue(self.called, (args, kwargs)) | ||
3802 | 103 | |||
3803 | 104 | @defer.inlineCallbacks | ||
3804 | 105 | def test_result_is_returned(self): | ||
3805 | 106 | """Result is returned.""" | ||
3806 | 107 | self.result = object() | ||
3807 | 108 | result = yield self.decorate_me() | ||
3808 | 109 | |||
3809 | 110 | self.assertEqual(self.result, result) | ||
3810 | 111 | |||
3811 | 112 | def test_name_is_preserved(self): | ||
3812 | 113 | """The method name is not masqueraded.""" | ||
3813 | 114 | self.assertEqual(self.decorate_me.__name__, self._decorate_me.__name__) | ||
3814 | 115 | |||
3815 | 116 | @defer.inlineCallbacks | ||
3816 | 117 | def test_exeptions_are_handled(self): | ||
3817 | 118 | """Any exception is handled and logged in the root logger.""" | ||
3818 | 119 | msg = 'This is me failing badly.' | ||
3819 | 120 | self.failure = Exception(msg) | ||
3820 | 121 | |||
3821 | 122 | yield self.decorate_me() | ||
3822 | 123 | |||
3823 | 124 | logged = self.memento.check_exception(self.failure.__class__, msg) | ||
3824 | 125 | recs = '\n'.join(rec.exc_text for rec in self.memento.records) | ||
3825 | 126 | self.assertTrue(logged, 'Exception must be logged, got:\n%s' % recs) | ||
3826 | 127 | |||
3827 | 128 | @defer.inlineCallbacks | ||
3828 | 129 | def test_show_error_message(self): | ||
3829 | 130 | """On error, show an error message.""" | ||
3830 | 131 | self.failure = Exception() | ||
3831 | 132 | |||
3832 | 133 | yield self.decorate_me() | ||
3833 | 134 | |||
3834 | 135 | msg = self.failure.__class__.__name__ | ||
3835 | 136 | self.assertEqual(FakedDialog.args, | ||
3836 | 137 | (None, '', msg, QtGui.QMessageBox.Close)) | ||
3837 | 138 | self.assertEqual(FakedDialog.kwargs, {}) | ||
3838 | 139 | |||
3839 | 140 | @defer.inlineCallbacks | ||
3840 | 141 | def test_show_error_message_if_args(self): | ||
3841 | 142 | """On error, show an error message.""" | ||
3842 | 143 | msg1 = 'This is me failing badly.' | ||
3843 | 144 | msg2 = 'More details about what went wrong.' | ||
3844 | 145 | obj = object() | ||
3845 | 146 | self.failure = Exception(msg1, msg2, obj) | ||
3846 | 147 | |||
3847 | 148 | yield self.decorate_me() | ||
3848 | 149 | |||
3849 | 150 | msg = '\n'.join(map(repr, (msg1, msg2, obj))) | ||
3850 | 151 | msg = self.failure.__class__.__name__ + '\n' + msg | ||
3851 | 152 | self.assertEqual(FakedDialog.args, | ||
3852 | 153 | (None, '', msg, QtGui.QMessageBox.Close)) | ||
3853 | 154 | self.assertEqual(FakedDialog.kwargs, {}) | ||
3854 | 155 | |||
3855 | 156 | @defer.inlineCallbacks | ||
3856 | 157 | def test_show_error_message_if_mapping(self): | ||
3857 | 158 | """On error, show an error message.""" | ||
3858 | 159 | msg1 = 'This is me failing badly.' | ||
3859 | 160 | msg2 = 'More details about what went wrong.' | ||
3860 | 161 | errdict = {'foo': msg1, 'bar': msg2} | ||
3861 | 162 | self.failure = Exception(errdict) | ||
3862 | 163 | |||
3863 | 164 | yield self.decorate_me() | ||
3864 | 165 | |||
3865 | 166 | msg = '\n'.join((msg1, msg2)) | ||
3866 | 167 | self.assertEqual(FakedDialog.args, | ||
3867 | 168 | (None, '', msg, QtGui.QMessageBox.Close)) | ||
3868 | 169 | self.assertEqual(FakedDialog.kwargs, {}) | ||
3869 | 170 | |||
3870 | 171 | @defer.inlineCallbacks | ||
3871 | 172 | def test_no_error_message_if_no_exception(self): | ||
3872 | 173 | """On success, do not show an error message.""" | ||
3873 | 174 | yield self.decorate_me() | ||
3874 | 175 | |||
3875 | 176 | self.assertEqual(FakedDialog.args, None) | ||
3876 | 177 | self.assertEqual(FakedDialog.kwargs, None) | ||
3877 | 178 | |||
3878 | 179 | @defer.inlineCallbacks | ||
3879 | 180 | def test_call_error_handler(self): | ||
3880 | 181 | """On success, do not execute error_handler.""" | ||
3881 | 182 | yield self.decorate_me() | ||
3882 | 183 | self.assertFalse(self.error_handler_called) | ||
3883 | 184 | |||
3884 | 185 | |||
3885 | 186 | class HandleErrorWithCustomLoggerTestCase(HandleErrorTestCase): | ||
3886 | 187 | """Test suite for the generic error handler.""" | ||
3887 | 188 | |||
3888 | 189 | use_logger = True | ||
3889 | 190 | logger = setup_logging('HandleErrorWithoutLoggerTestCase') # custom logger | ||
3890 | 191 | |||
3891 | 192 | |||
3892 | 193 | class HandleErrorWithHandlerTestCase(HandleErrorTestCase): | ||
3893 | 194 | """Test suite for the generic error handler when using a custom handler.""" | ||
3894 | 195 | |||
3895 | 196 | @defer.inlineCallbacks | ||
3896 | 197 | def error_handler(self, *a, **kw): | ||
3897 | 198 | """Implement an error handler.""" | ||
3898 | 199 | self.error_handler_called = (a, kw) | ||
3899 | 200 | yield | ||
3900 | 201 | |||
3901 | 202 | @defer.inlineCallbacks | ||
3902 | 203 | def test_call_error_handler(self): | ||
3903 | 204 | """On error, execute error_handler.""" | ||
3904 | 205 | msg = 'This is me failing badly.' | ||
3905 | 206 | self.failure = Exception(msg) | ||
3906 | 207 | |||
3907 | 208 | yield self.decorate_me() | ||
3908 | 209 | |||
3909 | 210 | self.assertEqual(self.error_handler_called, ((), {})) | ||
3910 | 0 | 211 | ||
3911 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py' | |||
3912 | --- ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py 2011-07-22 21:26:48 +0000 | |||
3913 | +++ ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py 2011-09-26 18:38:27 +0000 | |||
3914 | @@ -22,14 +22,16 @@ | |||
3915 | 22 | 22 | ||
3916 | 23 | from twisted.internet import defer | 23 | from twisted.internet import defer |
3917 | 24 | 24 | ||
3918 | 25 | from ubuntuone.controlpanel.gui import qt | ||
3919 | 26 | from ubuntuone.controlpanel.gui.qt import controlpanel as gui | 25 | from ubuntuone.controlpanel.gui.qt import controlpanel as gui |
3920 | 27 | from ubuntuone.controlpanel.gui.qt.tests import ( | 26 | from ubuntuone.controlpanel.gui.qt.tests import ( |
3926 | 28 | BaseTestCase, SAMPLE_ACCOUNT_INFO, SAMPLE_NAME, | 27 | SAMPLE_ACCOUNT_INFO, SAMPLE_NAME, TOKEN, |
3927 | 29 | ) | 28 | ) |
3928 | 30 | 29 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( | |
3929 | 31 | 30 | UbuntuOneBinTestCase, | |
3930 | 32 | class ControlPanelTestCase(BaseTestCase): | 31 | ) |
3931 | 32 | |||
3932 | 33 | |||
3933 | 34 | class ControlPanelTestCase(UbuntuOneBinTestCase): | ||
3934 | 33 | """Test the qt control panel.""" | 35 | """Test the qt control panel.""" |
3935 | 34 | 36 | ||
3936 | 35 | innerclass_ui = gui.controlpanel_ui | 37 | innerclass_ui = gui.controlpanel_ui |
3937 | @@ -39,18 +41,68 @@ | |||
3938 | 39 | @defer.inlineCallbacks | 41 | @defer.inlineCallbacks |
3939 | 40 | def setUp(self): | 42 | def setUp(self): |
3940 | 41 | yield super(ControlPanelTestCase, self).setUp() | 43 | yield super(ControlPanelTestCase, self).setUp() |
3941 | 44 | self.patch(self.ui.ui.folders_tab, 'process_info', lambda info: None) | ||
3942 | 42 | self.ui.backend.next_result = SAMPLE_ACCOUNT_INFO | 45 | self.ui.backend.next_result = SAMPLE_ACCOUNT_INFO |
3943 | 43 | 46 | ||
3948 | 44 | def test_backend(self): | 47 | @defer.inlineCallbacks |
3949 | 45 | """Backend is created.""" | 48 | def test_is_processing_while_asking_info(self): |
3950 | 46 | self.assertIsInstance(self.ui.backend, | 49 | """The ui is processing while the contents are loaded.""" |
3951 | 47 | gui.backend.ControlBackend) | 50 | def check(): |
3952 | 51 | """The ui must be is_processing.""" | ||
3953 | 52 | self.assertTrue(self.ui.is_processing, 'ui must be processing') | ||
3954 | 53 | return {} | ||
3955 | 54 | |||
3956 | 55 | self.patch(self.ui.backend, 'get_credentials', check) | ||
3957 | 56 | |||
3958 | 57 | yield self.ui.load() # trigger the info request | ||
3959 | 58 | self.assertFalse(self.ui.is_processing, 'ui must not be processing') | ||
3960 | 59 | |||
3961 | 60 | @defer.inlineCallbacks | ||
3962 | 61 | def test_credentials_are_requested_on_load(self): | ||
3963 | 62 | """The info is requested to the backend.""" | ||
3964 | 63 | yield self.ui.load() | ||
3965 | 64 | self.assert_backend_called('get_credentials') | ||
3966 | 65 | |||
3967 | 66 | @defer.inlineCallbacks | ||
3968 | 67 | def test_on_credentials_not_found_called(self): | ||
3969 | 68 | """If no credentials, on_credentials_not_found is called.""" | ||
3970 | 69 | self.patch(self.ui, 'on_credentials_not_found', self._set_called) | ||
3971 | 70 | self.patch(self.ui.backend, 'get_credentials', lambda: {}) | ||
3972 | 71 | yield self.ui.load() | ||
3973 | 72 | |||
3974 | 73 | self.assertEqual(self._called, ((), {})) | ||
3975 | 74 | |||
3976 | 75 | def test_on_credentials_not_found(self): | ||
3977 | 76 | """The signin panel is shown.""" | ||
3978 | 77 | self.ui.on_credentials_found() | ||
3979 | 78 | self.ui.on_credentials_not_found() | ||
3980 | 79 | self.assertIs(self.ui.ui.switcher.currentWidget(), self.ui.ui.signin) | ||
3981 | 80 | |||
3982 | 81 | @defer.inlineCallbacks | ||
3983 | 82 | def test_on_credentials_found_called(self): | ||
3984 | 83 | """If credentials, on_credentials_not_found is called.""" | ||
3985 | 84 | self.patch(self.ui, 'on_credentials_found', self._set_called) | ||
3986 | 85 | yield self.ui.load() | ||
3987 | 86 | |||
3988 | 87 | self.assertEqual(self._called, ((), {})) | ||
3989 | 88 | |||
3990 | 89 | def test_on_credentials_found(self): | ||
3991 | 90 | """The management panel is shown.""" | ||
3992 | 91 | self.patch(self.ui, 'connect_file_sync', self._set_called) | ||
3993 | 92 | self.ui.on_credentials_not_found() | ||
3994 | 93 | self.ui.on_credentials_found() | ||
3995 | 94 | |||
3996 | 95 | self.assertIs(self.ui.ui.switcher.currentWidget(), | ||
3997 | 96 | self.ui.ui.management) | ||
3998 | 97 | self.assertEqual(self._called, ((), {})) | ||
3999 | 48 | 98 | ||
4000 | 49 | @defer.inlineCallbacks | 99 | @defer.inlineCallbacks |
4001 | 50 | def test_info_is_requested_on_load(self): | 100 | def test_info_is_requested_on_load(self): |
4002 | 51 | """The info is requested to the backend.""" | 101 | """The info is requested to the backend.""" |
4003 | 102 | self.patch(self.ui, 'process_info', self._set_called) | ||
4004 | 52 | yield self.ui.load() | 103 | yield self.ui.load() |
4005 | 53 | self.assert_backend_called('account_info') | 104 | self.assert_backend_called('account_info') |
4006 | 105 | self.assertEqual(self._called, ((SAMPLE_ACCOUNT_INFO,), {})) | ||
4007 | 54 | 106 | ||
4008 | 55 | def test_process_info(self): | 107 | def test_process_info(self): |
4009 | 56 | """The info is processed when ready.""" | 108 | """The info is processed when ready.""" |
4010 | @@ -72,32 +124,85 @@ | |||
4011 | 72 | msg = gui.PERCENTAGE_LABEL % percentage_usage | 124 | msg = gui.PERCENTAGE_LABEL % percentage_usage |
4012 | 73 | self.assertEqual(self.ui.ui.percentage_usage_label.text(), msg) | 125 | self.assertEqual(self.ui.ui.percentage_usage_label.text(), msg) |
4013 | 74 | 126 | ||
4014 | 127 | def test_update_over_quota(self): | ||
4015 | 128 | """Check the labels state when the user exceed the quota.""" | ||
4016 | 129 | percentage_value = 100 | ||
4017 | 130 | # pylint: disable=W0212 | ||
4018 | 131 | self.ui._update_quota({'percentage': percentage_value}) | ||
4019 | 132 | # pylint: enable=W0212 | ||
4020 | 133 | |||
4021 | 134 | self.assertTrue( | ||
4022 | 135 | self.ui.ui.percentage_usage_label.property("OverQuota").toBool()) | ||
4023 | 136 | self.assertTrue( | ||
4024 | 137 | self.ui.ui.quota_usage_label.property("OverQuota").toBool()) | ||
4025 | 138 | |||
4026 | 139 | def test_update_quota_in_range(self): | ||
4027 | 140 | """Check the labels state when the quota is under the threshold.""" | ||
4028 | 141 | percentage_value = 50 | ||
4029 | 142 | # pylint: disable=W0212 | ||
4030 | 143 | self.ui._update_quota({'percentage': percentage_value}) | ||
4031 | 144 | # pylint: enable=W0212 | ||
4032 | 145 | |||
4033 | 146 | self.assertFalse( | ||
4034 | 147 | self.ui.ui.percentage_usage_label.property("OverQuota").toBool()) | ||
4035 | 148 | self.assertFalse( | ||
4036 | 149 | self.ui.ui.quota_usage_label.property("OverQuota").toBool()) | ||
4037 | 150 | |||
4038 | 151 | def test_on_local_device_removed(self): | ||
4039 | 152 | """On DeviesPanel's localDeviceRemoved, emit credentialsNotFound.""" | ||
4040 | 153 | self.ui.ui.devices_tab.localDeviceRemoved.emit() | ||
4041 | 154 | self.assertIs(self.ui.ui.switcher.currentWidget(), self.ui.ui.signin) | ||
4042 | 155 | |||
4043 | 156 | def test_on_signin_credentials_found(self): | ||
4044 | 157 | """On SignInPanel's credentialsFound, the management panel is shown.""" | ||
4045 | 158 | self.patch(self.ui, 'load', self._set_called) | ||
4046 | 159 | self.ui.ui.signin.credentialsFound.emit(TOKEN) | ||
4047 | 160 | |||
4048 | 161 | self.assertEqual(self._called, ((), {})) | ||
4049 | 162 | |||
4050 | 163 | @defer.inlineCallbacks | ||
4051 | 164 | def test_connect_file_sync_with_autoconnect(self): | ||
4052 | 165 | """Connect is called if autoconnect is enabled.""" | ||
4053 | 166 | settings = {gui.AUTOCONNECT_KEY: True} | ||
4054 | 167 | self.patch(self.ui.backend, 'file_sync_settings_info', | ||
4055 | 168 | lambda: defer.succeed(settings)) | ||
4056 | 169 | |||
4057 | 170 | yield self.ui.connect_file_sync() | ||
4058 | 171 | |||
4059 | 172 | self.assert_backend_called('connect_files') | ||
4060 | 173 | |||
4061 | 174 | @defer.inlineCallbacks | ||
4062 | 175 | def test_connect_file_sync_without_autoconnect(self): | ||
4063 | 176 | """Connect is called if autoconnect is disabled.""" | ||
4064 | 177 | settings = {gui.AUTOCONNECT_KEY: False} | ||
4065 | 178 | self.patch(self.ui.backend, 'file_sync_settings_info', | ||
4066 | 179 | lambda: defer.succeed(settings)) | ||
4067 | 180 | |||
4068 | 181 | yield self.ui.connect_file_sync() | ||
4069 | 182 | |||
4070 | 183 | # pylint: disable=W0212 | ||
4071 | 184 | self.assertNotIn('connect_files', self.ui.backend._called) | ||
4072 | 185 | |||
4073 | 75 | 186 | ||
4074 | 76 | class ExternalLinkButtonsTestCase(ControlPanelTestCase): | 187 | class ExternalLinkButtonsTestCase(ControlPanelTestCase): |
4075 | 77 | """The link in the go-to-web buttons are correct.""" | 188 | """The link in the go-to-web buttons are correct.""" |
4076 | 78 | 189 | ||
4077 | 79 | @defer.inlineCallbacks | ||
4078 | 80 | def setUp(self): | ||
4079 | 81 | self.patch(qt, 'uri_hook', self._set_called) | ||
4080 | 82 | self.patch(gui, 'uri_hook', self._set_called) | ||
4081 | 83 | yield super(ExternalLinkButtonsTestCase, self).setUp() | ||
4082 | 84 | |||
4083 | 85 | def test_get_more_space_button(self): | 190 | def test_get_more_space_button(self): |
4084 | 86 | """When clicking the get more GB button, the proper url is opened.""" | 191 | """When clicking the get more GB button, the proper url is opened.""" |
4087 | 87 | self.ui.ui.get_more_space_button.click() | 192 | self.assert_uri_hook_called(self.ui.ui.get_more_space_button, |
4088 | 88 | self.assertEqual(self._called, ((gui.EDIT_ACCOUNT_LINK,), {})) | 193 | gui.EDIT_SERVICES_LINK) |
4089 | 89 | 194 | ||
4090 | 90 | def test_help_button(self): | 195 | def test_help_button(self): |
4091 | 91 | """When clicking the help button, the proper url is opened.""" | 196 | """When clicking the help button, the proper url is opened.""" |
4094 | 92 | self.ui.ui.help_button.click() | 197 | self.assert_uri_hook_called(self.ui.ui.help_button, |
4095 | 93 | self.assertEqual(self._called, ((gui.GET_SUPPORT_LINK,), {})) | 198 | gui.GET_SUPPORT_LINK) |
4096 | 94 | 199 | ||
4097 | 95 | def test_twitter_button(self): | 200 | def test_twitter_button(self): |
4098 | 96 | """When clicking the twitter button, the proper url is opened.""" | 201 | """When clicking the twitter button, the proper url is opened.""" |
4101 | 97 | self.ui.ui.twitter_button.click() | 202 | self.assert_uri_hook_called(self.ui.ui.twitter_button, |
4102 | 98 | self.assertEqual(self._called, ((gui.TWITTER_LINK,), {})) | 203 | gui.TWITTER_LINK) |
4103 | 99 | 204 | ||
4104 | 100 | def test_facebook_button(self): | 205 | def test_facebook_button(self): |
4105 | 101 | """When clicking the facebook button, the proper url is opened.""" | 206 | """When clicking the facebook button, the proper url is opened.""" |
4108 | 102 | self.ui.ui.facebook_button.click() | 207 | self.assert_uri_hook_called(self.ui.ui.facebook_button, |
4109 | 103 | self.assertEqual(self._called, ((gui.FACEBOOK_LINK,), {})) | 208 | gui.FACEBOOK_LINK) |
4110 | 104 | 209 | ||
4111 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_device.py' | |||
4112 | --- ubuntuone/controlpanel/gui/qt/tests/test_device.py 2011-07-22 21:26:48 +0000 | |||
4113 | +++ ubuntuone/controlpanel/gui/qt/tests/test_device.py 2011-09-26 18:38:27 +0000 | |||
4114 | @@ -23,8 +23,9 @@ | |||
4115 | 23 | from ubuntuone.controlpanel.gui.qt import device as gui | 23 | from ubuntuone.controlpanel.gui.qt import device as gui |
4116 | 24 | from ubuntuone.controlpanel.gui.qt.tests import ( | 24 | from ubuntuone.controlpanel.gui.qt.tests import ( |
4117 | 25 | BaseTestCase, | 25 | BaseTestCase, |
4120 | 26 | FakedConfirmDialog, | 26 | CrashyBackend, |
4121 | 27 | FakedControlPanelBackend, | 27 | CrashyBackendException, |
4122 | 28 | FakedDialog, | ||
4123 | 28 | SAMPLE_COMPUTER_INFO, | 29 | SAMPLE_COMPUTER_INFO, |
4124 | 29 | SAMPLE_PHONE_INFO, | 30 | SAMPLE_PHONE_INFO, |
4125 | 30 | ) | 31 | ) |
4126 | @@ -40,18 +41,14 @@ | |||
4127 | 40 | innerclass_ui = gui.device_ui | 41 | innerclass_ui = gui.device_ui |
4128 | 41 | innerclass_name = "Ui_Form" | 42 | innerclass_name = "Ui_Form" |
4129 | 42 | class_ui = gui.DeviceWidget | 43 | class_ui = gui.DeviceWidget |
4130 | 43 | backend = FakedControlPanelBackend() | ||
4131 | 44 | device_id = 'zaraza' | 44 | device_id = 'zaraza' |
4133 | 45 | kwargs = {'backend': backend, 'device_id': device_id} | 45 | kwargs = {'device_id': device_id} |
4134 | 46 | logger = gui.logger | ||
4135 | 46 | 47 | ||
4136 | 47 | def test_has_id(self): | 48 | def test_has_id(self): |
4137 | 48 | """The device as an id, None by default.""" | 49 | """The device as an id, None by default.""" |
4138 | 49 | self.assertEqual(self.ui.id, self.device_id) | 50 | self.assertEqual(self.ui.id, self.device_id) |
4139 | 50 | 51 | ||
4140 | 51 | def test_has_backend(self): | ||
4141 | 52 | """The device as a backend, None by default.""" | ||
4142 | 53 | self.assertIs(self.ui.backend, self.backend) | ||
4143 | 54 | |||
4144 | 55 | def test_update_device_info(self): | 52 | def test_update_device_info(self): |
4145 | 56 | """The widget is updated with the info.""" | 53 | """The widget is updated with the info.""" |
4146 | 57 | info = SAMPLE_COMPUTER_INFO | 54 | info = SAMPLE_COMPUTER_INFO |
4147 | @@ -104,10 +101,7 @@ | |||
4148 | 104 | @defer.inlineCallbacks | 101 | @defer.inlineCallbacks |
4149 | 105 | def setUp(self): | 102 | def setUp(self): |
4150 | 106 | yield super(RemoveDeviceTestCase, self).setUp() | 103 | yield super(RemoveDeviceTestCase, self).setUp() |
4155 | 107 | FakedConfirmDialog.response = gui.NO | 104 | FakedDialog.response = gui.YES |
4152 | 108 | FakedConfirmDialog.args = None | ||
4153 | 109 | FakedConfirmDialog.kwargs = None | ||
4154 | 110 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4156 | 111 | 105 | ||
4157 | 112 | def test_remove_device_opens_confirmation_dialog(self): | 106 | def test_remove_device_opens_confirmation_dialog(self): |
4158 | 113 | """A confirmation dialog is opened when user clicks 'delete device'.""" | 107 | """A confirmation dialog is opened when user clicks 'delete device'.""" |
4159 | @@ -115,13 +109,13 @@ | |||
4160 | 115 | 109 | ||
4161 | 116 | msg = gui.DEVICE_CONFIRM_REMOVE | 110 | msg = gui.DEVICE_CONFIRM_REMOVE |
4162 | 117 | buttons = gui.YES | gui.NO | 111 | buttons = gui.YES | gui.NO |
4164 | 118 | self.assertEqual(FakedConfirmDialog.args, | 112 | self.assertEqual(FakedDialog.args, |
4165 | 119 | (self.ui, '', msg, buttons, gui.NO)) | 113 | (self.ui, '', msg, buttons, gui.NO)) |
4167 | 120 | self.assertEqual(FakedConfirmDialog.kwargs, {}) | 114 | self.assertEqual(FakedDialog.kwargs, {}) |
4168 | 121 | 115 | ||
4169 | 122 | def test_remove_device_does_not_remove_if_answer_is_no(self): | 116 | def test_remove_device_does_not_remove_if_answer_is_no(self): |
4170 | 123 | """The device is not removed is answer is No.""" | 117 | """The device is not removed is answer is No.""" |
4172 | 124 | FakedConfirmDialog.response = gui.NO | 118 | FakedDialog.response = gui.NO |
4173 | 125 | self.ui.removed.connect(self._set_called) | 119 | self.ui.removed.connect(self._set_called) |
4174 | 126 | self.ui.ui.remove_device_button.click() | 120 | self.ui.ui.remove_device_button.click() |
4175 | 127 | 121 | ||
4176 | @@ -130,7 +124,7 @@ | |||
4177 | 130 | 124 | ||
4178 | 131 | def test_remove_device_does_remove_if_answer_is_yes(self): | 125 | def test_remove_device_does_remove_if_answer_is_yes(self): |
4179 | 132 | """The device is removed is answer is Yes.""" | 126 | """The device is removed is answer is Yes.""" |
4181 | 133 | FakedConfirmDialog.response = gui.YES | 127 | FakedDialog.response = gui.YES |
4182 | 134 | self.ui.ui.remove_device_button.click() | 128 | self.ui.ui.remove_device_button.click() |
4183 | 135 | 129 | ||
4184 | 136 | self.assert_backend_called('remove_device', device_id=self.device_id) | 130 | self.assert_backend_called('remove_device', device_id=self.device_id) |
4185 | @@ -144,7 +138,7 @@ | |||
4186 | 144 | """Fire deferred when the device was removed.""" | 138 | """Fire deferred when the device was removed.""" |
4187 | 145 | d.callback(device_id) | 139 | d.callback(device_id) |
4188 | 146 | 140 | ||
4190 | 147 | FakedConfirmDialog.response = gui.YES | 141 | FakedDialog.response = gui.YES |
4191 | 148 | self.ui.removed.connect(self._set_called) | 142 | self.ui.removed.connect(self._set_called) |
4192 | 149 | self.patch(self.ui.backend, 'remove_device', check) | 143 | self.patch(self.ui.backend, 'remove_device', check) |
4193 | 150 | self.ui.ui.remove_device_button.click() | 144 | self.ui.ui.remove_device_button.click() |
4194 | @@ -154,8 +148,16 @@ | |||
4195 | 154 | 148 | ||
4196 | 155 | def test_remove_device_emits_signal_when_not_removed(self): | 149 | def test_remove_device_emits_signal_when_not_removed(self): |
4197 | 156 | """The signal 'removeCanceled' is emitted when user cancels removal.""" | 150 | """The signal 'removeCanceled' is emitted when user cancels removal.""" |
4199 | 157 | FakedConfirmDialog.response = gui.NO | 151 | FakedDialog.response = gui.NO |
4200 | 158 | self.ui.removeCanceled.connect(self._set_called) | 152 | self.ui.removeCanceled.connect(self._set_called) |
4201 | 159 | self.ui.ui.remove_device_button.click() | 153 | self.ui.ui.remove_device_button.click() |
4202 | 160 | 154 | ||
4203 | 161 | self.assertEqual(self._called, ((), {})) | 155 | self.assertEqual(self._called, ((), {})) |
4204 | 156 | |||
4205 | 157 | @defer.inlineCallbacks | ||
4206 | 158 | def test_backend_error_is_handled(self): | ||
4207 | 159 | """Any error from the backend is properly handled.""" | ||
4208 | 160 | self.patch(self.ui, 'backend', CrashyBackend()) | ||
4209 | 161 | yield self.ui.ui.remove_device_button.click() | ||
4210 | 162 | |||
4211 | 163 | self.assertTrue(self.memento.check_exception(CrashyBackendException)) | ||
4212 | 162 | 164 | ||
4213 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_devices.py' | |||
4214 | --- ubuntuone/controlpanel/gui/qt/tests/test_devices.py 2011-07-22 21:26:48 +0000 | |||
4215 | +++ ubuntuone/controlpanel/gui/qt/tests/test_devices.py 2011-09-26 18:38:27 +0000 | |||
4216 | @@ -20,10 +20,8 @@ | |||
4217 | 20 | 20 | ||
4218 | 21 | from twisted.internet import defer | 21 | from twisted.internet import defer |
4219 | 22 | 22 | ||
4220 | 23 | from ubuntuone.controlpanel.gui import qt | ||
4221 | 24 | from ubuntuone.controlpanel.gui.qt import devices as gui | 23 | from ubuntuone.controlpanel.gui.qt import devices as gui |
4222 | 25 | from ubuntuone.controlpanel.gui.qt.tests import ( | 24 | from ubuntuone.controlpanel.gui.qt.tests import ( |
4223 | 26 | FakedConfirmDialog, | ||
4224 | 27 | SAMPLE_DEVICES_INFO, | 25 | SAMPLE_DEVICES_INFO, |
4225 | 28 | ) | 26 | ) |
4226 | 29 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( | 27 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( |
4227 | @@ -42,7 +40,6 @@ | |||
4228 | 42 | def setUp(self): | 40 | def setUp(self): |
4229 | 43 | yield super(DevicesPanelTestCase, self).setUp() | 41 | yield super(DevicesPanelTestCase, self).setUp() |
4230 | 44 | self.ui.backend.next_result = SAMPLE_DEVICES_INFO | 42 | self.ui.backend.next_result = SAMPLE_DEVICES_INFO |
4231 | 45 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4232 | 46 | 43 | ||
4233 | 47 | def test_is_processing_while_asking_info(self): | 44 | def test_is_processing_while_asking_info(self): |
4234 | 48 | """The ui is processing while the contents are loaded.""" | 45 | """The ui is processing while the contents are loaded.""" |
4235 | @@ -97,10 +94,8 @@ | |||
4236 | 97 | 94 | ||
4237 | 98 | def test_manage_devices_button(self): | 95 | def test_manage_devices_button(self): |
4238 | 99 | """Clicking the manage devices button opens the proper url.""" | 96 | """Clicking the manage devices button opens the proper url.""" |
4243 | 100 | self.patch(qt, 'uri_hook', self._set_called) | 97 | self.assert_uri_hook_called(self.ui.ui.manage_devices_button, |
4244 | 101 | self.ui.ui.manage_devices_button.click() | 98 | gui.EDIT_DEVICES_LINK) |
4241 | 102 | |||
4242 | 103 | self.assertEqual(self._called, ((gui.EDIT_DEVICES_LINK,), {})) | ||
4245 | 104 | 99 | ||
4246 | 105 | def test_remove_device_widget_after_removal(self): | 100 | def test_remove_device_widget_after_removal(self): |
4247 | 106 | """When a device widget was deleted, remove it from the UI.""" | 101 | """When a device widget was deleted, remove it from the UI.""" |
4248 | @@ -110,3 +105,13 @@ | |||
4249 | 110 | local_device.removed.emit() | 105 | local_device.removed.emit() |
4250 | 111 | 106 | ||
4251 | 112 | self.assertTrue(self.ui.ui.local_device_box.itemAt(0) is None) | 107 | self.assertTrue(self.ui.ui.local_device_box.itemAt(0) is None) |
4252 | 108 | |||
4253 | 109 | def test_local_device_removed_signal(self): | ||
4254 | 110 | """When the local device is removed, emit localDeviceRemoved signal.""" | ||
4255 | 111 | self.ui.localDeviceRemoved.connect(self._set_called) | ||
4256 | 112 | self.ui.process_info(SAMPLE_DEVICES_INFO) | ||
4257 | 113 | |||
4258 | 114 | local_device = self.ui.ui.local_device_box.itemAt(0).widget() | ||
4259 | 115 | local_device.removed.emit() | ||
4260 | 116 | |||
4261 | 117 | self.assertEqual(self._called, ((), {})) | ||
4262 | 113 | 118 | ||
4263 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_folders.py' | |||
4264 | --- ubuntuone/controlpanel/gui/qt/tests/test_folders.py 2011-08-12 19:12:08 +0000 | |||
4265 | +++ ubuntuone/controlpanel/gui/qt/tests/test_folders.py 2011-09-26 18:38:27 +0000 | |||
4266 | @@ -31,11 +31,9 @@ | |||
4267 | 31 | FAKE_VOLUMES_NO_FREE_SPACE_INFO, | 31 | FAKE_VOLUMES_NO_FREE_SPACE_INFO, |
4268 | 32 | MUSIC_FOLDER, ROOT, USER_HOME, | 32 | MUSIC_FOLDER, ROOT, USER_HOME, |
4269 | 33 | ) | 33 | ) |
4270 | 34 | from ubuntuone.controlpanel.gui import qt | ||
4271 | 35 | from ubuntuone.controlpanel.gui.qt import folders as gui | 34 | from ubuntuone.controlpanel.gui.qt import folders as gui |
4272 | 36 | from ubuntuone.controlpanel.gui.qt.tests import ( | 35 | from ubuntuone.controlpanel.gui.qt.tests import ( |
4275 | 37 | FakedConfirmDialog, | 36 | FakedDialog, |
4274 | 38 | FakedFileDialog, | ||
4276 | 39 | ) | 37 | ) |
4277 | 40 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( | 38 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( |
4278 | 41 | UbuntuOneBinTestCase, | 39 | UbuntuOneBinTestCase, |
4279 | @@ -140,8 +138,10 @@ | |||
4280 | 140 | self.assertTrue(item is not None) | 138 | self.assertTrue(item is not None) |
4281 | 141 | 139 | ||
4282 | 142 | name = volume['path'].replace(USER_HOME + os.path.sep, '') | 140 | name = volume['path'].replace(USER_HOME + os.path.sep, '') |
4283 | 141 | expected_path = volume['path'] | ||
4284 | 143 | if volume['type'] == self.ui.backend.SHARE_TYPE: | 142 | if volume['type'] == self.ui.backend.SHARE_TYPE: |
4285 | 144 | name = volume['name'] | 143 | name = volume['name'] |
4286 | 144 | expected_path = volume['realpath'] | ||
4287 | 145 | label = item.text(gui.FOLDER_NAME_COL) | 145 | label = item.text(gui.FOLDER_NAME_COL) |
4288 | 146 | self.assertEqual(label, name) | 146 | self.assertEqual(label, name) |
4289 | 147 | 147 | ||
4290 | @@ -161,7 +161,7 @@ | |||
4291 | 161 | self.assertEqual(icon_name, gui.SHARE_ICON_NAME) | 161 | self.assertEqual(icon_name, gui.SHARE_ICON_NAME) |
4292 | 162 | 162 | ||
4293 | 163 | self.assertEqual(item.volume_id, volume['volume_id']) | 163 | self.assertEqual(item.volume_id, volume['volume_id']) |
4295 | 164 | self.assertEqual(item.volume_path, volume['path']) | 164 | self.assertEqual(item.volume_path, expected_path) |
4296 | 165 | 165 | ||
4297 | 166 | # tooltips are correct | 166 | # tooltips are correct |
4298 | 167 | self.assertEqual(item.toolTip(gui.FOLDER_NAME_COL), name) | 167 | self.assertEqual(item.toolTip(gui.FOLDER_NAME_COL), name) |
4299 | @@ -175,6 +175,8 @@ | |||
4300 | 175 | gui.FOLDER_ICON_NAME) | 175 | gui.FOLDER_ICON_NAME) |
4301 | 176 | self.assertEqual(button.iconSize().width(), 12) | 176 | self.assertEqual(button.iconSize().width(), 12) |
4302 | 177 | self.assertEqual(button.iconSize().height(), 12) | 177 | self.assertEqual(button.iconSize().height(), 12) |
4303 | 178 | self.assertEqual(button.isEnabled(), | ||
4304 | 179 | bool(volume['subscribed'])) | ||
4305 | 178 | 180 | ||
4306 | 179 | treeiter += 1 | 181 | treeiter += 1 |
4307 | 180 | item = treeiter.value() | 182 | item = treeiter.value() |
4308 | @@ -245,7 +247,8 @@ | |||
4309 | 245 | self.ui.on_folders_itemActivated(item) | 247 | self.ui.on_folders_itemActivated(item) |
4310 | 246 | 248 | ||
4311 | 247 | self.assertEqual(self._called, | 249 | self.assertEqual(self._called, |
4313 | 248 | ((gui.FILE_URI_PREFIX + path,), {})) | 250 | ((unicode(gui.QtCore.QUrl.fromLocalFile(path).toString()),), {})) |
4314 | 251 | self.assertTrue(gui.QtCore.QUrl(self._called[0][0]).isValid()) | ||
4315 | 249 | 252 | ||
4316 | 250 | def test_clicking_on_row_handles_path_none(self): | 253 | def test_clicking_on_row_handles_path_none(self): |
4317 | 251 | """None paths are properly handled.""" | 254 | """None paths are properly handled.""" |
4318 | @@ -302,10 +305,8 @@ | |||
4319 | 302 | 305 | ||
4320 | 303 | def test_share_publish_button(self): | 306 | def test_share_publish_button(self): |
4321 | 304 | """When clicking the share/publish button, the proper url is opened.""" | 307 | """When clicking the share/publish button, the proper url is opened.""" |
4326 | 305 | self.patch(qt, 'uri_hook', self._set_called) | 308 | self.assert_uri_hook_called(self.ui.ui.share_publish_button, |
4327 | 306 | self.ui.ui.share_publish_button.click() | 309 | gui.MANAGE_FILES_LINK) |
4324 | 307 | |||
4325 | 308 | self.assertEqual(self._called, ((gui.MANAGE_FILES_LINK,), {})) | ||
4328 | 309 | 310 | ||
4329 | 310 | 311 | ||
4330 | 311 | class FoldersPanelAddFolderTestCase(FoldersPanelTestCase): | 312 | class FoldersPanelAddFolderTestCase(FoldersPanelTestCase): |
4331 | @@ -322,17 +323,6 @@ | |||
4332 | 322 | # reset backend state | 323 | # reset backend state |
4333 | 323 | self.ui.backend._called.clear() | 324 | self.ui.backend._called.clear() |
4334 | 324 | 325 | ||
4335 | 325 | # default response if user does nothing | ||
4336 | 326 | FakedFileDialog.response = gui.QtCore.QString('') | ||
4337 | 327 | FakedFileDialog.args = None | ||
4338 | 328 | FakedFileDialog.kwargs = None | ||
4339 | 329 | self.patch(gui.QtGui, 'QFileDialog', FakedFileDialog) | ||
4340 | 330 | |||
4341 | 331 | FakedConfirmDialog.response = None | ||
4342 | 332 | FakedConfirmDialog.args = None | ||
4343 | 333 | FakedConfirmDialog.kwargs = None | ||
4344 | 334 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4345 | 335 | |||
4346 | 336 | def test_not_is_processing(self): | 326 | def test_not_is_processing(self): |
4347 | 337 | """Before clicking the add folder button, the UI is not processing.""" | 327 | """Before clicking the add folder button, the UI is not processing.""" |
4348 | 338 | self.assertFalse(self.ui.is_processing, 'ui must not be processing') | 328 | self.assertFalse(self.ui.is_processing, 'ui must not be processing') |
4349 | @@ -356,10 +346,7 @@ | |||
4350 | 356 | def setUp(self): | 346 | def setUp(self): |
4351 | 357 | yield super(FoldersPanelSubscriptionTestCase, self).setUp() | 347 | yield super(FoldersPanelSubscriptionTestCase, self).setUp() |
4352 | 358 | self.patch(gui.os.path, 'exists', lambda path: True) | 348 | self.patch(gui.os.path, 'exists', lambda path: True) |
4357 | 359 | FakedConfirmDialog.response = gui.YES | 349 | FakedDialog.response = gui.YES |
4354 | 360 | FakedConfirmDialog.args = None | ||
4355 | 361 | FakedConfirmDialog.kwargs = None | ||
4356 | 362 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4358 | 363 | 350 | ||
4359 | 364 | self.ui.process_info(FAKE_VOLUMES_MINIMAL_INFO) | 351 | self.ui.process_info(FAKE_VOLUMES_MINIMAL_INFO) |
4360 | 365 | # the music folder | 352 | # the music folder |
4361 | @@ -368,6 +355,7 @@ | |||
4362 | 368 | @defer.inlineCallbacks | 355 | @defer.inlineCallbacks |
4363 | 369 | def test_on_folders_item_changed(self): | 356 | def test_on_folders_item_changed(self): |
4364 | 370 | """Clicking on 'subscribed' updates the folder subscription.""" | 357 | """Clicking on 'subscribed' updates the folder subscription.""" |
4365 | 358 | self.patch(self.ui, 'load', self._set_called) | ||
4366 | 371 | volume = MUSIC_FOLDER | 359 | volume = MUSIC_FOLDER |
4367 | 372 | fid = volume['volume_id'] | 360 | fid = volume['volume_id'] |
4368 | 373 | subscribed = not bool(volume['subscribed']) | 361 | subscribed = not bool(volume['subscribed']) |
4369 | @@ -386,6 +374,9 @@ | |||
4370 | 386 | value = self.item.checkState(gui.SUBSCRIPTION_COL) == gui.CHECKED | 374 | value = self.item.checkState(gui.SUBSCRIPTION_COL) == gui.CHECKED |
4371 | 387 | self.assertEqual(value, bool(subscribed)) | 375 | self.assertEqual(value, bool(subscribed)) |
4372 | 388 | 376 | ||
4373 | 377 | # folder list was reloaded | ||
4374 | 378 | self.assertEqual(self._called, ((), {})) | ||
4375 | 379 | |||
4376 | 389 | @defer.inlineCallbacks | 380 | @defer.inlineCallbacks |
4377 | 390 | def test_on_folders_item_changed_is_processing(self): | 381 | def test_on_folders_item_changed_is_processing(self): |
4378 | 391 | """Clicking on 'subscribed' sets is_processing flag until done.""" | 382 | """Clicking on 'subscribed' sets is_processing flag until done.""" |
4379 | @@ -438,9 +429,9 @@ | |||
4380 | 438 | volume_path = self.item.volume_path | 429 | volume_path = self.item.volume_path |
4381 | 439 | msg = gui.FOLDERS_CONFIRM_MERGE % {'folder_path': volume_path} | 430 | msg = gui.FOLDERS_CONFIRM_MERGE % {'folder_path': volume_path} |
4382 | 440 | buttons = gui.YES | gui.NO | gui.CANCEL | 431 | buttons = gui.YES | gui.NO | gui.CANCEL |
4384 | 441 | self.assertEqual(FakedConfirmDialog.args, | 432 | self.assertEqual(FakedDialog.args, |
4385 | 442 | (self.ui, '', msg, buttons, gui.YES)) | 433 | (self.ui, '', msg, buttons, gui.YES)) |
4387 | 443 | self.assertEqual(FakedConfirmDialog.kwargs, {}) | 434 | self.assertEqual(FakedDialog.kwargs, {}) |
4388 | 444 | 435 | ||
4389 | 445 | @defer.inlineCallbacks | 436 | @defer.inlineCallbacks |
4390 | 446 | def test_confirm_dialog_if_path_does_not_exist(self): | 437 | def test_confirm_dialog_if_path_does_not_exist(self): |
4391 | @@ -454,14 +445,13 @@ | |||
4392 | 454 | 445 | ||
4393 | 455 | yield self.ui.on_folders_itemChanged(self.item) | 446 | yield self.ui.on_folders_itemChanged(self.item) |
4394 | 456 | 447 | ||
4397 | 457 | self.assertEqual(FakedConfirmDialog.args, None) | 448 | self.assertEqual(FakedDialog.args, None) |
4398 | 458 | self.assertEqual(FakedConfirmDialog.kwargs, None) | 449 | self.assertEqual(FakedDialog.kwargs, None) |
4399 | 459 | 450 | ||
4400 | 460 | @defer.inlineCallbacks | 451 | @defer.inlineCallbacks |
4401 | 461 | def test_subscribe_does_not_call_backend_if_dialog_closed(self): | 452 | def test_subscribe_does_not_call_backend_if_dialog_closed(self): |
4402 | 462 | """Backend is not called if users closes the confirmation dialog.""" | 453 | """Backend is not called if users closes the confirmation dialog.""" |
4405 | 463 | FakedConfirmDialog.response = gui.CANCEL | 454 | FakedDialog.response = gui.CANCEL |
4404 | 464 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4406 | 465 | 455 | ||
4407 | 466 | # make sure the item is subscribed | 456 | # make sure the item is subscribed |
4408 | 467 | self.ui.is_processing = True | 457 | self.ui.is_processing = True |
4409 | @@ -470,7 +460,7 @@ | |||
4410 | 470 | 460 | ||
4411 | 471 | yield self.ui.on_folders_itemChanged(self.item) | 461 | yield self.ui.on_folders_itemChanged(self.item) |
4412 | 472 | 462 | ||
4414 | 473 | self.assertFalse(FakedConfirmDialog.args is None, 'warning was called') | 463 | self.assertFalse(FakedDialog.args is None, 'warning was called') |
4415 | 474 | self.assertNotIn('change_volume_settings', self.ui.backend._called) | 464 | self.assertNotIn('change_volume_settings', self.ui.backend._called) |
4416 | 475 | self.assertFalse(self.ui.is_processing) | 465 | self.assertFalse(self.ui.is_processing) |
4417 | 476 | 466 | ||
4418 | @@ -480,8 +470,7 @@ | |||
4419 | 480 | @defer.inlineCallbacks | 470 | @defer.inlineCallbacks |
4420 | 481 | def test_subscribe_does_not_call_backend_if_answer_is_no(self): | 471 | def test_subscribe_does_not_call_backend_if_answer_is_no(self): |
4421 | 482 | """Backend is not called if users clicks on 'No'.""" | 472 | """Backend is not called if users clicks on 'No'.""" |
4424 | 483 | FakedConfirmDialog.response = gui.NO | 473 | FakedDialog.response = gui.NO |
4423 | 484 | self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog) | ||
4425 | 485 | 474 | ||
4426 | 486 | # make sure the item is subscribed | 475 | # make sure the item is subscribed |
4427 | 487 | self.ui.is_processing = True | 476 | self.ui.is_processing = True |
4428 | @@ -490,7 +479,7 @@ | |||
4429 | 490 | 479 | ||
4430 | 491 | yield self.ui.on_folders_itemChanged(self.item) | 480 | yield self.ui.on_folders_itemChanged(self.item) |
4431 | 492 | 481 | ||
4433 | 493 | self.assertFalse(FakedConfirmDialog.args is None, 'warning was called') | 482 | self.assertFalse(FakedDialog.args is None, 'warning was called') |
4434 | 494 | self.assertNotIn('change_volume_settings', self.ui.backend._called) | 483 | self.assertNotIn('change_volume_settings', self.ui.backend._called) |
4435 | 495 | self.assertFalse(self.ui.is_processing) | 484 | self.assertFalse(self.ui.is_processing) |
4436 | 496 | 485 | ||
4437 | @@ -506,10 +495,10 @@ | |||
4438 | 506 | self.ui.is_processing = False | 495 | self.ui.is_processing = False |
4439 | 507 | 496 | ||
4440 | 508 | # the confirm dialog was not called so far | 497 | # the confirm dialog was not called so far |
4443 | 509 | assert FakedConfirmDialog.args is None | 498 | assert FakedDialog.args is None |
4444 | 510 | assert FakedConfirmDialog.kwargs is None | 499 | assert FakedDialog.kwargs is None |
4445 | 511 | 500 | ||
4446 | 512 | yield self.ui.on_folders_itemChanged(self.item) | 501 | yield self.ui.on_folders_itemChanged(self.item) |
4447 | 513 | 502 | ||
4450 | 514 | self.assertTrue(FakedConfirmDialog.args is None, 'dialog was not run') | 503 | self.assertTrue(FakedDialog.args is None, 'dialog was not run') |
4451 | 515 | self.assertTrue(FakedConfirmDialog.kwargs is None, 'dialog was hid') | 504 | self.assertTrue(FakedDialog.kwargs is None, 'dialog was hid') |
4452 | 516 | 505 | ||
4453 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py' | |||
4454 | --- ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2011-07-22 21:26:48 +0000 | |||
4455 | +++ ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2011-09-26 18:38:27 +0000 | |||
4456 | @@ -20,7 +20,7 @@ | |||
4457 | 20 | 20 | ||
4458 | 21 | from twisted.internet import defer | 21 | from twisted.internet import defer |
4459 | 22 | 22 | ||
4461 | 23 | from ubuntuone.controlpanel.gui import qt | 23 | from ubuntuone.controlpanel.gui import qt, UBUNTUONE_LINK |
4462 | 24 | from ubuntuone.controlpanel.gui.qt import gotoweb as gui | 24 | from ubuntuone.controlpanel.gui.qt import gotoweb as gui |
4463 | 25 | from ubuntuone.controlpanel.gui.qt.tests import ( | 25 | from ubuntuone.controlpanel.gui.qt.tests import ( |
4464 | 26 | BaseTestCase, | 26 | BaseTestCase, |
4465 | @@ -35,7 +35,6 @@ | |||
4466 | 35 | @defer.inlineCallbacks | 35 | @defer.inlineCallbacks |
4467 | 36 | def setUp(self): | 36 | def setUp(self): |
4468 | 37 | yield super(GoToWebButtonTestCase, self).setUp() | 37 | yield super(GoToWebButtonTestCase, self).setUp() |
4469 | 38 | self.patch(qt, 'uri_hook', self._set_called) | ||
4470 | 39 | 38 | ||
4471 | 40 | def test_uri_can_be_set(self): | 39 | def test_uri_can_be_set(self): |
4472 | 41 | """The uri can be set.""" | 40 | """The uri can be set.""" |
4473 | @@ -47,8 +46,14 @@ | |||
4474 | 47 | """The layout direction is RightToLeft.""" | 46 | """The layout direction is RightToLeft.""" |
4475 | 48 | self.assertEqual(self.ui.layoutDirection(), gui.QtCore.Qt.RightToLeft) | 47 | self.assertEqual(self.ui.layoutDirection(), gui.QtCore.Qt.RightToLeft) |
4476 | 49 | 48 | ||
4477 | 49 | def test_cursor_pointer(self): | ||
4478 | 50 | """The cursor is PointingHandCursor.""" | ||
4479 | 51 | self.assertEqual(self.ui.cursor().shape(), | ||
4480 | 52 | gui.QtCore.Qt.PointingHandCursor) | ||
4481 | 53 | |||
4482 | 50 | def test_open_uri_when_clicked(self): | 54 | def test_open_uri_when_clicked(self): |
4483 | 51 | """When clicking the button, the uri is opened.""" | 55 | """When clicking the button, the uri is opened.""" |
4484 | 56 | self.patch(qt, 'uri_hook', self._set_called) | ||
4485 | 52 | self.ui.uri = 'yadda-yadda-yoo' | 57 | self.ui.uri = 'yadda-yadda-yoo' |
4486 | 53 | self.ui.click() | 58 | self.ui.click() |
4487 | 54 | 59 | ||
4488 | @@ -56,7 +61,54 @@ | |||
4489 | 56 | 61 | ||
4490 | 57 | def test_do_nothing_on_clicked_if_uri_is_none(self): | 62 | def test_do_nothing_on_clicked_if_uri_is_none(self): |
4491 | 58 | """When clicking the button, if the uri is None, do nothing.""" | 63 | """When clicking the button, if the uri is None, do nothing.""" |
4492 | 64 | self.patch(qt, 'uri_hook', self._set_called) | ||
4493 | 59 | self.ui.uri = None | 65 | self.ui.uri = None |
4494 | 60 | self.ui.click() | 66 | self.ui.click() |
4495 | 61 | 67 | ||
4496 | 62 | self.assertEqual(self._called, False) | 68 | self.assertEqual(self._called, False) |
4497 | 69 | |||
4498 | 70 | |||
4499 | 71 | class SignUrlTestCase(GoToWebButtonTestCase): | ||
4500 | 72 | """The test suite for the sign url management.""" | ||
4501 | 73 | |||
4502 | 74 | @defer.inlineCallbacks | ||
4503 | 75 | def setUp(self): | ||
4504 | 76 | yield super(SignUrlTestCase, self).setUp() | ||
4505 | 77 | self.patch(qt, 'uri_hook', lambda url: None) | ||
4506 | 78 | self.patch(gui, 'sign_url', self._set_called) | ||
4507 | 79 | self.creds = yield self.ui.backend.get_credentials() | ||
4508 | 80 | assert len(self.creds) > 0 | ||
4509 | 81 | |||
4510 | 82 | def test_without_ubuntuone_prefix(self): | ||
4511 | 83 | """If given url is not an ubuntuone url, don't sign it.""" | ||
4512 | 84 | self.ui.uri = 'bad_prefix' + UBUNTUONE_LINK | ||
4513 | 85 | self.ui.click() | ||
4514 | 86 | |||
4515 | 87 | self.assertFalse(self._called) | ||
4516 | 88 | |||
4517 | 89 | def test_with_ubuntuone_prefix(self): | ||
4518 | 90 | """If given url is an ubuntuone url, sign it.""" | ||
4519 | 91 | self.ui.uri = UBUNTUONE_LINK + 'foo' | ||
4520 | 92 | self.ui.click() | ||
4521 | 93 | |||
4522 | 94 | self.assertEqual(self._called, ((self.ui.uri, self.creds,), {})) | ||
4523 | 95 | |||
4524 | 96 | |||
4525 | 97 | class SignUrlNoCredsTestCase(SignUrlTestCase): | ||
4526 | 98 | """The test suite for the sign url management when there are no creds.""" | ||
4527 | 99 | |||
4528 | 100 | @defer.inlineCallbacks | ||
4529 | 101 | def setUp(self): | ||
4530 | 102 | yield super(SignUrlNoCredsTestCase, self).setUp() | ||
4531 | 103 | self.patch(self.ui.backend, 'get_credentials', lambda: {}) | ||
4532 | 104 | |||
4533 | 105 | def test_with_ubuntuone_prefix(self): | ||
4534 | 106 | """If given url is an ubuntuone url, don't sign it. | ||
4535 | 107 | |||
4536 | 108 | Since we have no credentials, the url should not be signed. | ||
4537 | 109 | |||
4538 | 110 | """ | ||
4539 | 111 | self.ui.uri = UBUNTUONE_LINK + 'foo' | ||
4540 | 112 | self.ui.click() | ||
4541 | 113 | |||
4542 | 114 | self.assertFalse(self._called) | ||
4543 | 63 | 115 | ||
4544 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_gui.py' | |||
4545 | --- ubuntuone/controlpanel/gui/qt/tests/test_gui.py 2011-07-22 21:26:48 +0000 | |||
4546 | +++ ubuntuone/controlpanel/gui/qt/tests/test_gui.py 2011-09-26 18:38:27 +0000 | |||
4547 | @@ -41,3 +41,10 @@ | |||
4548 | 41 | self.ui.close_callback = None | 41 | self.ui.close_callback = None |
4549 | 42 | self.ui.closeEvent(event=gui.QtGui.QCloseEvent()) | 42 | self.ui.closeEvent(event=gui.QtGui.QCloseEvent()) |
4550 | 43 | # world did not explode | 43 | # world did not explode |
4551 | 44 | |||
4552 | 45 | def test_on_signin_canceled(self): | ||
4553 | 46 | """On SigninPanel's signinCanceled, close.""" | ||
4554 | 47 | self.patch(self.ui, 'closeEvent', self._set_called) | ||
4555 | 48 | self.ui.ui.control_panel.ui.signin.signinCanceled.emit() | ||
4556 | 49 | self.assertEqual(len(self._called[0]), 1) | ||
4557 | 50 | self.assertIsInstance(self._called[0][0], gui.QtGui.QCloseEvent) | ||
4558 | 44 | 51 | ||
4559 | === added file 'ubuntuone/controlpanel/gui/qt/tests/test_signin.py' | |||
4560 | --- ubuntuone/controlpanel/gui/qt/tests/test_signin.py 1970-01-01 00:00:00 +0000 | |||
4561 | +++ ubuntuone/controlpanel/gui/qt/tests/test_signin.py 2011-09-26 18:38:27 +0000 | |||
4562 | @@ -0,0 +1,168 @@ | |||
4563 | 1 | # -*- coding: utf-8 -*- | ||
4564 | 2 | |||
4565 | 3 | # Authors: Natalia B Bidart <natalia.bidart@canonical.com> | ||
4566 | 4 | # | ||
4567 | 5 | # Copyright 2011 Canonical Ltd. | ||
4568 | 6 | # | ||
4569 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
4570 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
4571 | 9 | # by the Free Software Foundation. | ||
4572 | 10 | # | ||
4573 | 11 | # This program is distributed in the hope that it will be useful, but | ||
4574 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
4575 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
4576 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
4577 | 15 | # | ||
4578 | 16 | # You should have received a copy of the GNU General Public License along | ||
4579 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4580 | 18 | |||
4581 | 19 | """Tests for the Sign In Panel.""" | ||
4582 | 20 | |||
4583 | 21 | from twisted.internet import defer | ||
4584 | 22 | |||
4585 | 23 | from ubuntuone.controlpanel.gui import qt | ||
4586 | 24 | from ubuntuone.controlpanel.gui.qt import signin as gui | ||
4587 | 25 | from ubuntuone.controlpanel.gui.qt.tests import ( | ||
4588 | 26 | CrashyBackend, | ||
4589 | 27 | CrashyBackendException, | ||
4590 | 28 | ) | ||
4591 | 29 | from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import ( | ||
4592 | 30 | UbuntuOneBinTestCase, | ||
4593 | 31 | ) | ||
4594 | 32 | |||
4595 | 33 | EMAIL = 'foo@bar.com' | ||
4596 | 34 | PASSWORD = 'h3ll0World' | ||
4597 | 35 | TOKEN = {'yadda': 'doo'} | ||
4598 | 36 | |||
4599 | 37 | MSG = {u'errtype': u'AuthenticationError', | ||
4600 | 38 | u'message': u'The authentication failed.'} | ||
4601 | 39 | |||
4602 | 40 | |||
4603 | 41 | def fail(*a, **kw): | ||
4604 | 42 | """Emit CredentialsError.""" | ||
4605 | 43 | raise TypeError(MSG) | ||
4606 | 44 | |||
4607 | 45 | |||
4608 | 46 | class BaseSignInPanelTestCase(UbuntuOneBinTestCase): | ||
4609 | 47 | """Test the signin panel.""" | ||
4610 | 48 | |||
4611 | 49 | innerclass_ui = gui.signin_ui | ||
4612 | 50 | innerclass_name = "Ui_Form" | ||
4613 | 51 | class_ui = gui.SignInPanel | ||
4614 | 52 | logger = gui.logger | ||
4615 | 53 | |||
4616 | 54 | @defer.inlineCallbacks | ||
4617 | 55 | def setUp(self): | ||
4618 | 56 | yield super(BaseSignInPanelTestCase, self).setUp() | ||
4619 | 57 | self.ui.backend.next_result = TOKEN | ||
4620 | 58 | |||
4621 | 59 | |||
4622 | 60 | class SignInPanelTestCase(BaseSignInPanelTestCase): | ||
4623 | 61 | """Test the signin panel.""" | ||
4624 | 62 | |||
4625 | 63 | innerclass_ui = gui.signin_ui | ||
4626 | 64 | innerclass_name = "Ui_Form" | ||
4627 | 65 | class_ui = gui.SignInPanel | ||
4628 | 66 | |||
4629 | 67 | @defer.inlineCallbacks | ||
4630 | 68 | def setUp(self): | ||
4631 | 69 | yield super(SignInPanelTestCase, self).setUp() | ||
4632 | 70 | self.ui.backend.next_result = TOKEN | ||
4633 | 71 | self.ui.ui.email_entry.setText(gui.QtCore.QString('')) | ||
4634 | 72 | self.ui.ui.password_entry.setText(gui.QtCore.QString('')) | ||
4635 | 73 | |||
4636 | 74 | @defer.inlineCallbacks | ||
4637 | 75 | def test_is_processing_while_asking_info(self): | ||
4638 | 76 | """The ui is processing while the contents are loaded.""" | ||
4639 | 77 | def check(email, password): | ||
4640 | 78 | """The ui must be is_processing.""" | ||
4641 | 79 | self.assertTrue(self.ui.is_processing, 'ui must be processing') | ||
4642 | 80 | return TOKEN | ||
4643 | 81 | |||
4644 | 82 | self.patch(self.ui.backend, 'login', check) | ||
4645 | 83 | |||
4646 | 84 | self.assertFalse(self.ui.is_processing) | ||
4647 | 85 | yield self.ui.ui.signin_button.click() | ||
4648 | 86 | self.assertFalse(self.ui.is_processing) | ||
4649 | 87 | |||
4650 | 88 | def test_signin_disabled_at_startup(self): | ||
4651 | 89 | """The signin_button is disabled at startup.""" | ||
4652 | 90 | self.assertFalse(self.ui.ui.signin_button.isEnabled()) | ||
4653 | 91 | |||
4654 | 92 | def test_signin_disabled_if_no_email_but_password(self): | ||
4655 | 93 | """Disable signin_button if no email.""" | ||
4656 | 94 | self.ui.ui.password_entry.setText(gui.QtCore.QString('doo')) | ||
4657 | 95 | self.assertFalse(self.ui.ui.signin_button.isEnabled()) | ||
4658 | 96 | |||
4659 | 97 | def test_signin_disabled_if_no_password_but_email(self): | ||
4660 | 98 | """Disable signin_button if no password.""" | ||
4661 | 99 | self.ui.ui.email_entry.setText(gui.QtCore.QString('duh')) | ||
4662 | 100 | self.assertFalse(self.ui.ui.signin_button.isEnabled()) | ||
4663 | 101 | |||
4664 | 102 | def test_cancel_button(self): | ||
4665 | 103 | """Send a signal when the cancel button is clicked.""" | ||
4666 | 104 | self.ui.signinCanceled.connect(self._set_called) | ||
4667 | 105 | self.ui.ui.cancel_button.click() | ||
4668 | 106 | self.assertEqual(self._called, ((), {})) | ||
4669 | 107 | |||
4670 | 108 | def test_forgot_password_button(self): | ||
4671 | 109 | """When clicking the forgot passsword btn, the proper url is opened.""" | ||
4672 | 110 | self.patch(qt, 'uri_hook', self._set_called) | ||
4673 | 111 | self.ui.ui.forgot_password_button.click() | ||
4674 | 112 | |||
4675 | 113 | self.assertEqual(self._called, ((gui.RESET_PASSWORD_LINK,), {})) | ||
4676 | 114 | |||
4677 | 115 | |||
4678 | 116 | class SignInButtonPanelTestCase(BaseSignInPanelTestCase): | ||
4679 | 117 | """Test the signin_button widget.""" | ||
4680 | 118 | |||
4681 | 119 | @defer.inlineCallbacks | ||
4682 | 120 | def setUp(self): | ||
4683 | 121 | yield super(SignInButtonPanelTestCase, self).setUp() | ||
4684 | 122 | self.ui.ui.email_entry.setText(gui.QtCore.QString(EMAIL)) | ||
4685 | 123 | self.ui.ui.password_entry.setText(gui.QtCore.QString(PASSWORD)) | ||
4686 | 124 | |||
4687 | 125 | @defer.inlineCallbacks | ||
4688 | 126 | def test_signin_button(self): | ||
4689 | 127 | """Call the backend when the signin button is clicked.""" | ||
4690 | 128 | yield self.ui.ui.signin_button.click() | ||
4691 | 129 | |||
4692 | 130 | self.assert_backend_called('login', email=EMAIL, password=PASSWORD) | ||
4693 | 131 | # pylint: disable=W0212 | ||
4694 | 132 | for arg in self.ui.backend._called['login'][1].itervalues(): | ||
4695 | 133 | self.assertIsInstance(arg, unicode) # make sure not send QString | ||
4696 | 134 | |||
4697 | 135 | @defer.inlineCallbacks | ||
4698 | 136 | def test_signin_success(self): | ||
4699 | 137 | """Emit credentialsFound on signin success.""" | ||
4700 | 138 | self.ui.credentialsFound.connect(self._set_called) | ||
4701 | 139 | yield self.ui.ui.signin_button.click() | ||
4702 | 140 | |||
4703 | 141 | self.assertEqual(self._called, ((TOKEN,), {})) | ||
4704 | 142 | self.assertFalse(self.ui.is_processing) | ||
4705 | 143 | |||
4706 | 144 | def test_signin_enabled_if_email_and_password(self): | ||
4707 | 145 | """Enable signin_button if email and password are non empty.""" | ||
4708 | 146 | self.assertTrue(self.ui.ui.signin_button.isEnabled()) | ||
4709 | 147 | |||
4710 | 148 | def test_return_pressed(self): | ||
4711 | 149 | """On return pressed, click the signin_button.""" | ||
4712 | 150 | self.patch(self.ui.ui.signin_button, 'click', self._set_called) | ||
4713 | 151 | |||
4714 | 152 | for entry in (self.ui.ui.email_entry, self.ui.ui.password_entry): | ||
4715 | 153 | entry.returnPressed.emit() | ||
4716 | 154 | |||
4717 | 155 | # This is failing, so we need to settle with counting recievers | ||
4718 | 156 | #self.assertEqual(self._called, ((), {})) | ||
4719 | 157 | receivers = entry.receivers(gui.QtCore.SIGNAL('returnPressed()')) | ||
4720 | 158 | self.assertEqual(1, receivers) | ||
4721 | 159 | |||
4722 | 160 | self._called = False | ||
4723 | 161 | |||
4724 | 162 | @defer.inlineCallbacks | ||
4725 | 163 | def test_backend_error_is_handled(self): | ||
4726 | 164 | """Any error from the backend is properly handled.""" | ||
4727 | 165 | self.patch(self.ui, 'backend', CrashyBackend()) | ||
4728 | 166 | yield self.ui.ui.signin_button.click() | ||
4729 | 167 | |||
4730 | 168 | self.assertTrue(self.memento.check_exception(CrashyBackendException)) | ||
4731 | 0 | 169 | ||
4732 | === added file 'ubuntuone/controlpanel/gui/qt/tests/test_start.py' | |||
4733 | --- ubuntuone/controlpanel/gui/qt/tests/test_start.py 1970-01-01 00:00:00 +0000 | |||
4734 | +++ ubuntuone/controlpanel/gui/qt/tests/test_start.py 2011-09-26 18:38:27 +0000 | |||
4735 | @@ -0,0 +1,91 @@ | |||
4736 | 1 | # -*- coding: utf-8 -*- | ||
4737 | 2 | |||
4738 | 3 | # Author: Roberto Alsina <roberto.alsina@canonical.com> | ||
4739 | 4 | # | ||
4740 | 5 | # Copyright 2011 Canonical Ltd. | ||
4741 | 6 | # | ||
4742 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
4743 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
4744 | 9 | # by the Free Software Foundation. | ||
4745 | 10 | # | ||
4746 | 11 | # This program is distributed in the hope that it will be useful, but | ||
4747 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
4748 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
4749 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
4750 | 15 | # | ||
4751 | 16 | # You should have received a copy of the GNU General Public License along | ||
4752 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4753 | 18 | |||
4754 | 19 | """Tests for the start function.""" | ||
4755 | 20 | |||
4756 | 21 | from twisted.internet import defer | ||
4757 | 22 | |||
4758 | 23 | from ubuntuone.controlpanel.gui.qt import gui | ||
4759 | 24 | from ubuntuone.controlpanel.gui.qt.tests import NO_OP | ||
4760 | 25 | from ubuntuone.controlpanel.tests import TestCase | ||
4761 | 26 | |||
4762 | 27 | |||
4763 | 28 | class FakeThing(object): | ||
4764 | 29 | |||
4765 | 30 | """A fake thing.""" | ||
4766 | 31 | |||
4767 | 32 | def __init__(self): | ||
4768 | 33 | self.args = [] | ||
4769 | 34 | self.shown = False | ||
4770 | 35 | |||
4771 | 36 | def __call__(self, *args, **kwargs): | ||
4772 | 37 | self.args.append((args, kwargs)) | ||
4773 | 38 | return self | ||
4774 | 39 | |||
4775 | 40 | def show(self): | ||
4776 | 41 | """Show.""" | ||
4777 | 42 | self.shown = True | ||
4778 | 43 | |||
4779 | 44 | |||
4780 | 45 | class FakeReactor(object): | ||
4781 | 46 | """A fake reactor.""" | ||
4782 | 47 | |||
4783 | 48 | def run(self): | ||
4784 | 49 | """Start.""" | ||
4785 | 50 | |||
4786 | 51 | def stop(self): | ||
4787 | 52 | """Stop.""" | ||
4788 | 53 | |||
4789 | 54 | |||
4790 | 55 | class StartTestCase(TestCase): | ||
4791 | 56 | """Test the qt control panel.""" | ||
4792 | 57 | |||
4793 | 58 | @defer.inlineCallbacks | ||
4794 | 59 | def setUp(self): | ||
4795 | 60 | yield super(StartTestCase, self).setUp() | ||
4796 | 61 | self.main_window = FakeThing() | ||
4797 | 62 | self.tray_icon = FakeThing() | ||
4798 | 63 | self.patch(gui, "MainWindow", self.main_window) | ||
4799 | 64 | self.patch(gui, "TrayIcon", self.tray_icon) | ||
4800 | 65 | |||
4801 | 66 | def test_minimized(self): | ||
4802 | 67 | """Test behaviour with minimized=True.""" | ||
4803 | 68 | gui.start(NO_OP, minimized=True, with_icon=True) | ||
4804 | 69 | self.assertEqual(self.tray_icon.args, [((), {'window': None})]) | ||
4805 | 70 | self.assertEqual(self.main_window.args, []) | ||
4806 | 71 | |||
4807 | 72 | def test_with_icon(self): | ||
4808 | 73 | """Test behaviour with with_icon=True.""" | ||
4809 | 74 | gui.start(NO_OP, with_icon=True, minimized=False) | ||
4810 | 75 | self.assertEqual(self.main_window.args, [((), {})]) | ||
4811 | 76 | self.assertEqual(self.tray_icon.args, [((), | ||
4812 | 77 | {'window': self.main_window})]) | ||
4813 | 78 | |||
4814 | 79 | def test_both_false(self): | ||
4815 | 80 | """Test behaviour when with_icon and minimized are False.""" | ||
4816 | 81 | gui.start(NO_OP, with_icon=False, minimized=False) | ||
4817 | 82 | # Should be called | ||
4818 | 83 | self.assertNotEqual(self.main_window.args, []) | ||
4819 | 84 | # Should not be called | ||
4820 | 85 | self.assertEqual(self.tray_icon.args, []) | ||
4821 | 86 | |||
4822 | 87 | def test_both_true(self): | ||
4823 | 88 | """Test behaviour when with_icon and minimized are True.""" | ||
4824 | 89 | gui.start(NO_OP, with_icon=True, minimized=True) | ||
4825 | 90 | self.assertEqual(self.tray_icon.args, [((), {'window': None})]) | ||
4826 | 91 | self.assertEqual(self.main_window.args, []) | ||
4827 | 0 | 92 | ||
4828 | === added file 'ubuntuone/controlpanel/gui/qt/tests/test_systray.py' | |||
4829 | --- ubuntuone/controlpanel/gui/qt/tests/test_systray.py 1970-01-01 00:00:00 +0000 | |||
4830 | +++ ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2011-09-26 18:38:27 +0000 | |||
4831 | @@ -0,0 +1,103 @@ | |||
4832 | 1 | # -*- coding: utf-8 -*- | ||
4833 | 2 | |||
4834 | 3 | # Author: Roberto Alsina <roberto.alsina@canonical.com> | ||
4835 | 4 | # | ||
4836 | 5 | # Copyright 2011 Canonical Ltd. | ||
4837 | 6 | # | ||
4838 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
4839 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
4840 | 9 | # by the Free Software Foundation. | ||
4841 | 10 | # | ||
4842 | 11 | # This program is distributed in the hope that it will be useful, but | ||
4843 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
4844 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
4845 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
4846 | 15 | # | ||
4847 | 16 | # You should have received a copy of the GNU General Public License along | ||
4848 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4849 | 18 | |||
4850 | 19 | """Tests for the notification area icon.""" | ||
4851 | 20 | |||
4852 | 21 | from PyQt4 import QtGui | ||
4853 | 22 | |||
4854 | 23 | from ubuntuone.controlpanel.gui.qt.systray import TrayIcon | ||
4855 | 24 | from ubuntuone.controlpanel.tests import TestCase | ||
4856 | 25 | import ubuntuone.controlpanel.gui.qt.gui | ||
4857 | 26 | |||
4858 | 27 | |||
4859 | 28 | class FakeMainWindow(QtGui.QWidget): | ||
4860 | 29 | |||
4861 | 30 | """Fake Main Window.""" | ||
4862 | 31 | |||
4863 | 32 | def __init__(self, *args, **kwargs): | ||
4864 | 33 | self.args = (args, kwargs) | ||
4865 | 34 | super(FakeMainWindow, self).__init__() | ||
4866 | 35 | |||
4867 | 36 | |||
4868 | 37 | class SystrayTestCase(TestCase): | ||
4869 | 38 | |||
4870 | 39 | """Test the notification area icon.""" | ||
4871 | 40 | |||
4872 | 41 | def test_quit(self): | ||
4873 | 42 | """Test the quit option in the menu.""" | ||
4874 | 43 | # Not done on setup, because if I patch stop | ||
4875 | 44 | # after instantiation, it doesn't get called. | ||
4876 | 45 | self.patch(TrayIcon, "stop", self._set_called) | ||
4877 | 46 | tray = TrayIcon() | ||
4878 | 47 | tray.quit.trigger() | ||
4879 | 48 | self.assertEqual(self._called, ((False,), {})) | ||
4880 | 49 | |||
4881 | 50 | def test_restore_no_window(self): | ||
4882 | 51 | """Test the restore window option in the menu, with no window.""" | ||
4883 | 52 | self.patch(ubuntuone.controlpanel.gui.qt.gui, | ||
4884 | 53 | "MainWindow", FakeMainWindow) | ||
4885 | 54 | tray = TrayIcon() | ||
4886 | 55 | self.assertEqual(tray.window, None) | ||
4887 | 56 | tray.restore.trigger() | ||
4888 | 57 | self.assertIsInstance(tray.window, FakeMainWindow) | ||
4889 | 58 | self.assertTrue(tray.window.isVisible()) | ||
4890 | 59 | self.assertEqual(tray.window.args, ((), | ||
4891 | 60 | {'close_callback': tray.delete_window})) | ||
4892 | 61 | |||
4893 | 62 | def test_activate(self): | ||
4894 | 63 | """Test the icon activation.""" | ||
4895 | 64 | tray = TrayIcon() | ||
4896 | 65 | window = FakeMainWindow() | ||
4897 | 66 | tray.window = window | ||
4898 | 67 | self.assertFalse(tray.window.isVisible()) | ||
4899 | 68 | tray.activated.emit(tray.Trigger) | ||
4900 | 69 | self.assertEqual(tray.window, window) | ||
4901 | 70 | self.assertTrue(tray.window.isVisible()) | ||
4902 | 71 | |||
4903 | 72 | def test_restore_window(self): | ||
4904 | 73 | """Test the restore window option in the menu, with a window.""" | ||
4905 | 74 | tray = TrayIcon() | ||
4906 | 75 | window = FakeMainWindow() | ||
4907 | 76 | tray.window = window | ||
4908 | 77 | self.assertFalse(tray.window.isVisible()) | ||
4909 | 78 | tray.restore.trigger() | ||
4910 | 79 | self.assertEqual(tray.window, window) | ||
4911 | 80 | self.assertTrue(tray.window.isVisible()) | ||
4912 | 81 | |||
4913 | 82 | def test_delete_window(self): | ||
4914 | 83 | """Test deleting an existing window.""" | ||
4915 | 84 | tray = TrayIcon() | ||
4916 | 85 | window = FakeMainWindow() | ||
4917 | 86 | tray.window = window | ||
4918 | 87 | tray.delete_window() | ||
4919 | 88 | self.assertEqual(tray.window, None) | ||
4920 | 89 | self.assertFalse(window.isVisible()) | ||
4921 | 90 | |||
4922 | 91 | def test_delete_no_window(self): | ||
4923 | 92 | """Test deleting without an existing window.""" | ||
4924 | 93 | tray = TrayIcon() | ||
4925 | 94 | tray.delete_window() | ||
4926 | 95 | self.assertEqual(tray.window, None) | ||
4927 | 96 | |||
4928 | 97 | def test_initialization(self): | ||
4929 | 98 | """Test that everything initializes correctly.""" | ||
4930 | 99 | tray = TrayIcon() | ||
4931 | 100 | self.assertTrue(tray.isVisible()) | ||
4932 | 101 | self.assertEqual(tray.window, None) | ||
4933 | 102 | self.assertIsInstance(tray.context_menu, QtGui.QMenu) | ||
4934 | 103 | self.assertFalse(tray.icon() == None) | ||
4935 | 0 | 104 | ||
4936 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_ubuntuonebin.py' | |||
4937 | --- ubuntuone/controlpanel/gui/qt/tests/test_ubuntuonebin.py 2011-07-22 21:26:48 +0000 | |||
4938 | +++ ubuntuone/controlpanel/gui/qt/tests/test_ubuntuonebin.py 2011-09-26 18:38:27 +0000 | |||
4939 | @@ -18,25 +18,24 @@ | |||
4940 | 18 | 18 | ||
4941 | 19 | """Tests for the Ubuntu One Bin.""" | 19 | """Tests for the Ubuntu One Bin.""" |
4942 | 20 | 20 | ||
4944 | 21 | from ubuntuone.devtools.testcase import skipIfOS | 21 | from twisted.internet import defer |
4945 | 22 | 22 | ||
4946 | 23 | from ubuntuone.controlpanel.gui.qt import ubuntuonebin as gui | 23 | from ubuntuone.controlpanel.gui.qt import ubuntuonebin as gui |
4948 | 24 | from ubuntuone.controlpanel.gui.qt.tests import BaseTestCase | 24 | from ubuntuone.controlpanel.gui.qt.tests import ( |
4949 | 25 | BaseTestCase, | ||
4950 | 26 | CrashyBackend, | ||
4951 | 27 | CrashyBackendException, | ||
4952 | 28 | ) | ||
4953 | 25 | 29 | ||
4954 | 26 | # Attribute 'yyy' defined outside __init__, access to a protected member | 30 | # Attribute 'yyy' defined outside __init__, access to a protected member |
4955 | 27 | # pylint: disable=W0201, W0212 | 31 | # pylint: disable=W0201, W0212 |
4956 | 28 | 32 | ||
4957 | 29 | 33 | ||
4958 | 30 | class UbuntuOneBinTestCase(BaseTestCase): | 34 | class UbuntuOneBinTestCase(BaseTestCase): |
4960 | 31 | """Test the qt cloud folders tab.""" | 35 | """Test the Ubuntu One base widget.""" |
4961 | 32 | 36 | ||
4962 | 33 | class_ui = gui.UbuntuOneBin | 37 | class_ui = gui.UbuntuOneBin |
4963 | 34 | 38 | ||
4964 | 35 | def test_backend(self): | ||
4965 | 36 | """Backend is created.""" | ||
4966 | 37 | self.assertIsInstance(self.ui.backend, | ||
4967 | 38 | gui.backend.ControlBackend) | ||
4968 | 39 | |||
4969 | 40 | def test_is_not_processing_after_creation(self): | 39 | def test_is_not_processing_after_creation(self): |
4970 | 41 | """After creation, is not processing.""" | 40 | """After creation, is not processing.""" |
4971 | 42 | self.assertFalse(self.ui.is_processing) | 41 | self.assertFalse(self.ui.is_processing) |
4972 | @@ -46,22 +45,33 @@ | |||
4973 | 46 | """The animation is active.""" | 45 | """The animation is active.""" |
4974 | 47 | self.assertFalse(self.ui.overlay.isVisible()) | 46 | self.assertFalse(self.ui.overlay.isVisible()) |
4975 | 48 | 47 | ||
4976 | 49 | @skipIfOS('win32', 'crashes under windows, see LP: #806154') | ||
4977 | 50 | def test_is_enabled_if_not_processing(self): | 48 | def test_is_enabled_if_not_processing(self): |
4978 | 51 | """If not processing, the UI is enabled.""" | 49 | """If not processing, the UI is enabled.""" |
4979 | 52 | self.ui.show() # need to show to test widgets visibility | 50 | self.ui.show() # need to show to test widgets visibility |
4980 | 51 | self.addCleanup(self.ui.hide) | ||
4981 | 53 | 52 | ||
4982 | 54 | self.ui.is_processing = False | 53 | self.ui.is_processing = False |
4983 | 55 | 54 | ||
4984 | 56 | self.assertTrue(self.ui.isEnabled()) | 55 | self.assertTrue(self.ui.isEnabled()) |
4985 | 57 | self.assertFalse(self.ui.overlay.isVisible()) | 56 | self.assertFalse(self.ui.overlay.isVisible()) |
4986 | 58 | 57 | ||
4987 | 59 | @skipIfOS('win32', 'crashes under windows, see LP: #806154') | ||
4988 | 60 | def test_is_not_enabled_if_processing(self): | 58 | def test_is_not_enabled_if_processing(self): |
4989 | 61 | """If processing, the UI is disabled.""" | 59 | """If processing, the UI is disabled.""" |
4990 | 62 | self.ui.show() # need to show to test widgets visibility | 60 | self.ui.show() # need to show to test widgets visibility |
4991 | 61 | self.addCleanup(self.ui.hide) | ||
4992 | 63 | 62 | ||
4993 | 64 | self.ui.is_processing = True | 63 | self.ui.is_processing = True |
4994 | 65 | 64 | ||
4995 | 66 | self.assertFalse(self.ui.isEnabled()) | 65 | self.assertFalse(self.ui.isEnabled()) |
4996 | 67 | self.assertTrue(self.ui.overlay.isVisible()) | 66 | self.assertTrue(self.ui.overlay.isVisible()) |
4997 | 67 | |||
4998 | 68 | @defer.inlineCallbacks | ||
4999 | 69 | def test_backend_error_is_handled(self): | ||
5000 | 70 | """Any error from the backend is properly handled.""" |
Thank you for your work