diff --git a/OnePassword.xcodeproj/project.pbxproj b/OnePassword.xcodeproj/project.pbxproj index 2e1bdca8..dc110a5e 100644 --- a/OnePassword.xcodeproj/project.pbxproj +++ b/OnePassword.xcodeproj/project.pbxproj @@ -28,6 +28,19 @@ DA5BFA67147E415C00F98B1E /* OPMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA5BFA66147E415C00F98B1E /* OPMainViewController.m */; }; DA5DB7A614BE4B19002DD256 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = DA5DB7A514BE4B19002DD256 /* Default.png */; }; DA5DB7A814BE4B4B002DD256 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA5DB7A714BE4B4B002DD256 /* Default@2x.png */; }; + DA6556FE14D730B700841C99 /* guide_page_1.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556F814D730B700841C99 /* guide_page_1.png */; }; + DA6556FF14D730B700841C99 /* guide_page_2.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556F914D730B700841C99 /* guide_page_2.png */; }; + DA65570014D730B700841C99 /* guide_page_3.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556FA14D730B700841C99 /* guide_page_3.png */; }; + DA65570114D730B700841C99 /* guide_page_4.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556FB14D730B700841C99 /* guide_page_4.png */; }; + DA65570214D730B700841C99 /* guide_page_5.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556FC14D730B700841C99 /* guide_page_5.png */; }; + DA65570314D730B700841C99 /* guide_page_6.png in Resources */ = {isa = PBXBuildFile; fileRef = DA6556FD14D730B700841C99 /* guide_page_6.png */; }; + DA65570614D731F000841C99 /* OPGuideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA65570514D731F000841C99 /* OPGuideViewController.m */; }; + DA65570D14D760BD00841C99 /* guide_page_1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570714D760BD00841C99 /* guide_page_1@2x.png */; }; + DA65570E14D760BD00841C99 /* guide_page_2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570814D760BD00841C99 /* guide_page_2@2x.png */; }; + DA65570F14D760BD00841C99 /* guide_page_3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570914D760BD00841C99 /* guide_page_3@2x.png */; }; + DA65571014D760BD00841C99 /* guide_page_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570A14D760BD00841C99 /* guide_page_4@2x.png */; }; + DA65571114D760BD00841C99 /* guide_page_5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570B14D760BD00841C99 /* guide_page_5@2x.png */; }; + DA65571214D760BD00841C99 /* guide_page_6@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA65570C14D760BD00841C99 /* guide_page_6@2x.png */; }; DA684B7F14CF662700A497EC /* ui_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA684B5014CF662700A497EC /* ui_background@2x.png */; }; DA684B8014CF662700A497EC /* ui_box_checked@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA684B5114CF662700A497EC /* ui_box_checked@2x.png */; }; DA684B8114CF662700A497EC /* ui_box_empty@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA684B5214CF662700A497EC /* ui_box_empty@2x.png */; }; @@ -713,6 +726,20 @@ DA5BFA66147E415C00F98B1E /* OPMainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OPMainViewController.m; sourceTree = ""; }; DA5DB7A514BE4B19002DD256 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ../Default.png; sourceTree = ""; }; DA5DB7A714BE4B4B002DD256 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "../Default@2x.png"; sourceTree = ""; }; + DA6556F814D730B700841C99 /* guide_page_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_1.png; sourceTree = ""; }; + DA6556F914D730B700841C99 /* guide_page_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_2.png; sourceTree = ""; }; + DA6556FA14D730B700841C99 /* guide_page_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_3.png; sourceTree = ""; }; + DA6556FB14D730B700841C99 /* guide_page_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_4.png; sourceTree = ""; }; + DA6556FC14D730B700841C99 /* guide_page_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_5.png; sourceTree = ""; }; + DA6556FD14D730B700841C99 /* guide_page_6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = guide_page_6.png; sourceTree = ""; }; + DA65570414D731F000841C99 /* OPGuideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPGuideViewController.h; sourceTree = ""; }; + DA65570514D731F000841C99 /* OPGuideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPGuideViewController.m; sourceTree = ""; }; + DA65570714D760BD00841C99 /* guide_page_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_1@2x.png"; sourceTree = ""; }; + DA65570814D760BD00841C99 /* guide_page_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_2@2x.png"; sourceTree = ""; }; + DA65570914D760BD00841C99 /* guide_page_3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_3@2x.png"; sourceTree = ""; }; + DA65570A14D760BD00841C99 /* guide_page_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_4@2x.png"; sourceTree = ""; }; + DA65570B14D760BD00841C99 /* guide_page_5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_5@2x.png"; sourceTree = ""; }; + DA65570C14D760BD00841C99 /* guide_page_6@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "guide_page_6@2x.png"; sourceTree = ""; }; DA684B5014CF662700A497EC /* ui_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ui_background@2x.png"; sourceTree = ""; }; DA684B5114CF662700A497EC /* ui_box_checked@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ui_box_checked@2x.png"; sourceTree = ""; }; DA684B5214CF662700A497EC /* ui_box_empty@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ui_box_empty@2x.png"; sourceTree = ""; }; @@ -1780,6 +1807,8 @@ DA5BFA5A147E415C00F98B1E /* OPAppDelegate.m */, DA5BFA65147E415C00F98B1E /* OPMainViewController.h */, DA5BFA66147E415C00F98B1E /* OPMainViewController.m */, + DA65570414D731F000841C99 /* OPGuideViewController.h */, + DA65570514D731F000841C99 /* OPGuideViewController.m */, DA55B2A014B4EB46001131B7 /* OPSearchDelegate.h */, DA55B2A114B4EB46001131B7 /* OPSearchDelegate.m */, DAC781341482E67300BCF976 /* OPRecentViewController.h */, @@ -1801,6 +1830,7 @@ DA5BFA51147E415C00F98B1E /* Supporting Files */ = { isa = PBXGroup; children = ( + DA6556F714D730B700841C99 /* Guide */, DAA3B80414CDBBC600F35AF6 /* jquery-1.6.1.min.js */, DA84811E14CB50C100A2FA22 /* Tooltips */, DA0B951214C37486001D4EB1 /* Insignia */, @@ -1827,6 +1857,26 @@ name = "Supporting Files"; sourceTree = ""; }; + DA6556F714D730B700841C99 /* Guide */ = { + isa = PBXGroup; + children = ( + DA65570714D760BD00841C99 /* guide_page_1@2x.png */, + DA65570814D760BD00841C99 /* guide_page_2@2x.png */, + DA65570914D760BD00841C99 /* guide_page_3@2x.png */, + DA65570A14D760BD00841C99 /* guide_page_4@2x.png */, + DA65570B14D760BD00841C99 /* guide_page_5@2x.png */, + DA65570C14D760BD00841C99 /* guide_page_6@2x.png */, + DA6556F814D730B700841C99 /* guide_page_1.png */, + DA6556F914D730B700841C99 /* guide_page_2.png */, + DA6556FA14D730B700841C99 /* guide_page_3.png */, + DA6556FB14D730B700841C99 /* guide_page_4.png */, + DA6556FC14D730B700841C99 /* guide_page_5.png */, + DA6556FD14D730B700841C99 /* guide_page_6.png */, + ); + name = Guide; + path = Resources/Guide; + sourceTree = ""; + }; DA7C28A214AF02A000491972 /* Models */ = { isa = PBXGroup; children = ( @@ -2922,6 +2972,18 @@ DA684BE714CF6B0E00A497EC /* tip_location_mercury@2x.png in Resources */, DA684BE814CF6B0E00A497EC /* tip_location_teal@2x.png in Resources */, DA684BE914CF6B0E00A497EC /* tip_location_wood@2x.png in Resources */, + DA6556FE14D730B700841C99 /* guide_page_1.png in Resources */, + DA6556FF14D730B700841C99 /* guide_page_2.png in Resources */, + DA65570014D730B700841C99 /* guide_page_3.png in Resources */, + DA65570114D730B700841C99 /* guide_page_4.png in Resources */, + DA65570214D730B700841C99 /* guide_page_5.png in Resources */, + DA65570314D730B700841C99 /* guide_page_6.png in Resources */, + DA65570D14D760BD00841C99 /* guide_page_1@2x.png in Resources */, + DA65570E14D760BD00841C99 /* guide_page_2@2x.png in Resources */, + DA65570F14D760BD00841C99 /* guide_page_3@2x.png in Resources */, + DA65571014D760BD00841C99 /* guide_page_4@2x.png in Resources */, + DA65571114D760BD00841C99 /* guide_page_5@2x.png in Resources */, + DA65571214D760BD00841C99 /* guide_page_6@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2963,6 +3025,7 @@ DA55B2A214B4EB47001131B7 /* OPSearchDelegate.m in Sources */, DA0A848C14C4DFCB0090EA8E /* OPElementGeneratedEntity.m in Sources */, DAA3B81414CDC77100F35AF6 /* jquery-1.6.1.min.js in Sources */, + DA65570614D731F000841C99 /* OPGuideViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/OnePassword/MainStoryboard_iPhone.storyboard b/OnePassword/MainStoryboard_iPhone.storyboard index 7df0030e..7642eee9 100644 --- a/OnePassword/MainStoryboard_iPhone.storyboard +++ b/OnePassword/MainStoryboard_iPhone.storyboard @@ -1,5 +1,5 @@ - + @@ -616,26 +616,66 @@ L4m3P4sSw0rD - + - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - + @@ -650,22 +690,29 @@ L4m3P4sSw0rD + - + - + + + + + + + @@ -673,6 +720,53 @@ L4m3P4sSw0rD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OnePassword/OPAppDelegate.h b/OnePassword/OPAppDelegate.h index 657a5271..48c1ea2b 100644 --- a/OnePassword/OPAppDelegate.h +++ b/OnePassword/OPAppDelegate.h @@ -24,4 +24,7 @@ - (void)saveContext; - (NSURL *)applicationDocumentsDirectory; +- (void)showGuide; +- (void)loadKeyPhrase; + @end diff --git a/OnePassword/OPAppDelegate.m b/OnePassword/OPAppDelegate.m index cbcda599..18bf3032 100644 --- a/OnePassword/OPAppDelegate.m +++ b/OnePassword/OPAppDelegate.m @@ -15,7 +15,6 @@ + (NSDictionary *)keyPhraseQuery; + (NSDictionary *)keyPhraseHashQuery; -- (void)loadKeyPhrase; - (void)forgetKeyPhrase; - (void)loadStoredKeyPhrase; - (void)askKeyPhrase; @@ -122,7 +121,15 @@ } - (void)applicationDidBecomeActive:(UIApplication *)application { - [self loadKeyPhrase]; + if ([[OPConfig get].firstRun boolValue]) + [self showGuide]; + else + [self loadKeyPhrase]; +} + +- (void)showGuide { + + [self.navigationController performSegueWithIdentifier:@"OP_Guide" sender:self]; } - (void)loadKeyPhrase { diff --git a/OnePassword/OPGuideViewController.h b/OnePassword/OPGuideViewController.h new file mode 100644 index 00000000..65c2f4b8 --- /dev/null +++ b/OnePassword/OPGuideViewController.h @@ -0,0 +1,17 @@ +// +// OPGuideViewController.h +// OnePassword +// +// Created by Maarten Billemont on 30/01/12. +// Copyright (c) 2012 Lyndir. All rights reserved. +// + +#import + +@interface OPGuideViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UIScrollView *scrollView; + +- (IBAction)close; + +@end diff --git a/OnePassword/OPGuideViewController.m b/OnePassword/OPGuideViewController.m new file mode 100644 index 00000000..0162479c --- /dev/null +++ b/OnePassword/OPGuideViewController.m @@ -0,0 +1,45 @@ +// +// OPGuideViewController.m +// OnePassword +// +// Created by Maarten Billemont on 30/01/12. +// Copyright (c) 2012 Lyndir. All rights reserved. +// + +#import "OPGuideViewController.h" +#import "OPAppDelegate.h" + +@implementation OPGuideViewController +@synthesize scrollView; + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + + [UIUtils autoSizeContent:self.scrollView]; +} + +- (void)viewWillDisappear:(BOOL)animated { + + [super viewWillDisappear:animated]; + + [[OPAppDelegate get] loadKeyPhrase]; +} + +- (void)viewDidUnload { + + [self setScrollView:nil]; + [super viewDidUnload]; +} + +- (IBAction)close { + + [self.presentingViewController dismissModalViewControllerAnimated:YES]; +} + +@end diff --git a/OnePassword/OPMainViewController.m b/OnePassword/OPMainViewController.m index a3f09c38..d969892f 100644 --- a/OnePassword/OPMainViewController.m +++ b/OnePassword/OPMainViewController.m @@ -64,13 +64,8 @@ [super viewWillAppear:animated]; - if (![self.searchTipContainer.superview isKindOfClass:[UIWindow class]]) { - // Put the search tip on the window so it's above the nav bar. - [self.searchTipContainer removeFromSuperview]; - [[UIApplication sharedApplication].keyWindow addSubview:self.searchTipContainer]; - self.searchTipContainer.frame = CGRectSetY(self.searchTipContainer.frame, self.searchTipContainer.frame.origin.y - + self.navigationController.navigationBar.frame.size.height /* Nav */ + 20 /* Status */); - } + self.searchTipContainer.hidden = NO; + if (!self.activeElement.name) [UIView animateWithDuration:animated? 0.2f: 0 animations:^{ self.searchTipContainer.alpha = 1; @@ -80,8 +75,22 @@ [self updateAnimated:NO]; } +- (void)viewWillDisappear:(BOOL)animated { + + [super viewWillDisappear:animated]; + + self.searchTipContainer.hidden = YES; +} + - (void)viewDidLoad { + // Put the search tip on the window so it's above the nav bar. +// [self.searchTipContainer removeFromSuperview]; +// [[UIApplication sharedApplication].keyWindow addSubview:self.searchTipContainer]; +// self.searchTipContainer.frame = CGRectSetY(self.searchTipContainer.frame, self.searchTipContainer.frame.origin.y +// + self.navigationController.navigationBar.frame.size.height /* Nav */ + 20 /* Status */); + self.searchTipContainer.hidden = YES; + // Because IB's edit button doesn't auto-toggle self.editable like editButtonItem does. self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]]; [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:[NSOperationQueue mainQueue] @@ -368,7 +377,7 @@ [[UIApplication sharedApplication] openURL:[request URL]]; return NO; } - + return YES; } diff --git a/OnePassword/OnePassword-Info.plist b/OnePassword/OnePassword-Info.plist index 1f1b08f9..a379c999 100644 --- a/OnePassword/OnePassword-Info.plist +++ b/OnePassword/OnePassword-Info.plist @@ -45,7 +45,7 @@ LSRequiresIPhoneOS NSHumanReadableCopyright - ©2011-2012, Lyndir + © 2011-2012, Lyndir UIMainStoryboardFile MainStoryboard_iPhone UIMainStoryboardFile~ipad diff --git a/OnePassword/Resources/Guide/guide_page_1.png b/OnePassword/Resources/Guide/guide_page_1.png new file mode 100644 index 00000000..6ab34e4e Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_1.png differ diff --git a/OnePassword/Resources/Guide/guide_page_1@2x.png b/OnePassword/Resources/Guide/guide_page_1@2x.png new file mode 100644 index 00000000..69abb26e Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_1@2x.png differ diff --git a/OnePassword/Resources/Guide/guide_page_2.png b/OnePassword/Resources/Guide/guide_page_2.png new file mode 100644 index 00000000..c4b075ca Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_2.png differ diff --git a/OnePassword/Resources/Guide/guide_page_2@2x.png b/OnePassword/Resources/Guide/guide_page_2@2x.png new file mode 100644 index 00000000..94d8ee92 Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_2@2x.png differ diff --git a/OnePassword/Resources/Guide/guide_page_3.png b/OnePassword/Resources/Guide/guide_page_3.png new file mode 100644 index 00000000..f762f39d Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_3.png differ diff --git a/OnePassword/Resources/Guide/guide_page_3@2x.png b/OnePassword/Resources/Guide/guide_page_3@2x.png new file mode 100644 index 00000000..d16378aa Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_3@2x.png differ diff --git a/OnePassword/Resources/Guide/guide_page_4.png b/OnePassword/Resources/Guide/guide_page_4.png new file mode 100644 index 00000000..2ed78532 Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_4.png differ diff --git a/OnePassword/Resources/Guide/guide_page_4@2x.png b/OnePassword/Resources/Guide/guide_page_4@2x.png new file mode 100644 index 00000000..2e0e5eea Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_4@2x.png differ diff --git a/OnePassword/Resources/Guide/guide_page_5.png b/OnePassword/Resources/Guide/guide_page_5.png new file mode 100644 index 00000000..77913814 Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_5.png differ diff --git a/OnePassword/Resources/Guide/guide_page_5@2x.png b/OnePassword/Resources/Guide/guide_page_5@2x.png new file mode 100644 index 00000000..87d9ea7f Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_5@2x.png differ diff --git a/OnePassword/Resources/Guide/guide_page_6.png b/OnePassword/Resources/Guide/guide_page_6.png new file mode 100644 index 00000000..db85bb90 Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_6.png differ diff --git a/OnePassword/Resources/Guide/guide_page_6@2x.png b/OnePassword/Resources/Guide/guide_page_6@2x.png new file mode 100644 index 00000000..dfab8ce1 Binary files /dev/null and b/OnePassword/Resources/Guide/guide_page_6@2x.png differ diff --git a/Scripts/convertImages b/Scripts/convertImages index b1d340da..4c7bd07f 100755 --- a/Scripts/convertImages +++ b/Scripts/convertImages @@ -24,7 +24,7 @@ done echo emit "Converting @2x artwork" -for file in ./*@2x.png; do +for file in ./{,Guide/}*@2x.png; do inArray "${file##*/}" "${icons[@]}" && continue emit "${file/@2x}" --