Ignore:
Timestamp:
01/06/03 13:05:29 (21 years ago)
Author:
Nicholas Riley
Message:

Pester 1.1b1.

PSPowerManager: Fixed delegate method selectors to better reflect what
is going on (Apple's docs in IOKit Fundamentals help with this; the
kIOMessage*Sleep constants are really poorly named).

VERSION: Updated for 1.1b1.

PSSpeechAlert.h: Fixed company name.

PSAlert.[hm]: Added -prepareForAlarm: to support PSWakeAlert.

PSTimer.[hm]: Replacement for NSTimer that works properly across
sleep/wake cycles and will schedule wake timers.

PSAlerts.[hm]: Added -prepareForAlarm: to support PSWakeAlert.

Read Me.rtfd: Updated for 1.1b1.

PSAlarm.[hm]: Added -setWakeUp:, invoke -[PSAlerts prepareForAlarm],
replaced alarm timer NSTimer with PSTimer.

PSApplication.[hm]: Replaced dock update timer NSTimer with PSTimer.
Uncovered some issues, need to fix later. Enable alarm discard for
beta release.

PSWakeAlert.[hm]: Shared alert implementation for wakeup. Doesn't do
anything at trigger time, but uses new preparation interface to work
at alarm set time (should work for repeating alarms too, but I didn't
bother to test...)

PSAlarmSetController.m: Added support for PSWakeAlert. Save default
alert information on quit. Removed debug statements on hide/unhide;
it works fine regardless of whether the app is explicitly hidden or
the window hides itself.

PSAlarms.m: PSTimer support - invoke +[PSTimer setUp] to initialize
timer list.

File:
1 edited

Legend:

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

    r53 r61  
    1010#import "PSAlert.h"
    1111#import "PSAlerts.h"
     12#import "PSTimer.h"
    1213#import "NJRDateFormatter.h"
    1314#import "NSCalendarDate-NJRExtensions.h"
     
    143144}
    144145
    145 - (void)_timerExpired:(NSTimer *)aTimer;
     146- (void)_timerExpired:(PSTimer *)aTimer;
    146147{
    147148    NSLog(@"expired: %@; now %@", [[aTimer fireDate] description], [[NSDate date] description]);
     
    198199    NSAssert(alarmType == PSAlarmExpired, @"CanÕt snooze an alarm that hasnÕt expired");
    199200    alarmType = PSAlarmSnooze;
     201}
     202
     203- (void)setWakeUp:(BOOL)doWake;
     204{
     205    [timer setWakeUp: doWake];
    200206}
    201207
     
    379385        return NO;
    380386    }
    381     timer = [NSTimer scheduledTimerWithTimeInterval: (alarmType == PSAlarmSnooze ? snoozeInterval : alarmInterval) target: self selector: @selector(_timerExpired:) userInfo: nil repeats: NO];
     387    timer = [PSTimer scheduledTimerWithTimeInterval: (alarmType == PSAlarmSnooze ? snoozeInterval : alarmInterval) target: self selector: @selector(_timerExpired:) userInfo: nil repeats: NO];
    382388    if (timer == nil) return NO;
    383389    [timer retain];
    384390    alarmType = PSAlarmSet;
     391    [alerts prepareForAlarm: self];
     392
    385393    [[NSNotificationCenter defaultCenter] postNotificationName: PSAlarmTimerSetNotification object: self];
    386394    // NSLog(@"set: %@; now %@; remaining %@", [[timer fireDate] description], [[NSDate date] description], [self timeRemainingString]);
Note: See TracChangeset for help on using the changeset viewer.