Changeset 53 for trunk/Cocoa/Pester/Source/PSBeepAlert.m
- Timestamp:
- 01/02/03 05:30:03 (21 years ago)
- Location:
- trunk/Cocoa/Pester/Source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source
- Property svn:ignore
-
old new 1 1 build 2 .gdb_history
-
- Property svn:ignore
-
trunk/Cocoa/Pester/Source/PSBeepAlert.m
r34 r53 10 10 #import "PSBeepAlert.h" 11 11 #import "PSAlarmAlertController.h" 12 #import "NSDictionary-NJRExtensions.h" 13 14 // property list keys 15 static NSString * const PLAlertRepetitions = @"times"; // NSNumber 12 16 13 17 @implementation PSBeepAlert … … 32 36 } 33 37 38 - (unsigned short)repetitions; 39 { 40 return repetitions; 41 } 42 34 43 - (void)beep; 35 44 { … … 37 46 repetitionsRemaining--; 38 47 if (repetitionsRemaining == 0) { 48 [self completedForAlarm: alarm]; 39 49 [self release]; 40 50 return; … … 48 58 } 49 59 50 - (void)triggerForAlarm:(PSAlarm *)a larm;60 - (void)triggerForAlarm:(PSAlarm *)anAlarm; 51 61 { 62 alarm = anAlarm; 52 63 repetitionsRemaining = repetitions; 53 64 [self retain]; … … 56 67 } 57 68 69 - (NSAttributedString *)actionDescription; 70 { 71 return [[@"Play the system alert sound" stringByAppendingString: 72 repetitions == 1 ? @"" : [NSString stringWithFormat: @" %hu times", repetitions]] small]; 73 } 74 75 #pragma mark property list serialization (Pester 1.1) 76 77 - (NSDictionary *)propertyListRepresentation; 78 { 79 NSMutableDictionary *plAlert = [[super propertyListRepresentation] mutableCopy]; 80 [plAlert setObject: [NSNumber numberWithUnsignedShort: repetitions] forKey: PLAlertRepetitions]; 81 return [plAlert autorelease]; 82 } 83 84 - (id)initWithPropertyList:(NSDictionary *)dict; 85 { 86 return [self initWithRepetitions: [[dict objectForRequiredKey: PLAlertRepetitions] unsignedShortValue]]; 87 } 88 58 89 @end
Note:
See TracChangeset
for help on using the changeset viewer.