Merge lp:~dobey/ubuntuone-control-panel/update-4-0 into lp:ubuntuone-control-panel/stable-4-0

Proposed by dobey on 2012-07-18
Status: Merged
Approved by: dobey on 2012-07-19
Approved revision: no longer in the source branch.
Merged at revision: 332
Proposed branch: lp:~dobey/ubuntuone-control-panel/update-4-0
Merge into: lp:ubuntuone-control-panel/stable-4-0
Diff against target: 135 lines (+53/-6)
5 files modified
bin/ubuntuone-control-panel-qt (+2/-2)
ubuntuone/controlpanel/gui/qt/gui.py (+4/-3)
ubuntuone/controlpanel/gui/qt/main/__init__.py (+13/-1)
ubuntuone/controlpanel/gui/qt/main/tests/test_main.py (+33/-0)
ubuntuone/controlpanel/gui/qt/tests/test_start.py (+1/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-control-panel/update-4-0
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) trivial 2012-07-18 Approve on 2012-07-18
Review via email: mp+115607@code.launchpad.net

Commit Message

[Mike McCracken]

    - Call raise_() after show() to ensure the window is brought to the front on darwin. (LP: #1018614)
    - On Darwin, install qt4reactor after QApplication is created. (LP: #1015825)

[Diego Sarmentero]

    - Replacing side widget logo (LP: #1020187).

To post a comment you must log in.
Alejandro J. Cura (alecu) wrote :

+1

review: Approve (trivial)
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (252.9 KiB)

The attempt to merge lp:~dobey/ubuntuone-control-panel/update-4-0 into lp:ubuntuone-control-panel/stable-4-0 failed. Below is the output from the failed tests.

*** Running DBus test suite ***
ubuntuone.controlpanel.dbustests.test_dbus_service
  BaseTestCase
    runTest ... [OK]
  DBusServiceMainTestCase
    test_dbus_service_cant_register ... Control panel backend already running.
                                   [OK]
    test_dbus_service_main ... [OK]
  DBusServiceTestCase
    test_cant_register_twice ... [SKIPPED]
    test_dbus_busname_created ... [OK]
    test_error_handler_default ... [OK]
    test_error_handler_with_exception ... [OK]
    test_error_handler_with_failure ... [OK]
    test_error_handler_with_non_string_dict ... [OK]
    test_error_handler_with_string_dict ... [OK]
    test_register_service ... [OK]
  FileSyncTestCase
    test_file_sync_status_changed ... [OK]
    test_file_sync_status_disabled ... [OK]
    test_file_sync_status_disconnected ... [OK]
    test_file_sync_status_error ... [OK]
    test_file_sync_status_idle ... [OK]
    test_file_sync_status_starting ... [OK]
    test_file_sync_status_stopped ... [OK]
    test_file_sync_status_syncing ... [OK]
    test_file_sync_status_unknown ... [OK]
    test_status_changed_handler ... [OK]
    test_status_changed_handler_after_status_requested ... [OK]
    test_status_changed_handler_after_status_requested_twice ... [OK]
  OperationsAuthErrorTestCase
    test_account_info_returned ... [OK]
    test_change_device_settings ... [OK]
    test_change_replication_settings ... [OK]
    test_change_volume_settings ... [OK]
    test_connect_files ... [OK]
    test_devices_info_returned ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_remove_device ... [OK]
    test_replications_info ... [OK]
    test_restart_files ... [OK]
    t...

332. By Diego Sarmentero on 2012-07-19

[Mike McCracken]

    - Call raise_() after show() to ensure the window is brought to the front on darwin. (LP: #1018614)
    - On Darwin, install qt4reactor after QApplication is created. (LP: #1015825)

[Diego Sarmentero]

    - Replacing side widget logo (LP: #1020187).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-control-panel-qt'
2--- bin/ubuntuone-control-panel-qt 2012-06-15 21:28:44 +0000
3+++ bin/ubuntuone-control-panel-qt 2012-07-18 19:11:24 +0000
4@@ -22,7 +22,7 @@
5 import signal
6 import sys
7
8-if sys.platform in ('win32', 'darwin'):
9+if sys.platform == 'win32':
10 import qt4reactor
11 qt4reactor.install()
12
13@@ -31,4 +31,4 @@
14
15 if __name__ == "__main__":
16 signal.signal(signal.SIGINT, signal.SIG_DFL)
17- main.main(sys.argv)
18+ main.main(sys.argv, install_reactor_darwin=True)
19
20=== modified file 'data/logo.png'
21Binary files data/logo.png 2012-02-29 21:33:02 +0000 and data/logo.png 2012-07-18 19:11:24 +0000 differ
22=== modified file 'ubuntuone/controlpanel/gui/qt/gui.py'
23--- ubuntuone/controlpanel/gui/qt/gui.py 2012-06-15 22:09:46 +0000
24+++ ubuntuone/controlpanel/gui/qt/gui.py 2012-07-18 19:11:24 +0000
25@@ -119,14 +119,15 @@
26 window = MainWindow(installer=installer)
27 else:
28 window = MainWindow(close_callback=close_callback,
29- installer=installer)
30+ installer=installer)
31 app = QtGui.QApplication.instance()
32 style = QtGui.QStyle.alignedRect(
33- QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,
34- window.size(), app.desktop().availableGeometry())
35+ QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,
36+ window.size(), app.desktop().availableGeometry())
37 window.setGeometry(style)
38 window.check_updates()
39 window.show()
40+ window.raise_()
41 else:
42 window = None
43 if with_icon or minimized:
44
45=== modified file 'ubuntuone/controlpanel/gui/qt/main/__init__.py'
46--- ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-06-15 22:02:39 +0000
47+++ ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-07-18 19:11:24 +0000
48@@ -61,7 +61,13 @@
49 return result
50
51
52-def main(args):
53+def install_qt4reactor():
54+ """Import and install the qt4reactor."""
55+ import qt4reactor
56+ qt4reactor.install()
57+
58+
59+def main(args, install_reactor_darwin=False):
60 """Start the Qt mainloop and open the main window."""
61 # The following cannot be imported outside this function
62 # because u1trial already provides a reactor.
63@@ -69,6 +75,12 @@
64 args = ['ubuntuone-installer'] + args
65 app = UniqueApplication(args, "ubuntuone-control-panel")
66
67+ # on darwin, must install qt4reactor after UniqueApplication init.
68+ # otherwise qt4reactor will create a QCoreApplication for us,
69+ # instead of the QApplication we need
70+ if install_reactor_darwin and sys.platform == 'darwin':
71+ install_qt4reactor()
72+
73 # Install translator for standard dialogs.
74 locale = unicode(QtCore.QLocale.system().name())
75 translator = QtCore.QTranslator()
76
77=== modified file 'ubuntuone/controlpanel/gui/qt/main/tests/test_main.py'
78--- ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-05-14 22:30:47 +0000
79+++ ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-07-18 19:11:24 +0000
80@@ -130,6 +130,15 @@
81 self.patch(main.source, "main_start", lambda app: None)
82 self.patch(QtCore, "QTranslator", lambda: self.translator)
83
84+ self.qt4reactor_installed = False
85+
86+ def fake_install_qt4reactor():
87+ """Record the install without importing."""
88+ self.qt4reactor_installed = True
89+
90+ self.patch(main, "install_qt4reactor",
91+ fake_install_qt4reactor)
92+
93 def test_wm_class(self):
94 """Test that we set the 1st argument, used for WM_CLASS, correctly."""
95 main.main([sys.argv[0]])
96@@ -200,3 +209,27 @@
97 main.main([sys.argv[0]])
98 self.assertEqual(self.app.new_instance.target,
99 self.start.window.raise_)
100+
101+ def test_darwin_installs_qt4reactor(self):
102+ """Ensure the qt4 reactor is installed when requested."""
103+ self.patch(sys, 'platform', 'darwin')
104+ main.main([sys.argv[0]], install_reactor_darwin=True)
105+ self.assertEqual(self.qt4reactor_installed, True)
106+
107+ def test_darwin_doesnt_install_qt4reactor(self):
108+ """Ensure the qt4 reactor isn't installed by default."""
109+ self.patch(sys, 'platform', 'darwin')
110+ main.main([sys.argv[0]])
111+ self.assertEqual(self.qt4reactor_installed, False)
112+
113+ def test_nondarwin_ignores_true_install_flag(self):
114+ """Ensure the qt4 reactor isn't installed on non-darwin."""
115+ self.patch(sys, 'platform', 'not-darwin')
116+ main.main([sys.argv[0]], install_reactor_darwin=True)
117+ self.assertEqual(self.qt4reactor_installed, False)
118+
119+ def test_nondarwin_ignores_false_install_flag(self):
120+ """Ensure the qt4 reactor isn't installed on non-darwin."""
121+ self.patch(sys, 'platform', 'not-darwin')
122+ main.main([sys.argv[0]], install_reactor_darwin=False)
123+ self.assertEqual(self.qt4reactor_installed, False)
124
125=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_start.py'
126--- ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-06-15 22:23:19 +0000
127+++ ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-07-18 19:11:24 +0000
128@@ -31,6 +31,7 @@
129 shown = False
130 size = lambda *a: gui.QtCore.QSize(123456, 654321)
131 style = None
132+ raise_ = lambda self: None
133
134 def __init__(self):
135 self.args = []

Subscribers

People subscribed via source and target branches

to all changes: