Merge lp:~mikemc/ubuntuone-control-panel/fix-1018614-darwin-raise into lp:ubuntuone-control-panel

Proposed by Mike McCracken on 2012-06-28
Status: Merged
Approved by: Mike McCracken on 2012-07-05
Approved revision: 338
Merged at revision: 337
Proposed branch: lp:~mikemc/ubuntuone-control-panel/fix-1018614-darwin-raise
Merge into: lp:ubuntuone-control-panel
Diff against target: 34 lines (+5/-3)
2 files modified
ubuntuone/controlpanel/gui/qt/gui.py (+4/-3)
ubuntuone/controlpanel/gui/qt/tests/test_start.py (+1/-0)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-control-panel/fix-1018614-darwin-raise
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) 2012-06-28 Approve on 2012-06-28
Brian Curtin (community) Approve on 2012-06-28
Roberto Alsina (community) Approve on 2012-06-28
Review via email: mp+112493@code.launchpad.net

Commit Message

- Call raise_() after show() to ensure the window is brought to the front on darwin. (LP: #1018614)

Description of the Change

- Call raise_() after show() to ensure the window is brought to the front on darwin. (LP: #1018614)

To post a comment you must log in.
Manuel de la Peña (mandel) wrote :

Can we add a test in which we assert that raise is not called in anything but darwin. You can patch the sys.platform used in gui.py to return darwin or order according to the test.

review: Needs Fixing
Roberto Alsina (ralsina) wrote :

I think calling raise_ doesn't hurt in any platorm, so we may just get rid of the if.

Of course, someone needs to test that :)

Mike McCracken (mikemc) wrote :

Changed to call raise_ on every platform as Roberto suggested.
Verified on ubuntu and windows that it still works as expected.
On those platforms it should be unnecessary but doesn't hurt.

Roberto Alsina (ralsina) :
review: Approve
Brian Curtin (brian.curtin) wrote :

Looks alright to me.

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

The attempt to merge lp:~mikemc/ubuntuone-control-panel/fix-1018614-darwin-raise into lp:ubuntuone-control-panel 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]
 ...

338. By Mike McCracken on 2012-07-05

fix pep8 complaints

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/gui.py'
2--- ubuntuone/controlpanel/gui/qt/gui.py 2012-06-15 22:09:46 +0000
3+++ ubuntuone/controlpanel/gui/qt/gui.py 2012-07-05 16:45:22 +0000
4@@ -119,14 +119,15 @@
5 window = MainWindow(installer=installer)
6 else:
7 window = MainWindow(close_callback=close_callback,
8- installer=installer)
9+ installer=installer)
10 app = QtGui.QApplication.instance()
11 style = QtGui.QStyle.alignedRect(
12- QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,
13- window.size(), app.desktop().availableGeometry())
14+ QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,
15+ window.size(), app.desktop().availableGeometry())
16 window.setGeometry(style)
17 window.check_updates()
18 window.show()
19+ window.raise_()
20 else:
21 window = None
22 if with_icon or minimized:
23
24=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_start.py'
25--- ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-06-15 22:23:19 +0000
26+++ ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-07-05 16:45:22 +0000
27@@ -31,6 +31,7 @@
28 shown = False
29 size = lambda *a: gui.QtCore.QSize(123456, 654321)
30 style = None
31+ raise_ = lambda self: None
32
33 def __init__(self):
34 self.args = []

Subscribers

People subscribed via source and target branches