Changeset 102 for trunk/Cocoa/Pester/Source/PSAlarmNotifierController.m
- Timestamp:
- 02/23/03 04:55:07 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSAlarmNotifierController.m
r53 r102 11 11 #import "PSAlarm.h" 12 12 #import "PSNotifierAlert.h" 13 #import "PSSnoozeUntilController.h" 13 14 #import "NJRIntervalField.h" 14 15 … … 24 25 @implementation PSAlarmNotifierController 25 26 26 // XXX should use NSNonactivatingPanelMask on 10.2 27 // XXX should use NSNonactivatingPanelMask on 10.2? 27 28 28 29 - (id)initWithAlarm:(PSAlarm *)anAlarm; … … 34 35 [messageField setStringValue: [alarm message]]; 35 36 [dateField setStringValue: [alarm dateTimeString]]; 36 if (![s noozeIntervalField setInterval: [alarm snoozeInterval]] &&37 ![s noozeIntervalField setInterval: [[[NSUserDefaults standardUserDefaults] objectForKey: PSAlarmSnoozeInterval] doubleValue]])38 [s noozeIntervalField setInterval: 15 * 60]; // 15 minutes37 if (![self setSnoozeInterval: [alarm snoozeInterval]] && 38 ![self setSnoozeInterval: [[[NSUserDefaults standardUserDefaults] objectForKey: PSAlarmSnoozeInterval] doubleValue]]) 39 [self setSnoozeInterval: 15 * 60]; // 15 minutes 39 40 if ([alarm isRepeating]) { 40 41 [intervalField setStringValue: … … 75 76 - (void)update:(id)sender; 76 77 { 77 canSnooze = [snoozeIntervalField interval] != 0; 78 snoozeInterval = [snoozeIntervalField interval]; 79 canSnooze = (snoozeInterval > 0); 78 80 if (canSnooze) [nextDateField setStringValue: @"after snooze"]; 79 81 [snoozeButton setEnabled: canSnooze]; … … 89 91 } 90 92 93 - (IBAction)snoozeUntil:(NSMenuItem *)sender; 94 { 95 [PSSnoozeUntilController snoozeUntilControllerWithNotifierController: self]; 96 } 97 98 - (IBAction)snoozeIntervalUnitsChanged:(NSPopUpButton *)sender; 99 { 100 if ([[sender selectedItem] tag] > 0) [self update: nil]; 101 } 102 103 - (NSTimeInterval)snoozeInterval; 104 { 105 return snoozeInterval; 106 } 107 108 - (BOOL)setSnoozeInterval:(NSTimeInterval)interval; 109 { 110 snoozeInterval = interval; 111 return [snoozeIntervalField setInterval: interval]; 112 } 113 91 114 - (IBAction)snooze:(NSButton *)sender; 92 115 { 93 NSTimeIntervalsnoozeInterval = [snoozeIntervalField interval];116 snoozeInterval = [snoozeIntervalField interval]; 94 117 [alarm setSnoozeInterval: snoozeInterval]; 95 118 [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithDouble: snoozeInterval] forKey: PSAlarmSnoozeInterval]; 96 119 [self close: sender]; 120 } 121 122 - (void)snoozeUntilDate:(NSCalendarDate *)date; 123 { 124 [alarm setSnoozeInterval: [date timeIntervalSinceNow]]; 125 [self close: self]; 97 126 } 98 127
Note:
See TracChangeset
for help on using the changeset viewer.