Merge lp:~nataliabidart/ubuntu/precise/ubuntuone-control-panel/ubuntuone-control-panel-2.99.1 into lp:ubuntu/precise/ubuntuone-control-panel
- Precise (12.04)
- ubuntuone-control-panel-2.99.1
- Merge into precise
Proposed by
Natalia Bidart
Status: | Merged |
---|---|
Merged at revision: | 37 |
Proposed branch: | lp:~nataliabidart/ubuntu/precise/ubuntuone-control-panel/ubuntuone-control-panel-2.99.1 |
Merge into: | lp:ubuntu/precise/ubuntuone-control-panel |
Diff against target: |
387 lines (+161/-116) 9 files modified
PKG-INFO (+1/-1) debian/changelog (+9/-0) debian/control (+6/-6) debian/watch (+1/-1) setup.py (+1/-1) ubuntuone/controlpanel/gui/qt/addfolder.py (+2/-1) ubuntuone/controlpanel/gui/qt/systray.py (+14/-3) ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py (+1/-0) ubuntuone/controlpanel/gui/qt/tests/test_systray.py (+126/-103) |
To merge this branch: | bzr merge lp:~nataliabidart/ubuntu/precise/ubuntuone-control-panel/ubuntuone-control-panel-2.99.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Sponsors | Pending | ||
Review via email: mp+87406@code.launchpad.net |
Commit message
Description of the change
- Updating debian/watch to download from latest milestone.
- New upstream release.
To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'PKG-INFO' |
2 | --- PKG-INFO 2011-12-20 18:12:36 +0000 |
3 | +++ PKG-INFO 2012-01-03 19:53:28 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | Metadata-Version: 1.1 |
6 | Name: ubuntuone-control-panel |
7 | -Version: 2.99.0 |
8 | +Version: 2.99.1 |
9 | Summary: Ubuntu One Control Panel |
10 | Home-page: https://launchpad.net/ubuntuone-control-panel |
11 | Author: Natalia Bidart |
12 | |
13 | === modified file 'debian/changelog' |
14 | --- debian/changelog 2011-12-23 21:39:56 +0000 |
15 | +++ debian/changelog 2012-01-03 19:53:28 +0000 |
16 | @@ -1,3 +1,12 @@ |
17 | +ubuntuone-control-panel (2.99.1-0ubuntu1) UNRELEASED; urgency=low |
18 | + |
19 | + * New upstream release. |
20 | + * debian/control: update ubuntu-sso-client and ubuntuone-client dependencies |
21 | + to 2.99.1. |
22 | + * debian/watch: download from latest milestone. |
23 | + |
24 | + -- Natalia Bidart (nessita) <natalia.bidart@canonical.com> Tue, 03 Jan 2012 16:04:20 -0300 |
25 | + |
26 | ubuntuone-control-panel (2.99.0-0ubuntu1) precise; urgency=low |
27 | |
28 | [ Natalia Bidart (nessita) ] |
29 | |
30 | === modified file 'debian/control' |
31 | --- debian/control 2011-12-20 18:59:29 +0000 |
32 | +++ debian/control 2012-01-03 19:53:28 +0000 |
33 | @@ -17,7 +17,7 @@ |
34 | ${python:Depends}, |
35 | python, |
36 | python-ubuntuone-control-panel (= ${binary:Version}), |
37 | - ubuntuone-client (>= 2.99.0), |
38 | + ubuntuone-client (>= 2.99.1), |
39 | Recommends: ubuntuone-control-panel-gui |
40 | Description: Ubuntu One Control Panel |
41 | Desktop application to manage an Ubuntu One account. |
42 | @@ -37,8 +37,8 @@ |
43 | python-simplejson, |
44 | python-twisted-core, |
45 | python-twisted-web, |
46 | - python-ubuntuone-client (>= 2.99.0), |
47 | - ubuntu-sso-client (>= 2.99.0), |
48 | + python-ubuntuone-client (>= 2.99.1), |
49 | + ubuntu-sso-client (>= 2.99.1), |
50 | Description: Ubuntu One Control Panel Python Libraries |
51 | Ubuntu One Control Panel provides a Python library to manage an Ubuntu One |
52 | account. |
53 | @@ -55,9 +55,9 @@ |
54 | python-defer | python-aptdaemon, |
55 | python-gobject (>= 2.21.5), |
56 | python-gtk2, |
57 | - python-ubuntuone-client (>= 2.99.0), |
58 | - ubuntu-sso-client (>= 2.99.0), |
59 | - ubuntuone-client (>= 2.99.0), |
60 | + python-ubuntuone-client (>= 2.99.1), |
61 | + ubuntu-sso-client (>= 2.99.1), |
62 | + ubuntuone-client (>= 2.99.1), |
63 | ubuntuone-control-panel (= ${binary:Version}), |
64 | ubuntuone-installer (>= 2.0.0), |
65 | Provides: ubuntuone-control-panel-gui |
66 | |
67 | === modified file 'debian/watch' |
68 | --- debian/watch 2011-12-20 18:11:41 +0000 |
69 | +++ debian/watch 2012-01-03 19:53:28 +0000 |
70 | @@ -1,2 +1,2 @@ |
71 | version=3 |
72 | -http://launchpad.net/ubuntuone-control-panel/stable-3-0/2.99.0 .*/ubuntuone-control-panel-([0-9.]+)\.tar\.gz |
73 | +http://launchpad.net/ubuntuone-control-panel/stable-3-0/2.99.1 .*/ubuntuone-control-panel-([0-9.]+)\.tar\.gz |
74 | |
75 | === modified file 'setup.py' |
76 | --- setup.py 2011-12-20 18:12:36 +0000 |
77 | +++ setup.py 2012-01-03 19:53:28 +0000 |
78 | @@ -229,7 +229,7 @@ |
79 | |
80 | DistUtilsExtra.auto.setup( |
81 | name='ubuntuone-control-panel', |
82 | - version='2.99.0', |
83 | + version='2.99.1', |
84 | license='GPL v3', |
85 | author='Natalia Bidart', |
86 | author_email='natalia.bidart@canonical.com', |
87 | |
88 | === modified file 'ubuntuone/controlpanel/gui/qt/addfolder.py' |
89 | --- ubuntuone/controlpanel/gui/qt/addfolder.py 2011-09-26 17:47:13 +0000 |
90 | +++ ubuntuone/controlpanel/gui/qt/addfolder.py 2012-01-03 19:53:28 +0000 |
91 | @@ -57,7 +57,8 @@ |
92 | """The 'Sync another folder' button was clicked.""" |
93 | # The options argument is because of LP: #835013 |
94 | folder = QtGui.QFileDialog.getExistingDirectory( |
95 | - parent=self, options=QtGui.QFileDialog.DontUseNativeDialog) |
96 | + parent=self, directory=os.path.expanduser('~'), |
97 | + options=QtGui.QFileDialog.DontUseNativeDialog) |
98 | folder = unicode(QtCore.QDir.toNativeSeparators(folder)) |
99 | logger.debug('on_add_folder_button_clicked: user requested folder ' |
100 | 'creation for path %r', folder) |
101 | |
102 | === modified file 'ubuntuone/controlpanel/gui/qt/systray.py' |
103 | --- ubuntuone/controlpanel/gui/qt/systray.py 2011-09-26 17:47:13 +0000 |
104 | +++ ubuntuone/controlpanel/gui/qt/systray.py 2012-01-03 19:53:28 +0000 |
105 | @@ -1,6 +1,4 @@ |
106 | # -*- coding: utf-8 -*- |
107 | - |
108 | -# Authors: Roberto Alsina <roberto.alsina@canonical.com> |
109 | # |
110 | # Copyright 2011 Canonical Ltd. |
111 | # |
112 | @@ -18,6 +16,9 @@ |
113 | """System notification area icon.""" |
114 | |
115 | from PyQt4 import QtGui |
116 | +from twisted.internet.defer import inlineCallbacks |
117 | + |
118 | +from ubuntuone.platform.tools import SyncDaemonTool |
119 | |
120 | |
121 | class TrayIcon(QtGui.QSystemTrayIcon): |
122 | @@ -60,8 +61,18 @@ |
123 | self.window.close() |
124 | self.window = None |
125 | |
126 | - def stop(self): |
127 | + @inlineCallbacks |
128 | + def stop(self, *args, **kwargs): |
129 | """Stop the application.""" |
130 | + # Stop syncdaemon |
131 | + # pylint: disable=W0702 |
132 | + # Really, if it fails we can't do anything about it. |
133 | + try: |
134 | + st = SyncDaemonTool() |
135 | + yield st.quit() |
136 | + except: |
137 | + # Maybe it was not running? |
138 | + pass |
139 | # pylint: disable=W0404 |
140 | from twisted.internet import reactor |
141 | # pylint: enable=W0404 |
142 | |
143 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py' |
144 | --- ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py 2011-12-20 18:12:36 +0000 |
145 | +++ ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py 2012-01-03 19:53:28 +0000 |
146 | @@ -83,6 +83,7 @@ |
147 | self.assertEqual(FakedFileDialog.args, ()) |
148 | self.assertEqual(FakedFileDialog.kwargs, { |
149 | 'options': gui.QtGui.QFileDialog.DontUseNativeDialog, |
150 | + 'directory': os.path.expanduser('~'), |
151 | 'parent': self.ui, |
152 | }) |
153 | |
154 | |
155 | === modified file 'ubuntuone/controlpanel/gui/qt/tests/test_systray.py' |
156 | --- ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2011-09-26 17:47:13 +0000 |
157 | +++ ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2012-01-03 19:53:28 +0000 |
158 | @@ -1,103 +1,126 @@ |
159 | -# -*- coding: utf-8 -*- |
160 | - |
161 | -# Author: Roberto Alsina <roberto.alsina@canonical.com> |
162 | -# |
163 | -# Copyright 2011 Canonical Ltd. |
164 | -# |
165 | -# This program is free software: you can redistribute it and/or modify it |
166 | -# under the terms of the GNU General Public License version 3, as published |
167 | -# by the Free Software Foundation. |
168 | -# |
169 | -# This program is distributed in the hope that it will be useful, but |
170 | -# WITHOUT ANY WARRANTY; without even the implied warranties of |
171 | -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
172 | -# PURPOSE. See the GNU General Public License for more details. |
173 | -# |
174 | -# You should have received a copy of the GNU General Public License along |
175 | -# with this program. If not, see <http://www.gnu.org/licenses/>. |
176 | - |
177 | -"""Tests for the notification area icon.""" |
178 | - |
179 | -from PyQt4 import QtGui |
180 | - |
181 | -from ubuntuone.controlpanel.gui.qt.systray import TrayIcon |
182 | -from ubuntuone.controlpanel.tests import TestCase |
183 | -import ubuntuone.controlpanel.gui.qt.gui |
184 | - |
185 | - |
186 | -class FakeMainWindow(QtGui.QWidget): |
187 | - |
188 | - """Fake Main Window.""" |
189 | - |
190 | - def __init__(self, *args, **kwargs): |
191 | - self.args = (args, kwargs) |
192 | - super(FakeMainWindow, self).__init__() |
193 | - |
194 | - |
195 | -class SystrayTestCase(TestCase): |
196 | - |
197 | - """Test the notification area icon.""" |
198 | - |
199 | - def test_quit(self): |
200 | - """Test the quit option in the menu.""" |
201 | - # Not done on setup, because if I patch stop |
202 | - # after instantiation, it doesn't get called. |
203 | - self.patch(TrayIcon, "stop", self._set_called) |
204 | - tray = TrayIcon() |
205 | - tray.quit.trigger() |
206 | - self.assertEqual(self._called, ((False,), {})) |
207 | - |
208 | - def test_restore_no_window(self): |
209 | - """Test the restore window option in the menu, with no window.""" |
210 | - self.patch(ubuntuone.controlpanel.gui.qt.gui, |
211 | - "MainWindow", FakeMainWindow) |
212 | - tray = TrayIcon() |
213 | - self.assertEqual(tray.window, None) |
214 | - tray.restore.trigger() |
215 | - self.assertIsInstance(tray.window, FakeMainWindow) |
216 | - self.assertTrue(tray.window.isVisible()) |
217 | - self.assertEqual(tray.window.args, ((), |
218 | - {'close_callback': tray.delete_window})) |
219 | - |
220 | - def test_activate(self): |
221 | - """Test the icon activation.""" |
222 | - tray = TrayIcon() |
223 | - window = FakeMainWindow() |
224 | - tray.window = window |
225 | - self.assertFalse(tray.window.isVisible()) |
226 | - tray.activated.emit(tray.Trigger) |
227 | - self.assertEqual(tray.window, window) |
228 | - self.assertTrue(tray.window.isVisible()) |
229 | - |
230 | - def test_restore_window(self): |
231 | - """Test the restore window option in the menu, with a window.""" |
232 | - tray = TrayIcon() |
233 | - window = FakeMainWindow() |
234 | - tray.window = window |
235 | - self.assertFalse(tray.window.isVisible()) |
236 | - tray.restore.trigger() |
237 | - self.assertEqual(tray.window, window) |
238 | - self.assertTrue(tray.window.isVisible()) |
239 | - |
240 | - def test_delete_window(self): |
241 | - """Test deleting an existing window.""" |
242 | - tray = TrayIcon() |
243 | - window = FakeMainWindow() |
244 | - tray.window = window |
245 | - tray.delete_window() |
246 | - self.assertEqual(tray.window, None) |
247 | - self.assertFalse(window.isVisible()) |
248 | - |
249 | - def test_delete_no_window(self): |
250 | - """Test deleting without an existing window.""" |
251 | - tray = TrayIcon() |
252 | - tray.delete_window() |
253 | - self.assertEqual(tray.window, None) |
254 | - |
255 | - def test_initialization(self): |
256 | - """Test that everything initializes correctly.""" |
257 | - tray = TrayIcon() |
258 | - self.assertTrue(tray.isVisible()) |
259 | - self.assertEqual(tray.window, None) |
260 | - self.assertIsInstance(tray.context_menu, QtGui.QMenu) |
261 | - self.assertFalse(tray.icon() == None) |
262 | +# -*- coding: utf-8 -*- |
263 | + |
264 | +# Author: Roberto Alsina <roberto.alsina@canonical.com> |
265 | +# |
266 | +# Copyright 2011 Canonical Ltd. |
267 | +# |
268 | +# This program is free software: you can redistribute it and/or modify it |
269 | +# under the terms of the GNU General Public License version 3, as published |
270 | +# by the Free Software Foundation. |
271 | +# |
272 | +# This program is distributed in the hope that it will be useful, but |
273 | +# WITHOUT ANY WARRANTY; without even the implied warranties of |
274 | +# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
275 | +# PURPOSE. See the GNU General Public License for more details. |
276 | +# |
277 | +# You should have received a copy of the GNU General Public License along |
278 | +# with this program. If not, see <http://www.gnu.org/licenses/>. |
279 | + |
280 | +"""Tests for the notification area icon.""" |
281 | + |
282 | +from PyQt4 import QtGui |
283 | +from twisted.internet import reactor |
284 | +from twisted.internet.defer import inlineCallbacks |
285 | + |
286 | +from ubuntuone.controlpanel.gui.qt import systray |
287 | +from ubuntuone.controlpanel.tests import TestCase |
288 | +import ubuntuone.controlpanel.gui.qt.gui |
289 | + |
290 | + |
291 | +class FakeSDTool(object): |
292 | + |
293 | + """Fake SyncDaemonTool.""" |
294 | + |
295 | + called = False |
296 | + |
297 | + def quit(self): |
298 | + """Fake quit.""" |
299 | + self.called = True |
300 | + |
301 | + |
302 | +class FakeMainWindow(QtGui.QWidget): |
303 | + |
304 | + """Fake Main Window.""" |
305 | + |
306 | + def __init__(self, *args, **kwargs): |
307 | + self.args = (args, kwargs) |
308 | + super(FakeMainWindow, self).__init__() |
309 | + |
310 | + |
311 | +class SystrayTestCase(TestCase): |
312 | + |
313 | + """Test the notification area icon.""" |
314 | + |
315 | + def test_quit(self): |
316 | + """Test the quit option in the menu.""" |
317 | + # Not done on setup, because if I patch stop |
318 | + # after instantiation, it doesn't get called. |
319 | + self.patch(systray.TrayIcon, "stop", self._set_called) |
320 | + tray = systray.TrayIcon() |
321 | + tray.quit.trigger() |
322 | + self.assertEqual(self._called, ((False,), {})) |
323 | + |
324 | + @inlineCallbacks |
325 | + def test_stop_sd(self): |
326 | + """Quit should call SyncDaemonTool.quit().""" |
327 | + st = FakeSDTool() |
328 | + self.patch(systray, "SyncDaemonTool", lambda: st) |
329 | + self.patch(reactor, "stop", lambda: None) |
330 | + tray = systray.TrayIcon() |
331 | + yield tray.stop() |
332 | + self.assertTrue(st.called) |
333 | + |
334 | + def test_restore_no_window(self): |
335 | + """Test the restore window option in the menu, with no window.""" |
336 | + self.patch(ubuntuone.controlpanel.gui.qt.gui, |
337 | + "MainWindow", FakeMainWindow) |
338 | + tray = systray.TrayIcon() |
339 | + self.assertEqual(tray.window, None) |
340 | + tray.restore.trigger() |
341 | + self.assertIsInstance(tray.window, FakeMainWindow) |
342 | + self.assertTrue(tray.window.isVisible()) |
343 | + self.assertEqual(tray.window.args, ((), |
344 | + {'close_callback': tray.delete_window})) |
345 | + |
346 | + def test_activate(self): |
347 | + """Test the icon activation.""" |
348 | + tray = systray.TrayIcon() |
349 | + window = FakeMainWindow() |
350 | + tray.window = window |
351 | + self.assertFalse(tray.window.isVisible()) |
352 | + tray.activated.emit(tray.Trigger) |
353 | + self.assertEqual(tray.window, window) |
354 | + self.assertTrue(tray.window.isVisible()) |
355 | + |
356 | + def test_restore_window(self): |
357 | + """Test the restore window option in the menu, with a window.""" |
358 | + tray = systray.TrayIcon() |
359 | + window = FakeMainWindow() |
360 | + tray.window = window |
361 | + self.assertFalse(tray.window.isVisible()) |
362 | + tray.restore.trigger() |
363 | + self.assertEqual(tray.window, window) |
364 | + self.assertTrue(tray.window.isVisible()) |
365 | + |
366 | + def test_delete_window(self): |
367 | + """Test deleting an existing window.""" |
368 | + tray = systray.TrayIcon() |
369 | + window = FakeMainWindow() |
370 | + tray.window = window |
371 | + tray.delete_window() |
372 | + self.assertEqual(tray.window, None) |
373 | + self.assertFalse(window.isVisible()) |
374 | + |
375 | + def test_delete_no_window(self): |
376 | + """Test deleting without an existing window.""" |
377 | + tray = systray.TrayIcon() |
378 | + tray.delete_window() |
379 | + self.assertEqual(tray.window, None) |
380 | + |
381 | + def test_initialization(self): |
382 | + """Test that everything initializes correctly.""" |
383 | + tray = systray.TrayIcon() |
384 | + self.assertTrue(tray.isVisible()) |
385 | + self.assertEqual(tray.window, None) |
386 | + self.assertIsInstance(tray.context_menu, QtGui.QMenu) |
387 | + self.assertFalse(tray.icon() == None) |
Thank you for your work!