2
0

Improvements to layout, password types and preparations for security answers.

This commit is contained in:
Maarten Billemont 2016-04-23 11:54:07 -04:00
parent 35c443d82d
commit 15b14d67db
5 changed files with 565 additions and 388 deletions

2
External/Pearl vendored

@ -1 +1 @@
Subproject commit 8b6e3481d7963d08cd50fc5994702f2abdce3cc5
Subproject commit db613dce0a2a7ac83c866e9d0578038d45ec0c31

View File

@ -179,7 +179,7 @@ NSOperationQueue *_mpwQueue = nil;
return @"PIN";
case MPSiteTypeGeneratedName:
return @"Login Name";
return @"Name";
case MPSiteTypeGeneratedPhrase:
return @"Phrase";
@ -281,7 +281,7 @@ NSOperationQueue *_mpwQueue = nil;
- (NSArray *)allTypes {
return [self allTypesStartingWith:MPSiteTypeGeneratedMaximum];
return [self allTypesStartingWith:MPSiteTypeGeneratedPhrase];
}
- (NSArray *)allTypesStartingWith:(MPSiteType)startingType {
@ -298,6 +298,10 @@ NSOperationQueue *_mpwQueue = nil;
- (MPSiteType)nextType:(MPSiteType)type {
switch (type) {
case MPSiteTypeGeneratedPhrase:
return MPSiteTypeGeneratedName;
case MPSiteTypeGeneratedName:
return MPSiteTypeGeneratedMaximum;
case MPSiteTypeGeneratedMaximum:
return MPSiteTypeGeneratedLong;
case MPSiteTypeGeneratedLong:
@ -313,7 +317,7 @@ NSOperationQueue *_mpwQueue = nil;
case MPSiteTypeStoredPersonal:
return MPSiteTypeStoredDevicePrivate;
case MPSiteTypeStoredDevicePrivate:
return MPSiteTypeGeneratedMaximum;
return MPSiteTypeGeneratedPhrase;
default:
return MPSiteTypeGeneratedLong;
}

View File

@ -427,15 +427,14 @@
- (IBAction)changeType:(id)sender {
MPSiteModel *site = self.selectedSite;
NSArray *types = [site.algorithm allTypesStartingWith:MPSiteTypeGeneratedPIN];
NSArray *types = [site.algorithm allTypes];
[self.passwordTypesMatrix renewRows:(NSInteger)[types count] columns:1];
for (NSUInteger t = 0; t < [types count]; ++t) {
MPSiteType type = (MPSiteType)[types[t] unsignedIntegerValue];
NSString *title = [site.algorithm nameOfType:type];
if (type & MPSiteTypeClassGenerated)
title = [site.algorithm generatePasswordForSiteNamed:site.name ofType:type
withCounter:site.counter
usingKey:[MPMacAppDelegate get].key];
title = strf( @"%@ %@", [site.algorithm generatePasswordForSiteNamed:site.name ofType:type withCounter:site.counter
usingKey:[MPMacAppDelegate get].key], title );
NSButtonCell *cell = [self.passwordTypesMatrix cellAtRow:(NSInteger)t column:0];
cell.tag = type;
@ -443,11 +442,12 @@
cell.title = title;
}
self.passwordTypesBox.title = strf( @"Choose a password type for %@:", site.name );
NSAlert *alert = [NSAlert new];
[alert addButtonWithTitle:@"Save"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Change Password Type"];
[alert setInformativeText:strf( @"Choose a new password type for: %@", site.name )];
[alert setAccessoryView:self.passwordTypesBox];
[alert layout];
[alert beginSheetModalForWindow:self.window modalDelegate:self

File diff suppressed because it is too large Load Diff

View File

@ -168,6 +168,15 @@
[self updateContent];
}
- (void)setQuestion:(NSString *)question {
if ([question isEqualToString:_question])
return;
_question = question;
[self updateContent];
}
- (BOOL)outdated {
return self.algorithmVersion < MPAlgorithmVersionCurrent;