Ignore:
Timestamp:
01/05/03 23:02:48 (21 years ago)
Author:
Nicholas Riley
Message:

PSScriptAlert.m: Removed reference to NDAppleScriptObject.

PSMovieAlertController.[hm]: Added minimum sizing.

NJRCenteringMovieView.[hm]: Support for centering movie inside its
frame if the frame is too large for the movie; sizes movie
proportionally if necessary (not used in Pester).

NSImage-NJRExtensions.[hm]: Fixed copyright.

Read Me.rtfd: Updated with bug fixes.

PSMovieAlert.m: Note bug in NSMovieView, currently doesn't affect us.

NJRQTMediaPopUpButton.m: Work around background processor use bug when
NSMovieView has movie set but not playing.

NJRVoicePopUpButton.m: Removed obsolete comment.

PSApplication.m: Only show alarm set window on rapp if alerts aren't
expiring.

PSAlarms.[hm]: Added -alarmsExpiring for support of conditional
rapp window open feature in PSApplication.

PSAlarmSetController.m: Stop window update timer and movie playback on
hide, restart timer on activate - fixes background processor usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/PSAlarmSetController.m

    r53 r60  
    6767{
    6868    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     69    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    6970    alarm = [[PSAlarm alloc] init];
    7071    [[self window] center];
     
    119120    [self editAlertChanged: nil];
    120121    [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];
    123126    [voice setDelegate: self]; // XXX why don't we do this in IB?  It should use the accessor...
    124127    [wakeUp setEnabled: [PSPowerManager autoWakeSupported]];
     
    519522
    520523@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.