Merge lp:~nataliabidart/ubuntu-sso-client/send-signal-on-close into lp:ubuntu-sso-client

Proposed by Natalia Bidart
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 607
Merged at revision: 607
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/send-signal-on-close
Merge into: lp:ubuntu-sso-client
Diff against target: 29 lines (+8/-0)
2 files modified
ubuntu_sso/gui.py (+2/-0)
ubuntu_sso/tests/test_gui.py (+6/-0)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/send-signal-on-close
Reviewer Review Type Date Requested Status
Rodrigo Moya (community) Approve
John Lenton (community) Approve
Review via email: mp+34205@code.launchpad.net

Commit message

* User-cancelation signal is sent when the window is close and no other event was generated (LP: #627419).

Description of the change

User-cancelation signal is sent when the window is close and no other event was generated (LP: #627419).

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve
Revision history for this message
Rodrigo Moya (rodrigo-moya) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/gui.py'
2--- ubuntu_sso/gui.py 2010-08-30 17:59:00 +0000
3+++ ubuntu_sso/gui.py 2010-08-31 14:41:02 +0000
4@@ -681,6 +681,8 @@
5 signal = self._gtk_signal_log[-1][0]
6 args = self._gtk_signal_log[-1][1:]
7 self.window.emit(signal, *args)
8+ else:
9+ self.window.emit(SIG_USER_CANCELATION, self.app_name)
10
11 # call user defined callback
12 if self.close_callback is not None:
13
14=== modified file 'ubuntu_sso/tests/test_gui.py'
15--- ubuntu_sso/tests/test_gui.py 2010-08-30 17:59:00 +0000
16+++ ubuntu_sso/tests/test_gui.py 2010-08-31 14:41:02 +0000
17@@ -1816,6 +1816,12 @@
18 """Keep trace of signals emition."""
19 self._called[args[-1]] = (widget, args[:-1], kwargs)
20
21+ def test_closing_main_window_sends_outcome_as_signal(self):
22+ """A signal is sent when closing the main window."""
23+ self.ui.window.emit('delete-event', gtk.gdk.Event(gtk.gdk.DELETE))
24+ expected = (self.ui.window, (APP_NAME,), {})
25+ self.assertEqual(self._called[gui.SIG_USER_CANCELATION], expected)
26+
27 def test_every_cancel_emits_proper_signal(self):
28 """Clicking on any cancel button, 'user-cancelation' signal is sent."""
29 sig = gui.SIG_USER_CANCELATION

Subscribers

People subscribed via source and target branches