Dropping 10.9 support

This commit is contained in:
michael starke
2017-05-24 18:12:12 +02:00
parent 7b04331a2d
commit e6a73a2e65
18 changed files with 31 additions and 65 deletions

View File

@@ -2249,7 +2249,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2/**"; HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2/**";
MACOSX_DEPLOYMENT_TARGET = 10.9; MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-lxml2"; OTHER_LDFLAGS = "-lxml2";
SDKROOT = macosx; SDKROOT = macosx;
@@ -2287,7 +2287,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2/**"; HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2/**";
MACOSX_DEPLOYMENT_TARGET = 10.9; MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_LDFLAGS = "-lxml2"; OTHER_LDFLAGS = "-lxml2";
SDKROOT = macosx; SDKROOT = macosx;
WARNING_CFLAGS = "-Wpartial-availability"; WARNING_CFLAGS = "-Wpartial-availability";

View File

@@ -196,7 +196,6 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
if(!self.passwordCreatorController) { if(!self.passwordCreatorController) {
self.passwordCreatorController = [[MPPasswordCreatorViewController alloc] init]; self.passwordCreatorController = [[MPPasswordCreatorViewController alloc] init];
self.passwordCreatorWindow.contentView = self.passwordCreatorController.view; self.passwordCreatorWindow.contentView = self.passwordCreatorController.view;
[self.passwordCreatorController updateResponderChain];
} }
[self.passwordCreatorController reset]; [self.passwordCreatorController reset];
[self.passwordCreatorWindow makeKeyAndOrderFront:self.passwordCreatorWindow]; [self.passwordCreatorWindow makeKeyAndOrderFront:self.passwordCreatorWindow];
@@ -233,7 +232,10 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
- (void)checkForUpdates:(id)sender { - (void)checkForUpdates:(id)sender {
#ifdef DEBUG #ifdef DEBUG
NSAlert *alert = [NSAlert alertWithMessageText:@"Updates are disabled!" defaultButton:@"Ok" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Sparkle updates are only available in offical releases of %@!", NSApp.applicationName]; NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = @"Updates are disabled!";
alert.informativeText = [NSString stringWithFormat:@"Sparkle updates are only available in offical releases of %@!", NSApp.applicationName];
[alert addButtonWithTitle:@"Ok"];
[alert runModal]; [alert runModal];
#else #else
[[SUUpdater sharedUpdater] checkForUpdates:sender]; [[SUUpdater sharedUpdater] checkForUpdates:sender];

View File

@@ -164,7 +164,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
views:NSDictionaryOfVariableBindings(newContentView)]]; views:NSDictionaryOfVariableBindings(newContentView)]];
[contentView layout]; [contentView layout];
[viewController updateResponderChain];
[self.window makeFirstResponder:viewController.reconmendedFirstResponder]; [self.window makeFirstResponder:viewController.reconmendedFirstResponder];
} }
@@ -419,7 +418,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
options:0 options:0
metrics:nil metrics:nil
views:NSDictionaryOfVariableBindings(inspectorView)]]; views:NSDictionaryOfVariableBindings(inspectorView)]];
[self.inspectorViewController updateResponderChain];
} }
[[NSUserDefaults standardUserDefaults] setBool:!inspectorWasVisible forKey:kMPSettingsKeyShowInspector]; [[NSUserDefaults standardUserDefaults] setBool:!inspectorWasVisible forKey:kMPSettingsKeyShowInspector];
} }
@@ -500,9 +498,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
options:0 options:0
metrics:nil metrics:nil
views:views]]; views:views]];
[self.entryViewController updateResponderChain];
[self.inspectorViewController updateResponderChain];
[self.outlineViewController updateResponderChain];
[self.outlineViewController showOutline]; [self.outlineViewController showOutline];
/* Restore the State the inspector view was in before the view change */ /* Restore the State the inspector view was in before the view change */

View File

