Ignore:
Timestamp:
01/06/03 13:05:29 (20 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/PSAlarmSetController.m

    r60 r61  
    2727#import "PSMovieAlert.h"
    2828#import "PSSpeechAlert.h"
     29#import "PSWakeAlert.h"
    2930
    3031/* Bugs to file:
     
    124125    [notificationCenter addObserver: self selector: @selector(applicationWillHide:) name: NSApplicationWillHideNotification object: NSApp];
    125126    [notificationCenter addObserver: self selector: @selector(applicationDidUnhide:) name: NSApplicationDidUnhideNotification object: NSApp];
     127    [notificationCenter addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: NSApp];
    126128    [voice setDelegate: self]; // XXX why don't we do this in IB?  It should use the accessor...
    127129    [wakeUp setEnabled: [PSPowerManager autoWakeSupported]];
     
    380382            [doSpeak setIntValue: YES];
    381383            [voice setVoice: [(PSSpeechAlert *)alert voice]];
    382         }
    383     }
     384        } else if ([alert isKindOfClass: [PSWakeAlert class]]) {
     385            [wakeUp setIntValue: YES];
     386        }
     387}
    384388}
    385389
     
    417421        if ([doSpeak intValue])
    418422            [alerts addAlert: [PSSpeechAlert alertWithVoice: [voice titleOfSelectedItem]]];
     423        // wake alert
     424        if ([wakeUp intValue])
     425            [alerts addAlert: [PSWakeAlert alert]];
    419426        [[NSUserDefaults standardUserDefaults] setObject: [alerts propertyListRepresentation] forKey: PSAlertsSelected];
    420427    NS_HANDLER
     
    525532@implementation PSAlarmSetController (NSApplicationNotifications)
    526533
     534- (void)applicationWillTerminate:(NSNotification *)notification;
     535{
     536    [self _setAlerts];
     537}
     538
    527539- (void)applicationWillHide:(NSNotification *)notification;
    528540{
    529541    if ([[self window] isVisible]) {
    530         NSLog(@"hide");
    531542        [self silence: nil];
    532543        [self _stopUpdateTimer];
     
    537548{
    538549    if ([[self window] isVisible]) {
    539         NSLog(@"unhide");
    540550        [self update: self];
    541551    }
Note: See TracChangeset for help on using the changeset viewer.