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/NJRIntervalField.m

    r355 r364  
    8080}
    8181
    82 - (void)handleDidFailToFormatString:(NSString *)string errorDescription:(NSString *)error label:(NSString *)label;
    83 {
    84     NSString *alertMessage = nil;
    85     NSString *alternateButtonString = nil;
    86     NSNumber *proposedValue = nil;
    87     NSDictionary *contextInfo;
    88 
    89     NSString *alertInformation = [NSString localizedStringWithFormat:
    90         NSLocalizedString(@"The %@ field must be set to a value between %@ and %@.",
    91                           @"Informative text for alert posed by text field when invalid value entered"),
    92         label, [[self formatter] minimum], [[self formatter] maximum]];
    93     NSString *defaultButtonString = NSLocalizedString(@"Edit", @"Name of Edit button");
    94     NSString *otherButtonString = NSLocalizedString(@"Cancel", @"Name of Cancel button");
    95 
    96     if ([error isEqualToString:
    97         NSLocalizedStringFromTableInBundle(@"Fell short of minimum", @"Formatter",
    98                                            [NSBundle bundleForClass:[NSFormatter class]],
    99                                            @"Presented when user value smaller than minimum")]) {
    100         proposedValue = [[self formatter] minimum];
    101         alertMessage = [NSString stringWithFormat:
    102             NSLocalizedString(@"%@ is too small for the %@ field.",
    103                               @"Message text for alert posed by numeric field when too-small value entered"),
    104             string, label];
    105         alternateButtonString = [NSString localizedStringWithFormat:
    106             NSLocalizedString(@"Set to %@",
    107                               @"Name of alternate button for alert posed by numeric field when too-small value entered"),
    108             proposedValue];
    109     } else if ([error isEqualToString:
    110         NSLocalizedStringFromTableInBundle(@"Maximum exceeded", @"Formatter",
    111                                            [NSBundle bundleForClass:[NSFormatter class]],
    112                                            @"Presented when user value larger than maximum")]) {
    113         proposedValue = [[self formatter] maximum];
    114         alertMessage = [NSString stringWithFormat:
    115             NSLocalizedString(@"%@ is too large for the %@ field.",
    116                               @"Message text for alert posed by numeric field when too-large value entered"),
    117             string, label];
    118         alternateButtonString = [NSString localizedStringWithFormat:
    119             NSLocalizedString(@"Set to %@",
    120                               @"Name of alternate button for alert posed by numeric field when too-large value entered"),
    121             proposedValue];
    122     } else if ([error isEqualToString:
    123         NSLocalizedStringFromTableInBundle(@"Invalid number", @"Formatter",
    124                                            [NSBundle bundleForClass:[NSFormatter class]],
    125                                            @"Presented when user typed illegal characters: no valid object")]) {
    126         alertMessage = [NSString stringWithFormat:
    127             NSLocalizedString(@"%@ is not a valid entry for the %@ field.",
    128                               @"Message text for alert posed by text field when invalid value entered"),
    129             string, label];
    130         alternateButtonString = nil;
    131     }
    132 
    133     contextInfo = [NSDictionary dictionaryWithObject: proposedValue forKey: @"proposedValue"];
    134     [contextInfo retain];
    135     NSBeep();
    136     NSBeginAlertSheet(alertMessage, defaultButtonString, alternateButtonString, otherButtonString, [self window],
    137                       self, @selector(validationFailedSheetDidEnd:returnCode:contextInfo:), NULL, contextInfo,
    138                       alertInformation);
    139 }
    140 
    141 - (void)_propagateValidationChange;
    142 {
    143     NSText *fieldEditor = [self currentEditor];
    144     NSDictionary *userInfo = nil;
    145     if (fieldEditor != nil) userInfo = [NSDictionary dictionaryWithObject: fieldEditor forKey: @"NSFieldEditor"];
    146     [[NSNotificationCenter defaultCenter] postNotificationName: NSControlTextDidChangeNotification object: self userInfo: userInfo];
    147     [self selectText: self];
    148 }
    149 
    150 - (void)validationFailedSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
    151     // modal delegate callback method for NSBeginAlertSheet() function; called in the above method
    152     if (returnCode == NSAlertOtherReturn) { // cancel
    153         [self abortEditing]; // abort edit session and reinstate original value
    154         [self _propagateValidationChange];
    155     } else if (returnCode == NSAlertAlternateReturn) { // set to min/max/default value
    156         [self setObjectValue: [(NSDictionary *)contextInfo objectForKey: @"proposedValue"]];
    157         [self validateEditing];
    158         [self _propagateValidationChange];
    159     }
    160     [(NSDictionary *)contextInfo release];
    161 }
    162 
    16382@end
Note: See TracChangeset for help on using the changeset viewer.