Merge lp:~ralsina/ubuntuone-control-panel/fix-865688 into lp:ubuntuone-control-panel

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 322
Merged at revision: 321
Proposed branch: lp:~ralsina/ubuntuone-control-panel/fix-865688
Merge into: lp:ubuntuone-control-panel
Diff against target: 34 lines (+13/-0)
2 files modified
ubuntuone/controlpanel/gui/qt/systray.py (+1/-0)
ubuntuone/controlpanel/gui/qt/tests/test_systray.py (+12/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/fix-865688
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+105713@code.launchpad.net

Commit message

 - Restore minimized windows from the tray (Fixes LP:865688).

Description of the change

To test IRL:

PYTHONPATH=. ./bin/ubuntuone-control-panel-qt --with-icon

Minimize the control panel window

Right-click on the tray icon -> restore

The window should show itself again.

If you can't see the tray icon, install sni-qt or, whitelist the tray, or try it on windows ;-)

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Works for me on Windows.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/systray.py'
2--- ubuntuone/controlpanel/gui/qt/systray.py 2012-03-02 13:53:24 +0000
3+++ ubuntuone/controlpanel/gui/qt/systray.py 2012-05-14 20:19:19 +0000
4@@ -60,6 +60,7 @@
5 # pylint: enable=W0404
6 self.window = MainWindow(close_callback=self.delete_window)
7 self.window.show()
8+ self.window.activateWindow()
9
10 def delete_window(self):
11 """Close and remove the main window."""
12
13=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_systray.py'
14--- ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2012-02-06 21:10:10 +0000
15+++ ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2012-05-14 20:19:19 +0000
16@@ -100,6 +100,18 @@
17 self.assertEqual(tray.window, window)
18 self.assertTrue(tray.window.isVisible())
19
20+ def test_restore_window_minimized(self):
21+ """Test the restore window option in the menu, with a min. window."""
22+ tray = systray.TrayIcon()
23+ window = FakeMainWindow()
24+ # This cannot be tested with the real activateWindow
25+ # because the un-minimization is done by the WM, so
26+ # it has a small delay, and it fails.
27+ self.patch(window, "activateWindow", self._set_called)
28+ tray.window = window
29+ tray.restore.trigger()
30+ self.assertEqual(self._called, ((), {}))
31+
32 def test_delete_window(self):
33 """Test deleting an existing window."""
34 tray = systray.TrayIcon()

Subscribers

People subscribed via source and target branches