diff --git a/MasterPassword/ObjC/MPAppDelegate_InApp.m b/MasterPassword/ObjC/MPAppDelegate_InApp.m index 6caad2e8..451ff258 100644 --- a/MasterPassword/ObjC/MPAppDelegate_InApp.m +++ b/MasterPassword/ObjC/MPAppDelegate_InApp.m @@ -21,7 +21,7 @@ PearlAssociatedObjectProperty( NSArray*, PaymentTransactions, paymentTransaction } ); SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers: - [[NSSet alloc] initWithObjects:MPProductGenerateLogins, MPProductAdvancedExport, nil]]; + [[NSSet alloc] initWithObjects:MPProductGenerateLogins, MPProductGenerateAnswers, nil]]; productsRequest.delegate = self; [productsRequest start]; } diff --git a/MasterPassword/ObjC/MPTypes.h b/MasterPassword/ObjC/MPTypes.h index b12db544..09db473f 100644 --- a/MasterPassword/ObjC/MPTypes.h +++ b/MasterPassword/ObjC/MPTypes.h @@ -86,7 +86,7 @@ typedef NS_ENUM(NSUInteger, MPSiteType) { #define MPInconsistenciesFixResultUserKey @"MPInconsistenciesFixResultUserKey" #define MPProductGenerateLogins @"com.lyndir.masterpassword.products.generatelogins" -#define MPProductAdvancedExport @"com.lyndir.masterpassword.products.advancedexport" +#define MPProductGenerateAnswers @"com.lyndir.masterpassword.products.generateanswers" static void MPCheckpoint(NSString *checkpoint, NSDictionary *attributes) { diff --git a/MasterPassword/ObjC/iOS/MPAnswersViewController.m b/MasterPassword/ObjC/iOS/MPAnswersViewController.m index f93b1f48..ac2c37bb 100644 --- a/MasterPassword/ObjC/iOS/MPAnswersViewController.m +++ b/MasterPassword/ObjC/iOS/MPAnswersViewController.m @@ -38,9 +38,9 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; - - [tableView deselectRowAtIndexPath:indexPath animated:YES]; +// UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; +// +// [tableView deselectRowAtIndexPath:indexPath animated:YES]; } @end diff --git a/MasterPassword/ObjC/iOS/MPStoreViewController.h b/MasterPassword/ObjC/iOS/MPStoreViewController.h index 039f6a9d..f875fe58 100644 --- a/MasterPassword/ObjC/iOS/MPStoreViewController.h +++ b/MasterPassword/ObjC/iOS/MPStoreViewController.h @@ -14,7 +14,6 @@ @property(weak, nonatomic) IBOutlet MPStoreProductCell *generateLoginCell; @property(weak, nonatomic) IBOutlet MPStoreProductCell *generateAnswersCell; -@property(weak, nonatomic) IBOutlet MPStoreProductCell *advancedExportCell; @property(weak, nonatomic) IBOutlet MPStoreProductCell *iOSIntegrationCell; @property(weak, nonatomic) IBOutlet MPStoreProductCell *touchIDCell; diff --git a/MasterPassword/ObjC/iOS/MPStoreViewController.m b/MasterPassword/ObjC/iOS/MPStoreViewController.m index fa273d9e..c93039f7 100644 --- a/MasterPassword/ObjC/iOS/MPStoreViewController.m +++ b/MasterPassword/ObjC/iOS/MPStoreViewController.m @@ -134,8 +134,8 @@ if ([productIdentifier isEqualToString:MPProductGenerateLogins]) return self.generateLoginCell; - if ([productIdentifier isEqualToString:MPProductAdvancedExport]) - return self.advancedExportCell; + if ([productIdentifier isEqualToString:MPProductGenerateAnswers]) + return self.generateAnswersCell; return nil; } @@ -148,7 +148,7 @@ for (SKProduct *product in products) { [self showCellForProductWithIdentifier:MPProductGenerateLogins ifProduct:product showingCells:showCells]; - [self showCellForProductWithIdentifier:MPProductAdvancedExport ifProduct:product showingCells:showCells]; + [self showCellForProductWithIdentifier:MPProductGenerateAnswers ifProduct:product showingCells:showCells]; } [hideCells removeObjectsInArray:showCells]; diff --git a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m index a83ed010..80b914ed 100644 --- a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m +++ b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m @@ -416,28 +416,36 @@ NSString *exportFileName = strf( @"%@ (%@).mpsites", [self activeUserForMainThread].name, [exportDateFormatter stringFromDate:[NSDate date]] ); - if (![[MPiOSAppDelegate get] isPurchased:MPProductAdvancedExport]) - [PearlEMail sendEMailTo:nil fromVC:viewController subject:@"Master Password Export" body:message - attachments:[[PearlEMailAttachment alloc] initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding] - mimeType:@"text/plain" fileName:exportFileName], - nil]; - else { - NSURL *applicationSupportURL = [[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory - inDomains:NSUserDomainMask] lastObject]; - NSURL *exportURL = [[applicationSupportURL - URLByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier isDirectory:YES] - URLByAppendingPathComponent:exportFileName isDirectory:NO]; - NSError *error = nil; - if (![[exportedSites dataUsingEncoding:NSUTF8StringEncoding] - writeToURL:exportURL options:NSDataWritingFileProtectionComplete error:&error]) - err( @"Failed to write export data to URL %@: %@", exportURL, error ); - else { - self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:exportURL]; - self.interactionController.UTI = @"com.lyndir.masterpassword.sites"; - self.interactionController.delegate = self; - [self.interactionController presentOpenInMenuFromRect:CGRectZero inView:viewController.view animated:YES]; - } - } + [PearlSheet showSheetWithTitle:@"Export Destination" viewStyle:UIActionSheetStyleBlackTranslucent initSheet:nil + tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) { + if (buttonIndex == [sheet cancelButtonIndex]) + return; + + if (buttonIndex == [sheet firstOtherButtonIndex]) { + [PearlEMail sendEMailTo:nil fromVC:viewController subject:@"Master Password Export" body:message + attachments:[[PearlEMailAttachment alloc] + initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding] + mimeType:@"text/plain" fileName:exportFileName], + nil]; + return; + } + + NSURL *applicationSupportURL = [[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory + inDomains:NSUserDomainMask] lastObject]; + NSURL *exportURL = [[applicationSupportURL + URLByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier isDirectory:YES] + URLByAppendingPathComponent:exportFileName isDirectory:NO]; + NSError *error = nil; + if (![[exportedSites dataUsingEncoding:NSUTF8StringEncoding] + writeToURL:exportURL options:NSDataWritingFileProtectionComplete error:&error]) + err( @"Failed to write export data to URL %@: %@", exportURL, error ); + else { + self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:exportURL]; + self.interactionController.UTI = @"com.lyndir.masterpassword.sites"; + self.interactionController.delegate = self; + [self.interactionController presentOpenInMenuFromRect:CGRectZero inView:viewController.view animated:YES]; + } + } cancelTitle:@"Cancel" destructiveTitle:nil otherTitles:@"Send As E-Mail", @"Share / Airdrop", nil]; } - (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void ( ^ )(void))didReset { diff --git a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj index 85752da2..cc77a31b 100644 --- a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -284,9 +284,6 @@ DAE1EF2217E942DE00BC0086 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAE1EF2417E942DE00BC0086 /* Localizable.strings */; }; DAE2725919C93B80007C5262 /* libInAppSettingsKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAFC5655172C573B00CB5CC5 /* libInAppSettingsKit.a */; }; DAE2725A19C93B8E007C5262 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA70EC7F1811B13C00F65DB2 /* StoreKit.framework */; }; - DAE2725E19CA98A5007C5262 /* thumb_advanced_export.png in Resources */ = {isa = PBXBuildFile; fileRef = DAE2725B19CA98A5007C5262 /* thumb_advanced_export.png */; }; - DAE2725F19CA98A5007C5262 /* thumb_advanced_export@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DAE2725C19CA98A5007C5262 /* thumb_advanced_export@2x.png */; }; - DAE2726019CA98A5007C5262 /* thumb_advanced_export@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DAE2725D19CA98A5007C5262 /* thumb_advanced_export@3x.png */; }; DAE2726319CE9CB3007C5262 /* UITableViewCell+PearlDeque.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE2726119CE9CB3007C5262 /* UITableViewCell+PearlDeque.m */; }; DAE2726419CE9CB3007C5262 /* UITableViewCell+PearlDeque.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE2726219CE9CB3007C5262 /* UITableViewCell+PearlDeque.h */; }; DAEBC45314F6364500987BF6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAEBC45214F6364500987BF6 /* QuartzCore.framework */; }; @@ -1245,9 +1242,6 @@ DAD312C01552A20800A3F9ED /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; DADBB55918DB0CFC00D099FE /* keyboard-dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "keyboard-dark@2x.png"; sourceTree = ""; }; DAE1EF2317E942DE00BC0086 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - DAE2725B19CA98A5007C5262 /* thumb_advanced_export.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumb_advanced_export.png; sourceTree = ""; }; - DAE2725C19CA98A5007C5262 /* thumb_advanced_export@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "thumb_advanced_export@2x.png"; sourceTree = ""; }; - DAE2725D19CA98A5007C5262 /* thumb_advanced_export@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "thumb_advanced_export@3x.png"; sourceTree = ""; }; DAE2726119CE9CB3007C5262 /* UITableViewCell+PearlDeque.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableViewCell+PearlDeque.m"; sourceTree = ""; }; DAE2726219CE9CB3007C5262 /* UITableViewCell+PearlDeque.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableViewCell+PearlDeque.h"; sourceTree = ""; }; DAE8E65119867AB500416A0F /* libopensslcrypto-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libopensslcrypto-ios.a"; sourceTree = ""; }; @@ -1563,9 +1557,6 @@ DABD360D1711E29400CF925C /* Media */ = { isa = PBXGroup; children = ( - DAE2725B19CA98A5007C5262 /* thumb_advanced_export.png */, - DAE2725C19CA98A5007C5262 /* thumb_advanced_export@2x.png */, - DAE2725D19CA98A5007C5262 /* thumb_advanced_export@3x.png */, DA29993119C9132F00AF7DF1 /* thumb_generated_login@3x.png */, DA29992D19C86F5700AF7DF1 /* thumb_generated_login@2x.png */, DA29992E19C86F5700AF7DF1 /* thumb_generated_login.png */, @@ -3081,7 +3072,6 @@ DA250A031956484D00AC23F1 /* image-7@2x.png in Resources */, DA25C5FA197CCAE00046CDCF /* icon_delete.png in Resources */, DA25C601197DBF260046CDCF /* icon_trash@2x.png in Resources */, - DAE2725E19CA98A5007C5262 /* thumb_advanced_export.png in Resources */, DABD39551711E29700CF925C /* avatar-6.png in Resources */, DABD39561711E29700CF925C /* avatar-6@2x.png in Resources */, DABD39571711E29700CF925C /* avatar-7.png in Resources */, @@ -3103,7 +3093,6 @@ DABD39881711E29700CF925C /* SourceCodePro-ExtraLight.otf in Resources */, DABD39A01711E29700CF925C /* icon_action.png in Resources */, DABD39A11711E29700CF925C /* icon_action@2x.png in Resources */, - DAE2726019CA98A5007C5262 /* thumb_advanced_export@3x.png in Resources */, DABD39F21711E29700CF925C /* icon_cancel.png in Resources */, DA25C5FB197CCAE00046CDCF /* icon_delete@2x.png in Resources */, DA29993219C9132F00AF7DF1 /* thumb_generated_login@3x.png in Resources */, @@ -3118,7 +3107,6 @@ DABD3AA01711E29800CF925C /* icon_pause.png in Resources */, DABD3AA11711E29800CF925C /* icon_pause@2x.png in Resources */, DABD3AAA1711E29800CF925C /* icon_person.png in Resources */, - DAE2725F19CA98A5007C5262 /* thumb_advanced_export@2x.png in Resources */, DABD3AAB1711E29800CF925C /* icon_person@2x.png in Resources */, DABD3ABC1711E29800CF925C /* icon_play.png in Resources */, DABD3ABD1711E29800CF925C /* icon_play@2x.png in Resources */, diff --git a/MasterPassword/ObjC/iOS/Storyboard.storyboard b/MasterPassword/ObjC/iOS/Storyboard.storyboard index e1f4ad51..5dfddd5a 100644 --- a/MasterPassword/ObjC/iOS/Storyboard.storyboard +++ b/MasterPassword/ObjC/iOS/Storyboard.storyboard @@ -28,7 +28,6 @@ Exo2.0-Bold Exo2.0-Bold Exo2.0-Bold - Exo2.0-Bold Exo2.0-ExtraBold @@ -66,8 +65,6 @@ Exo2.0-Regular Exo2.0-Regular Exo2.0-Regular - Exo2.0-Regular - Exo2.0-Regular Exo2.0-Thin @@ -87,7 +84,6 @@ Exo2.0-Thin Exo2.0-Thin Exo2.0-Thin - Exo2.0-Thin SourceCodePro-Black @@ -120,7 +116,7 @@ @@ -2539,71 +2535,6 @@ See - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2787,7 +2718,6 @@ See - @@ -2798,7 +2728,7 @@ See - + @@ -2832,7 +2762,7 @@ See -