diff --git a/MacPass/MPDatePickingViewController.h b/MacPass/MPDatePickingViewController.h index b9162806..426d52cf 100644 --- a/MacPass/MPDatePickingViewController.h +++ b/MacPass/MPDatePickingViewController.h @@ -13,6 +13,7 @@ @property (strong,readonly) NSDate *date; @property (weak) IBOutlet NSDatePicker *datePicker; @property (weak) IBOutlet NSPopUpButton *presetPopupButton; +@property (assign, readonly) BOOL didCancel; - (IBAction)useDate:(id)sender; - (IBAction)cancel:(id)sender; diff --git a/MacPass/MPDatePickingViewController.m b/MacPass/MPDatePickingViewController.m index dfe1fbd4..c6c110e8 100644 --- a/MacPass/MPDatePickingViewController.m +++ b/MacPass/MPDatePickingViewController.m @@ -24,6 +24,7 @@ typedef NS_ENUM(NSUInteger, MPDatePreset) { @interface MPDatePickingViewController () @property (strong) NSDate *date; +@property (assign) BOOL didCancel; @end @@ -57,13 +58,14 @@ typedef NS_ENUM(NSUInteger, MPDatePreset) { } - (IBAction)useDate:(id)sender { + self.didCancel = NO; self.date = [self.datePicker dateValue]; id target = [NSApp targetForAction:@selector(performClose:)]; [target performClose:sender]; } - (IBAction)cancel:(id)sender { - self.date = nil; + self.didCancel = YES; id target = [NSApp targetForAction:@selector(performClose:)]; [target performClose:sender]; } diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 557bdf32..1c90327c 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -235,7 +235,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { } if([popover.contentViewController isKindOfClass:[MPDatePickingViewController class]]) { MPDatePickingViewController *viewController = (MPDatePickingViewController *)popover.contentViewController; - [self _setExpiryDate:viewController.date]; + if(!viewController.didCancel) { + [self _setExpiryDate:viewController.date]; + } } self.popover = nil; } diff --git a/MacPass/MPValueTransformerHelper.m b/MacPass/MPValueTransformerHelper.m index 61697f8a..7d56269f 100644 --- a/MacPass/MPValueTransformerHelper.m +++ b/MacPass/MPValueTransformerHelper.m @@ -30,7 +30,7 @@ NSString *const MPExpiryDateValueTransformer = @"com.hicknhack.macpass.kMPExpiry transformedValueClass:[NSString class] returningTransformedValueWithBlock:^id(id value) { if(![value isKindOfClass:[NSDate class]]) { - return @""; // Wrong input + return NSLocalizedString(@"NO_EXPIRE_DATE_SET",""); } static NSDateFormatter *formatter; if(!formatter) { diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings index 36b49ed2..030aba8a 100644 Binary files a/MacPass/de.lproj/Localizable.strings and b/MacPass/de.lproj/Localizable.strings differ diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index b8611109..6dc93a9b 100644 Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ diff --git a/MacPass/fr.lproj/Localizable.strings b/MacPass/fr.lproj/Localizable.strings index 6fd7a10c..b37b4eb2 100644 Binary files a/MacPass/fr.lproj/Localizable.strings and b/MacPass/fr.lproj/Localizable.strings differ diff --git a/MacPass/nl.lproj/Localizable.strings b/MacPass/nl.lproj/Localizable.strings index 7704e616..77acbfd9 100644 Binary files a/MacPass/nl.lproj/Localizable.strings and b/MacPass/nl.lproj/Localizable.strings differ diff --git a/MacPass/zh-Hans.lproj/Localizable.strings b/MacPass/zh-Hans.lproj/Localizable.strings index 29b27f4e..d84530aa 100644 Binary files a/MacPass/zh-Hans.lproj/Localizable.strings and b/MacPass/zh-Hans.lproj/Localizable.strings differ