Changeset 364 for trunk/Cocoa/Pester/Source/PSAlarm.m
- Timestamp:
- 11/28/07 01:29:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSAlarm.m
r358 r364 357 357 358 358 [string appendAttributedString: 359 [[NSString stringWithFormat: NSLocalizedString(@"At alarm time for %@:\n", "Alert list title in pretty description, %@ replaced with message"), [self message]] small]];359 [[NSString stringWithFormat: NSLocalizedString(@"At alarm time for '%@':\n", "Alert list title in pretty description, %@ replaced with message"), [self message]] small]]; 360 360 if (alertList != nil) { 361 361 [string appendAttributedString: alertList]; … … 415 415 // don't want to put this logic in setTimer or isValid because it can cause invalid alarms to be set (consider when someone clicks the "repeat" checkbox, then switches to a [nonrepeating, by design] date alarm, and enters a date that has passed: we do -not- want the alarm to magically morph into a repeating interval alarm) 416 416 NSTimeInterval savedInterval = alarmInterval; 417 if (![self setTimer]) { 417 if ([self setTimer]) { 418 // alarm is set, but not repeating - and the interval is wrong because it was computed from the date 419 alarmInterval = savedInterval; 420 [self setRepeating: YES]; 421 } else { 422 // alarm is now invalid: expired in the past, so we start the timer over again 423 // We could potentially start counting from the expiration date (or expiration date + n * interval), but this doesn't match our existing behavior. 418 424 alarmType = PSAlarmInterval; 419 425 [self setInterval: savedInterval]; … … 563 569 } 564 570 [self setMessage: [coder decodeObject]]; 565 if (alarmType == PSAlarmSet) {571 if (alarmType == PSAlarmSet) 566 572 alarmType = PSAlarmDate; 567 [self setTimer]; 568 } 573 // Note: the timer is not set here, so these alarms are inert. 574 // This helps make importing atomic (see -[PSAlarms importVersion1Alarms]) 569 575 } 570 576 return self;
Note:
See TracChangeset
for help on using the changeset viewer.