Ignore:
Timestamp:
11/28/07 01:29:26 (16 years ago)
Author:
Nicholas Riley
Message:

English.lproj/Alarms.nib: Specify alternating row coloring in the nib,
now we're 10.4+.

English.lproj/InfoPlist.strings: Updated for 1.1b6.

English.lproj/Localizable.strings: Quote alarm message in pretty
description (used in tooltip). Change voice error now it no longer
incorporates OSStatus.

English.lproj/MainMenu.nib: Add speech prefs again; turn repetitions
field into a NJRValidatingField and hook up its delegate.

Info-Pester.plist: Updated for 1.1b6.

NJRHotKey.m: Switch to new Objective-C exception style.

NJRIntervalField.[hm]: Now a subclass of NJRValidatingField.

NJRTableDelegate.m: Get rid of our own tooltip support as NSTableView
now supports them (though with a minor visual glitch on the first
tooltip).

NJRTableView.[hm]: Remove tooltip support. Remove alternating row
coloring support.

NJRValidatingField.[hm]: Contains validation sheet stuff from
NJRIntervalField.

NJRVoicePopUpButton.[hm]: Switch to NSSpeechSynthesizer.

PSAlarm.m: Quote alarm message in pretty description (used in
tooltip). Fix repeating alarms not restoring as repeating if they
didn't expire while Pester was not running. No longer set timer on
Pester 1.0 alarm import, to help make importing atomic.

PSAlarmSetController.[hm]: Use NJRValidatingField for repetitions
field. Switch to new Objective-C exception style. Fix validation
issues on in/at changing. Temporary changes to restore speech support
and allow the sound popup to be removed entirely from the nib (rather
than being dragged out of the visible area, as it was in 1.1b5).
Changes for NSSpeechSynthesizer, which uses different voice names.

PSAlarms.m: Switch to new Objective-C exception style. Fix
duplication and error handling in Pester 1.0 alarm import, making
atomic.

PSAlarmsController.m: Use new tooltip support (since it's implemented
in the delegate rather than the data source, we have to proxy it).

PSAlerts.m: Wrap initialization in exception block so we don't leak.

PSApplication.m: Switch to new Objective-C exception style.

PSMediaAlert.m: Clamp repetitions at 1..99 so the user can't type an
invalid value, then quit and have it saved.

PSSpeechAlert.[hm]: Switch to NSSpeechSynthesizer. Throw an
intelligible exception if the voice is unavailable.

PSTimer.m: Switch to new Objective-C exception style.

Pester.xcodeproj: Remove VERSION generation; rename targets to be more
understandable.

Read Me.rtfd: Updated for 1.1b6.

SUSpeaker.[hm]: Gone in switch to NSSpeechSynthesizer.

VERSION: Gone - we use agvtool for everything now.

Updates/release-notes.html: Updated for 1.1b6.

Updates/updates.xml: Updated for 1.1b6.

package-Pester.sh: Use agvtool to get version. Atomically update
file on Web server to avoid partial downloads.

File:
1 edited

