From ef79bf6fe31bc11665bb61d63b9f3a83437d9724 Mon Sep 17 00:00:00 2001 From: nico Date: Tue, 5 Sep 2000 01:07:59 +0000 Subject: [PATCH] Implemented NSApplicationWillTerminateNotification git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7380 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSApplication.m | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index ecb9902ec..e5e3046e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 5 03:04:41 2000 Nicola Pero + + * Source/NSApplication.m ([-terminate:]): Post + NSApplicationWillTerminateNotification. ([-setDelegate:]): + Register the delegate for NSApplicationWillTerminateNotification. + Tue Sep 5 00:31:50 2000 Nicola Pero * Source/NSClipView.m ([-encodeWithCoder:]), ([-initWithCoder:]): diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 2e83ef641..fec31f045 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -2119,7 +2119,10 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException); if (shouldTerminate) { NSDictionary *userInfo; + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + [nc postNotificationName: NSApplicationWillTerminateNotification + object: self]; app_should_quit = YES; /* * add dummy event to queue to assure loop cycles @@ -2168,6 +2171,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException); SET_DELEGATE_NOTIFICATION(WillFinishLaunching); SET_DELEGATE_NOTIFICATION(WillHide); SET_DELEGATE_NOTIFICATION(WillResignActive); + SET_DELEGATE_NOTIFICATION(WillTerminate); SET_DELEGATE_NOTIFICATION(WillUnhide); SET_DELEGATE_NOTIFICATION(WillUpdate); }