Reformat.
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
|
||||
@interface MPAppDelegate : MPAppDelegate_Shared
|
||||
|
||||
@property (nonatomic, readonly) GPPShare *googlePlus;
|
||||
@property(nonatomic, readonly) GPPShare *googlePlus;
|
||||
|
||||
- (void)showGuide;
|
||||
- (void)showSetup;
|
||||
- (void)showFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController;
|
||||
|
||||
- (void)export;
|
||||
- (void)changeMasterPasswordFor:(MPUserEntity *)user inContext:(NSManagedObjectContext *)moc didResetBlock:(void(^)(void))didReset;
|
||||
- (void)changeMasterPasswordFor:(MPUserEntity *)user inContext:(NSManagedObjectContext *)moc didResetBlock:(void (^)(void))didReset;
|
||||
|
||||
@end
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
|
||||
#import "IASKSettingsReader.h"
|
||||
|
||||
@interface MPAppDelegate ()
|
||||
@interface MPAppDelegate()
|
||||
|
||||
@property (nonatomic, readwrite) GPPShare *googlePlus;
|
||||
@property(nonatomic, readwrite) GPPShare *googlePlus;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MPAppDelegate
|
||||
|
||||
+ (void)initialize {
|
||||
@@ -59,12 +58,12 @@
|
||||
level = PearlLogLevelInfo;
|
||||
|
||||
if (message.level >= level)
|
||||
TFLog(@"%@", [message messageDescription]);
|
||||
TFLog( @"%@", [message messageDescription] );
|
||||
|
||||
return YES;
|
||||
}];
|
||||
TFLog(@"TestFlight (%@) initialized for: %@ v%@.", //
|
||||
TESTFLIGHT_SDK_VERSION, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion);
|
||||
TFLog( @"TestFlight (%@) initialized for: %@ v%@.", //
|
||||
TESTFLIGHT_SDK_VERSION, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion );
|
||||
}
|
||||
}
|
||||
@catch (id exception) {
|
||||
@@ -99,12 +98,12 @@
|
||||
level = PearlLogLevelInfo;
|
||||
|
||||
if (message.level >= level)
|
||||
CLSLog(@"%@", [message messageDescription]);
|
||||
CLSLog( @"%@", [message messageDescription] );
|
||||
|
||||
return YES;
|
||||
}];
|
||||
CLSLog(@"Crashlytics (%@) initialized for: %@ v%@.", //
|
||||
[Crashlytics sharedInstance].version, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion);
|
||||
CLSLog( @"Crashlytics (%@) initialized for: %@ v%@.", //
|
||||
[Crashlytics sharedInstance].version, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion );
|
||||
}
|
||||
}
|
||||
@catch (id exception) {
|
||||
@@ -133,34 +132,34 @@
|
||||
err(@"Localytics exception: %@", exception);
|
||||
}
|
||||
|
||||
UIImage *navBarImage = [[UIImage imageNamed:@"ui_navbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
|
||||
UIImage *navBarImage = [[UIImage imageNamed:@"ui_navbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 5, 0, 5 )];
|
||||
[[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
|
||||
[[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsLandscapePhone];
|
||||
[[UINavigationBar appearance] setTitleTextAttributes:
|
||||
@{
|
||||
UITextAttributeTextColor: [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
|
||||
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.8f],
|
||||
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
|
||||
UITextAttributeFont: [UIFont fontWithName:@"Exo-Bold" size:20.0f]
|
||||
}];
|
||||
@{
|
||||
UITextAttributeTextColor : [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
|
||||
UITextAttributeTextShadowColor : [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.8f],
|
||||
UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake( 0, -1 )],
|
||||
UITextAttributeFont : [UIFont fontWithName:@"Exo-Bold" size:20.0f]
|
||||
}];
|
||||
|
||||
UIImage *navBarButton = [[UIImage imageNamed:@"ui_navbar_button"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
|
||||
UIImage *navBarBack = [[UIImage imageNamed:@"ui_navbar_back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
|
||||
UIImage *navBarButton = [[UIImage imageNamed:@"ui_navbar_button"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 5, 0, 5 )];
|
||||
UIImage *navBarBack = [[UIImage imageNamed:@"ui_navbar_back"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 13, 0, 5 )];
|
||||
[[UIBarButtonItem appearance] setBackgroundImage:navBarButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
|
||||
[[UIBarButtonItem appearance] setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];
|
||||
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:navBarBack forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
|
||||
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];
|
||||
[[UIBarButtonItem appearance] setTitleTextAttributes:
|
||||
@{
|
||||
UITextAttributeTextColor: [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
|
||||
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.5f],
|
||||
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, 1)]//,
|
||||
// Causes a bug in iOS where image views get oddly stretched... or something.
|
||||
//UITextAttributeFont: [UIFont fontWithName:@"HelveticaNeue" size:13.0f]
|
||||
}
|
||||
@{
|
||||
UITextAttributeTextColor : [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
|
||||
UITextAttributeTextShadowColor : [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.5f],
|
||||
UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake( 0, 1 )]//,
|
||||
// Causes a bug in iOS where image views get oddly stretched... or something.
|
||||
//UITextAttributeFont: [UIFont fontWithName:@"HelveticaNeue" size:13.0f]
|
||||
}
|
||||
forState:UIControlStateNormal];
|
||||
|
||||
UIImage *toolBarImage = [[UIImage imageNamed:@"ui_toolbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake(25, 5, 5, 5)];
|
||||
UIImage *toolBarImage = [[UIImage imageNamed:@"ui_toolbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake( 25, 5, 5, 5 )];
|
||||
[[UISearchBar appearance] setBackgroundImage:toolBarImage];
|
||||
[[UIToolbar appearance] setBackgroundImage:toolBarImage forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
|
||||
|
||||
@@ -188,58 +187,62 @@
|
||||
*/
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPCheckConfigNotification object:nil queue:nil usingBlock:
|
||||
^(NSNotification *note) {
|
||||
if ([[MPiOSConfig get].sendInfo boolValue]) {
|
||||
if ([PearlLogger get].printLevel > PearlLogLevelInfo)
|
||||
[PearlLogger get].printLevel = PearlLogLevelInfo;
|
||||
^(NSNotification *note) {
|
||||
if ([[MPiOSConfig get].sendInfo boolValue]) {
|
||||
if ([PearlLogger get].printLevel > PearlLogLevelInfo)
|
||||
[PearlLogger get].printLevel = PearlLogLevelInfo;
|
||||
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].rememberLogin boolValue] forKey:@"rememberLogin"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[self storeManager].cloudEnabled forKey:@"iCloud"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].iCloudDecided boolValue] forKey:@"iCloudDecided"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].sendInfo boolValue] forKey:@"sendInfo"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].helpHidden boolValue] forKey:@"helpHidden"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].showSetup boolValue] forKey:@"showQuickStart"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[PearlConfig get].firstRun boolValue] forKey:@"firstRun"];
|
||||
[[Crashlytics sharedInstance] setIntValue:[[PearlConfig get].launchCount intValue] forKey:@"launchCount"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[PearlConfig get].askForReviews boolValue] forKey:@"askForReviews"];
|
||||
[[Crashlytics sharedInstance] setIntValue:[[PearlConfig get].reviewAfterLaunches intValue] forKey:@"reviewAfterLaunches"];
|
||||
[[Crashlytics sharedInstance] setObjectValue:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].rememberLogin boolValue] forKey:@"rememberLogin"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[self storeManager].cloudEnabled forKey:@"iCloud"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].iCloudDecided boolValue] forKey:@"iCloudDecided"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].sendInfo boolValue] forKey:@"sendInfo"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].helpHidden boolValue] forKey:@"helpHidden"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[MPiOSConfig get].showSetup boolValue] forKey:@"showQuickStart"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[PearlConfig get].firstRun boolValue] forKey:@"firstRun"];
|
||||
[[Crashlytics sharedInstance] setIntValue:[[PearlConfig get].launchCount intValue] forKey:@"launchCount"];
|
||||
[[Crashlytics sharedInstance] setBoolValue:[[PearlConfig get].askForReviews boolValue] forKey:@"askForReviews"];
|
||||
[[Crashlytics sharedInstance]
|
||||
setIntValue:[[PearlConfig get].reviewAfterLaunches intValue] forKey:@"reviewAfterLaunches"];
|
||||
[[Crashlytics sharedInstance] setObjectValue:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"];
|
||||
|
||||
#ifdef TESTFLIGHT_SDK_VERSION
|
||||
[TestFlight addCustomEnvironmentInformation:[[MPConfig get].rememberLogin boolValue]? @"YES": @"NO" forKey:@"rememberLogin"];
|
||||
[TestFlight addCustomEnvironmentInformation:[self storeManager].cloudEnabled? @"YES": @"NO" forKey:@"iCloud"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[MPConfig get].iCloudDecided boolValue]? @"YES": @"NO" forKey:@"iCloudDecided"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[MPiOSConfig get].sendInfo boolValue]? @"YES": @"NO" forKey:@"sendInfo"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[MPiOSConfig get].helpHidden boolValue]? @"YES": @"NO" forKey:@"helpHidden"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[MPiOSConfig get].showSetup boolValue]? @"YES": @"NO"
|
||||
forKey:@"showQuickStart"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].firstRun boolValue]? @"YES": @"NO" forKey:@"firstRun"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].launchCount description] forKey:@"launchCount"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].askForReviews boolValue]? @"YES": @"NO"
|
||||
forKey:@"askForReviews"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].reviewAfterLaunches description] forKey:@"reviewAfterLaunches"];
|
||||
[TestFlight addCustomEnvironmentInformation:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[MPConfig get].rememberLogin boolValue]) description]
|
||||
forKey:@"rememberLogin"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([self storeManager].cloudEnabled) description] forKey:@"iCloud"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[MPConfig get].iCloudDecided boolValue]) description]
|
||||
forKey:@"iCloudDecided"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[MPiOSConfig get].sendInfo boolValue]) description] forKey:@"sendInfo"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[MPiOSConfig get].helpHidden boolValue]) description]
|
||||
forKey:@"helpHidden"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[MPiOSConfig get].showSetup boolValue]) description]
|
||||
forKey:@"showQuickStart"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[PearlConfig get].firstRun boolValue]) description] forKey:@"firstRun"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].launchCount description] forKey:@"launchCount"];
|
||||
[TestFlight addCustomEnvironmentInformation:[@([[PearlConfig get].askForReviews boolValue]) description]
|
||||
forKey:@"askForReviews"];
|
||||
[TestFlight addCustomEnvironmentInformation:[[PearlConfig get].reviewAfterLaunches description]
|
||||
forKey:@"reviewAfterLaunches"];
|
||||
[TestFlight addCustomEnvironmentInformation:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"];
|
||||
#endif
|
||||
MPCheckpoint( MPCheckpointConfig, @{
|
||||
@"rememberLogin" : [[MPConfig get].rememberLogin boolValue]? @"YES": @"NO",
|
||||
@"iCloud" : [self storeManager].cloudEnabled? @"YES": @"NO",
|
||||
@"iCloudDecided" : [[MPConfig get].iCloudDecided boolValue]? @"YES": @"NO",
|
||||
@"sendInfo" : [[MPiOSConfig get].sendInfo boolValue]? @"YES": @"NO",
|
||||
@"helpHidden" : [[MPiOSConfig get].helpHidden boolValue]? @"YES": @"NO",
|
||||
@"showQuickStart" : [[MPiOSConfig get].showSetup boolValue]? @"YES": @"NO",
|
||||
@"firstRun" : [[PearlConfig get].firstRun boolValue]? @"YES": @"NO",
|
||||
@"launchCount" : NilToNSNull([[PearlConfig get].launchCount description]),
|
||||
@"askForReviews" : [[PearlConfig get].askForReviews boolValue]? @"YES": @"NO",
|
||||
@"reviewAfterLaunches" : NilToNSNull([[PearlConfig get].reviewAfterLaunches description]),
|
||||
@"reviewedVersion" : NilToNSNull([PearlConfig get].reviewedVersion)
|
||||
} );
|
||||
}
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:kIASKAppSettingChanged object:nil queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification
|
||||
object:note userInfo:nil];
|
||||
}];
|
||||
MPCheckpoint( MPCheckpointConfig, @{
|
||||
@"rememberLogin" : @([[MPConfig get].rememberLogin boolValue]),
|
||||
@"iCloud" : @([self storeManager].cloudEnabled),
|
||||
@"iCloudDecided" : @([[MPConfig get].iCloudDecided boolValue]),
|
||||
@"sendInfo" : @([[MPiOSConfig get].sendInfo boolValue]),
|
||||
@"helpHidden" : @([[MPiOSConfig get].helpHidden boolValue]),
|
||||
@"showQuickStart" : @([[MPiOSConfig get].showSetup boolValue]),
|
||||
@"firstRun" : @([[PearlConfig get].firstRun boolValue]),
|
||||
@"launchCount" : NilToNSNull([[PearlConfig get].launchCount description]),
|
||||
@"askForReviews" : @([[PearlConfig get].askForReviews boolValue]),
|
||||
@"reviewAfterLaunches" : NilToNSNull([[PearlConfig get].reviewAfterLaunches description]),
|
||||
@"reviewedVersion" : NilToNSNull([PearlConfig get].reviewedVersion)
|
||||
} );
|
||||
}
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:kIASKAppSettingChanged object:nil queue:nil usingBlock:^(NSNotification *note) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:note userInfo:nil];
|
||||
}];
|
||||
|
||||
#ifdef ADHOC
|
||||
[PearlAlert showAlertWithTitle:@"Welcome, tester!" message:
|
||||
@@ -257,10 +260,10 @@
|
||||
|
||||
inf(@"Started up with device identifier: %@", [PearlKeyChain deviceIdentifier]);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
if ([[MPiOSConfig get].showSetup boolValue])
|
||||
[[MPAppDelegate get] showSetup];
|
||||
});
|
||||
} );
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -277,11 +280,11 @@
|
||||
return YES;
|
||||
|
||||
// Arbitrary URL to mpsites data.
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
NSError *error;
|
||||
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
|
||||
NSError *error;
|
||||
NSURLResponse *response;
|
||||
NSData *importedSitesData = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:url]
|
||||
returningResponse:&response error:&error];
|
||||
NSData *importedSitesData = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:url]
|
||||
returningResponse:&response error:&error];
|
||||
if (error)
|
||||
err(@"While reading imported sites from %@: %@", url, error);
|
||||
if (!importedSitesData)
|
||||
@@ -294,11 +297,11 @@
|
||||
__block NSString *masterPassword = nil;
|
||||
|
||||
dispatch_group_t importPasswordGroup = dispatch_group_create();
|
||||
dispatch_group_enter(importPasswordGroup);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_group_enter( importPasswordGroup );
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
[PearlAlert showAlertWithTitle:@"Import File's Master Password"
|
||||
message:PearlString(@"%@'s export was done using a different master password.\n"
|
||||
@"Enter that master password to unlock the exported data.", userName)
|
||||
message:PearlString( @"%@'s export was done using a different master password.\n"
|
||||
@"Enter that master password to unlock the exported data.", userName )
|
||||
viewStyle:UIAlertViewStyleSecureTextInput
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
@try {
|
||||
@@ -308,23 +311,23 @@
|
||||
masterPassword = [alert_ textFieldAtIndex:0].text;
|
||||
}
|
||||
@finally {
|
||||
dispatch_group_leave(importPasswordGroup);
|
||||
dispatch_group_leave( importPasswordGroup );
|
||||
}
|
||||
}
|
||||
cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Unlock Import", nil];
|
||||
});
|
||||
dispatch_group_wait(importPasswordGroup, DISPATCH_TIME_FOREVER);
|
||||
} );
|
||||
dispatch_group_wait( importPasswordGroup, DISPATCH_TIME_FOREVER );
|
||||
|
||||
return masterPassword;
|
||||
} askUserPassword:^NSString *(NSString *userName, NSUInteger importCount, NSUInteger deleteCount) {
|
||||
__block NSString *masterPassword = nil;
|
||||
|
||||
dispatch_group_t userPasswordGroup = dispatch_group_create();
|
||||
dispatch_group_enter(userPasswordGroup);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[PearlAlert showAlertWithTitle:PearlString(@"Master Password for\n%@", userName)
|
||||
message:PearlString(@"Imports %d sites, overwriting %d.", importCount,
|
||||
deleteCount)
|
||||
dispatch_group_enter( userPasswordGroup );
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
[PearlAlert showAlertWithTitle:PearlString( @"Master Password for\n%@", userName )
|
||||
message:PearlString( @"Imports %d sites, overwriting %d.", importCount,
|
||||
deleteCount )
|
||||
viewStyle:UIAlertViewStyleSecureTextInput
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
@try {
|
||||
@@ -334,12 +337,12 @@
|
||||
masterPassword = [alert_ textFieldAtIndex:0].text;
|
||||
}
|
||||
@finally {
|
||||
dispatch_group_leave(userPasswordGroup);
|
||||
dispatch_group_leave( userPasswordGroup );
|
||||
}
|
||||
}
|
||||
cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Import", nil];
|
||||
});
|
||||
dispatch_group_wait(userPasswordGroup, DISPATCH_TIME_FOREVER);
|
||||
} );
|
||||
dispatch_group_wait( userPasswordGroup, DISPATCH_TIME_FOREVER );
|
||||
|
||||
return masterPassword;
|
||||
}];
|
||||
@@ -360,7 +363,7 @@
|
||||
}
|
||||
|
||||
[activityAlert cancelAlertAnimated:YES];
|
||||
});
|
||||
} );
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -411,8 +414,7 @@
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
|
||||
inf(@"Re-activated");
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification
|
||||
object:application userInfo:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:application userInfo:nil];
|
||||
|
||||
[[LocalyticsSession sharedLocalyticsSession] resume];
|
||||
[[LocalyticsSession sharedLocalyticsSession] upload];
|
||||
@@ -453,26 +455,25 @@
|
||||
if (![PearlEMail canSendMail])
|
||||
[PearlAlert showAlertWithTitle:@"Feedback"
|
||||
message:
|
||||
@"Have a question, comment, issue or just saying thanks?\n\n"
|
||||
@"We'd love to hear what you think!\n"
|
||||
@"masterpassword@lyndir.com"
|
||||
@"Have a question, comment, issue or just saying thanks?\n\n"
|
||||
@"We'd love to hear what you think!\n"
|
||||
@"masterpassword@lyndir.com"
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay
|
||||
otherTitles:nil];
|
||||
|
||||
else if (logs)
|
||||
[PearlAlert showAlertWithTitle:@"Feedback"
|
||||
message:
|
||||
@"Have a question, comment, issue or just saying thanks?\n\n"
|
||||
@"If you're having trouble, it may help us if you can first reproduce the problem "
|
||||
@"and then include log files in your message."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
[self openFeedbackWithLogs:(buttonIndex_ == [alert_ firstOtherButtonIndex]) forVC:viewController];
|
||||
} cancelTitle:nil otherTitles:@"Include Logs", @"No Logs", nil];
|
||||
else
|
||||
if (logs)
|
||||
[PearlAlert showAlertWithTitle:@"Feedback"
|
||||
message:
|
||||
@"Have a question, comment, issue or just saying thanks?\n\n"
|
||||
@"If you're having trouble, it may help us if you can first reproduce the problem "
|
||||
@"and then include log files in your message."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
[self openFeedbackWithLogs:(buttonIndex_ == [alert_ firstOtherButtonIndex]) forVC:viewController];
|
||||
} cancelTitle:nil otherTitles:@"Include Logs", @"No Logs", nil];
|
||||
else
|
||||
[self openFeedbackWithLogs:NO forVC:viewController];
|
||||
[self openFeedbackWithLogs:NO forVC:viewController];
|
||||
}
|
||||
|
||||
- (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController {
|
||||
@@ -481,46 +482,48 @@
|
||||
PearlLogLevel logLevel = [[MPiOSConfig get].sendInfo boolValue]? PearlLogLevelDebug: PearlLogLevelInfo;
|
||||
|
||||
[[[PearlEMail alloc] initForEMailTo:@"Master Password Development <masterpassword@lyndir.com>"
|
||||
subject:PearlString(@"Feedback for Master Password [%@]",
|
||||
[[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"])
|
||||
body:PearlString(@"\n\n\n"
|
||||
@"--\n"
|
||||
@"%@"
|
||||
@"Master Password %@, build %@",
|
||||
userName? ([userName stringByAppendingString:@"\n"]): @"",
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion)
|
||||
subject:PearlString( @"Feedback for Master Password [%@]",
|
||||
[[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"] )
|
||||
body:PearlString( @"\n\n\n"
|
||||
@"--\n"
|
||||
@"%@"
|
||||
@"Master Password %@, build %@",
|
||||
userName? ([userName stringByAppendingString:@"\n"]): @"",
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion )
|
||||
|
||||
attachments:(logs
|
||||
? [[PearlEMailAttachment alloc] initWithContent:[[[PearlLogger get] formatMessagesWithLevel:logLevel] dataUsingEncoding:NSUTF8StringEncoding]
|
||||
mimeType:@"text/plain"
|
||||
fileName:PearlString(@"%@-%@.log",
|
||||
[[NSDateFormatter rfc3339DateFormatter] stringFromDate:[NSDate date]],
|
||||
[PearlKeyChain deviceIdentifier])]
|
||||
: nil), nil]
|
||||
showComposerForVC:viewController];
|
||||
? [[PearlEMailAttachment alloc]
|
||||
initWithContent:[[[PearlLogger get] formatMessagesWithLevel:logLevel]
|
||||
dataUsingEncoding:NSUTF8StringEncoding]
|
||||
mimeType:@"text/plain"
|
||||
fileName:PearlString( @"%@-%@.log",
|
||||
[[NSDateFormatter rfc3339DateFormatter] stringFromDate:[NSDate date]],
|
||||
[PearlKeyChain deviceIdentifier] )]
|
||||
: nil), nil]
|
||||
showComposerForVC:viewController];
|
||||
}
|
||||
|
||||
- (void)export {
|
||||
|
||||
[PearlAlert showNotice:
|
||||
@"This will export all your site names.\n\n"
|
||||
@"You can open the export with a text editor to get an overview of all your sites.\n\n"
|
||||
@"The file also acts as a personal backup of your site list in case you don't sync with iCloud/iTunes."
|
||||
@"This will export all your site names.\n\n"
|
||||
@"You can open the export with a text editor to get an overview of all your sites.\n\n"
|
||||
@"The file also acts as a personal backup of your site list in case you don't sync with iCloud/iTunes."
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
[PearlAlert showAlertWithTitle:@"Reveal Passwords?" message:
|
||||
@"Would you like to make all your passwords visible in the export?\n\n"
|
||||
@"A safe export will only include your stored passwords, in an encrypted manner, "
|
||||
@"making the result safe from falling in the wrong hands.\n\n"
|
||||
@"If all your passwords are shown and somebody else finds the export, "
|
||||
@"they could gain access to all your sites!"
|
||||
@"Would you like to make all your passwords visible in the export?\n\n"
|
||||
@"A safe export will only include your stored passwords, in an encrypted manner, "
|
||||
@"making the result safe from falling in the wrong hands.\n\n"
|
||||
@"If all your passwords are shown and somebody else finds the export, "
|
||||
@"they could gain access to all your sites!"
|
||||
viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||
tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 0)
|
||||
// Safe Export
|
||||
// Safe Export
|
||||
[self exportShowPasswords:NO];
|
||||
if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 1)
|
||||
// Show Passwords
|
||||
// Show Passwords
|
||||
[self exportShowPasswords:YES];
|
||||
} cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Safe Export", @"Show Passwords", nil];
|
||||
} otherTitles:nil];
|
||||
@@ -531,8 +534,8 @@
|
||||
if (![PearlEMail canSendMail]) {
|
||||
[PearlAlert showAlertWithTitle:@"Cannot Send Mail"
|
||||
message:
|
||||
@"Your device is not yet set up for sending mail.\n"
|
||||
@"Close Master Password, go into Settings and add a Mail account."
|
||||
@"Your device is not yet set up for sending mail.\n"
|
||||
@"Close Master Password, go into Settings and add a Mail account."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay
|
||||
otherTitles:nil];
|
||||
@@ -543,22 +546,22 @@
|
||||
NSString *message;
|
||||
|
||||
if (showPasswords)
|
||||
message = PearlString(@"Export of Master Password sites with passwords included.\n\n"
|
||||
@"REMINDER: Make sure nobody else sees this file! Passwords are visible!\n\n\n"
|
||||
@"--\n"
|
||||
@"%@\n"
|
||||
@"Master Password %@, build %@",
|
||||
[self activeUserForThread].name,
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion);
|
||||
message = PearlString( @"Export of Master Password sites with passwords included.\n\n"
|
||||
@"REMINDER: Make sure nobody else sees this file! Passwords are visible!\n\n\n"
|
||||
@"--\n"
|
||||
@"%@\n"
|
||||
@"Master Password %@, build %@",
|
||||
[self activeUserForThread].name,
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion );
|
||||
else
|
||||
message = PearlString(@"Backup of Master Password sites.\n\n\n"
|
||||
@"--\n"
|
||||
@"%@\n"
|
||||
@"Master Password %@, build %@",
|
||||
[self activeUserForThread].name,
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion);
|
||||
message = PearlString( @"Backup of Master Password sites.\n\n\n"
|
||||
@"--\n"
|
||||
@"%@\n"
|
||||
@"Master Password %@, build %@",
|
||||
[self activeUserForThread].name,
|
||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||
[PearlInfoPlist get].CFBundleVersion );
|
||||
|
||||
NSDateFormatter *exportDateFormatter = [NSDateFormatter new];
|
||||
[exportDateFormatter setDateFormat:@"yyyy'-'MM'-'dd"];
|
||||
@@ -566,7 +569,8 @@
|
||||
[PearlEMail sendEMailTo:nil subject:@"Master Password Export" body:message
|
||||
attachments:[[PearlEMailAttachment alloc] initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding]
|
||||
mimeType:@"text/plain" fileName:
|
||||
PearlString(@"%@ (%@).mpsites", [self activeUserForThread].name, [exportDateFormatter stringFromDate:[NSDate date]])],
|
||||
PearlString( @"%@ (%@).mpsites", [self activeUserForThread].name,
|
||||
[exportDateFormatter stringFromDate:[NSDate date]] )],
|
||||
nil];
|
||||
}
|
||||
|
||||
@@ -574,9 +578,9 @@
|
||||
|
||||
[PearlAlert showAlertWithTitle:@"Changing Master Password"
|
||||
message:
|
||||
@"If you continue, you'll be able to set a new master password.\n\n"
|
||||
@"Changing your master password will cause all your generated passwords to change!\n"
|
||||
@"Changing the master password back to the old one will cause your passwords to revert as well."
|
||||
@"If you continue, you'll be able to set a new master password.\n\n"
|
||||
@"Changing your master password will cause all your generated passwords to change!\n"
|
||||
@"Changing the master password back to the old one will cause your passwords to revert as well."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert cancelButtonIndex])
|
||||
@@ -603,8 +607,8 @@
|
||||
|
||||
- (void)didUpdateConfigForKey:(SEL)configKey fromValue:(id)value {
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification
|
||||
object:NSStringFromSelector(configKey) userInfo:nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:MPCheckConfigNotification object:NSStringFromSelector( configKey ) userInfo:nil];
|
||||
}
|
||||
|
||||
#pragma mark - UbiquityStoreManagerDelegate
|
||||
@@ -619,34 +623,33 @@
|
||||
- (void)alertCloudDisabledForManager:(UbiquityStoreManager *)manager {
|
||||
|
||||
[PearlAlert showAlertWithTitle:@"iCloud" message:
|
||||
@"iCloud is now disabled.\n\n"
|
||||
@"It is highly recommended you enable iCloud."
|
||||
viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert firstOtherButtonIndex] + 0) {
|
||||
[PearlAlert showAlertWithTitle:@"About iCloud" message:
|
||||
@"iCloud is Apple's solution for saving your data in \"the cloud\" "
|
||||
@"and making sure your other iPhones, iPads and Macs are in sync.\n\n"
|
||||
@"For Master Password, that means your sites are available on all your "
|
||||
@"Apple devices, and you always have a backup of them in case "
|
||||
@"you lose one or need to restore.\n\n"
|
||||
@"Thanks to the way Master Password works, it doesn't need to send your "
|
||||
@"site's passwords to Apple for the backup to work: Only their names are "
|
||||
@"saved. If you set a custom password it will be sent to iCloud after "
|
||||
@"being encrypted with your master password.\n\n"
|
||||
@"Apple can never see any of your passwords."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
[self alertCloudDisabledForManager:manager];
|
||||
}
|
||||
cancelTitle:[PearlStrings get].commonButtonThanks otherTitles:nil];
|
||||
return;
|
||||
}
|
||||
@"iCloud is now disabled.\n\n"
|
||||
@"It is highly recommended you enable iCloud."
|
||||
viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert firstOtherButtonIndex] + 0) {
|
||||
[PearlAlert showAlertWithTitle:@"About iCloud" message:
|
||||
@"iCloud is Apple's solution for saving your data in \"the cloud\" "
|
||||
@"and making sure your other iPhones, iPads and Macs are in sync.\n\n"
|
||||
@"For Master Password, that means your sites are available on all your "
|
||||
@"Apple devices, and you always have a backup of them in case "
|
||||
@"you lose one or need to restore.\n\n"
|
||||
@"Thanks to the way Master Password works, it doesn't need to send your "
|
||||
@"site's passwords to Apple for the backup to work: Only their names are "
|
||||
@"saved. If you set a custom password it will be sent to iCloud after "
|
||||
@"being encrypted with your master password.\n\n"
|
||||
@"Apple can never see any of your passwords."
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
[self alertCloudDisabledForManager:manager];
|
||||
}
|
||||
cancelTitle:[PearlStrings get].commonButtonThanks otherTitles:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
[MPConfig get].iCloudDecided = @YES;
|
||||
if (buttonIndex == [alert firstOtherButtonIndex] + 1)
|
||||
manager.cloudEnabled = YES;
|
||||
} cancelTitle:@"Leave Off" otherTitles:@"Explain?", @"Enable iCloud", nil];
|
||||
[MPConfig get].iCloudDecided = @YES;
|
||||
if (buttonIndex == [alert firstOtherButtonIndex] + 1)
|
||||
manager.cloudEnabled = YES;
|
||||
} cancelTitle:@"Leave Off" otherTitles:@"Explain?", @"Enable iCloud", nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -657,7 +660,7 @@
|
||||
static NSDictionary *googlePlusInfo = nil;
|
||||
if (googlePlusInfo == nil)
|
||||
googlePlusInfo = [[NSDictionary alloc] initWithContentsOfURL:
|
||||
[[NSBundle mainBundle] URLForResource:@"Google+" withExtension:@"plist"]];
|
||||
[[NSBundle mainBundle] URLForResource:@"Google+" withExtension:@"plist"]];
|
||||
|
||||
return googlePlusInfo;
|
||||
}
|
||||
@@ -675,7 +678,7 @@
|
||||
static NSDictionary *testFlightInfo = nil;
|
||||
if (testFlightInfo == nil)
|
||||
testFlightInfo = [[NSDictionary alloc] initWithContentsOfURL:
|
||||
[[NSBundle mainBundle] URLForResource:@"TestFlight" withExtension:@"plist"]];
|
||||
[[NSBundle mainBundle] URLForResource:@"TestFlight" withExtension:@"plist"]];
|
||||
|
||||
return testFlightInfo;
|
||||
}
|
||||
@@ -693,7 +696,7 @@
|
||||
static NSDictionary *crashlyticsInfo = nil;
|
||||
if (crashlyticsInfo == nil)
|
||||
crashlyticsInfo = [[NSDictionary alloc] initWithContentsOfURL:
|
||||
[[NSBundle mainBundle] URLForResource:@"Crashlytics" withExtension:@"plist"]];
|
||||
[[NSBundle mainBundle] URLForResource:@"Crashlytics" withExtension:@"plist"]];
|
||||
|
||||
return crashlyticsInfo;
|
||||
}
|
||||
@@ -711,7 +714,7 @@
|
||||
static NSDictionary *localyticsInfo = nil;
|
||||
if (localyticsInfo == nil)
|
||||
localyticsInfo = [[NSDictionary alloc] initWithContentsOfURL:
|
||||
[[NSBundle mainBundle] URLForResource:@"Localytics" withExtension:@"plist"]];
|
||||
[[NSBundle mainBundle] URLForResource:@"Localytics" withExtension:@"plist"]];
|
||||
|
||||
return localyticsInfo;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface MPAppViewController : UIViewController
|
||||
|
||||
- (IBAction)gorillas:(UIButton *)sender;
|
||||
|
||||
@@ -17,12 +17,9 @@
|
||||
|
||||
#import "MPAppViewController.h"
|
||||
|
||||
|
||||
@implementation MPAppViewController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)gorillas:(UIButton *)sender {
|
||||
|
||||
MPCheckpoint( MPCheckpointApp, @{
|
||||
@@ -35,7 +32,7 @@
|
||||
- (IBAction)deblock:(UIButton *)sender {
|
||||
|
||||
MPCheckpoint( MPCheckpointApp, @{
|
||||
@"app": @"deblock"
|
||||
@"app" : @"deblock"
|
||||
} );
|
||||
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/app/lyndir/deblock/id325058485?mt=8"]];
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface MPAppsViewController : UIViewController<UIPageViewControllerDataSource, UIPageViewControllerDelegate>
|
||||
|
||||
@interface MPAppsViewController : UIViewController <UIPageViewControllerDataSource, UIPageViewControllerDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *pagePositionView;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *pagePositionView;
|
||||
|
||||
- (IBAction)exit;
|
||||
|
||||
|
||||
@@ -17,30 +17,27 @@
|
||||
|
||||
#import "MPAppsViewController.h"
|
||||
|
||||
@interface MPAppsViewController()
|
||||
|
||||
@interface MPAppsViewController ()
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *pageVCs;
|
||||
@property (nonatomic, strong) UIPageViewController *pageViewController;
|
||||
|
||||
@property(nonatomic, strong) NSMutableArray *pageVCs;
|
||||
@property(nonatomic, strong) UIPageViewController *pageViewController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPAppsViewController {
|
||||
|
||||
}
|
||||
|
||||
@synthesize pagePositionView = _pagePositionView;
|
||||
@synthesize pageVCs = _pageVCs;
|
||||
@synthesize pageViewController = _pageViewController;
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
||||
self.pageVCs = [NSMutableArray array];
|
||||
UIViewController *vc;
|
||||
@try {
|
||||
for (NSUInteger p = 0;
|
||||
(vc = [self.storyboard instantiateViewControllerWithIdentifier:PearlString(@"MPAppViewController_%u", p)]);
|
||||
(vc = [self.storyboard instantiateViewControllerWithIdentifier:PearlString( @"MPAppViewController_%u", p )]);
|
||||
++p)
|
||||
[self.pageVCs addObject:vc];
|
||||
}
|
||||
@@ -49,11 +46,11 @@
|
||||
[e raise];
|
||||
}
|
||||
|
||||
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl
|
||||
navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal
|
||||
options:nil];
|
||||
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl
|
||||
navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal
|
||||
options:nil];
|
||||
self.pageViewController.dataSource = self;
|
||||
self.pageViewController.delegate = self;
|
||||
self.pageViewController.delegate = self;
|
||||
[self addChildViewController:self.pageViewController];
|
||||
[self.view addSubview:self.pageViewController.view];
|
||||
self.pageViewController.view.frame = self.pagePositionView.frame;
|
||||
@@ -68,7 +65,7 @@
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
|
||||
MPCheckpoint( MPCheckpointApps, nil );
|
||||
|
||||
[self.pageViewController setViewControllers:@[ [self.pageVCs objectAtIndex:1] ] direction:UIPageViewControllerNavigationDirectionForward
|
||||
[self.pageViewController setViewControllers:@[ [self.pageVCs objectAtIndex:1] ] direction:UIPageViewControllerNavigationDirectionForward
|
||||
animated:NO completion:nil];
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
@@ -101,7 +98,6 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController
|
||||
viewControllerBeforeViewController:(UIViewController *)viewController {
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#import "MPElementListController.h"
|
||||
|
||||
@interface MPElementListAllViewController : MPElementListController
|
||||
@property (weak, nonatomic) IBOutlet UINavigationBar *navigationBar;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UINavigationBar *navigationBar;
|
||||
|
||||
- (IBAction)close:(id)sender;
|
||||
- (IBAction)add:(id)sender;
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
} cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:[PearlStrings get].commonButtonContinue, nil];
|
||||
}
|
||||
|
||||
- (void)performUpgradeAllWithCompletion:(void(^)(BOOL success, NSDictionary *changes))completion {
|
||||
- (void)performUpgradeAllWithCompletion:(void (^)(BOOL success, NSDictionary *changes))completion {
|
||||
|
||||
[MPAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
||||
@@ -93,7 +93,7 @@
|
||||
NSArray *elements = [moc executeFetchRequest:fetchRequest error:&error];
|
||||
if (!elements) {
|
||||
err(@"Failed to fetch outdated sites for upgrade: %@", error);
|
||||
completion(NO, nil);
|
||||
completion( NO, nil );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
}
|
||||
|
||||
[moc saveToStore];
|
||||
completion(YES, elementChanges);
|
||||
completion( YES, elementChanges );
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -131,14 +131,13 @@
|
||||
[PearlAlert showAlertWithTitle:@"Sites Upgraded"
|
||||
message:PearlString( @"This upgrade has caused %d passwords to change.\n"
|
||||
@"To make updating the actual passwords of these accounts easier, "
|
||||
@"you can email a summary of these changes to yourself.", [changes count])
|
||||
viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert cancelButtonIndex])
|
||||
return;
|
||||
@"you can email a summary of these changes to yourself.", [changes count] )
|
||||
viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert cancelButtonIndex])
|
||||
return;
|
||||
|
||||
[PearlEMail sendEMailTo:nil subject:@"[Master Password] Upgrade Changes" body:formattedChanges];
|
||||
} cancelTitle:@"Don't Email" otherTitles:@"Send Email", nil];
|
||||
[PearlEMail sendEMailTo:nil subject:@"[Master Password] Upgrade Changes" body:formattedChanges];
|
||||
} cancelTitle:@"Don't Email" otherTitles:@"Send Email", nil];
|
||||
}
|
||||
|
||||
- (NSFetchedResultsController *)fetchedResultsControllerByUses {
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
#define MPElementListFilterNone @"MPElementListFilterNone"
|
||||
#define MPElementListFilterOutdated @"MPElementListFilterOutdated"
|
||||
|
||||
@interface MPElementListController : UITableViewController <NSFetchedResultsControllerDelegate>
|
||||
@interface MPElementListController : UITableViewController<NSFetchedResultsControllerDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet id<MPElementListDelegate> delegate;
|
||||
@property (strong, nonatomic) NSString *filter;
|
||||
@property(weak, nonatomic) IBOutlet id<MPElementListDelegate> delegate;
|
||||
@property(strong, nonatomic) NSString *filter;
|
||||
|
||||
@property (readonly) NSFetchedResultsController *fetchedResultsControllerByUses;
|
||||
@property (readonly) NSFetchedResultsController *fetchedResultsControllerByLastUsed;
|
||||
@property (readonly) NSDateFormatter *dateFormatter;
|
||||
@property(readonly) NSFetchedResultsController *fetchedResultsControllerByUses;
|
||||
@property(readonly) NSFetchedResultsController *fetchedResultsControllerByLastUsed;
|
||||
@property(readonly) NSDateFormatter *dateFormatter;
|
||||
|
||||
- (void)updateData;
|
||||
- (void)addElementNamed:(NSString *)siteName completion:(void (^)(BOOL success))completion;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#import "MPAppDelegate_Store.h"
|
||||
#import "MPAppDelegate.h"
|
||||
|
||||
@interface MPElementListController ()
|
||||
@interface MPElementListController()
|
||||
@end
|
||||
|
||||
@implementation MPElementListController {
|
||||
@@ -13,11 +13,11 @@
|
||||
NSDateFormatter *_dateFormatter;
|
||||
}
|
||||
|
||||
- (void)addElementNamed:(NSString *)siteName completion:(void(^)(BOOL success))completion {
|
||||
- (void)addElementNamed:(NSString *)siteName completion:(void (^)(BOOL success))completion {
|
||||
|
||||
if (![siteName length]) {
|
||||
if (completion)
|
||||
completion(false);
|
||||
completion( false );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@
|
||||
[moc saveToStore];
|
||||
|
||||
NSManagedObjectID *elementOID = [element objectID];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
MPElementEntity *element_ = (MPElementEntity *) [[MPAppDelegate managedObjectContextForThreadIfReady]
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
MPElementEntity *element_ = (MPElementEntity *)[[MPAppDelegate managedObjectContextForThreadIfReady]
|
||||
objectRegisteredForID:elementOID];
|
||||
[self.delegate didSelectElement:element_];
|
||||
if (completion)
|
||||
completion(true);
|
||||
});
|
||||
completion( true );
|
||||
} );
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@
|
||||
if (!moc)
|
||||
return nil;
|
||||
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPElementEntity class])];
|
||||
fetchRequest.sortDescriptors = @[[[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO]];
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
||||
fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO] ];
|
||||
[self configureFetchRequest:fetchRequest];
|
||||
_fetchedResultsControllerByLastUsed = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc
|
||||
sectionNameKeyPath:nil cacheName:nil];
|
||||
sectionNameKeyPath:nil cacheName:nil];
|
||||
_fetchedResultsControllerByLastUsed.delegate = self;
|
||||
}
|
||||
|
||||
@@ -119,20 +119,20 @@
|
||||
return;
|
||||
|
||||
predicate = [NSCompoundPredicate andPredicateWithSubpredicates:
|
||||
@[predicate, [NSPredicate predicateWithFormat:@"name BEGINSWITH[cd] %@", query]]];
|
||||
@[ predicate, [NSPredicate predicateWithFormat:@"name BEGINSWITH[cd] %@", query] ]];
|
||||
}
|
||||
|
||||
|
||||
// Add filter predicate.
|
||||
if ([self.filter isEqualToString:MPElementListFilterOutdated])
|
||||
predicate = [NSCompoundPredicate andPredicateWithSubpredicates:
|
||||
@[[NSPredicate predicateWithFormat:@"requiresExplicitMigration_ == YES"], predicate]];
|
||||
@[ [NSPredicate predicateWithFormat:@"requiresExplicitMigration_ == YES"], predicate ]];
|
||||
|
||||
// Fetch
|
||||
NSError *error;
|
||||
self.fetchedResultsControllerByLastUsed.fetchRequest.predicate = predicate;
|
||||
self.fetchedResultsControllerByUses.fetchRequest.predicate = predicate;
|
||||
if (![self.fetchedResultsControllerByLastUsed performFetch:&error])
|
||||
err(@"Couldn't fetch elements: %@", error);
|
||||
err(@"Couldn't fetch elements: %@", error);
|
||||
if (![self.fetchedResultsControllerByUses performFetch:&error])
|
||||
err(@"Couldn't fetch elements: %@", error);
|
||||
|
||||
@@ -140,13 +140,12 @@
|
||||
}
|
||||
|
||||
- (void)customTableViewUpdates {
|
||||
|
||||
}
|
||||
|
||||
// See MP-14, also crashes easily on internal assertions etc..
|
||||
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
|
||||
|
||||
dbg(@"%@", NSStringFromSelector(_cmd));
|
||||
dbg(@"%@", NSStringFromSelector( _cmd ));
|
||||
[self.tableView beginUpdates];
|
||||
}
|
||||
|
||||
@@ -156,25 +155,25 @@
|
||||
switch (type) {
|
||||
|
||||
case NSFetchedResultsChangeInsert:
|
||||
dbg(@"%@ -- NSFetchedResultsChangeInsert:%@", NSStringFromSelector(_cmd), anObject);
|
||||
dbg(@"%@ -- NSFetchedResultsChangeInsert:%@", NSStringFromSelector( _cmd ), anObject);
|
||||
[self.tableView insertRowsAtIndexPaths:@[ [self tableIndexPathForFetchController:controller indexPath:newIndexPath] ]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
break;
|
||||
|
||||
case NSFetchedResultsChangeDelete:
|
||||
dbg(@"%@ -- NSFetchedResultsChangeDelete:%@", NSStringFromSelector(_cmd), anObject);
|
||||
dbg(@"%@ -- NSFetchedResultsChangeDelete:%@", NSStringFromSelector( _cmd ), anObject);
|
||||
[self.tableView deleteRowsAtIndexPaths:@[ [self tableIndexPathForFetchController:controller indexPath:indexPath] ]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
break;
|
||||
|
||||
case NSFetchedResultsChangeUpdate:
|
||||
dbg(@"%@ -- NSFetchedResultsChangeUpdate:%@", NSStringFromSelector(_cmd), anObject);
|
||||
dbg(@"%@ -- NSFetchedResultsChangeUpdate:%@", NSStringFromSelector( _cmd ), anObject);
|
||||
[self.tableView reloadRowsAtIndexPaths:@[ [self tableIndexPathForFetchController:controller indexPath:indexPath] ]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
break;
|
||||
|
||||
case NSFetchedResultsChangeMove:
|
||||
dbg(@"%@ -- NSFetchedResultsChangeMove:%@", NSStringFromSelector(_cmd), anObject);
|
||||
dbg(@"%@ -- NSFetchedResultsChangeMove:%@", NSStringFromSelector( _cmd ), anObject);
|
||||
[self.tableView deleteRowsAtIndexPaths:@[ [self tableIndexPathForFetchController:controller indexPath:indexPath] ]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
[self.tableView insertRowsAtIndexPaths:@[ [self tableIndexPathForFetchController:controller indexPath:newIndexPath] ]
|
||||
@@ -185,7 +184,7 @@
|
||||
|
||||
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
|
||||
|
||||
dbg(@"%@ on %@", NSStringFromSelector(_cmd), [NSThread currentThread].name);
|
||||
dbg(@"%@ on %@", NSStringFromSelector( _cmd ), [NSThread currentThread].name);
|
||||
[self customTableViewUpdates];
|
||||
[self.tableView endUpdates];
|
||||
}
|
||||
@@ -210,7 +209,7 @@
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MPElementListCell"];
|
||||
if (!cell)
|
||||
cell = (UITableViewCell *) [[UIViewController alloc] initWithNibName:@"MPElementListCellView" bundle:nil].view;
|
||||
cell = (UITableViewCell *)[[UIViewController alloc] initWithNibName:@"MPElementListCellView" bundle:nil].view;
|
||||
|
||||
[self configureCell:cell inTableView:tableView atTableIndexPath:indexPath];
|
||||
|
||||
@@ -222,11 +221,12 @@
|
||||
MPElementEntity *element = [self elementForTableIndexPath:indexPath];
|
||||
|
||||
cell.textLabel.text = element.name;
|
||||
cell.detailTextLabel.text = PearlString(@"%d views, last on %@: %@",
|
||||
element.uses, [self.dateFormatter stringFromDate:element.lastUsed], [element.algorithm shortNameOfType:element.type]);
|
||||
cell.detailTextLabel.text = PearlString( @"%d views, last on %@: %@",
|
||||
element.uses, [self.dateFormatter stringFromDate:element.lastUsed], [element.algorithm shortNameOfType:element.type] );
|
||||
}
|
||||
|
||||
- (NSIndexPath *)tableIndexPathForFetchController:(NSFetchedResultsController *)fetchedResultsController indexPath:(NSIndexPath *)indexPath {
|
||||
- (NSIndexPath *)tableIndexPathForFetchController:(NSFetchedResultsController *)fetchedResultsController
|
||||
indexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
if (fetchedResultsController == self.fetchedResultsControllerByLastUsed)
|
||||
return [NSIndexPath indexPathForRow:indexPath.row inSection:0];
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
|
||||
|
||||
return @[@"recency", @"uses"];
|
||||
return @[ @"recency", @"uses" ];
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
|
||||
@@ -292,7 +292,7 @@ forRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
MPCheckpoint( MPCheckpointDeleteElement, @{
|
||||
@"type" : element.typeName,
|
||||
@"version" : @(element.version)
|
||||
});
|
||||
} );
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#import "MPElementEntity.h"
|
||||
|
||||
@protocol MPElementListDelegate <NSObject>
|
||||
@protocol MPElementListDelegate<NSObject>
|
||||
|
||||
- (void)didSelectElement:(MPElementEntity *)element;
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
@interface MPElementListSearchController : MPElementListController<UISearchBarDelegate, UISearchDisplayDelegate>
|
||||
|
||||
@property (strong, nonatomic) UILabel *tipView;
|
||||
@property(strong, nonatomic) UILabel *tipView;
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UISearchDisplayController *searchDisplayController;
|
||||
@property (weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
||||
@property(strong, nonatomic) IBOutlet UISearchDisplayController *searchDisplayController;
|
||||
@property(weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
#import "MPMainViewController.h"
|
||||
#import "MPAppDelegate.h"
|
||||
|
||||
@interface MPElementListSearchController ()
|
||||
@interface MPElementListSearchController()
|
||||
|
||||
@property (nonatomic) BOOL newSiteSectionWasNeeded;
|
||||
@property(nonatomic) BOOL newSiteSectionWasNeeded;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPElementListSearchController
|
||||
|
||||
@synthesize searchDisplayController;
|
||||
|
||||
- (id)init {
|
||||
@@ -24,22 +25,22 @@
|
||||
if (!(self = [super init]))
|
||||
return nil;
|
||||
|
||||
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 170)];
|
||||
self.tipView.textAlignment = NSTextAlignmentCenter;
|
||||
self.tipView.backgroundColor = [UIColor clearColor];
|
||||
self.tipView.textColor = [UIColor lightTextColor];
|
||||
self.tipView.shadowColor = [UIColor blackColor];
|
||||
self.tipView.shadowOffset = CGSizeMake(0, -1);
|
||||
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake( 0, 0, 320, 170 )];
|
||||
self.tipView.textAlignment = NSTextAlignmentCenter;
|
||||
self.tipView.backgroundColor = [UIColor clearColor];
|
||||
self.tipView.textColor = [UIColor lightTextColor];
|
||||
self.tipView.shadowColor = [UIColor blackColor];
|
||||
self.tipView.shadowOffset = CGSizeMake( 0, -1 );
|
||||
self.tipView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
|
||||
| UIViewAutoresizingFlexibleBottomMargin;
|
||||
self.tipView.numberOfLines = 0;
|
||||
self.tipView.font = [UIFont systemFontOfSize:14];
|
||||
| UIViewAutoresizingFlexibleBottomMargin;
|
||||
self.tipView.numberOfLines = 0;
|
||||
self.tipView.font = [UIFont systemFontOfSize:14];
|
||||
self.tipView.text =
|
||||
@"Tip:\n"
|
||||
@"Name your sites by their domain name:\n"
|
||||
@"apple.com, twitter.com\n\n"
|
||||
@"For email accounts, use the address:\n"
|
||||
@"john@apple.com, john@gmail.com";
|
||||
@"Tip:\n"
|
||||
@"Name your sites by their domain name:\n"
|
||||
@"apple.com, twitter.com\n\n"
|
||||
@"For email accounts, use the address:\n"
|
||||
@"john@apple.com, john@gmail.com";
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -69,7 +70,7 @@
|
||||
|
||||
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
|
||||
|
||||
controller.searchBar.text = @"";
|
||||
controller.searchBar.text = @"";
|
||||
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.searchTipContainer.alpha = 0;
|
||||
@@ -83,15 +84,15 @@
|
||||
|
||||
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller {
|
||||
|
||||
controller.searchBar.prompt = nil;
|
||||
controller.searchBar.prompt = nil;
|
||||
controller.searchBar.searchResultsButtonSelected = NO;
|
||||
}
|
||||
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView {
|
||||
|
||||
tableView.backgroundColor = [UIColor blackColor];
|
||||
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
tableView.rowHeight = 48.0f;
|
||||
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
tableView.rowHeight = 48.0f;
|
||||
|
||||
self.tableView = tableView;
|
||||
}
|
||||
@@ -103,7 +104,7 @@
|
||||
}
|
||||
|
||||
- (void)updateData {
|
||||
|
||||
|
||||
[super updateData];
|
||||
|
||||
UISearchBar *searchBar = self.searchDisplayController.searchBar;
|
||||
@@ -111,13 +112,13 @@
|
||||
[searchBar.superview enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||
|
||||
if ([subview isKindOfClass:[UIControl class]] &&
|
||||
CGPointEqualToPoint(
|
||||
CGPointDistanceBetweenCGPoints(searchBarFrame.origin, subview.frame.origin),
|
||||
CGPointMake(0, searchBarFrame.size.height))) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
CGPointEqualToPoint(
|
||||
CGPointDistanceBetweenCGPoints( searchBarFrame.origin, subview.frame.origin ),
|
||||
CGPointMake( 0, searchBarFrame.size.height ) )) {
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
[self.tipView removeFromSuperview];
|
||||
[subview addSubview:self.tipView];
|
||||
});
|
||||
} );
|
||||
|
||||
*stop = YES;
|
||||
}
|
||||
@@ -131,7 +132,7 @@
|
||||
return NO;
|
||||
|
||||
__block BOOL hasExactQueryMatch = NO;
|
||||
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsControllerByUses sections] lastObject];
|
||||
id<NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsControllerByUses sections] lastObject];
|
||||
[[sectionInfo objects] enumerateObjectsUsingBlock:^(id obj_, NSUInteger idx_, BOOL *stop_) {
|
||||
if ([[obj_ name] isEqualToString:query]) {
|
||||
hasExactQueryMatch = YES;
|
||||
@@ -178,7 +179,7 @@
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
|
||||
if (section < [super numberOfSectionsInTableView:tableView])
|
||||
// Section is one of super's sections.
|
||||
// Section is one of super's sections.
|
||||
return [super tableView:tableView numberOfRowsInSection:section];
|
||||
|
||||
return 1;
|
||||
@@ -195,8 +196,8 @@
|
||||
// "New" section
|
||||
NSString *query = [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||
cell.textLabel.text = query;
|
||||
cell.detailTextLabel.text = PearlString(@"New site: %@",
|
||||
[MPAlgorithmDefault shortNameOfType:[[[MPAppDelegate get] activeUserForThread] defaultType]]);
|
||||
cell.detailTextLabel.text = PearlString( @"New site: %@",
|
||||
[MPAlgorithmDefault shortNameOfType:[[[MPAppDelegate get] activeUserForThread] defaultType]] );
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
@@ -208,10 +209,11 @@
|
||||
}
|
||||
|
||||
// "New" section.
|
||||
NSString *siteName = [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||
NSString *siteName
|
||||
= [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||
|
||||
[PearlAlert showAlertWithTitle:@"New Site"
|
||||
message:PearlString(@"Do you want to create a new site named:\n%@", siteName)
|
||||
message:PearlString( @"Do you want to create a new site named:\n%@", siteName )
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
@@ -226,7 +228,7 @@
|
||||
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
|
||||
|
||||
if (section < [super numberOfSectionsInTableView:tableView])
|
||||
// Section is one of super's sections.
|
||||
// Section is one of super's sections.
|
||||
return [super tableView:tableView titleForHeaderInSection:section];
|
||||
|
||||
return @"Create";
|
||||
@@ -236,9 +238,8 @@
|
||||
forRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
if (indexPath.section < [super numberOfSectionsInTableView:tableView])
|
||||
// Section is one of super's sections.
|
||||
// Section is one of super's sections.
|
||||
[super tableView:tableView commitEditingStyle:editingStyle forRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,24 +8,24 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MPGuideViewController : UIViewController <UIScrollViewDelegate>
|
||||
@interface MPGuideViewController : UIViewController<UIScrollViewDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIView *siteNameTip;
|
||||
@property (weak, nonatomic) IBOutlet UIView *contentTip;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *contentTipText;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *usernameButton;
|
||||
@property (weak, nonatomic) IBOutlet UIView *usernameTip;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *typeButton;
|
||||
@property (weak, nonatomic) IBOutlet UIView *typeTip;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *toolButton;
|
||||
@property (weak, nonatomic) IBOutlet UIView *toolTip;
|
||||
@property (weak, nonatomic) IBOutlet UIProgressView *progress;
|
||||
@property (weak, nonatomic) IBOutlet UIView *content;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *contentButton;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *contentText;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *volumeButton;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *largePlayButton;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *smallPlayButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView *siteNameTip;
|
||||
@property(weak, nonatomic) IBOutlet UIView *contentTip;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *contentTipText;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *usernameButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView *usernameTip;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *typeButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView *typeTip;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *toolButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView *toolTip;
|
||||
@property(weak, nonatomic) IBOutlet UIProgressView *progress;
|
||||
@property(weak, nonatomic) IBOutlet UIView *content;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *contentButton;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *contentText;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *volumeButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *largePlayButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *smallPlayButton;
|
||||
|
||||
- (IBAction)play;
|
||||
- (IBAction)close;
|
||||
|
||||
@@ -12,46 +12,45 @@
|
||||
|
||||
@interface MPMainViewController : UIViewController<MPTypeDelegate, UITextFieldDelegate, MPElementListDelegate, UIWebViewDelegate, UIGestureRecognizerDelegate>
|
||||
|
||||
@property (assign, nonatomic) BOOL siteInfoHidden;
|
||||
@property (strong, nonatomic) IBOutlet MPElementListSearchController *searchDelegate;
|
||||
@property (strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullDownGesture;
|
||||
@property (strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullUpGesture;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *contentField;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *typeButton;
|
||||
@property (weak, nonatomic) IBOutlet UIWebView *helpView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *siteName;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *passwordCounter;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *passwordIncrementer;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *passwordEdit;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *passwordUpgrade;
|
||||
@property (weak, nonatomic) IBOutlet UIView *contentContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *displayContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *helpContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *contentTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *loginNameTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *alertContainer;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *alertTitle;
|
||||
@property (weak, nonatomic) IBOutlet UITextView *alertBody;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *contentTipBody;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *loginNameTipBody;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *toolTipEditIcon;
|
||||
@property (weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *actionsTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *typeTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIView *toolTipContainer;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *toolTipBody;
|
||||
@property (weak, nonatomic) IBOutlet UIView *loginNameContainer;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *loginNameField;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *passwordUser;
|
||||
@property (weak, nonatomic) IBOutlet UIView *outdatedAlertContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *outdatedAlertBack;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *outdatedAlertCloseButton;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *pullUpView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *pullDownView;
|
||||
@property(assign, nonatomic) BOOL siteInfoHidden;
|
||||
@property(strong, nonatomic) IBOutlet MPElementListSearchController *searchDelegate;
|
||||
@property(strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullDownGesture;
|
||||
@property(strong, nonatomic) IBOutlet UIPanGestureRecognizer *pullUpGesture;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *contentField;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *typeButton;
|
||||
@property(weak, nonatomic) IBOutlet UIWebView *helpView;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *siteName;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *passwordCounter;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *passwordIncrementer;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *passwordEdit;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *passwordUpgrade;
|
||||
@property(weak, nonatomic) IBOutlet UIView *contentContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *displayContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *helpContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *contentTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *loginNameTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *alertContainer;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *alertTitle;
|
||||
@property(weak, nonatomic) IBOutlet UITextView *alertBody;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *contentTipBody;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *loginNameTipBody;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *toolTipEditIcon;
|
||||
@property(weak, nonatomic) IBOutlet UIView *searchTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *actionsTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *typeTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIView *toolTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *toolTipBody;
|
||||
@property(weak, nonatomic) IBOutlet UIView *loginNameContainer;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *loginNameField;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *passwordUser;
|
||||
@property(weak, nonatomic) IBOutlet UIView *outdatedAlertContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *outdatedAlertBack;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *outdatedAlertCloseButton;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *pullUpView;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *pullDownView;
|
||||
|
||||
|
||||
@property (copy, nonatomic) void (^contentTipCleanup)(BOOL finished);
|
||||
@property (copy, nonatomic) void (^toolTipCleanup)(BOOL finished);
|
||||
@property(copy, nonatomic) void (^contentTipCleanup)(BOOL finished);
|
||||
@property(copy, nonatomic) void (^toolTipCleanup)(BOOL finished);
|
||||
|
||||
- (IBAction)copyContent;
|
||||
- (IBAction)incrementPasswordCounter;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#import "MPAppDelegate_Store.h"
|
||||
#import "MPElementListAllViewController.h"
|
||||
|
||||
|
||||
@interface MPMainViewController()
|
||||
@property (nonatomic)BOOL suppressOutdatedAlert;
|
||||
|
||||
@property(nonatomic) BOOL suppressOutdatedAlert;
|
||||
@end
|
||||
|
||||
@implementation MPMainViewController {
|
||||
@@ -43,7 +43,6 @@
|
||||
[self updateUserHiddenAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
|
||||
if ([[segue identifier] isEqualToString:@"MP_ChooseType"])
|
||||
@@ -56,13 +55,13 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
||||
self.searchDelegate = [MPElementListSearchController new];
|
||||
self.searchDelegate.delegate = self;
|
||||
self.searchDelegate.searchDisplayController = self.searchDisplayController;
|
||||
self.searchDelegate.searchTipContainer = self.searchTipContainer;
|
||||
self.searchDisplayController.searchBar.delegate = self.searchDelegate;
|
||||
self.searchDisplayController.delegate = self.searchDelegate;
|
||||
self.searchDisplayController.searchResultsDelegate = self.searchDelegate;
|
||||
self.searchDelegate = [MPElementListSearchController new];
|
||||
self.searchDelegate.delegate = self;
|
||||
self.searchDelegate.searchDisplayController = self.searchDisplayController;
|
||||
self.searchDelegate.searchTipContainer = self.searchTipContainer;
|
||||
self.searchDisplayController.searchBar.delegate = self.searchDelegate;
|
||||
self.searchDisplayController.delegate = self.searchDelegate;
|
||||
self.searchDisplayController.searchResultsDelegate = self.searchDelegate;
|
||||
self.searchDisplayController.searchResultsDataSource = self.searchDelegate;
|
||||
|
||||
[self.passwordIncrementer addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self
|
||||
@@ -75,21 +74,21 @@
|
||||
|
||||
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]];
|
||||
|
||||
self.alertBody.text = nil;
|
||||
self.alertBody.text = nil;
|
||||
self.toolTipEditIcon.hidden = YES;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification object:self queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
self.suppressOutdatedAlert = NO;
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:UIApplicationDidEnterBackgroundNotification object:self queue:nil usingBlock:^(NSNotification *note) {
|
||||
self.suppressOutdatedAlert = NO;
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPElementUpdatedNotification object:nil queue:nil usingBlock:
|
||||
^void(NSNotification *note) {
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
if (activeElement.type & MPElementTypeClassStored && ![[activeElement.content description] length])
|
||||
[self showToolTip:@"Tap to set a password." withIcon:self.toolTipEditIcon];
|
||||
if (activeElement.requiresExplicitMigration)
|
||||
[self showToolTip:@"Password outdated. Tap to upgrade it." withIcon:nil];
|
||||
}];
|
||||
^void(NSNotification *note) {
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
if (activeElement.type & MPElementTypeClassStored && ![[activeElement.content description] length])
|
||||
[self showToolTip:@"Tap to set a password." withIcon:self.toolTipEditIcon];
|
||||
if (activeElement.requiresExplicitMigration)
|
||||
[self showToolTip:@"Password outdated. Tap to upgrade it." withIcon:nil];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPSignedOutNotification object:nil queue:nil usingBlock:
|
||||
^(NSNotification *note) {
|
||||
BOOL animated = [[note.userInfo objectForKey:@"animated"] boolValue];
|
||||
@@ -119,14 +118,14 @@
|
||||
_activeElementOID = nil;
|
||||
|
||||
self.searchDisplayController.searchBar.text = nil;
|
||||
self.alertContainer.hidden = NO;
|
||||
self.outdatedAlertContainer.hidden = NO;
|
||||
self.searchTipContainer.hidden = NO;
|
||||
self.actionsTipContainer.hidden = NO;
|
||||
self.typeTipContainer.hidden = NO;
|
||||
self.toolTipContainer.hidden = NO;
|
||||
self.contentTipContainer.hidden = NO;
|
||||
self.loginNameTipContainer.hidden = NO;
|
||||
self.alertContainer.hidden = NO;
|
||||
self.outdatedAlertContainer.hidden = NO;
|
||||
self.searchTipContainer.hidden = NO;
|
||||
self.actionsTipContainer.hidden = NO;
|
||||
self.typeTipContainer.hidden = NO;
|
||||
self.toolTipContainer.hidden = NO;
|
||||
self.contentTipContainer.hidden = NO;
|
||||
self.loginNameTipContainer.hidden = NO;
|
||||
|
||||
[self updateAnimated:NO];
|
||||
|
||||
@@ -142,7 +141,7 @@
|
||||
|
||||
// Needed for when we appear after a modal VC dismisses:
|
||||
// We can't present until the other modal VC has been fully dismissed and presenting in -viewWillAppear: will fail.
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
||||
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0 ), ^{
|
||||
MPUserEntity *activeUser = [[MPAppDelegate get] activeUserForThread];
|
||||
if ([MPAlgorithmDefault migrateUser:activeUser] && !self.suppressOutdatedAlert)
|
||||
[UIView animateWithDuration:0.3f animations:^{
|
||||
@@ -150,7 +149,7 @@
|
||||
self.suppressOutdatedAlert = YES;
|
||||
}];
|
||||
[activeUser.managedObjectContext saveToStore];
|
||||
});
|
||||
} );
|
||||
|
||||
if (![[MPiOSConfig get].actionsTipShown boolValue])
|
||||
[UIView animateWithDuration:animated? 0.3f: 0 animations:^{
|
||||
@@ -161,7 +160,7 @@
|
||||
|
||||
[MPiOSConfig get].actionsTipShown = @YES;
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after( dispatch_time( DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC) ), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.actionsTipContainer.alpha = 0;
|
||||
} completion:^(BOOL finished_) {
|
||||
@@ -170,7 +169,7 @@
|
||||
self.searchTipContainer.alpha = 1;
|
||||
}];
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}];
|
||||
|
||||
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Main"];
|
||||
@@ -197,15 +196,15 @@
|
||||
[self setHelpChapter:activeElement? @"2": @"1"];
|
||||
[self updateHelpHiddenAnimated:NO];
|
||||
|
||||
self.passwordCounter.alpha = 0;
|
||||
self.passwordCounter.alpha = 0;
|
||||
self.passwordIncrementer.alpha = 0;
|
||||
self.passwordEdit.alpha = 0;
|
||||
self.passwordUpgrade.alpha = 0;
|
||||
self.passwordUser.alpha = 0;
|
||||
self.displayContainer.alpha = 0;
|
||||
self.passwordEdit.alpha = 0;
|
||||
self.passwordUpgrade.alpha = 0;
|
||||
self.passwordUser.alpha = 0;
|
||||
self.displayContainer.alpha = 0;
|
||||
|
||||
if (activeElement) {
|
||||
self.passwordUser.alpha = 0.5f;
|
||||
self.passwordUser.alpha = 0.5f;
|
||||
self.displayContainer.alpha = 1.0f;
|
||||
}
|
||||
|
||||
@@ -214,11 +213,11 @@
|
||||
|
||||
else {
|
||||
if (activeElement.type & MPElementTypeClassGenerated) {
|
||||
self.passwordCounter.alpha = 0.5f;
|
||||
self.passwordCounter.alpha = 0.5f;
|
||||
self.passwordIncrementer.alpha = 0.5f;
|
||||
} else
|
||||
if (activeElement.type & MPElementTypeClassStored)
|
||||
self.passwordEdit.alpha = 0.5f;
|
||||
}
|
||||
else if (activeElement.type & MPElementTypeClassStored)
|
||||
self.passwordEdit.alpha = 0.5f;
|
||||
}
|
||||
|
||||
self.siteName.text = activeElement.name;
|
||||
@@ -228,21 +227,21 @@
|
||||
forState:UIControlStateNormal];
|
||||
|
||||
if ([activeElement isKindOfClass:[MPElementGeneratedEntity class]])
|
||||
self.passwordCounter.text = PearlString(@"%u", ((MPElementGeneratedEntity *)activeElement).counter);
|
||||
self.passwordCounter.text = PearlString( @"%u", ((MPElementGeneratedEntity *)activeElement).counter );
|
||||
|
||||
self.contentField.enabled = NO;
|
||||
self.contentField.text = @"";
|
||||
self.contentField.text = @"";
|
||||
if (activeElement.name && ![activeElement isDeleted])
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
|
||||
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0 ), ^{
|
||||
NSString *description = [activeElement.content description];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
self.contentField.text = description;
|
||||
});
|
||||
});
|
||||
} );
|
||||
} );
|
||||
|
||||
self.loginNameField.enabled = NO;
|
||||
self.loginNameField.text = activeElement.loginName;
|
||||
self.loginNameField.text = activeElement.loginName;
|
||||
self.siteInfoHidden = !activeElement || ([[MPiOSConfig get].siteInfoHidden boolValue] && (activeElement.loginName == nil));
|
||||
[self updateUserHiddenAnimated:NO];
|
||||
}
|
||||
@@ -271,10 +270,11 @@
|
||||
self.pullDownView.hidden = [[MPiOSConfig get].helpHidden boolValue];
|
||||
|
||||
if ([[MPiOSConfig get].helpHidden boolValue]) {
|
||||
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, self.view.bounds.size.height - 44 /* search bar */);
|
||||
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, self.view.bounds.size.height - 20 /* pull-up */);
|
||||
} else {
|
||||
self.contentContainer.frame = CGRectSetHeight(self.contentContainer.frame, 225);
|
||||
self.contentContainer.frame = CGRectSetHeight( self.contentContainer.frame, self.view.bounds.size.height - 44 /* search bar */);
|
||||
self.helpContainer.frame = CGRectSetY( self.helpContainer.frame, self.view.bounds.size.height - 20 /* pull-up */);
|
||||
}
|
||||
else {
|
||||
self.contentContainer.frame = CGRectSetHeight( self.contentContainer.frame, 225 );
|
||||
[self.helpContainer setFrameFromCurrentSizeAndParentPaddingTop:CGFLOAT_MAX right:0 bottom:0 left:0];
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@
|
||||
- (void)toggleUserAnimated:(BOOL)animated {
|
||||
|
||||
[MPiOSConfig get].siteInfoHidden = PearlBool(!self.siteInfoHidden);
|
||||
self.siteInfoHidden = [[MPiOSConfig get].siteInfoHidden boolValue];
|
||||
self.siteInfoHidden = [[MPiOSConfig get].siteInfoHidden boolValue];
|
||||
[self updateUserHiddenAnimated:animated];
|
||||
}
|
||||
|
||||
@@ -301,11 +301,11 @@
|
||||
}
|
||||
|
||||
if (self.siteInfoHidden) {
|
||||
self.displayContainer.frame = CGRectSetHeight(self.displayContainer.frame, 87);
|
||||
} else {
|
||||
self.displayContainer.frame = CGRectSetHeight(self.displayContainer.frame, 137);
|
||||
self.displayContainer.frame = CGRectSetHeight( self.displayContainer.frame, 87 );
|
||||
}
|
||||
else {
|
||||
self.displayContainer.frame = CGRectSetHeight( self.displayContainer.frame, 137 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)setHelpChapter:(NSString *)chapter {
|
||||
@@ -314,11 +314,11 @@
|
||||
@"chapter" : chapter
|
||||
} );
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
NSURL *url = [NSURL URLWithString:[@"#" stringByAppendingString:chapter]
|
||||
relativeToURL:[[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"]];
|
||||
[self.helpView loadRequest:[NSURLRequest requestWithURL:url]];
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
- (IBAction)panHelpDown:(UIPanGestureRecognizer *)sender {
|
||||
@@ -330,7 +330,7 @@
|
||||
targetY = 246;
|
||||
}
|
||||
|
||||
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, targetY);
|
||||
self.helpContainer.frame = CGRectSetY( self.helpContainer.frame, targetY );
|
||||
|
||||
if (sender.state == UIGestureRecognizerStateEnded)
|
||||
[self setHelpHidden:hideHelp animated:YES];
|
||||
@@ -342,10 +342,10 @@
|
||||
BOOL hideHelp = NO;
|
||||
if (targetY >= self.view.bounds.size.height - 20) {
|
||||
hideHelp = YES;
|
||||
targetY = self.view.bounds.size.height - 20 ;
|
||||
targetY = self.view.bounds.size.height - 20;
|
||||
}
|
||||
|
||||
self.helpContainer.frame = CGRectSetY(self.helpContainer.frame, targetY);
|
||||
self.helpContainer.frame = CGRectSetY( self.helpContainer.frame, targetY );
|
||||
|
||||
if (sender.state == UIGestureRecognizerStateEnded)
|
||||
[self setHelpHidden:hideHelp animated:YES];
|
||||
@@ -355,21 +355,21 @@
|
||||
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:
|
||||
PearlString(@"setClass('%@');", activeElement.typeClassName)];
|
||||
PearlString( @"setClass('%@');", activeElement.typeClassName )];
|
||||
if (error.length)
|
||||
err(@"helpView.setClass: %@", error);
|
||||
err(@"helpView.setClass: %@", error);
|
||||
}
|
||||
|
||||
- (void)showContentTip:(NSString *)message withIcon:(UIImageView *)icon {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
if (self.contentTipCleanup)
|
||||
self.contentTipCleanup(NO);
|
||||
self.contentTipCleanup( NO );
|
||||
|
||||
__weak MPMainViewController *wSelf = self;
|
||||
self.contentTipBody.text = message;
|
||||
self.contentTipCleanup = ^(BOOL finished) {
|
||||
icon.hidden = YES;
|
||||
self.contentTipCleanup = ^(BOOL finished) {
|
||||
icon.hidden = YES;
|
||||
wSelf.contentTipCleanup = nil;
|
||||
};
|
||||
|
||||
@@ -378,47 +378,47 @@
|
||||
self.contentTipContainer.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
if (finished) {
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
|
||||
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
||||
dispatch_time_t popTime = dispatch_time( DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC );
|
||||
dispatch_after( popTime, dispatch_get_main_queue(), ^(void) {
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.contentTipContainer.alpha = 0;
|
||||
} completion:self.contentTipCleanup];
|
||||
});
|
||||
} );
|
||||
}
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
- (void)showLoginNameTip:(NSString *)message {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
self.loginNameTipBody.text = message;
|
||||
|
||||
[UIView animateWithDuration:0.3f animations:^{
|
||||
self.loginNameTipContainer.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
if (finished) {
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
|
||||
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
||||
dispatch_time_t popTime = dispatch_time( DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC );
|
||||
dispatch_after( popTime, dispatch_get_main_queue(), ^(void) {
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.loginNameTipContainer.alpha = 0;
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
- (void)showToolTip:(NSString *)message withIcon:(UIImageView *)icon {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
if (self.toolTipCleanup)
|
||||
self.toolTipCleanup(NO);
|
||||
self.toolTipCleanup( NO );
|
||||
|
||||
__weak MPMainViewController *wSelf = self;
|
||||
self.toolTipBody.text = message;
|
||||
self.toolTipCleanup = ^(BOOL finished) {
|
||||
icon.hidden = YES;
|
||||
self.toolTipCleanup = ^(BOOL finished) {
|
||||
icon.hidden = YES;
|
||||
wSelf.toolTipCleanup = nil;
|
||||
};
|
||||
|
||||
@@ -427,22 +427,22 @@
|
||||
self.toolTipContainer.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
if (finished) {
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
|
||||
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
||||
dispatch_time_t popTime = dispatch_time( DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC );
|
||||
dispatch_after( popTime, dispatch_get_main_queue(), ^(void) {
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.toolTipContainer.alpha = 0;
|
||||
} completion:self.toolTipCleanup];
|
||||
});
|
||||
} );
|
||||
}
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
self.alertTitle.text = title;
|
||||
NSRange scrollRange = NSMakeRange(self.alertBody.text.length, message.length);
|
||||
NSRange scrollRange = NSMakeRange( self.alertBody.text.length, message.length );
|
||||
if ([self.alertBody.text length])
|
||||
self.alertBody.text = [NSString stringWithFormat:@"%@\n\n---\n\n%@", self.alertBody.text, message];
|
||||
else
|
||||
@@ -452,7 +452,7 @@
|
||||
[UIView animateWithDuration:0.3f animations:^{
|
||||
self.alertContainer.alpha = 1;
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
#pragma mark - Protocols
|
||||
@@ -462,7 +462,7 @@
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
id content = activeElement.content;
|
||||
if (!content)
|
||||
// Nothing to copy.
|
||||
// Nothing to copy.
|
||||
return;
|
||||
|
||||
inf(@"Copying password for: %@", activeElement.name);
|
||||
@@ -497,65 +497,65 @@
|
||||
- (IBAction)incrementPasswordCounter {
|
||||
|
||||
[self changeActiveElementWithWarning:
|
||||
@"You are incrementing the site's password counter.\n\n"
|
||||
@"If you continue, a new password will be generated for this site. "
|
||||
@"You will then need to update your account's old password to this newly generated password.\n\n"
|
||||
@"You can reset the counter by holding down on this button."
|
||||
do:^BOOL(MPElementEntity *activeElement) {
|
||||
if (![activeElement isKindOfClass:[MPElementGeneratedEntity class]]) {
|
||||
// Not of a type that supports a password counter.
|
||||
err(@"Cannot increment password counter: Element is not generated: %@", activeElement.name);
|
||||
return NO;
|
||||
}
|
||||
MPElementGeneratedEntity *activeGeneratedElement = (MPElementGeneratedEntity *)activeElement;
|
||||
@"You are incrementing the site's password counter.\n\n"
|
||||
@"If you continue, a new password will be generated for this site. "
|
||||
@"You will then need to update your account's old password to this newly generated password.\n\n"
|
||||
@"You can reset the counter by holding down on this button."
|
||||
do:^BOOL(MPElementEntity *activeElement) {
|
||||
if (![activeElement isKindOfClass:[MPElementGeneratedEntity class]]) {
|
||||
// Not of a type that supports a password counter.
|
||||
err(@"Cannot increment password counter: Element is not generated: %@", activeElement.name);
|
||||
return NO;
|
||||
}
|
||||
MPElementGeneratedEntity *activeGeneratedElement = (MPElementGeneratedEntity *)activeElement;
|
||||
|
||||
inf(@"Incrementing password counter for: %@", activeGeneratedElement.name);
|
||||
++activeGeneratedElement.counter;
|
||||
inf(@"Incrementing password counter for: %@", activeGeneratedElement.name);
|
||||
++activeGeneratedElement.counter;
|
||||
|
||||
MPCheckpoint( MPCheckpointIncrementPasswordCounter, @{
|
||||
@"type" : activeGeneratedElement.typeName,
|
||||
@"version" : @(activeGeneratedElement.version),
|
||||
@"counter" : @(activeGeneratedElement.counter)
|
||||
} );
|
||||
return YES;
|
||||
}];
|
||||
MPCheckpoint( MPCheckpointIncrementPasswordCounter, @{
|
||||
@"type" : activeGeneratedElement.typeName,
|
||||
@"version" : @(activeGeneratedElement.version),
|
||||
@"counter" : @(activeGeneratedElement.counter)
|
||||
} );
|
||||
return YES;
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)resetPasswordCounter:(UILongPressGestureRecognizer *)sender {
|
||||
|
||||
if (sender.state != UIGestureRecognizerStateBegan)
|
||||
// Only fire when the gesture was first detected.
|
||||
// Only fire when the gesture was first detected.
|
||||
return;
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
if (![activeElement isKindOfClass:[MPElementGeneratedEntity class]]) {
|
||||
// Not of a type that supports a password counter.
|
||||
err(@"Cannot reset password counter: Element is not generated: %@", activeElement.name);
|
||||
return;
|
||||
} else
|
||||
if (((MPElementGeneratedEntity *)activeElement).counter == 1)
|
||||
// Counter has initial value, no point resetting.
|
||||
return;
|
||||
}
|
||||
else if (((MPElementGeneratedEntity *)activeElement).counter == 1)
|
||||
// Counter has initial value, no point resetting.
|
||||
return;
|
||||
|
||||
[self changeActiveElementWithWarning:
|
||||
@"You are resetting the site's password counter.\n\n"
|
||||
@"If you continue, the site's password will change back to its original value. "
|
||||
@"You will then need to update your account's password back to this original value."
|
||||
do:^BOOL(MPElementEntity *activeElement_){
|
||||
inf(@"Resetting password counter for: %@", activeElement_.name);
|
||||
((MPElementGeneratedEntity *)activeElement_).counter = 1;
|
||||
@"You are resetting the site's password counter.\n\n"
|
||||
@"If you continue, the site's password will change back to its original value. "
|
||||
@"You will then need to update your account's password back to this original value."
|
||||
do:^BOOL(MPElementEntity *activeElement_) {
|
||||
inf(@"Resetting password counter for: %@", activeElement_.name);
|
||||
((MPElementGeneratedEntity *)activeElement_).counter = 1;
|
||||
|
||||
MPCheckpoint( MPCheckpointResetPasswordCounter, @{
|
||||
@"type" : activeElement_.typeName,
|
||||
@"version" : @(activeElement_.version)
|
||||
} );
|
||||
return YES;
|
||||
}];
|
||||
MPCheckpoint( MPCheckpointResetPasswordCounter, @{
|
||||
@"type" : activeElement_.typeName,
|
||||
@"version" : @(activeElement_.version)
|
||||
} );
|
||||
return YES;
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)editLoginName:(UILongPressGestureRecognizer *)sender {
|
||||
|
||||
if (sender.state != UIGestureRecognizerStateBegan)
|
||||
// Only fire when the gesture was first detected.
|
||||
// Only fire when the gesture was first detected.
|
||||
return;
|
||||
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
@@ -620,12 +620,11 @@
|
||||
NSError *error;
|
||||
MPElementEntity *activeElement = (MPElementEntity *)[moc existingObjectWithID:_activeElementOID error:&error];
|
||||
if (!activeElement)
|
||||
err(@"Couldn't retrieve active element: %@", error);
|
||||
err(@"Couldn't retrieve active element: %@", error);
|
||||
|
||||
return activeElement;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)editPassword {
|
||||
|
||||
MPElementEntity *activeElement = [self activeElementForThread];
|
||||
@@ -651,12 +650,12 @@
|
||||
return;
|
||||
|
||||
NSString *warning = activeElement.type & MPElementTypeClassGenerated?
|
||||
@"You are upgrading the site.\n\n"
|
||||
@"This upgrade improves the site's compatibility with the latest version of Master Password.\n\n"
|
||||
@"Your password will change and you will need to update your site's account."
|
||||
:
|
||||
@"You are upgrading the site.\n\n"
|
||||
@"This upgrade improves the site's compatibility with the latest version of Master Password.";
|
||||
@"You are upgrading the site.\n\n"
|
||||
@"This upgrade improves the site's compatibility with the latest version of Master Password.\n\n"
|
||||
@"Your password will change and you will need to update your site's account."
|
||||
:
|
||||
@"You are upgrading the site.\n\n"
|
||||
@"This upgrade improves the site's compatibility with the latest version of Master Password.";
|
||||
|
||||
[self changeActiveElementWithWarning:warning do:
|
||||
^BOOL(MPElementEntity *activeElement_) {
|
||||
@@ -772,19 +771,20 @@
|
||||
- (void)didSelectType:(MPElementType)type {
|
||||
|
||||
[self changeActiveElementWithWarning:
|
||||
@"You are about to change the type of this password.\n\n"
|
||||
@"If you continue, the password for this site will change. "
|
||||
@"You will need to update your account's old password to the new one."
|
||||
do:^BOOL(MPElementEntity *activeElement){
|
||||
@"You are about to change the type of this password.\n\n"
|
||||
@"If you continue, the password for this site will change. "
|
||||
@"You will need to update your account's old password to the new one."
|
||||
do:^BOOL(MPElementEntity *activeElement) {
|
||||
if ([activeElement.algorithm classOfType:type] != activeElement.typeClass) {
|
||||
// Type requires a different class of element. Recreate the element.
|
||||
MPElementEntity *newElement = [NSEntityDescription insertNewObjectForEntityForName:[activeElement.algorithm classNameOfType:type]
|
||||
inManagedObjectContext:activeElement.managedObjectContext];
|
||||
newElement.name = activeElement.name;
|
||||
newElement.user = activeElement.user;
|
||||
newElement.uses = activeElement.uses;
|
||||
newElement.lastUsed = activeElement.lastUsed;
|
||||
newElement.version = activeElement.version;
|
||||
MPElementEntity *newElement
|
||||
= [NSEntityDescription insertNewObjectForEntityForName:[activeElement.algorithm classNameOfType:type]
|
||||
inManagedObjectContext:activeElement.managedObjectContext];
|
||||
newElement.name = activeElement.name;
|
||||
newElement.user = activeElement.user;
|
||||
newElement.uses = activeElement.uses;
|
||||
newElement.lastUsed = activeElement.lastUsed;
|
||||
newElement.version = activeElement.version;
|
||||
newElement.loginName = activeElement.loginName;
|
||||
|
||||
[activeElement.managedObjectContext deleteObject:activeElement];
|
||||
@@ -793,8 +793,8 @@
|
||||
}
|
||||
activeElement.type = type;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPElementUpdatedNotification
|
||||
object:activeElement.objectID];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:MPElementUpdatedNotification object:activeElement.objectID];
|
||||
return YES;
|
||||
}];
|
||||
}
|
||||
@@ -809,11 +809,11 @@
|
||||
[self changeActiveElementWithoutWarningDo:^BOOL(MPElementEntity *activeElement) {
|
||||
if ([activeElement use] == 1)
|
||||
[self showAlertWithTitle:@"New Site" message:
|
||||
PearlString(@"You've just created a password for %@.\n\n"
|
||||
@"IMPORTANT:\n"
|
||||
@"Go to %@ and set or change the password for your account to the password above.\n"
|
||||
@"Do this right away: if you forget, you may have trouble remembering which password to use to log into the site later on.",
|
||||
activeElement.name, activeElement.name)];
|
||||
PearlString( @"You've just created a password for %@.\n\n"
|
||||
@"IMPORTANT:\n"
|
||||
@"Go to %@ and set or change the password for your account to the password above.\n"
|
||||
@"Do this right away: if you forget, you may have trouble remembering which password to use to log into the site later on.",
|
||||
activeElement.name, activeElement.name )];
|
||||
return YES;
|
||||
}];
|
||||
|
||||
@@ -828,11 +828,11 @@
|
||||
[MPiOSConfig get].typeTipShown = PearlBool(YES);
|
||||
|
||||
dispatch_after(
|
||||
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.typeTipContainer.alpha = 0;
|
||||
}];
|
||||
});
|
||||
dispatch_time( DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC) ), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.typeTipContainer.alpha = 0;
|
||||
}];
|
||||
} );
|
||||
}
|
||||
}];
|
||||
|
||||
@@ -866,8 +866,9 @@
|
||||
// Not of a type whose content can be edited.
|
||||
err(@"Cannot update element content: Element is not stored: %@", activeElement.name);
|
||||
return;
|
||||
} else if ([((MPElementStoredEntity *)activeElement).content isEqual:self.contentField.text])
|
||||
// Content hasn't changed.
|
||||
}
|
||||
else if ([((MPElementStoredEntity *)activeElement).content isEqual:self.contentField.text])
|
||||
// Content hasn't changed.
|
||||
return;
|
||||
|
||||
[self changeActiveElementWithoutWarningDo:^BOOL(MPElementEntity *activeElement_) {
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
@interface MPPreferencesViewController : UITableViewController<IASKSettingsDelegate, MPTypeDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *savePasswordSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UITableViewCell *exportCell;
|
||||
@property (weak, nonatomic) IBOutlet UITableViewCell *changeMPCell;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *defaultTypeLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
||||
@property(weak, nonatomic) IBOutlet UISwitch *savePasswordSwitch;
|
||||
@property(weak, nonatomic) IBOutlet UITableViewCell *exportCell;
|
||||
@property(weak, nonatomic) IBOutlet UITableViewCell *changeMPCell;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *defaultTypeLabel;
|
||||
|
||||
- (IBAction)didToggleSwitch:(UISwitch *)sender;
|
||||
- (IBAction)settings:(id)sender;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import "MPAppDelegate_Key.h"
|
||||
#import "MPAppDelegate_Store.h"
|
||||
|
||||
@interface MPPreferencesViewController ()
|
||||
@interface MPPreferencesViewController()
|
||||
|
||||
@end
|
||||
|
||||
@@ -24,35 +24,35 @@
|
||||
|
||||
for (int a = 0; a < MPAvatarCount; ++a) {
|
||||
UIButton *avatar = [self.avatarTemplate clone];
|
||||
avatar.tag = a;
|
||||
avatar.hidden = NO;
|
||||
avatar.center = CGPointMake(
|
||||
self.avatarTemplate.center.x * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a,
|
||||
self.avatarTemplate.center.y);
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString(@"avatar-%d", a)]
|
||||
forState:UIControlStateNormal];
|
||||
avatar.tag = a;
|
||||
avatar.hidden = NO;
|
||||
avatar.center = CGPointMake(
|
||||
self.avatarTemplate.center.x * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a,
|
||||
self.avatarTemplate.center.y );
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%d", a )]
|
||||
forState:UIControlStateNormal];
|
||||
[avatar setSelectionInSuperviewCandidate:YES isClearable:NO];
|
||||
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.layer.shadowOpacity = 1;
|
||||
avatar.layer.shadowRadius = 5;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
avatar.layer.shadowRadius = 5;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
|
||||
[avatar onHighlightOrSelect:^(BOOL highlighted, BOOL selected) {
|
||||
if (highlighted || selected)
|
||||
avatar.backgroundColor = self.avatarTemplate.backgroundColor;
|
||||
else
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
} options:0];
|
||||
} options:0];
|
||||
[avatar onSelect:^(BOOL selected) {
|
||||
if (selected) {
|
||||
MPUserEntity *activeUser = [[MPAppDelegate get] activeUserForThread];
|
||||
activeUser.avatar = (unsigned)avatar.tag;
|
||||
activeUser.avatar = (unsigned)avatar.tag;
|
||||
[activeUser.managedObjectContext saveToStore];
|
||||
}
|
||||
} options:0];
|
||||
avatar.selected = (a == [[MPAppDelegate get] activeUserForThread].avatar);
|
||||
} options:0];
|
||||
avatar.selected = (a == [[MPAppDelegate get] activeUserForThread].avatar);
|
||||
}
|
||||
|
||||
[super viewDidLoad];
|
||||
@@ -64,9 +64,10 @@
|
||||
[self.avatarsView autoSizeContent];
|
||||
[self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||
if (subview.tag && ((UIControl *)subview).selected) {
|
||||
[self.avatarsView setContentOffset:CGPointMake(subview.center.x - self.avatarsView.bounds.size.width / 2, 0) animated:animated];
|
||||
[self.avatarsView setContentOffset:CGPointMake( subview.center.x - self.avatarsView.bounds.size.width / 2, 0 )
|
||||
animated:animated];
|
||||
}
|
||||
} recurse:NO];
|
||||
} recurse:NO];
|
||||
|
||||
MPUserEntity *activeUser = [[MPAppDelegate get] activeUserForThread];
|
||||
self.savePasswordSwitch.on = activeUser.saveKey;
|
||||
@@ -89,12 +90,12 @@
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotate {
|
||||
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
|
||||
|
||||
|
||||
return UIInterfaceOrientationPortrait;
|
||||
}
|
||||
|
||||
@@ -112,11 +113,10 @@
|
||||
if (cell == self.exportCell)
|
||||
[[MPAppDelegate get] export];
|
||||
|
||||
else
|
||||
if (cell == self.changeMPCell) {
|
||||
MPUserEntity *activeUser = [[MPAppDelegate get] activeUserForThread];
|
||||
[[MPAppDelegate get] changeMasterPasswordFor:activeUser inContext:activeUser.managedObjectContext didResetBlock:nil];
|
||||
}
|
||||
else if (cell == self.changeMPCell) {
|
||||
MPUserEntity *activeUser = [[MPAppDelegate get] activeUserForThread];
|
||||
[[MPAppDelegate get] changeMasterPasswordFor:activeUser inContext:activeUser.managedObjectContext didResetBlock:nil];
|
||||
}
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
@@ -158,10 +158,10 @@
|
||||
}
|
||||
|
||||
- (IBAction)settings:(UIBarButtonItem *)sender {
|
||||
|
||||
|
||||
IASKAppSettingsViewController *vc = [IASKAppSettingsViewController new];
|
||||
vc.showDoneButton = NO;
|
||||
|
||||
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Settings"];
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
@interface MPSetupViewController : UIViewController
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *cloudSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *rememberLoginSwitch;
|
||||
@property(weak, nonatomic) IBOutlet UISwitch *cloudSwitch;
|
||||
@property(weak, nonatomic) IBOutlet UISwitch *rememberLoginSwitch;
|
||||
|
||||
- (IBAction)close:(UIBarButtonItem *)sender;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#import "MPEntities.h"
|
||||
|
||||
|
||||
@protocol MPTypeDelegate<NSObject>
|
||||
|
||||
@required
|
||||
@@ -24,7 +23,7 @@
|
||||
|
||||
@interface MPTypeViewController : UITableViewController
|
||||
|
||||
@property (nonatomic, weak) id<MPTypeDelegate> delegate;
|
||||
@property (weak, nonatomic) IBOutlet UIView *recommendedTipContainer;
|
||||
@property(nonatomic, weak) id<MPTypeDelegate> delegate;
|
||||
@property(weak, nonatomic) IBOutlet UIView *recommendedTipContainer;
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,10 +9,8 @@
|
||||
#import "MPTypeViewController.h"
|
||||
#import "MPAppDelegate.h"
|
||||
#import "MPAppDelegate_Store.h"
|
||||
#import "MPAppDelegate_Key.h"
|
||||
|
||||
|
||||
@interface MPTypeViewController ()
|
||||
@interface MPTypeViewController()
|
||||
|
||||
- (MPElementType)typeAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
@@ -37,11 +35,11 @@
|
||||
self.recommendedTipContainer.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
if (finished) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
dispatch_after( dispatch_time( DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC) ), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.2f animations:^{
|
||||
self.recommendedTipContainer.alpha = 0;
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
}];
|
||||
|
||||
@@ -76,7 +74,7 @@
|
||||
cell.selected = (selectedType == cellType);
|
||||
|
||||
if (cellType != NSNotFound && cellType & MPElementTypeClassGenerated) {
|
||||
[(UITextField *) [cell viewWithTag:2] setText:@"..."];
|
||||
[(UITextField *)[cell viewWithTag:2] setText:@"..."];
|
||||
|
||||
NSString *name = selectedElement.name;
|
||||
NSUInteger counter = ((MPElementGeneratedEntity *)selectedElement).counter;
|
||||
@@ -100,7 +98,7 @@
|
||||
|
||||
MPElementType type = [self typeAtIndexPath:indexPath];
|
||||
if (type == NSNotFound)
|
||||
// Selected a non-type row.
|
||||
// Selected a non-type row.
|
||||
return;
|
||||
|
||||
[self.delegate didSelectType:type];
|
||||
|
||||
@@ -10,34 +10,34 @@
|
||||
|
||||
@interface MPUnlockViewController : UIViewController<UITextFieldDelegate, UIScrollViewDelegate, UIWebViewDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *spinner;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *passwordFieldLabel;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordField;
|
||||
@property (weak, nonatomic) IBOutlet UIView *passwordView;
|
||||
@property (weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *oldNameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
||||
@property (weak, nonatomic) IBOutlet UIView *createPasswordTipView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *tip;
|
||||
@property (weak, nonatomic) IBOutlet UIView *passwordTipView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *passwordTipLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIView *wordWall;
|
||||
@property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *targetedUserActionGesture;
|
||||
@property (weak, nonatomic) IBOutlet UIView *uiContainer;
|
||||
@property (weak, nonatomic) IBOutlet UIWebView *newsView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *emergencyGeneratorContainer;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *emergencyName;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *emergencyMasterPassword;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *emergencySite;
|
||||
@property (weak, nonatomic) IBOutlet UIStepper *emergencyCounterStepper;
|
||||
@property (weak, nonatomic) IBOutlet UISegmentedControl *emergencyTypeControl;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *emergencyCounter;
|
||||
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *emergencyActivity;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *emergencyPassword;
|
||||
@property (weak, nonatomic) IBOutlet UIView *emergencyContentTipContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *spinner;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *passwordFieldLabel;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *passwordField;
|
||||
@property(weak, nonatomic) IBOutlet UIView *passwordView;
|
||||
@property(weak, nonatomic) IBOutlet UIScrollView *avatarsView;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *oldNameLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *avatarTemplate;
|
||||
@property(weak, nonatomic) IBOutlet UIView *createPasswordTipView;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *tip;
|
||||
@property(weak, nonatomic) IBOutlet UIView *passwordTipView;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *passwordTipLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIView *wordWall;
|
||||
@property(strong, nonatomic) IBOutlet UILongPressGestureRecognizer *targetedUserActionGesture;
|
||||
@property(weak, nonatomic) IBOutlet UIView *uiContainer;
|
||||
@property(weak, nonatomic) IBOutlet UIWebView *newsView;
|
||||
@property(weak, nonatomic) IBOutlet UIView *emergencyGeneratorContainer;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *emergencyName;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *emergencyMasterPassword;
|
||||
@property(weak, nonatomic) IBOutlet UITextField *emergencySite;
|
||||
@property(weak, nonatomic) IBOutlet UIStepper *emergencyCounterStepper;
|
||||
@property(weak, nonatomic) IBOutlet UISegmentedControl *emergencyTypeControl;
|
||||
@property(weak, nonatomic) IBOutlet UILabel *emergencyCounter;
|
||||
@property(weak, nonatomic) IBOutlet UIActivityIndicatorView *emergencyActivity;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *emergencyPassword;
|
||||
@property(weak, nonatomic) IBOutlet UIView *emergencyContentTipContainer;
|
||||
|
||||
@property (nonatomic, strong) UIColor *avatarShadowColor;
|
||||
@property(nonatomic, strong) UIColor *avatarShadowColor;
|
||||
|
||||
- (IBAction)targetedUserAction:(UILongPressGestureRecognizer *)sender;
|
||||
- (IBAction)facebook:(UIButton *)sender;
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
#import "MPAppDelegate_Key.h"
|
||||
#import "MPAppDelegate_Store.h"
|
||||
|
||||
@interface MPUnlockViewController ()
|
||||
@interface MPUnlockViewController()
|
||||
|
||||
@property (strong, nonatomic) NSMutableDictionary *avatarToUserOID;
|
||||
@property (nonatomic) BOOL wordWallAnimating;
|
||||
@property (nonatomic, strong) NSArray *wordList;
|
||||
@property(strong, nonatomic) NSMutableDictionary *avatarToUserOID;
|
||||
@property(nonatomic) BOOL wordWallAnimating;
|
||||
@property(nonatomic, strong) NSArray *wordList;
|
||||
|
||||
@property(nonatomic, strong) NSOperationQueue *emergencyQueue;
|
||||
@property(nonatomic, strong) MPKey *emergencyKey;
|
||||
@@ -34,28 +34,28 @@
|
||||
|
||||
- (void)initializeAvatarAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user inContext:(NSManagedObjectContext *)moc {
|
||||
|
||||
UIScrollView *alertAvatarScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(12, 30, 260, 150)];
|
||||
UIScrollView *alertAvatarScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake( 12, 30, 260, 150 )];
|
||||
alertAvatarScrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
|
||||
[alertAvatarScrollView flashScrollIndicatorsContinuously];
|
||||
[alert addSubview:alertAvatarScrollView];
|
||||
|
||||
CGPoint selectedOffset = CGPointZero;
|
||||
for (int a = 0; a < MPAvatarCount; ++a) {
|
||||
CGPoint selectedOffset = CGPointZero;
|
||||
for (int a = 0; a < MPAvatarCount; ++a) {
|
||||
UIButton *avatar = [self.avatarTemplate cloneAddedTo:alertAvatarScrollView];
|
||||
|
||||
avatar.tag = a;
|
||||
avatar.tag = a;
|
||||
avatar.hidden = NO;
|
||||
avatar.center = CGPointMake(
|
||||
(20 + self.avatarTemplate.bounds.size.width / 2) * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a,
|
||||
20 + self.avatarTemplate.bounds.size.height / 2);
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString(@"avatar-%d", a)] forState:UIControlStateNormal];
|
||||
(20 + self.avatarTemplate.bounds.size.width / 2) * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a,
|
||||
20 + self.avatarTemplate.bounds.size.height / 2 );
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%d", a )] forState:UIControlStateNormal];
|
||||
[avatar setSelectionInSuperviewCandidate:YES isClearable:NO];
|
||||
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.layer.shadowOpacity = 1;
|
||||
avatar.layer.shadowRadius = 5;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
avatar.layer.shadowRadius = 5;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
|
||||
[avatar onHighlightOrSelect:^(BOOL highlighted, BOOL selected) {
|
||||
if (highlighted || selected)
|
||||
@@ -69,9 +69,9 @@
|
||||
user.avatar = (unsigned)avatar.tag;
|
||||
}];
|
||||
} options:0];
|
||||
avatar.selected = (a == user.avatar);
|
||||
avatar.selected = (a == user.avatar);
|
||||
if (avatar.selected)
|
||||
selectedOffset = CGPointMake(avatar.center.x - alertAvatarScrollView.bounds.size.width / 2, 0);
|
||||
selectedOffset = CGPointMake( avatar.center.x - alertAvatarScrollView.bounds.size.width / 2, 0 );
|
||||
}
|
||||
|
||||
[alertAvatarScrollView autoSizeContent];
|
||||
@@ -80,28 +80,28 @@
|
||||
|
||||
- (void)initializeConfirmationAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
||||
|
||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(12, 70, 260, 110)];
|
||||
UIView *container = [[UIView alloc] initWithFrame:CGRectMake( 12, 70, 260, 110 )];
|
||||
[alert addSubview:container];
|
||||
|
||||
UIButton *alertAvatar = [self.avatarTemplate cloneAddedTo:container];
|
||||
alertAvatar.center = CGPointMake(130, 55);
|
||||
alertAvatar.hidden = NO;
|
||||
alertAvatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
alertAvatar.center = CGPointMake( 130, 55 );
|
||||
alertAvatar.hidden = NO;
|
||||
alertAvatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
alertAvatar.layer.shadowOpacity = 1;
|
||||
alertAvatar.layer.shadowRadius = 5;
|
||||
alertAvatar.backgroundColor = [UIColor clearColor];
|
||||
[alertAvatar setBackgroundImage:[UIImage imageNamed:PearlString(@"avatar-%d", user.avatar)] forState:UIControlStateNormal];
|
||||
alertAvatar.layer.shadowRadius = 5;
|
||||
alertAvatar.backgroundColor = [UIColor clearColor];
|
||||
[alertAvatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%d", user.avatar )] forState:UIControlStateNormal];
|
||||
|
||||
UILabel *alertNameLabel = [self.nameLabel cloneAddedTo:container];
|
||||
alertNameLabel.center = alertAvatar.center;
|
||||
alertNameLabel.text = user.name;
|
||||
alertNameLabel.bounds = CGRectSetHeight(alertNameLabel.bounds,
|
||||
[alertNameLabel.text sizeWithFont:self.nameLabel.font
|
||||
constrainedToSize:CGSizeMake(alertNameLabel.bounds.size.width - 10,
|
||||
100)
|
||||
lineBreakMode:self.nameLabel.lineBreakMode].height);
|
||||
alertNameLabel.center = alertAvatar.center;
|
||||
alertNameLabel.text = user.name;
|
||||
alertNameLabel.bounds = CGRectSetHeight( alertNameLabel.bounds,
|
||||
[alertNameLabel.text sizeWithFont:self.nameLabel.font
|
||||
constrainedToSize:CGSizeMake( alertNameLabel.bounds.size.width - 10,
|
||||
100 )
|
||||
lineBreakMode:self.nameLabel.lineBreakMode].height );
|
||||
alertNameLabel.layer.cornerRadius = 5;
|
||||
alertNameLabel.backgroundColor = [UIColor blackColor];
|
||||
alertNameLabel.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotate {
|
||||
@@ -122,19 +122,19 @@
|
||||
|
||||
[self.avatarsView addGestureRecognizer:self.targetedUserActionGesture];
|
||||
self.avatarsView.decelerationRate = UIScrollViewDecelerationRateFast;
|
||||
self.avatarsView.clipsToBounds = NO;
|
||||
self.tip.text = @"";
|
||||
self.avatarsView.clipsToBounds = NO;
|
||||
self.tip.text = @"";
|
||||
self.nameLabel.layer.cornerRadius = 5;
|
||||
self.avatarTemplate.hidden = YES;
|
||||
self.spinner.alpha = 0;
|
||||
self.passwordTipView.hidden = NO;
|
||||
self.avatarTemplate.hidden = YES;
|
||||
self.spinner.alpha = 0;
|
||||
self.passwordTipView.hidden = NO;
|
||||
self.createPasswordTipView.hidden = NO;
|
||||
[self.emergencyPassword setTitle:@"" forState:UIControlStateNormal];
|
||||
self.emergencyGeneratorContainer.alpha = 0;
|
||||
self.emergencyGeneratorContainer.hidden = YES;
|
||||
self.emergencyQueue = [NSOperationQueue new];
|
||||
[self.emergencyCounterStepper addTargetBlock:^(id sender, UIControlEvents event) {
|
||||
self.emergencyCounter.text = PearlString( @"%d", (NSUInteger)self.emergencyCounterStepper.value);
|
||||
self.emergencyCounter.text = PearlString( @"%d", (NSUInteger)self.emergencyCounterStepper.value );
|
||||
|
||||
[self updateEmergencyPassword];
|
||||
} forControlEvents:UIControlEventValueChanged];
|
||||
@@ -143,8 +143,10 @@
|
||||
} forControlEvents:UIControlEventValueChanged];
|
||||
self.emergencyContentTipContainer.alpha = 0;
|
||||
self.emergencyContentTipContainer.hidden = NO;
|
||||
self.marqueeTipTexts = @[ @"Tap and hold to delete or reset user.",
|
||||
@"Shake for emergency generator." ];
|
||||
self.marqueeTipTexts = @[
|
||||
@"Tap and hold to delete or reset user.",
|
||||
@"Shake for emergency generator."
|
||||
];
|
||||
|
||||
NSMutableArray *wordListLines = [NSMutableArray arrayWithCapacity:27413];
|
||||
[[[NSString alloc] initWithData:[NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"dictionary" withExtension:@"lst"]]
|
||||
@@ -160,26 +162,26 @@
|
||||
[self initializeWordLabel:wordLabel];
|
||||
} recurse:NO];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:UbiquityManagedStoreDidChangeNotification object:nil queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
[self updateUsers];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:UbiquityManagedStoreDidImportChangesNotification object:nil queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
[self updateUsers];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
[self emergencyCloseAnimated:NO];
|
||||
self.uiContainer.alpha = 0;
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
[self updateLayoutAnimated:NO allowScroll:NO completion:nil];
|
||||
[UIView animateWithDuration:1 animations:^{
|
||||
self.uiContainer.alpha = 1;
|
||||
}];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:UbiquityManagedStoreDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
|
||||
[self updateUsers];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:UbiquityManagedStoreDidImportChangesNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
|
||||
[self updateUsers];
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
|
||||
[self emergencyCloseAnimated:NO];
|
||||
self.uiContainer.alpha = 0;
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
|
||||
[self updateLayoutAnimated:NO allowScroll:NO completion:nil];
|
||||
[UIView animateWithDuration:1 animations:^{
|
||||
self.uiContainer.alpha = 1;
|
||||
}];
|
||||
}];
|
||||
|
||||
[self updateLayoutAnimated:NO allowScroll:YES completion:nil];
|
||||
|
||||
@@ -250,19 +252,20 @@
|
||||
self.emergencyGeneratorContainer.hidden = NO;
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.emergencyGeneratorContainer.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
} completion:^(BOOL finished) {
|
||||
[self.emergencyName becomeFirstResponder];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)marqueeTip {
|
||||
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.tip.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
} completion:^(BOOL finished) {
|
||||
if (!finished)
|
||||
return;
|
||||
|
||||
|
||||
self.tip.text = self.marqueeTipTexts[++self.marqueeTipTextIndex % [self.marqueeTipTexts count]];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.tip.alpha = 1;
|
||||
@@ -278,9 +281,9 @@
|
||||
|
||||
__block NSArray *users = nil;
|
||||
[moc performBlockAndWait:^{
|
||||
NSError *error = nil;
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MPUserEntity class])];
|
||||
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO]];
|
||||
NSError *error = nil;
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPUserEntity class] )];
|
||||
fetchRequest.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO] ];
|
||||
users = [moc executeFetchRequest:fetchRequest error:&error];
|
||||
if (!users)
|
||||
err(@"Failed to load users: %@", error);
|
||||
@@ -289,7 +292,7 @@
|
||||
// Clean up avatars.
|
||||
for (UIView *subview in [self.avatarsView subviews])
|
||||
if ([[self.avatarToUserOID allKeys] containsObject:[NSValue valueWithNonretainedObject:subview]])
|
||||
// This subview is a former avatar.
|
||||
// This subview is a former avatar.
|
||||
[subview removeFromSuperview];
|
||||
[self.avatarToUserOID removeAllObjects];
|
||||
|
||||
@@ -308,17 +311,17 @@
|
||||
|
||||
- (UIButton *)setupAvatar:(UIButton *)avatar forUser:(MPUserEntity *)user {
|
||||
|
||||
avatar.center = CGPointMake(avatar.center.x + [self.avatarToUserOID count] * 160, avatar.center.y);
|
||||
avatar.hidden = NO;
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.center = CGPointMake( avatar.center.x + [self.avatarToUserOID count] * 160, avatar.center.y );
|
||||
avatar.hidden = NO;
|
||||
avatar.layer.cornerRadius = avatar.bounds.size.height / 2;
|
||||
avatar.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
avatar.layer.shadowOpacity = 1;
|
||||
avatar.layer.shadowRadius = 20;
|
||||
avatar.layer.shadowRadius = 20;
|
||||
avatar.layer.masksToBounds = NO;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
avatar.tag = user.avatar;
|
||||
avatar.backgroundColor = [UIColor clearColor];
|
||||
avatar.tag = user.avatar;
|
||||
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString(@"avatar-%u", user.avatar)]
|
||||
[avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%u", user.avatar )]
|
||||
forState:UIControlStateNormal];
|
||||
[avatar setSelectionInSuperviewCandidate:YES isClearable:YES];
|
||||
[avatar onHighlightOrSelect:^(BOOL highlighted, BOOL selected) {
|
||||
@@ -331,7 +334,8 @@
|
||||
if (!selected) {
|
||||
self.selectedUser = nil;
|
||||
[self didToggleUserSelection];
|
||||
} else if ((self.selectedUser = user))
|
||||
}
|
||||
else if ((self.selectedUser = user))
|
||||
[self didToggleUserSelection];
|
||||
else
|
||||
[self didSelectNewUserAvatar:avatar];
|
||||
@@ -341,7 +345,7 @@
|
||||
|
||||
if ([_selectedUserOID isEqual:[user objectID]]) {
|
||||
self.selectedUser = user;
|
||||
avatar.selected = YES;
|
||||
avatar.selected = YES;
|
||||
}
|
||||
|
||||
return avatar;
|
||||
@@ -352,11 +356,10 @@
|
||||
MPUserEntity *selectedUser = self.selectedUser;
|
||||
if (!selectedUser)
|
||||
[self.passwordField resignFirstResponder];
|
||||
else
|
||||
if ([[MPAppDelegate get] signInAsUser:selectedUser usingMasterPassword:nil]) {
|
||||
[self performSegueWithIdentifier:@"MP_Unlock" sender:self];
|
||||
return;
|
||||
}
|
||||
else if ([[MPAppDelegate get] signInAsUser:selectedUser usingMasterPassword:nil]) {
|
||||
[self performSegueWithIdentifier:@"MP_Unlock" sender:self];
|
||||
return;
|
||||
}
|
||||
|
||||
[self updateLayoutAnimated:YES allowScroll:YES completion:^(BOOL finished) {
|
||||
if (self.selectedUser)
|
||||
@@ -367,7 +370,8 @@
|
||||
- (void)didSelectNewUserAvatar:(UIButton *)newUserAvatar {
|
||||
|
||||
[MPAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
||||
MPUserEntity *newUser = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPUserEntity class]) inManagedObjectContext:moc];
|
||||
MPUserEntity *newUser = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass( [MPUserEntity class] )
|
||||
inManagedObjectContext:moc];
|
||||
|
||||
[self showNewUserNameAlertFor:newUser inContext:moc completion:^(BOOL finished) {
|
||||
newUserAvatar.selected = NO;
|
||||
@@ -383,14 +387,14 @@
|
||||
message:nil viewStyle:UIAlertViewStylePlainTextInput
|
||||
initAlert:^(UIAlertView *alert, UITextField *firstField) {
|
||||
firstField.autocapitalizationType = UITextAutocapitalizationTypeWords;
|
||||
firstField.keyboardType = UIKeyboardTypeAlphabet;
|
||||
firstField.text = newUser.name;
|
||||
firstField.placeholder = @"eg. Robert Lee Mitchell";
|
||||
firstField.keyboardType = UIKeyboardTypeAlphabet;
|
||||
firstField.text = newUser.name;
|
||||
firstField.placeholder = @"eg. Robert Lee Mitchell";
|
||||
firstField.enablesReturnKeyAutomatically = YES;
|
||||
}
|
||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [alert cancelButtonIndex]) {
|
||||
completion(NO);
|
||||
completion( NO );
|
||||
return;
|
||||
}
|
||||
NSString *name = [alert textFieldAtIndex:0].text;
|
||||
@@ -398,7 +402,7 @@
|
||||
[PearlAlert showAlertWithTitle:@"Name Is Required" message:nil viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||
tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||
[self showNewUserNameAlertFor:newUser inContext:moc completion:completion];
|
||||
} cancelTitle:@"Try Again" otherTitles:nil];
|
||||
} cancelTitle:@"Try Again" otherTitles:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -431,8 +435,8 @@
|
||||
|
||||
[PearlAlert showAlertWithTitle:@"Is this correct?"
|
||||
message:
|
||||
@"Please double-check your name.\n"
|
||||
@"\n\n\n\n\n\n"
|
||||
@"Please double-check your name.\n"
|
||||
@"\n\n\n\n\n\n"
|
||||
viewStyle:UIAlertViewStyleDefault
|
||||
initAlert:^void(UIAlertView *__alert, UITextField *__firstField) {
|
||||
[self initializeConfirmationAlert:__alert forUser:newUser];
|
||||
@@ -445,7 +449,7 @@
|
||||
|
||||
// Confirm
|
||||
[moc saveToStore];
|
||||
completion(YES);
|
||||
completion( YES );
|
||||
|
||||
[self updateUsers];
|
||||
}
|
||||
@@ -455,18 +459,18 @@
|
||||
- (void)updateLayoutAnimated:(BOOL)animated allowScroll:(BOOL)allowScroll completion:(void (^)(BOOL finished))completion {
|
||||
|
||||
if (animated) {
|
||||
self.oldNameLabel.text = self.nameLabel.text;
|
||||
self.oldNameLabel.text = self.nameLabel.text;
|
||||
self.oldNameLabel.alpha = 1;
|
||||
self.nameLabel.alpha = 0;
|
||||
self.nameLabel.alpha = 0;
|
||||
|
||||
[UIView animateWithDuration:0.5f animations:^{
|
||||
[self updateLayoutAnimated:NO allowScroll:allowScroll completion:nil];
|
||||
|
||||
self.oldNameLabel.alpha = 0;
|
||||
self.nameLabel.alpha = 1;
|
||||
self.nameLabel.alpha = 1;
|
||||
} completion:^(BOOL finished) {
|
||||
if (completion)
|
||||
completion(finished);
|
||||
completion( finished );
|
||||
}];
|
||||
return;
|
||||
}
|
||||
@@ -474,92 +478,93 @@
|
||||
// Lay out password entry and user selection views.
|
||||
if (self.selectedUser && !self.passwordView.alpha) {
|
||||
// User was just selected.
|
||||
self.passwordView.alpha = 1;
|
||||
self.avatarsView.center = CGPointMake(160, 180);
|
||||
self.passwordView.alpha = 1;
|
||||
self.avatarsView.center = CGPointMake( 160, 180 );
|
||||
self.avatarsView.scrollEnabled = NO;
|
||||
self.nameLabel.center = CGPointMake(160, 94);
|
||||
self.nameLabel.center = CGPointMake( 160, 94 );
|
||||
self.nameLabel.backgroundColor = [UIColor blackColor];
|
||||
self.oldNameLabel.center = self.nameLabel.center;
|
||||
self.avatarShadowColor = [UIColor whiteColor];
|
||||
} else
|
||||
if (!self.selectedUser && self.passwordView.alpha == 1) {
|
||||
// User was just deselected.
|
||||
self.passwordField.text = nil;
|
||||
self.passwordView.alpha = 0;
|
||||
self.avatarsView.center = CGPointMake(160, 310);
|
||||
self.avatarsView.scrollEnabled = YES;
|
||||
self.nameLabel.center = CGPointMake(160, 296);
|
||||
self.nameLabel.backgroundColor = [UIColor clearColor];
|
||||
self.oldNameLabel.center = self.nameLabel.center;
|
||||
self.avatarShadowColor = [UIColor lightGrayColor];
|
||||
}
|
||||
self.oldNameLabel.center = self.nameLabel.center;
|
||||
self.avatarShadowColor = [UIColor whiteColor];
|
||||
}
|
||||
else if (!self.selectedUser && self.passwordView.alpha == 1) {
|
||||
// User was just deselected.
|
||||
self.passwordField.text = nil;
|
||||
self.passwordView.alpha = 0;
|
||||
self.avatarsView.center = CGPointMake( 160, 310 );
|
||||
self.avatarsView.scrollEnabled = YES;
|
||||
self.nameLabel.center = CGPointMake( 160, 296 );
|
||||
self.nameLabel.backgroundColor = [UIColor clearColor];
|
||||
self.oldNameLabel.center = self.nameLabel.center;
|
||||
self.avatarShadowColor = [UIColor lightGrayColor];
|
||||
}
|
||||
|
||||
// Lay out the word wall.
|
||||
if (!self.selectedUser || self.selectedUser.keyID) {
|
||||
self.passwordFieldLabel.text = @"Enter your master password:";
|
||||
|
||||
self.wordWall.alpha = 0;
|
||||
self.wordWall.alpha = 0;
|
||||
self.createPasswordTipView.alpha = 0;
|
||||
self.wordWallAnimating = NO;
|
||||
} else {
|
||||
self.wordWallAnimating = NO;
|
||||
}
|
||||
else {
|
||||
self.passwordFieldLabel.text = @"Create your master password:";
|
||||
|
||||
if (!self.wordWallAnimating) {
|
||||
self.wordWallAnimating = YES;
|
||||
self.wordWall.alpha = 1;
|
||||
self.wordWallAnimating = YES;
|
||||
self.wordWall.alpha = 1;
|
||||
self.createPasswordTipView.alpha = 1;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
// Jump out of our UIView animation block.
|
||||
[self beginWordWallAnimation];
|
||||
});
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 15 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
} );
|
||||
dispatch_after( dispatch_time( DISPATCH_TIME_NOW, 15 * NSEC_PER_SEC ), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:1 animations:^{
|
||||
self.createPasswordTipView.alpha = 0;
|
||||
}];
|
||||
});
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
// Lay out user targeting.
|
||||
MPUserEntity *targetedUser = self.selectedUser;
|
||||
UIButton *selectedAvatar = [self avatarForUser:self.selectedUser];
|
||||
UIButton *targetedAvatar = selectedAvatar;
|
||||
MPUserEntity *targetedUser = self.selectedUser;
|
||||
UIButton *selectedAvatar = [self avatarForUser:self.selectedUser];
|
||||
UIButton *targetedAvatar = selectedAvatar;
|
||||
if (!targetedAvatar) {
|
||||
targetedAvatar = [self findTargetedAvatar];
|
||||
targetedUser = [self userForAvatar:targetedAvatar];
|
||||
targetedUser = [self userForAvatar:targetedAvatar];
|
||||
}
|
||||
|
||||
[self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||
if (![[self.avatarToUserOID allKeys] containsObject:[NSValue valueWithNonretainedObject:subview]])
|
||||
// This subview is not one of the user avatars.
|
||||
// This subview is not one of the user avatars.
|
||||
return;
|
||||
UIButton *avatar = (UIButton *)subview;
|
||||
|
||||
BOOL isTargeted = avatar == targetedAvatar;
|
||||
|
||||
avatar.userInteractionEnabled = isTargeted;
|
||||
avatar.alpha = isTargeted? 1: self.selectedUser? 0.1: 0.4;
|
||||
avatar.alpha = isTargeted? 1: self.selectedUser? 0.1: 0.4;
|
||||
|
||||
[self updateAvatarShadowColor:avatar isTargeted:isTargeted];
|
||||
} recurse:NO];
|
||||
|
||||
if (allowScroll) {
|
||||
CGPoint targetContentOffset = CGPointMake(MAX(0, targetedAvatar.center.x - self.avatarsView.bounds.size.width / 2),
|
||||
self.avatarsView.contentOffset.y);
|
||||
if (!CGPointEqualToPoint(self.avatarsView.contentOffset, targetContentOffset))
|
||||
CGPoint targetContentOffset = CGPointMake( MAX(0, targetedAvatar.center.x - self.avatarsView.bounds.size.width / 2),
|
||||
self.avatarsView.contentOffset.y );
|
||||
if (!CGPointEqualToPoint( self.avatarsView.contentOffset, targetContentOffset ))
|
||||
[self.avatarsView setContentOffset:targetContentOffset animated:animated];
|
||||
}
|
||||
|
||||
// Lay out user name label.
|
||||
self.nameLabel.text = targetedAvatar? (targetedUser? targetedUser.name: @"New User"): nil;
|
||||
self.nameLabel.bounds = CGRectSetHeight(self.nameLabel.bounds,
|
||||
[self.nameLabel.text sizeWithFont:self.nameLabel.font
|
||||
constrainedToSize:CGSizeMake(self.nameLabel.bounds.size.width - 10, 100)
|
||||
lineBreakMode:self.nameLabel.lineBreakMode].height);
|
||||
self.nameLabel.text = targetedAvatar? (targetedUser? targetedUser.name: @"New User"): nil;
|
||||
self.nameLabel.bounds = CGRectSetHeight( self.nameLabel.bounds,
|
||||
[self.nameLabel.text sizeWithFont:self.nameLabel.font
|
||||
constrainedToSize:CGSizeMake( self.nameLabel.bounds.size.width - 10, 100 )
|
||||
lineBreakMode:self.nameLabel.lineBreakMode].height );
|
||||
self.oldNameLabel.bounds = self.nameLabel.bounds;
|
||||
if (completion)
|
||||
completion(YES);
|
||||
completion( YES );
|
||||
}
|
||||
|
||||
- (void)beginWordWallAnimation {
|
||||
@@ -568,7 +573,7 @@
|
||||
UILabel *wordLabel = (UILabel *)subview;
|
||||
|
||||
if (wordLabel.frame.origin.x < -self.wordWall.frame.size.width / 3) {
|
||||
wordLabel.frame = CGRectSetX(wordLabel.frame, wordLabel.frame.origin.x + self.wordWall.frame.size.width);
|
||||
wordLabel.frame = CGRectSetX( wordLabel.frame, wordLabel.frame.origin.x + self.wordWall.frame.size.width );
|
||||
[self initializeWordLabel:wordLabel];
|
||||
}
|
||||
} recurse:NO];
|
||||
@@ -578,7 +583,7 @@
|
||||
[self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||
UILabel *wordLabel = (UILabel *)subview;
|
||||
|
||||
wordLabel.frame = CGRectSetX(wordLabel.frame, wordLabel.frame.origin.x - self.wordWall.frame.size.width / 3);
|
||||
wordLabel.frame = CGRectSetX( wordLabel.frame, wordLabel.frame.origin.x - self.wordWall.frame.size.width / 3 );
|
||||
} recurse:NO];
|
||||
} completion:^(BOOL finished) {
|
||||
if (finished)
|
||||
@@ -589,7 +594,7 @@
|
||||
- (void)initializeWordLabel:(UILabel *)wordLabel {
|
||||
|
||||
wordLabel.alpha = 0.05 + (random() % 35) / 100.0F;
|
||||
wordLabel.text = [self.wordList objectAtIndex:(NSUInteger)random() % [self.wordList count]];
|
||||
wordLabel.text = [self.wordList objectAtIndex:(NSUInteger)random() % [self.wordList count]];
|
||||
}
|
||||
|
||||
- (void)setPasswordTip:(NSString *)string {
|
||||
@@ -605,15 +610,15 @@
|
||||
- (void)tryMasterPassword {
|
||||
|
||||
if (!self.selectedUser)
|
||||
// No user selected, can't try sign-in.
|
||||
// No user selected, can't try sign-in.
|
||||
return;
|
||||
|
||||
[self setSpinnerActive:YES];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
|
||||
BOOL unlocked = [[MPAppDelegate get] signInAsUser:self.selectedUser usingMasterPassword:self.passwordField.text];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
if (unlocked)
|
||||
[self performSegueWithIdentifier:@"MP_Unlock" sender:self];
|
||||
|
||||
@@ -623,14 +628,14 @@
|
||||
|
||||
[self setSpinnerActive:NO];
|
||||
}
|
||||
});
|
||||
});
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
- (UIButton *)findTargetedAvatar {
|
||||
|
||||
CGFloat xOfMiddle = self.avatarsView.contentOffset.x + self.avatarsView.bounds.size.width / 2;
|
||||
return (UIButton *)[PearlUIUtils viewClosestTo:CGPointMake(xOfMiddle, self.avatarsView.contentOffset.y)
|
||||
return (UIButton *)[PearlUIUtils viewClosestTo:CGPointMake( xOfMiddle, self.avatarsView.contentOffset.y )
|
||||
ofArray:self.avatarsView.subviews];
|
||||
}
|
||||
|
||||
@@ -660,7 +665,7 @@
|
||||
NSError *error;
|
||||
MPUserEntity *user = (MPUserEntity *)[moc existingObjectWithID:userOID error:&error];
|
||||
if (!user)
|
||||
err(@"Failed retrieving user for avatar: %@", error);
|
||||
err(@"Failed retrieving user for avatar: %@", error);
|
||||
|
||||
return user;
|
||||
}
|
||||
@@ -669,16 +674,17 @@
|
||||
|
||||
PearlMainThread(^{
|
||||
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
|
||||
rotate.toValue = [NSNumber numberWithDouble:2 * M_PI];
|
||||
rotate.toValue = [NSNumber numberWithDouble:2 * M_PI];
|
||||
rotate.duration = 5.0;
|
||||
|
||||
if (active) {
|
||||
rotate.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
|
||||
rotate.fromValue = [NSNumber numberWithFloat:0];
|
||||
rotate.repeatCount = MAXFLOAT;
|
||||
} else {
|
||||
rotate.fromValue = [NSNumber numberWithFloat:0];
|
||||
rotate.repeatCount = MAXFLOAT;
|
||||
}
|
||||
else {
|
||||
rotate.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
|
||||
rotate.repeatCount = 1;
|
||||
rotate.repeatCount = 1;
|
||||
}
|
||||
|
||||
[self.spinner.layer removeAnimationForKey:@"rotation"];
|
||||
@@ -700,44 +706,45 @@
|
||||
if (targeted) {
|
||||
if (![avatar.layer animationForKey:@"targetedShadow"]) {
|
||||
CABasicAnimation *toShadowColorAnimation = [CABasicAnimation animationWithKeyPath:@"shadowColor"];
|
||||
toShadowColorAnimation.toValue = (__bridge id)(avatar.selected? self.avatarTemplate.backgroundColor
|
||||
: [UIColor whiteColor]).CGColor;
|
||||
toShadowColorAnimation.toValue = (__bridge id)(avatar.selected? self.avatarTemplate.backgroundColor
|
||||
: [UIColor whiteColor]).CGColor;
|
||||
toShadowColorAnimation.beginTime = 0.0f;
|
||||
toShadowColorAnimation.duration = 0.5f;
|
||||
toShadowColorAnimation.fillMode = kCAFillModeForwards;
|
||||
toShadowColorAnimation.duration = 0.5f;
|
||||
toShadowColorAnimation.fillMode = kCAFillModeForwards;
|
||||
|
||||
CABasicAnimation *toShadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
|
||||
toShadowOpacityAnimation.toValue = PearlFloat(0.2);
|
||||
toShadowOpacityAnimation.toValue = PearlFloat(0.2);
|
||||
toShadowOpacityAnimation.duration = 0.5f;
|
||||
|
||||
CABasicAnimation *pulseShadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
|
||||
pulseShadowOpacityAnimation.fromValue = PearlFloat(0.2);
|
||||
pulseShadowOpacityAnimation.toValue = PearlFloat(0.6);
|
||||
pulseShadowOpacityAnimation.beginTime = 0.5f;
|
||||
pulseShadowOpacityAnimation.duration = 2.0f;
|
||||
pulseShadowOpacityAnimation.fromValue = PearlFloat(0.2);
|
||||
pulseShadowOpacityAnimation.toValue = PearlFloat(0.6);
|
||||
pulseShadowOpacityAnimation.beginTime = 0.5f;
|
||||
pulseShadowOpacityAnimation.duration = 2.0f;
|
||||
pulseShadowOpacityAnimation.autoreverses = YES;
|
||||
pulseShadowOpacityAnimation.repeatCount = MAXFLOAT;
|
||||
pulseShadowOpacityAnimation.repeatCount = MAXFLOAT;
|
||||
|
||||
CAAnimationGroup *group = [[CAAnimationGroup alloc] init];
|
||||
group.animations = @[toShadowColorAnimation, toShadowOpacityAnimation, pulseShadowOpacityAnimation];
|
||||
group.duration = MAXFLOAT;
|
||||
group.animations = @[ toShadowColorAnimation, toShadowOpacityAnimation, pulseShadowOpacityAnimation ];
|
||||
group.duration = MAXFLOAT;
|
||||
|
||||
[avatar.layer removeAnimationForKey:@"inactiveShadow"];
|
||||
[avatar.layer addAnimation:group forKey:@"targetedShadow"];
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ([avatar.layer animationForKey:@"targetedShadow"]) {
|
||||
CABasicAnimation *toShadowColorAnimation = [CABasicAnimation animationWithKeyPath:@"shadowColor"];
|
||||
toShadowColorAnimation.toValue = (__bridge id)[UIColor blackColor].CGColor;
|
||||
toShadowColorAnimation.toValue = (__bridge id)[UIColor blackColor].CGColor;
|
||||
toShadowColorAnimation.duration = 0.5f;
|
||||
|
||||
CABasicAnimation *toShadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
|
||||
toShadowOpacityAnimation.toValue = PearlFloat(1);
|
||||
toShadowOpacityAnimation.toValue = PearlFloat(1);
|
||||
toShadowOpacityAnimation.duration = 0.5f;
|
||||
|
||||
CAAnimationGroup *group = [[CAAnimationGroup alloc] init];
|
||||
group.animations = @[toShadowColorAnimation, toShadowOpacityAnimation];
|
||||
group.duration = 0.5f;
|
||||
group.animations = @[ toShadowColorAnimation, toShadowOpacityAnimation ];
|
||||
group.duration = 0.5f;
|
||||
|
||||
[avatar.layer removeAnimationForKey:@"targetedShadow"];
|
||||
[avatar.layer addAnimation:group forKey:@"inactiveShadow"];
|
||||
@@ -905,18 +912,18 @@
|
||||
}
|
||||
|
||||
- (void)emergencyCloseAnimated:(BOOL)animated {
|
||||
|
||||
|
||||
[[self.emergencyGeneratorContainer findFirstResponderInHierarchy] resignFirstResponder];
|
||||
|
||||
if (animated) {
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.emergencyGeneratorContainer.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
} completion:^(BOOL finished) {
|
||||
[self emergencyCloseAnimated:NO];
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self.emergencyName.text = @"";
|
||||
self.emergencyMasterPassword.text = @"";
|
||||
self.emergencySite.text = @"";
|
||||
@@ -933,9 +940,9 @@
|
||||
targetContentOffset:(inout CGPoint *)targetContentOffset {
|
||||
|
||||
CGFloat xOfMiddle = targetContentOffset->x + scrollView.bounds.size.width / 2;
|
||||
UIButton *middleAvatar = (UIButton *)[PearlUIUtils viewClosestTo:CGPointMake(xOfMiddle, targetContentOffset->y)
|
||||
UIButton *middleAvatar = (UIButton *)[PearlUIUtils viewClosestTo:CGPointMake( xOfMiddle, targetContentOffset->y )
|
||||
ofArray:scrollView.subviews];
|
||||
*targetContentOffset = CGPointMake(middleAvatar.center.x - scrollView.bounds.size.width / 2, targetContentOffset->y);
|
||||
*targetContentOffset = CGPointMake( middleAvatar.center.x - scrollView.bounds.size.width / 2, targetContentOffset->y );
|
||||
|
||||
[self updateLayoutAnimated:NO allowScroll:NO completion:nil];
|
||||
}
|
||||
@@ -979,7 +986,7 @@
|
||||
|
||||
NSManagedObjectContext *moc = targetedUser.managedObjectContext;
|
||||
[PearlSheet showSheetWithTitle:targetedUser.name
|
||||
viewStyle:UIActionSheetStyleBlackTranslucent
|
||||
viewStyle:UIActionSheetStyleBlackTranslucent
|
||||
initSheet:nil tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
|
||||
if (buttonIndex == [sheet cancelButtonIndex])
|
||||
return;
|
||||
@@ -989,18 +996,18 @@
|
||||
[moc deleteObject:targetedUser];
|
||||
[moc saveToStore];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
[self updateUsers];
|
||||
});
|
||||
} );
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttonIndex == [sheet firstOtherButtonIndex])
|
||||
[[MPAppDelegate get] changeMasterPasswordFor:targetedUser inContext:moc didResetBlock:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
dispatch_async( dispatch_get_main_queue(), ^{
|
||||
[[self avatarForUser:targetedUser] setSelected:YES];
|
||||
});
|
||||
} );
|
||||
}];
|
||||
} cancelTitle:[PearlStrings get].commonButtonCancel
|
||||
destructiveTitle:@"Delete User" otherTitles:@"Reset Password", nil];
|
||||
@@ -1040,7 +1047,7 @@
|
||||
|
||||
id<GPPShareBuilder> shareDialog = [[MPAppDelegate get].googlePlus shareDialog];
|
||||
[[[shareDialog setURLToShare:[NSURL URLWithString:@"http://masterpasswordapp.com"]]
|
||||
setPrefillText:@"I've started doing passwords properly thanks to Master Password for iOS."] open];
|
||||
setPrefillText:@"I've started doing passwords properly thanks to Master Password for iOS."] open];
|
||||
}
|
||||
|
||||
- (IBAction)mail:(UIButton *)sender {
|
||||
@@ -1069,18 +1076,19 @@
|
||||
// Twitter
|
||||
UIApplication *application = [UIApplication sharedApplication];
|
||||
for (NSString *candidate in @[
|
||||
@"twitter://user?screen_name=%@", // Twitter
|
||||
@"tweetbot:///user_profile/%@", // TweetBot
|
||||
@"echofon:///user_timeline?%@", // Echofon
|
||||
@"twit:///user?screen_name=%@", // Twittelator Pro
|
||||
@"x-seesmic://twitter_profile?twitter_screen_name=%@", // Seesmic
|
||||
@"x-birdfeed://user?screen_name=%@", // Birdfeed
|
||||
@"tweetings:///user?screen_name=%@", // Tweetings
|
||||
@"simplytweet:?link=http://twitter.com/%@", // SimplyTweet
|
||||
@"icebird://user?screen_name=%@", // IceBird
|
||||
@"fluttr://user/%@", // Fluttr
|
||||
@"http://twitter.com/%@"]) {
|
||||
NSURL *url = [NSURL URLWithString:PearlString(candidate, @"master_password")];
|
||||
@"twitter://user?screen_name=%@", // Twitter
|
||||
@"tweetbot:///user_profile/%@", // TweetBot
|
||||
@"echofon:///user_timeline?%@", // Echofon
|
||||
@"twit:///user?screen_name=%@", // Twittelator Pro
|
||||
@"x-seesmic://twitter_profile?twitter_screen_name=%@", // Seesmic
|
||||
@"x-birdfeed://user?screen_name=%@", // Birdfeed
|
||||
@"tweetings:///user?screen_name=%@", // Tweetings
|
||||
@"simplytweet:?link=http://twitter.com/%@", // SimplyTweet
|
||||
@"icebird://user?screen_name=%@", // IceBird
|
||||
@"fluttr://user/%@", // Fluttr
|
||||
@"http://twitter.com/%@"
|
||||
]) {
|
||||
NSURL *url = [NSURL URLWithString:PearlString( candidate, @"master_password" )];
|
||||
|
||||
if ([application canOpenURL:url]) {
|
||||
[application openURL:url];
|
||||
@@ -1093,7 +1101,7 @@
|
||||
// Mailing List
|
||||
[PearlEMail sendEMailTo:@"masterpassword-join@lists.lyndir.com" subject:@"Subscribe"
|
||||
body:@"Press 'Send' now to subscribe to the Master Password mailing list.\n\n"
|
||||
@"You'll be kept up-to-date on the evolution of and discussions revolving Master Password."];
|
||||
@"You'll be kept up-to-date on the evolution of and discussions revolving Master Password."];
|
||||
return;
|
||||
}
|
||||
if (buttonIndex == [sheet firstOtherButtonIndex] + 4) {
|
||||
@@ -1119,7 +1127,7 @@
|
||||
NSError *error;
|
||||
MPUserEntity *selectedUser = (MPUserEntity *)[moc existingObjectWithID:_selectedUserOID error:&error];
|
||||
if (!selectedUser)
|
||||
err(@"Failed to retrieve selected user: %@", error);
|
||||
err(@"Failed to retrieve selected user: %@", error);
|
||||
|
||||
return selectedUser;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
@interface MPiOSConfig : MPConfig
|
||||
|
||||
@property (nonatomic, retain) NSNumber *helpHidden;
|
||||
@property (nonatomic, retain) NSNumber *siteInfoHidden;
|
||||
@property (nonatomic, retain) NSNumber *showSetup;
|
||||
@property (nonatomic, retain) NSNumber *actionsTipShown;
|
||||
@property (nonatomic, retain) NSNumber *typeTipShown;
|
||||
@property (nonatomic, retain) NSNumber *loginNameTipShown;
|
||||
@property(nonatomic, retain) NSNumber *helpHidden;
|
||||
@property(nonatomic, retain) NSNumber *siteInfoHidden;
|
||||
@property(nonatomic, retain) NSNumber *showSetup;
|
||||
@property(nonatomic, retain) NSNumber *actionsTipShown;
|
||||
@property(nonatomic, retain) NSNumber *typeTipShown;
|
||||
@property(nonatomic, retain) NSNumber *loginNameTipShown;
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
@implementation MPiOSConfig
|
||||
|
||||
@dynamic sendInfo, helpHidden, siteInfoHidden, showSetup, actionsTipShown, typeTipShown, loginNameTipShown;
|
||||
|
||||
- (id)init {
|
||||
@@ -14,13 +15,15 @@
|
||||
if (!(self = [super init]))
|
||||
return self;
|
||||
|
||||
[self.defaults registerDefaults:@{ NSStringFromSelector(@selector(helpHidden)): @NO,
|
||||
NSStringFromSelector(@selector(siteInfoHidden)): @YES,
|
||||
NSStringFromSelector(@selector(showSetup)): @YES,
|
||||
NSStringFromSelector(@selector(iTunesID)): @"510296984",
|
||||
NSStringFromSelector(@selector(actionsTipShown)): PearlBoolNot(self.firstRun),
|
||||
NSStringFromSelector(@selector(typeTipShown)): PearlBoolNot(self.firstRun),
|
||||
NSStringFromSelector(@selector(loginNameTipShown)): PearlBool(NO)}];
|
||||
[self.defaults registerDefaults:@{
|
||||
NSStringFromSelector( @selector(helpHidden) ) : @NO,
|
||||
NSStringFromSelector( @selector(siteInfoHidden) ) : @YES,
|
||||
NSStringFromSelector( @selector(showSetup) ) : @YES,
|
||||
NSStringFromSelector( @selector(iTunesID) ) : @"510296984",
|
||||
NSStringFromSelector( @selector(actionsTipShown) ) : PearlBoolNot(self.firstRun),
|
||||
NSStringFromSelector( @selector(typeTipShown) ) : PearlBoolNot(self.firstRun),
|
||||
NSStringFromSelector( @selector(loginNameTipShown) ) : PearlBool(NO)
|
||||
}];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -1,165 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>M. Password</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mpsites</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Master Password sites</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.lyndir.lhunath.MasterPassword.sites</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.lyndir.lhunath.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>[auto]</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.lyndir.lhunath.MasterPassword</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>com.lyndir.lhunath.MasterPassword</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>[auto]</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>257095917745237</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011-2013 Lyndir. All rights reserved.</string>
|
||||
<key>ReplacementFonts</key>
|
||||
<dict>
|
||||
<key>AmericanTypewriter-Bold</key>
|
||||
<string>SourceCodePro-Black</string>
|
||||
<key>AmericanTypewriter-Light</key>
|
||||
<string>SourceCodePro-ExtraLight</string>
|
||||
<key>Futura-CondensedExtraBold</key>
|
||||
<string>Exo-ExtraBold</string>
|
||||
<key>Futura-Medium</key>
|
||||
<string>Exo</string>
|
||||
</dict>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Exo-Bold.otf</string>
|
||||
<string>Exo-ExtraBold.otf</string>
|
||||
<string>Exo-Regular.otf</string>
|
||||
<string>SourceCodePro-Black.otf</string>
|
||||
<string>SourceCodePro-ExtraLight.otf</string>
|
||||
</array>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>MainStoryboard_iPhone</string>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<true/>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<true/>
|
||||
<key>UIStatusBarStyle</key>
|
||||
<string>UIStatusBarStyleDefault</string>
|
||||
<key>UIStatusBarTintParameters</key>
|
||||
<dict>
|
||||
<key>UINavigationBar</key>
|
||||
<dict>
|
||||
<key>Style</key>
|
||||
<string>UIBarStyleDefault</string>
|
||||
<key>TintColor</key>
|
||||
<dict>
|
||||
<key>Blue</key>
|
||||
<real>0.42745098039215684</real>
|
||||
<key>Green</key>
|
||||
<real>0.39215686274509803</real>
|
||||
<key>Red</key>
|
||||
<real>0.37254901960784315</real>
|
||||
</dict>
|
||||
<key>Translucent</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Master Password sites</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.lyndir.lhunath.MasterPassword.sites</string>
|
||||
<key>UTTypeSize320IconFile</key>
|
||||
<string></string>
|
||||
<key>UTTypeSize64IconFile</key>
|
||||
<string></string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>mpsites</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>M. Password</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mpsites</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Master Password sites</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.lyndir.lhunath.MasterPassword.sites</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.lyndir.lhunath.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>[auto]</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.lyndir.lhunath.MasterPassword</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>com.lyndir.lhunath.MasterPassword</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>[auto]</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>257095917745237</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011-2013 Lyndir. All rights reserved.</string>
|
||||
<key>ReplacementFonts</key>
|
||||
<dict>
|
||||
<key>AmericanTypewriter-Bold</key>
|
||||
<string>SourceCodePro-Black</string>
|
||||
<key>AmericanTypewriter-Light</key>
|
||||
<string>SourceCodePro-ExtraLight</string>
|
||||
<key>Futura-CondensedExtraBold</key>
|
||||
<string>Exo-ExtraBold</string>
|
||||
<key>Futura-Medium</key>
|
||||
<string>Exo</string>
|
||||
</dict>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Exo-Bold.otf</string>
|
||||
<string>Exo-ExtraBold.otf</string>
|
||||
<string>Exo-Regular.otf</string>
|
||||
<string>SourceCodePro-Black.otf</string>
|
||||
<string>SourceCodePro-ExtraLight.otf</string>
|
||||
</array>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>MainStoryboard_iPhone</string>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<true/>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<true/>
|
||||
<key>UIStatusBarStyle</key>
|
||||
<string>UIStatusBarStyleDefault</string>
|
||||
<key>UIStatusBarTintParameters</key>
|
||||
<dict>
|
||||
<key>UINavigationBar</key>
|
||||
<dict>
|
||||
<key>Style</key>
|
||||
<string>UIBarStyleDefault</string>
|
||||
<key>TintColor</key>
|
||||
<dict>
|
||||
<key>Blue</key>
|
||||
<real>0.42745098039215684</real>
|
||||
<key>Green</key>
|
||||
<real>0.39215686274509803</real>
|
||||
<key>Red</key>
|
||||
<real>0.37254901960784315</real>
|
||||
</dict>
|
||||
<key>Translucent</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Master Password sites</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.lyndir.lhunath.MasterPassword.sites</string>
|
||||
<key>UTTypeSize320IconFile</key>
|
||||
<string></string>
|
||||
<key>UTTypeSize64IconFile</key>
|
||||
<string></string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>mpsites</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,95 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>If you're experiencing problems, enabling this will send us details that can help diagnose and resolve them. You will remain completely anonymous amongst the other thousands of users. No sensitive information is ever sent.</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Version</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Build</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Copyright</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Send Diagnostic Info</string>
|
||||
<key>Key</key>
|
||||
<string>sendInfo</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>When enabled, closing the application will not log out the user. Similar to your phone's SIM lock, you only need to log in once after powering on.</string>
|
||||
<key>Title</key>
|
||||
<string>Master Password</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>rememberLogin</string>
|
||||
<key>Title</key>
|
||||
<string>Stay logged in</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>FooterText</key>
|
||||
<string>Makes your sites available to all your Apple devices. This also works as a way of automatically keeping a back-up of your sites. Apple cannot see any of your passwords.</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>iCloud</string>
|
||||
<key>Key</key>
|
||||
<string>USMCloudEnabledKey</string>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Root</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>If you're experiencing problems, enabling this will send us details that can help diagnose and resolve them.
|
||||
You will remain completely anonymous amongst the other thousands of users. No sensitive information is ever sent.
|
||||
</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Version</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Build</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<string>[auto]</string>
|
||||
<key>Title</key>
|
||||
<string>Copyright</string>
|
||||
<key>Type</key>
|
||||
<string>PSTitleValueSpecifier</string>
|
||||
<key>Key</key>
|
||||
<string>unset</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Send Diagnostic Info</string>
|
||||
<key>Key</key>
|
||||
<string>sendInfo</string>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>When enabled, closing the application will not log out the user. Similar to your phone's SIM lock, you only
|
||||
need to log in once after powering on.
|
||||
</string>
|
||||
<key>Title</key>
|
||||
<string>Master Password</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>rememberLogin</string>
|
||||
<key>Title</key>
|
||||
<string>Stay logged in</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>FooterText</key>
|
||||
<string>Makes your sites available to all your Apple devices. This also works as a way of automatically keeping a back-up of
|
||||
your sites. Apple cannot see any of your passwords.
|
||||
</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>iCloud</string>
|
||||
<key>Key</key>
|
||||
<string>USMCloudEnabledKey</string>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Root</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MPAppDelegate class]));
|
||||
return UIApplicationMain( argc, argv, nil, NSStringFromClass( [MPAppDelegate class] ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user