Legend:

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

    r363 r364  
    1818#import "NJRQTMediaPopUpButton.h"
    1919#import "NJRSoundManager.h"
     20#import "NJRValidatingField.h"
    2021#import "NJRVoicePopUpButton.h"
    2122#import "NSString-NJRExtensions.h"
     
    8788    {
    8889        NSDictionary *plAlerts = [defaults dictionaryForKey: PSAlertsSelected];
    89         PSAlerts *alerts;
     90        PSAlerts *alerts = nil;
    9091        if (plAlerts == nil) {
    9192            alerts = [[PSAlerts alloc] initWithPesterVersion1Alerts];
    9293        } else {
    93             NS_DURING
     94            @try {
    9495                alerts = [[PSAlerts alloc] initWithPropertyList: plAlerts];
    95             NS_HANDLER
    96                 NSRunAlertPanel(@"Unable to restore alerts", @"Pester could not restore recent alert information for one or more alerts in the Set Alarm window.  The default set of alerts will be used instead.\n\n%@", nil, nil, nil, [localException reason]);
     96            } @catch (NSException *exception) {
     97                NSRunAlertPanel(@"Unable to restore alerts", @"Pester could not restore recent alert information for one or more alerts in the Set Alarm window.  The default set of alerts will be used instead.\n\n%@", nil, nil, nil, [exception reason]);
    9798                alerts = [[PSAlerts alloc] initWithPesterVersion1Alerts];
    98             NS_ENDHANDLER
     99            }
    99100        }
    100101        [self _readAlerts: alerts];
     
    199200    old = [inAtMatrix cellWithTag: isInterval];
    200201    NSAssert(new != old, @"in and at buttons should be distinct!");
     202   
     203    if (sender != nil) {
     204        // XXX validation doesn't work properly for date/time, so we just universally cancel editing now
     205        if (![[self window] makeFirstResponder: nil] && !isInterval) {
     206            // This works fine synchronously only if you're using the keyboard shortcut to switch in/at.  Directly activating the button, a delayed invocation is necessary.
     207            NSInvocation *i = [NSInvocation invocationWithMethodSignature:
     208                               [inAtMatrix methodSignatureForSelector: @selector(selectCellWithTag:)]];
     209            int tag = [old tag];
     210            [i setSelector: @selector(selectCellWithTag:)];
     211            [i setTarget: inAtMatrix];
     212            [i setArgument: &tag atIndex: 2];
     213            [NSTimer scheduledTimerWithTimeInterval: 0 invocation: i repeats: NO];
     214            return;
     215        }
     216    }
     217   
    201218    [old setKeyEquivalent: [new keyEquivalent]];
    202219    [old setKeyEquivalentModifierMask: [new keyEquivalentModifierMask]];
     
    211228    [timeCalendarButton setEnabled: !isInterval];
    212229    if (sender != nil)
    213         [[self window] makeFirstResponder: isInterval ? (NSTextField *)timeInterval : timeOfDay];
    214     if (!isInterval) { // need to do this every time the controls are enabled
     230        [[self window] makeFirstResponder: isInterval ? (NSTextField *)timeInterval : timeOfDay];
     231    if (!isInterval) // need to do this every time the controls are enabled
    215232        [timeOfDay setNextKeyView: timeDate];
    216     }
    217233    // NSLog(@"UPDATING FROM inAtChanged");
    218234    [self update: nil];
     
    337353{
    338354    BOOL playSoundSelected = [playSound intValue];
    339     BOOL canRepeat = playSoundSelected ? [sound canRepeat] : NO;
    340     [sound setEnabled: NO]; //playSoundSelected]; // XXX temporary for 1.1b5
     355    BOOL canRepeat = playSoundSelected; // ? [sound canRepeat] : NO; // XXX temporary for 1.1b6
     356    [sound setEnabled: playSoundSelected];
    341357    [soundRepetitions setEnabled: canRepeat];
    342358    [soundVolumeButton setEnabled: canRepeat && [sound hasAudio]];
     
    344360    [soundRepetitionsLabel setTextColor: canRepeat ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]];
    345361    if (playSoundSelected && sender == playSound) {
    346         [[self window] makeFirstResponder: sound];
     362        [[self window] makeFirstResponder: soundRepetitions]; // sound]; // XXX temporary for 1.1b6
    347363    }
    348364}
     
    437453   
    438454    [alerts removeAlerts];
    439     NS_DURING
     455    @try {
    440456        // dock bounce alert
    441457        if ([bounceDockIcon state] == NSOnState)
     
    467483        // speech alert
    468484        if ([doSpeak intValue])
    469             [alerts addAlert: [PSSpeechAlert alertWithVoice: [voice titleOfSelectedItem]]];
     485            [alerts addAlert: [PSSpeechAlert alertWithVoice: [[voice selectedItem] representedObject]]];
    470486        // wake alert
    471487        if ([wakeUp intValue])
    472488            [alerts addAlert: [PSWakeAlert alert]];
    473489        [[NSUserDefaults standardUserDefaults] setObject: [alerts propertyListRepresentation] forKey: PSAlertsSelected];
    474     NS_HANDLER
    475         [self setStatus: [localException reason]];
    476         NS_VALUERETURN(NO, BOOL);
    477     NS_ENDHANDLER
     490    } @catch (NSException *exception) {
     491        [self setStatus: [exception reason]];
     492        return NO;
     493    }
    478494    return YES;
    479495}
     
    540556    if (control == timeInterval)
    541557        [timeInterval handleDidFailToFormatString: string errorDescription: error label: @"alarm interval"];
     558    else if (control == soundRepetitions)
     559        [soundRepetitions handleDidFailToFormatString: string errorDescription: error label: @"alert repetitions"];
    542560    return NO;
    543561}
Note: See TracChangeset for help on using the changeset viewer.