diff --git a/External/Crashlytics.framework/Versions/A/Crashlytics b/External/Crashlytics.framework/Versions/A/Crashlytics index 4701a362..aa001c2b 100644 Binary files a/External/Crashlytics.framework/Versions/A/Crashlytics and b/External/Crashlytics.framework/Versions/A/Crashlytics differ diff --git a/External/Crashlytics.framework/Versions/A/Resources/Info.plist b/External/Crashlytics.framework/Versions/A/Resources/Info.plist index 1290a7a3..bf21197c 100644 --- a/External/Crashlytics.framework/Versions/A/Resources/Info.plist +++ b/External/Crashlytics.framework/Versions/A/Resources/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable Crashlytics CFBundleIdentifier - com.crashlytics.ios + com.crashlytics.sdk.mac CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,16 +15,16 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.6 + 2.1.2 CFBundleSupportedPlatforms - iPhoneOS + macosx CFBundleVersion - 21 + 9 DTPlatformName - iphoneos + macosx MinimumOSVersion - 4.0 + 10.6 diff --git a/MasterPassword/ObjC/Mac/MPElementCollectionView.m b/MasterPassword/ObjC/Mac/MPElementCollectionView.m index 28b77868..d90c3c01 100644 --- a/MasterPassword/ObjC/Mac/MPElementCollectionView.m +++ b/MasterPassword/ObjC/Mac/MPElementCollectionView.m @@ -205,6 +205,8 @@ MPElementEntity *element = [self.representedObject entityInContext:context]; [context deleteObject:element]; [context saveToStore]; + + [((MPPasswordWindowController *)self.collectionView.window.windowController) updateElements]; }]; break; } diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.h b/MasterPassword/ObjC/Mac/MPPasswordWindowController.h index 649dc377..374b86a7 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.h +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.h @@ -18,4 +18,6 @@ @property(nonatomic, weak) IBOutlet NSTextField *userLabel; @property(nonatomic, weak) IBOutlet NSCollectionView *siteCollectionView; +- (void)updateElements; + @end diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m index b397e28a..bf450bfc 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m @@ -178,14 +178,17 @@ } if (contextInfo == MPAlertCreateSite) { switch (returnCode) { - case NSAlertDefaultReturn: { + case NSAlertFirstButtonReturn: { + // "Create" button. [[MPMacAppDelegate get] addElementNamed:[self.siteField stringValue] completion:^(MPElementEntity *element) { - if (element) { + if (element) [self updateElements]; - } }]; break; } + case NSAlertThirdButtonReturn: + // "Cancel" button. + break; default: break; } @@ -345,23 +348,35 @@ NSError *error = nil; NSArray *siteResults = [context executeFetchRequest:fetchRequest error:&error]; - if (!siteResults) - err(@"While fetching elements for completion: %@", error); - else if ([siteResults count]) { - NSMutableArray *newElements = [NSMutableArray arrayWithCapacity:[siteResults count]]; - for (MPElementEntity *element in siteResults) - [newElements addObject:[[MPElementModel alloc] initWithEntity:element]]; - self.elements = newElements; - if (!self.selectedElement && [newElements count]) - self.elementSelectionIndexes = [NSIndexSet indexSetWithIndex:0]; + if (!siteResults) { + err(@"While fetching elements for completion: %@", error); + return; } + + NSMutableArray *newElements = [NSMutableArray arrayWithCapacity:[siteResults count]]; + for (MPElementEntity *element in siteResults) + [newElements addObject:[[MPElementModel alloc] initWithEntity:element]]; + self.elements = newElements; + if (!self.selectedElement) + self.elementSelectionIndexes = [newElements count]? [NSIndexSet indexSetWithIndex:0]: nil; }]; } +- (NSUInteger)selectedIndex { + + if (!self.elementSelectionIndexes) + return NSNotFound; + NSUInteger selectedIndex = self.elementSelectionIndexes.firstIndex; + if (selectedIndex >= self.elements.count) + return NSNotFound; + + return selectedIndex; +} + - (NSBox *)selectedView { - NSUInteger selectedIndex = self.elementSelectionIndexes.firstIndex; - if (selectedIndex == NSNotFound || selectedIndex >= self.elements.count) + NSUInteger selectedIndex = [self selectedIndex]; + if (selectedIndex == NSNotFound) return nil; return (NSBox *)[self.siteCollectionView itemAtIndex:selectedIndex].view; @@ -369,10 +384,11 @@ - (MPElementModel *)selectedElement { - if (!self.elementSelectionIndexes.count) + NSUInteger selectedIndex = [self selectedIndex]; + if (selectedIndex == NSNotFound) return nil; - return (MPElementModel *)self.elements[self.elementSelectionIndexes.firstIndex]; + return (MPElementModel *)self.elements[selectedIndex]; } - (void)setSelectedElement:(MPElementModel *)element { diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj index 14ae6cd5..c3a06497 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -1978,7 +1978,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; CODE_SIGN_IDENTITY = "Mac Developer"; - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer: Maarten Billemont (DWGU95U4ZD)"; COMBINE_HIDPI_IMAGES = YES; GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; diff --git a/MasterPassword/ObjC/Mac/MasterPassword.entitlements b/MasterPassword/ObjC/Mac/MasterPassword.entitlements index 4475482e..4965233b 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword.entitlements +++ b/MasterPassword/ObjC/Mac/MasterPassword.entitlements @@ -4,11 +4,11 @@ com.apple.developer.ubiquity-container-identifiers - $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword.Mac - $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword.shared + HL3Q45LX9N.com.lyndir.lhunath.MasterPassword.Mac + HL3Q45LX9N.com.lyndir.lhunath.MasterPassword.shared com.apple.developer.ubiquity-kvstore-identifier - $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword.shared + HL3Q45LX9N.com.lyndir.lhunath.MasterPassword.shared com.apple.security.app-sandbox