Using current Version of HNHUi

Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
michael starke
2015-12-02 19:02:24 +01:00
parent 8283998fa2
commit 8a2880789b
8 changed files with 13 additions and 89 deletions

View File

@@ -7,7 +7,7 @@
//
#import <Cocoa/Cocoa.h>
#import "MPSheetWindowController.h"
#import <HNHUi/HNHUi.h>
typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) {
MPDatabaseSettingsTabGeneral,
@@ -18,7 +18,7 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) {
@class MPDocument;
@class HNHRoundedTextField;
@interface MPDatabaseSettingsWindowController : MPSheetWindowController <NSTextFieldDelegate, NSTabViewDelegate>
@interface MPDatabaseSettingsWindowController : HNHUISheetWindowController <NSTextFieldDelegate, NSTabViewDelegate>
@property (weak) IBOutlet NSTabView *sectionTabView;

View File

@@ -7,7 +7,8 @@
//
#import <Cocoa/Cocoa.h>
#import "MPSheetWindowController.h"
#import <HNHUi/HNHUi.h>
@class MPDocument;
@class HNHUIRoundedSecureTextField;
@@ -22,7 +23,7 @@
@end
@interface MPPasswordEditWindowController : MPSheetWindowController <NSTextFieldDelegate>
@interface MPPasswordEditWindowController : HNHUISheetWindowController <NSTextFieldDelegate>
@property (weak) IBOutlet HNHUIRoundedSecureTextField *passwordTextField;
@property (weak) IBOutlet HNHUIRoundedSecureTextField *passwordRepeatTextField;

View File

@@ -32,7 +32,7 @@ static MPPluginHost *_instance;
return self;
}
- (NSArray *)filteredEntriesUsingBlock:(NodeMatchBlock)matchBlock {
- (NSArray<KPKEntry *> *)filteredEntriesUsingBlock:(NodeMatchBlock)matchBlock {
NSArray *currentDocuments = [[NSDocumentController sharedDocumentController] documents];
NSMutableArray *entries = [[NSMutableArray alloc] initWithCapacity:200];
for(MPDocument *document in currentDocuments) {
@@ -44,7 +44,7 @@ static MPPluginHost *_instance;
return [[NSArray alloc] initWithArray:[entries filteredArrayUsingPredicate:predicate] copyItems:YES];
}
- (NSArray *)filteredGroupsUsingBlock:(NodeMatchBlock)matchBlock {
- (NSArray<KPKGroup *> *)filteredGroupsUsingBlock:(NodeMatchBlock)matchBlock {
NSAssert(NO, @"Not implemented");
return nil;
}

View File

@@ -1,33 +0,0 @@
//
// MPSheetWindowController.h
// MacPass
//
// Created by Michael Starke on 10.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
// Based on
// DESSheetController by Peter Nix (pnix@digitalenginesoftware.com)
//
#import <Cocoa/Cocoa.h>
/**
* Generic Windowcontroller to be used for sheets
* Subclasses are able to initialize their views within updateView
* and thus are able to reset themselves before being displayed as sheets
*/
@interface MPSheetWindowController : NSWindowController
/**
* Flag to indicate that the view might need resetting.
* The default implementation of dismiss sheet and the
* designate initializer both set the value to YES
*/
@property (nonatomic, assign) BOOL isDirty;
/**
* This method is a entry point to ensure updated ui before being presented
* The method is called every time the window message is sent to the controller
*/
- (void)updateView;
- (void)dismissSheet:(NSInteger)returnCode;
@end

View File

@@ -1,36 +0,0 @@
//
// MPSheetWindowController.m
// MacPass
//
// Created by Michael Starke on 10.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPSheetWindowController.h"
@implementation MPSheetWindowController
- (id)initWithWindow:(NSWindow *)window {
self = [super initWithWindow:window];
if(self) {
_isDirty = YES;
}
return self;
}
- (NSWindow *)window {
NSWindow *window = super.window;
[self updateView];
return window;
}
- (void)updateView {
// do nothing
}
- (void)dismissSheet:(NSInteger)returnCode {
self.isDirty = YES;
[[super window] orderOut:self];
[NSApp endSheet:[super window] returnCode:returnCode];
}
@end