@@ -91,7 +91,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
return nil; return nil;
} }
- (void)didLoadView { - (void)viewDidLoad {
[self _addScrollViewWithView:self.generalView atTab:MPEntryTabGeneral]; [self _addScrollViewWithView:self.generalView atTab:MPEntryTabGeneral];
[self _addScrollViewWithView:self.autotypView atTab:MPEntryTabAutotype]; [self _addScrollViewWithView:self.autotypView atTab:MPEntryTabAutotype];

View File

@@ -110,7 +110,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
- (void)didLoadView { - (void)viewDidLoad {
self.view.wantsLayer = YES; self.view.wantsLayer = YES;
self.entryTable.delegate = self; self.entryTable.delegate = self;
@@ -534,7 +534,6 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
_isDisplayingContextBar = YES; _isDisplayingContextBar = YES;
if(!self.contextBarViewController.view.superview) { if(!self.contextBarViewController.view.superview) {
[self.view addSubview:self.contextBarViewController.view]; [self.view addSubview:self.contextBarViewController.view];
[self.contextBarViewController updateResponderChain];
NSView *contextBar = self.contextBarViewController.view; NSView *contextBar = self.contextBarViewController.view;
NSView *scrollView = self.entryTable.enclosingScrollView; NSView *scrollView = self.entryTable.enclosingScrollView;
NSDictionary *views = NSDictionaryOfVariableBindings(scrollView, contextBar); NSDictionary *views = NSDictionaryOfVariableBindings(scrollView, contextBar);

View File

@@ -30,7 +30,7 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab";
return NSLocalizedString(@"GENERAL_SETTINGS", @"General Settings Label"); return NSLocalizedString(@"GENERAL_SETTINGS", @"General Settings Label");
} }
- (void)didLoadView { - (void)viewDidLoad {
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController]; NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
[self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyClearPasteboardOnQuit] options:nil]; [self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyClearPasteboardOnQuit] options:nil];

View File

@@ -24,8 +24,7 @@
return @"IconSelection"; return @"IconSelection";
} }
- (void)didLoadView { - (void)viewDidLoad {
//[[self.imageButton cell] setBackgroundStyle:NSBackgroundStyleLowered];
self.iconCollectionView.backgroundColors = @[[NSColor clearColor]]; self.iconCollectionView.backgroundColors = @[[NSColor clearColor]];
self.iconCollectionView.selectable = YES; self.iconCollectionView.selectable = YES;
self.iconCollectionView.allowsMultipleSelection = NO; self.iconCollectionView.allowsMultipleSelection = NO;

View File

@@ -126,12 +126,6 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
[self.entryViewController registerNotificationsForDocument:document]; [self.entryViewController registerNotificationsForDocument:document];
} }
- (void)updateResponderChain {
[super updateResponderChain];
[self.groupViewController updateResponderChain];
[self.entryViewController updateResponderChain];
}
#pragma mark - #pragma mark -
#pragma mark Properties #pragma mark Properties
- (void)setActiveTab:(NSUInteger)activeTab { - (void)setActiveTab:(NSUInteger)activeTab {

View File

@@ -66,11 +66,11 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
- (void)dealloc { - (void)dealloc {
[self.outlineView unbind:NSContentBinding]; [self.outlineView unbind:NSContentBinding];
[self.treeController unbind:NSContentBinding]; [self.treeController unbind:NSContentBinding];
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
[self.outlineView setDelegate:nil]; [self.outlineView setDelegate:nil];
} }
- (void)didLoadView { - (void)viewDidLoad {
self.outlineView.menu = [self _contextMenu]; self.outlineView.menu = [self _contextMenu];
self.outlineView.allowsEmptySelection = YES; self.outlineView.allowsEmptySelection = YES;
self.outlineView.floatsGroupRows = NO; self.outlineView.floatsGroupRows = NO;
@@ -80,14 +80,14 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
[self.outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]]; [self.outlineView registerForDraggedTypes:@[ KPKGroupUTI, KPKEntryUTI ]];
[self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES]; [self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[[NSNotificationCenter defaultCenter] addObserver:self [NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(_didBecomeFirstResponder:) selector:@selector(_didBecomeFirstResponder:)
name:MPDidActivateViewNotification name:MPDidActivateViewNotification
object:self.outlineView]; object:self.outlineView];
NSView *clipView = self.outlineView.enclosingScrollView.contentView; NSView *clipView = self.outlineView.enclosingScrollView.contentView;
[[NSNotificationCenter defaultCenter] addObserver:self [NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(_outlineDidScroll:) selector:@selector(_outlineDidScroll:)
name:NSViewBoundsDidChangeNotification name:NSViewBoundsDidChangeNotification
object:clipView]; object:clipView];
@@ -108,7 +108,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
[self.outlineView bind:NSContentBinding toObject:self.treeController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil]; [self.outlineView bind:NSContentBinding toObject:self.treeController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil];
[self.outlineView bind:NSSelectionIndexPathsBinding toObject:self.treeController withKeyPath:NSStringFromSelector(@selector(selectionIndexPaths)) options:nil]; [self.outlineView bind:NSSelectionIndexPathsBinding toObject:self.treeController withKeyPath:NSStringFromSelector(@selector(selectionIndexPaths)) options:nil];
[self bind:NSStringFromSelector(@selector(databaseNameWrapper)) toObject:document.tree.metaData withKeyPath:NSStringFromSelector(@selector(databaseName)) options:nil]; [self bind:NSStringFromSelector(@selector(databaseNameWrapper)) toObject:document.tree.metaData withKeyPath:NSStringFromSelector(@selector(databaseName)) options:nil];
[self.outlineView setDataSource:self.datasource]; self.outlineView.dataSource = self.datasource;
_bindingEstablished = YES; _bindingEstablished = YES;
} }
NSTreeNode *node = [_outlineView itemAtRow:0]; NSTreeNode *node = [_outlineView itemAtRow:0];

View File

@@ -127,7 +127,6 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
self.lowerCaseButton.tag = MPPasswordCharactersLowerCase; self.lowerCaseButton.tag = MPPasswordCharactersLowerCase;
self.symbolsButton.tag = MPPasswordCharactersSymbols; self.symbolsButton.tag = MPPasswordCharactersSymbols;
[self updateResponderChain];
[self reset]; [self reset];
} }

View File

@@ -51,7 +51,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
- (void)didLoadView { - (void)viewDidLoad {
self.keyPathControl.delegate = self.pathControlDelegate; self.keyPathControl.delegate = self.pathControlDelegate;
self.errorImageView.image = [NSImage imageNamed:NSImageNameCaution]; self.errorImageView.image = [NSImage imageNamed:NSImageNameCaution];
[self.passwordTextField bind:NSStringFromSelector(@selector(showPassword)) toObject:self withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil]; [self.passwordTextField bind:NSStringFromSelector(@selector(showPassword)) toObject:self withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil];

View File

@@ -33,14 +33,14 @@
return self; return self;
} }
- (void)didLoadView { - (void)viewDidLoad {
[self.pluginDataController bind:NSContentDictionaryBinding toObject:self.representedObject withKeyPath:NSStringFromSelector(@selector(customData)) options:nil]; [self.pluginDataController bind:NSContentDictionaryBinding toObject:self.representedObject withKeyPath:NSStringFromSelector(@selector(customData)) options:nil];
[self.pluginDataTabelView bind:NSContentBinding toObject:self.pluginDataController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil]; [self.pluginDataTabelView bind:NSContentBinding toObject:self.pluginDataController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil];
self.pluginDataTabelView.backgroundColor = [NSColor clearColor]; self.pluginDataTabelView.backgroundColor = NSColor.clearColor;
} }
- (KPKNode *)representedNode { - (KPKNode *)representedNode {
if([self.representedObject isKindOfClass:[KPKNode class]]) { if([self.representedObject isKindOfClass:KPKNode.class]) {
return self.representedObject; return self.representedObject;
} }
return nil; return nil;

View File

@@ -38,7 +38,7 @@
return NSLocalizedString(@"PLUGIN_SETTINGS", ""); return NSLocalizedString(@"PLUGIN_SETTINGS", "");
} }
- (void)didLoadView { - (void)viewDidLoad {
self.pluginTableView.delegate = self; self.pluginTableView.delegate = self;
self.pluginTableView.dataSource = self; self.pluginTableView.dataSource = self;

View File

@@ -22,7 +22,7 @@
return @"ReferenceBuilderView"; return @"ReferenceBuilderView";
} }
- (void)didLoadView { - (void)viewDidLoad {
[self.searchKeyPopUpButton setMenu:[self _allocateAttributeItemMenu:YES withTitle:NSLocalizedString(@"SEARCH_VALUE", "")]]; [self.searchKeyPopUpButton setMenu:[self _allocateAttributeItemMenu:YES withTitle:NSLocalizedString(@"SEARCH_VALUE", "")]];
[self.valuePopUpButton setMenu:[self _allocateAttributeItemMenu:NO withTitle:NSLocalizedString(@"OUTPUT_VALUE", "")]]; [self.valuePopUpButton setMenu:[self _allocateAttributeItemMenu:NO withTitle:NSLocalizedString(@"OUTPUT_VALUE", "")]];
[self.searchStringTextField bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(searchString)) options:nil]; [self.searchStringTextField bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(searchString)) options:nil];
@@ -32,7 +32,6 @@
- (NSMenu *)_allocateAttributeItemMenu:(BOOL)allowCustomAttributes withTitle:(NSString *)title { - (NSMenu *)_allocateAttributeItemMenu:(BOOL)allowCustomAttributes withTitle:(NSString *)title {
NSMenu *menu = [[NSMenu alloc] init]; NSMenu *menu = [[NSMenu alloc] init];
/* first item is button label */ /* first item is button label */
//[menu addItemWithTitle:title action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"UUID","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"UUID","") action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"TITLE","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"TITLE","") action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"USERNAME","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"USERNAME","") action:NULL keyEquivalent:@""];

View File

@@ -22,7 +22,7 @@
return @"SavePanelAccessoryView"; return @"SavePanelAccessoryView";
} }
- (void)didLoadView { - (void)viewDidLoad {
NSArray *types = [self.document writableTypesForSaveOperation:NSSaveOperation]; NSArray *types = [self.document writableTypesForSaveOperation:NSSaveOperation];
NSMenu *menu = [[NSMenu alloc] init]; NSMenu *menu = [[NSMenu alloc] init];
for (NSString *uti in types ) { for (NSString *uti in types ) {

View File

@@ -15,7 +15,4 @@
@property (weak, nullable) id<MPModelChangeObserving> observer; @property (weak, nullable) id<MPModelChangeObserving> observer;
@property (nonatomic, readonly, nullable) NSResponder *reconmendedFirstResponder; @property (nonatomic, readonly, nullable) NSResponder *reconmendedFirstResponder;
- (void)didLoadView;
- (void)updateResponderChain;
@end @end

View File

@@ -11,16 +11,6 @@
@implementation MPViewController @implementation MPViewController
- (void)loadView {
[super loadView];
[self updateResponderChain];
[self didLoadView];
}
- (void)didLoadView {
// override
}
- (NSWindowController *)windowController { - (NSWindowController *)windowController {
return self.view.window.windowController; return self.view.window.windowController;
} }
@@ -30,14 +20,6 @@
return nil; // override return nil; // override
} }
- (void)updateResponderChain {
if(self.view && self.view.nextResponder != self) {
NSResponder *nextResponder = self.view.nextResponder;
self.view.nextResponder = self;
self.nextResponder = nextResponder;
}
}
#pragma mark NSEditorRegistration #pragma mark NSEditorRegistration
- (void)objectDidBeginEditing:(id)editor { - (void)objectDidBeginEditing:(id)editor {
[self.windowController.document objectDidBeginEditing:editor]; [self.windowController.document objectDidBeginEditing:editor];

View File

@@ -20,7 +20,7 @@
return @"WorkflowSettings"; return @"WorkflowSettings";
} }
- (void)didLoadView { - (void)viewDidLoad {
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController]; NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
[self.doubleClickURLPopup bind:NSSelectedIndexBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyDoubleClickURLAction] options:nil]; [self.doubleClickURLPopup bind:NSSelectedIndexBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyDoubleClickURLAction] options:nil];