Merge lp:~thisfred/ubuntuone-control-panel/attention-seeking into lp:ubuntuone-control-panel

Proposed by Eric Casteleijn on 2011-03-03
Status: Merged
Approved by: Eric Casteleijn on 2011-03-07
Approved revision: 99
Merged at revision: 94
Proposed branch: lp:~thisfred/ubuntuone-control-panel/attention-seeking
Merge into: lp:ubuntuone-control-panel
Diff against target: 48 lines (+12/-4)
2 files modified
bin/ubuntuone-control-panel-gtk (+4/-2)
ubuntuone/controlpanel/gtk/gui.py (+8/-2)
To merge this branch: bzr merge lp:~thisfred/ubuntuone-control-panel/attention-seeking
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2011-03-07
Natalia Bidart 2011-03-03 Approve on 2011-03-04
Review via email: mp+52131@code.launchpad.net

Commit message

Adds a command line option (--alert) to open the window with an urgency hint

Description of the change

Adds a command line option (--alert) to open the window with an urgency hint

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

The --alert option should be a boolean option. Right now, I can't use it without an explicit argument:

ubuntuone-control-panel-gtk: error: --alert option requires an argument
nessita@dali:~/canonical/u1/cp/review_attention-seeking$ DEBUG=True PYTHONPATH=. ./bin/ubuntuone-control-panel-gtk --alert
Usage: ubuntuone-control-panel-gtk [option]

ubuntuone-control-panel-gtk: error: --alert option requires an argument

Can you please fix that?

review: Needs Fixing
Eric Casteleijn (thisfred) wrote :

Fixed in r98

Natalia Bidart (nataliabidart) wrote :

Here we go!

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

The attempt to merge lp:~thisfred/ubuntuone-control-panel/attention-seeking into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

Running test suite for ubuntuone/controlpanel/tests
Xlib: extension "RANDR" missing on display ":99".
ubuntuone.controlpanel.tests.test_backend
  BackendAccountTestCase
    test_account_info ... [OK]
    test_account_info_fails ... [OK]
    test_account_info_with_current_plan ... [OK]
    test_backend_creation ... [OK]
    test_device_is_local ... [OK]
    test_get_token ... [OK]
  BackendBasicTestCase
    test_backend_creation ... [OK]
    test_device_is_local ... [OK]
    test_get_token ... [OK]
  BackendDevicesTestCase
    test_backend_creation ... [OK]
    test_change_download_speed_limit ... [OK]
    test_change_limit_bandwidth ... [OK]
    test_change_show_all_notifications ... [OK]
    test_change_upload_speed_limit ... [OK]
    test_changing_settings_for_wrong_id_has_no_effect ... [OK]
    test_device_is_local ... [OK]
    test_devices_info ... [OK]
    test_devices_info_fails ... [OK]
    test_get_token ... [OK]
    test_remove_device ... [OK]
    test_remove_device_clear_credentials_if_local_device ... [OK]
    test_remove_device_fails ... [OK]
  BackendFileSyncOpsTestCase
    test_backend_creation ... [OK]
    test_connect_files ... [OK]
    test_device_is_local ... [OK]
    test_disable_files ... [OK]
    test_disconnect_files ... [OK]
    test_enable_files ... [OK]
    test_get_token ... [OK]
    test_restart_files ... [OK]
    test_start_files ... [OK]
    test_stop_files ... [OK]
  BackendReplicationsTestCase
    test_backend_creation ... [OK]
    test_change_replication_settings ... [OK]
    test_change_replication_settings_no_set...

Read more...

99. By Eric Casteleijn on 2011-03-07

no XXX allowed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-control-panel-gtk'
2--- bin/ubuntuone-control-panel-gtk 2011-01-21 17:46:49 +0000
3+++ bin/ubuntuone-control-panel-gtk 2011-03-07 19:53:08 +0000
4@@ -40,12 +40,14 @@
5 help="Start the Ubuntu One Control Panel (GTK) in the "
6 "PANEL_NAME tab. Possible values are: "
7 "dashboard, volumes, devices, applications")
8+ result.add_option("-a", "--alert", dest="alert", action="store_true",
9+ help="Start the Ubuntu One Control Panel (GTK) alerting "
10+ "the user to its presence.")
11 return result
12
13
14 if __name__ == "__main__":
15 parser = parser_options()
16 (options, args) = parser.parse_args(sys.argv)
17-
18- gui = ControlPanelWindow(switch_to=options.switch_to)
19+ gui = ControlPanelWindow(switch_to=options.switch_to, alert=options.alert)
20 gui.main()
21
22=== modified file 'ubuntuone/controlpanel/gtk/gui.py'
23--- ubuntuone/controlpanel/gtk/gui.py 2011-03-04 13:47:35 +0000
24+++ ubuntuone/controlpanel/gtk/gui.py 2011-03-07 19:53:08 +0000
25@@ -1495,7 +1495,7 @@
26
27 TITLE = _('%(app_name)s Control Panel')
28
29- def __init__(self, switch_to=None):
30+ def __init__(self, switch_to=None, alert=False):
31 super(ControlPanelWindow, self).__init__()
32
33 self.set_title(self.TITLE % {'app_name': U1_APP_NAME})
34@@ -1504,7 +1504,13 @@
35 self.set_size_request(-1, 525) # bug #683164
36
37 self.connect('delete-event', lambda w, e: gtk.main_quit())
38- self.show()
39+ if alert:
40+ print "YES"
41+ # NOTE this should prevent focus stealing but it does not :(
42+ self.present_with_time(1)
43+ self.set_urgency_hint(True)
44+ else:
45+ self.present()
46
47 self.control_panel = ControlPanel(main_window=self)
48 self.add(self.control_panel)

Subscribers

People subscribed via source and target branches