Ignore:
Timestamp:
11/10/02 05:34:08 (22 years ago)
Author:
Nicholas Riley
Message:

Pester 1.1a1.

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

English.lproj/MainMenu.nib: Placeholder for day names in popup menu, fixed up by code (this means you can still edit it from IB though). Added command-shift-T to both in/at cells (required, code removes one or the other as appropriate). Fixed up sizes of fields. Default to today (this will need fixing when we localized the word "today", but it's fine for now...).

English.lproj/Notifier.nib: Remove date formatter because we set a string directly now instead (could set formatter from code, but we don't).

NJRDateFormatter: many workarounds for Cocoa bugs: missing AM/PM, incorrect results with space before AM/PM, etc. Added class methods to do format manipulation and return localized formats which work for output (though not always for input; this class has an internal workaround for the AM/PM problem).

NJRFSObjectSelector: properly handle enabled attribute, store internally and report externally as appropriate. Previously, the button would become enabled if you dropped something on it even if it was supposed to be disabled.

NJRQTMediaPopUpButton: stop sound preview when button disabled.

NJRVoicePopUpButton: stop voice preview when button disabled.

PSAlarm: new method -dateString returns long date string. Maintain local copy of long date, short date and time formats, and locale, using NJRDateFormatter.

PSAlarmNotifierController: update to use -[PSAlarm dateString], -[PSAlarm timeString] for localization instead of using broken formatter.

PSAlarmSetController: update documentation for some more Cocoa bugs I need to file. Set time of day and date formatters with localized date formats from NJRDateFormatter (retain/release issue here?) Localize weekday popup for predefined dates. Localize static date display with NJRDateFormatter. Note a solution (thanks to Douglas Davidson) for figuring out which control is editing. Added command-shift-T key equivalent to toggle in/at. Properly work around bugs witih soundRepetitionCount flashing, except where it's impossible to do anything else.

Read Me.rtfd: Updated for 1.1a1.

VERSION: Updated for 1.1a1.

File:
1 edited

Legend:

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

    r34 r43  
    99#import "PSAlarm.h"
    1010#import "PSAlert.h"
     11#import "NJRDateFormatter.h"
    1112
    1213NSString * const PSAlarmTimerSetNotification = @"PSAlarmTimerSetNotification";
    1314NSString * const PSAlarmTimerExpiredNotification = @"PSAlarmTimerExpiredNotification";
    1415
     16static NSString *dateFormat, *shortDateFormat, *timeFormat;
     17static NSDictionary *locale;
     18
    1519// XXX need to reset pending alarms after sleep, they "freeze" and never expire.
    1620
    1721@implementation PSAlarm
     22
     23+ (void)initialize; // XXX change on locale modification, subscribe to NSNotifications
     24{
     25    dateFormat = [[NJRDateFormatter localizedDateFormatIncludingWeekday: YES] retain];
     26    shortDateFormat = [[NJRDateFormatter localizedShortDateFormatIncludingWeekday: NO] retain];
     27    timeFormat = [[NJRDateFormatter localizedTimeFormatIncludingSeconds: YES] retain];
     28    locale = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] retain];
     29}
    1830
    1931- (void)dealloc;
     
    153165}
    154166
     167- (NSString *)dateString;
     168{
     169    return [[self date] descriptionWithCalendarFormat: dateFormat locale: locale];
     170}
     171
    155172- (NSString *)shortDateString;
    156173{
    157     return [[self date] descriptionWithCalendarFormat: [[NSUserDefaults standardUserDefaults] stringForKey: NSShortDateFormatString]];
     174    return [[self date] descriptionWithCalendarFormat: shortDateFormat locale: locale];
    158175}
    159176
    160177- (NSString *)timeString;
    161178{
    162     return [[self date] descriptionWithCalendarFormat: @"%1I:%M:%S %p"]; // XXX regular format doesn't work
     179    return [[self date] descriptionWithCalendarFormat: timeFormat locale: locale];
    163180}
    164181
Note: See TracChangeset for help on using the changeset viewer.