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
=== modified file 'ubuntuone/controlpanel/gui/qt/systray.py'
--- ubuntuone/controlpanel/gui/qt/systray.py 2012-03-02 13:53:24 +0000
+++ ubuntuone/controlpanel/gui/qt/systray.py 2012-05-14 20:19:19 +0000
@@ -60,6 +60,7 @@
60 # pylint: enable=W040460 # pylint: enable=W0404
61 self.window = MainWindow(close_callback=self.delete_window)61 self.window = MainWindow(close_callback=self.delete_window)
62 self.window.show()62 self.window.show()
63 self.window.activateWindow()
6364
64 def delete_window(self):65 def delete_window(self):
65 """Close and remove the main window."""66 """Close and remove the main window."""
6667
=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_systray.py'
--- ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2012-02-06 21:10:10 +0000
+++ ubuntuone/controlpanel/gui/qt/tests/test_systray.py 2012-05-14 20:19:19 +0000
@@ -100,6 +100,18 @@
100 self.assertEqual(tray.window, window)100 self.assertEqual(tray.window, window)
101 self.assertTrue(tray.window.isVisible())101 self.assertTrue(tray.window.isVisible())
102102
103 def test_restore_window_minimized(self):
104 """Test the restore window option in the menu, with a min. window."""
105 tray = systray.TrayIcon()
106 window = FakeMainWindow()
107 # This cannot be tested with the real activateWindow
108 # because the un-minimization is done by the WM, so
109 # it has a small delay, and it fails.
110 self.patch(window, "activateWindow", self._set_called)
111 tray.window = window
112 tray.restore.trigger()
113 self.assertEqual(self._called, ((), {}))
114
103 def test_delete_window(self):115 def test_delete_window(self):
104 """Test deleting an existing window."""116 """Test deleting an existing window."""
105 tray = systray.TrayIcon()117 tray = systray.TrayIcon()

Subscribers

People subscribed via source and target branches