Changeset 60 for trunk/Cocoa/Pester/Source/PSAlarmSetController.m
- Timestamp:
- 01/05/03 23:02:48 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSAlarmSetController.m
r53 r60 67 67 { 68 68 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 69 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 69 70 alarm = [[PSAlarm alloc] init]; 70 71 [[self window] center]; … … 119 120 [self editAlertChanged: nil]; 120 121 [script setFileTypes: [NSArray arrayWithObjects: @"applescript", @"script", NSFileTypeForHFSTypeCode(kOSAFileType), NSFileTypeForHFSTypeCode('TEXT'), nil]]; 121 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(silence:) name: PSAlarmAlertStopNotification object: nil]; 122 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(playSoundChanged:) name: NJRQTMediaPopUpButtonMovieChangedNotification object: sound]; 122 [notificationCenter addObserver: self selector: @selector(silence:) name: PSAlarmAlertStopNotification object: nil]; 123 [notificationCenter addObserver: self selector: @selector(playSoundChanged:) name: NJRQTMediaPopUpButtonMovieChangedNotification object: sound]; 124 [notificationCenter addObserver: self selector: @selector(applicationWillHide:) name: NSApplicationWillHideNotification object: NSApp]; 125 [notificationCenter addObserver: self selector: @selector(applicationDidUnhide:) name: NSApplicationDidUnhideNotification object: NSApp]; 123 126 [voice setDelegate: self]; // XXX why don't we do this in IB? It should use the accessor... 124 127 [wakeUp setEnabled: [PSPowerManager autoWakeSupported]]; … … 519 522 520 523 @end 524 525 @implementation PSAlarmSetController (NSApplicationNotifications) 526 527 - (void)applicationWillHide:(NSNotification *)notification; 528 { 529 if ([[self window] isVisible]) { 530 NSLog(@"hide"); 531 [self silence: nil]; 532 [self _stopUpdateTimer]; 533 } 534 } 535 536 - (void)applicationDidUnhide:(NSNotification *)notification; 537 { 538 if ([[self window] isVisible]) { 539 NSLog(@"unhide"); 540 [self update: self]; 541 } 542 } 543 544 @end
Note:
See TracChangeset
for help on using the changeset viewer.