Settings now work with KDB1 Files and do not trap the Application in the modal dialog

Added user base settings to hide/show passwords at KDB1 field. The settings are stored but not considered ;)
This commit is contained in:
michael starke
2013-07-19 22:25:40 +02:00
parent 5e6d2bed3d
commit efa727eaba
14 changed files with 765 additions and 109 deletions

View File

@@ -59,8 +59,8 @@ enum {
@property (strong) NSPopover *activePopover;
@property (weak) IBOutlet NSButton *generatePasswordButton;
@property (nonatomic, weak) NSDate *modificationDate;
@property (nonatomic, weak) NSDate *creationDate;
@property (nonatomic, strong) NSDate *modificationDate;
@property (nonatomic, strong) NSDate *creationDate;
@property (nonatomic, assign) BOOL showPassword;
@@ -137,25 +137,32 @@ enum {
}
- (void)setModificationDate:(NSDate *)modificationDate {
NSString *modificationString = [NSDateFormatter localizedStringFromDate:modificationDate
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterShortStyle];
modificationString = [modificationDate humanized];
NSString *modifedAtTemplate = NSLocalizedString(@"MODIFED_AT_%@", @"Modifed at template string. %@ is replaced by locaized date and time");
[self.modifiedTextField setStringValue:[NSString stringWithFormat:modifedAtTemplate, modificationString]];
_modificationDate = modificationDate;
[self _updateDateStrings];
}
- (void)setCreationDate:(NSDate *)creationDate {
NSString *creationString = [NSDateFormatter localizedStringFromDate:creationDate
dateStyle:NSDateFormatterShortStyle
timeStyle:NSDateFormatterShortStyle];
creationString = [creationDate humanized];
_creationDate = creationDate;
[self _updateDateStrings];
}
- (void)_updateDateStrings {
if(!self.creationDate || !self.modificationDate ) {
[self.modifiedTextField setStringValue:@""];
[self.createdTextField setStringValue:@""];
return; // No dates, just clear
}
NSString *creationString = [self.creationDate humanized];
NSString *modificationString = [self.modificationDate humanized];
NSString *modifedAtTemplate = NSLocalizedString(@"MODIFED_AT_%@", @"Modifed at template string. %@ is replaced by locaized date and time");
NSString *createdAtTemplate = NSLocalizedString(@"CREATED_AT_%@", @"Created at template string. %@ is replaced by locaized date and time");
[self.modifiedTextField setStringValue:[NSString stringWithFormat:modifedAtTemplate, modificationString]];
[self.createdTextField setStringValue:[NSString stringWithFormat:createdAtTemplate, creationString]];
}
- (void)_updateContent {