Refactored to NS_ENUM and NS_OPTION

This commit is contained in:
michael starke
2013-06-13 23:31:19 +02:00
parent 90f1b9641b
commit cc58ec3770
17 changed files with 91 additions and 107 deletions

View File

@@ -19,6 +19,7 @@
4C2E381F16D11FF900037A9D /* 05_LanguagesTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */; }; 4C2E381F16D11FF900037A9D /* 05_LanguagesTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */; };
4C2E382316D1421B00037A9D /* MPIconHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382216D1421B00037A9D /* MPIconHelper.m */; }; 4C2E382316D1421B00037A9D /* MPIconHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382216D1421B00037A9D /* MPIconHelper.m */; };
4C2E382616D1470200037A9D /* MPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382516D1470200037A9D /* MPViewController.m */; }; 4C2E382616D1470200037A9D /* MPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382516D1470200037A9D /* MPViewController.m */; };
4C37A6731769393300AD0A40 /* HNHTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A6721769393300AD0A40 /* HNHTableHeaderCell.m */; };
4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */; }; 4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */; };
4C3BD51516D276F800389F1F /* MPToolbarDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3BD51416D276F800389F1F /* MPToolbarDelegate.m */; }; 4C3BD51516D276F800389F1F /* MPToolbarDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3BD51416D276F800389F1F /* MPToolbarDelegate.m */; };
4C3CD2A8175570C9005F911C /* DMSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3CD2A7175570C9005F911C /* DMSplitView.m */; }; 4C3CD2A8175570C9005F911C /* DMSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3CD2A7175570C9005F911C /* DMSplitView.m */; };
@@ -155,6 +156,8 @@
4C2E382216D1421B00037A9D /* MPIconHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPIconHelper.m; sourceTree = "<group>"; }; 4C2E382216D1421B00037A9D /* MPIconHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPIconHelper.m; sourceTree = "<group>"; };
4C2E382416D1470200037A9D /* MPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPViewController.h; sourceTree = "<group>"; }; 4C2E382416D1470200037A9D /* MPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPViewController.h; sourceTree = "<group>"; };
4C2E382516D1470200037A9D /* MPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPViewController.m; sourceTree = "<group>"; }; 4C2E382516D1470200037A9D /* MPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPViewController.m; sourceTree = "<group>"; };
4C37A6711769393300AD0A40 /* HNHTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTableHeaderCell.h; sourceTree = "<group>"; };
4C37A6721769393300AD0A40 /* HNHTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTableHeaderCell.m; sourceTree = "<group>"; };
4C37A83E15B8B474005EF8EE /* MPOutlineDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineDataSource.h; sourceTree = "<group>"; }; 4C37A83E15B8B474005EF8EE /* MPOutlineDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineDataSource.h; sourceTree = "<group>"; };
4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineDataSource.m; sourceTree = "<group>"; }; 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineDataSource.m; sourceTree = "<group>"; };
4C3BD51316D276F800389F1F /* MPToolbarDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPToolbarDelegate.h; sourceTree = "<group>"; }; 4C3BD51316D276F800389F1F /* MPToolbarDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPToolbarDelegate.h; sourceTree = "<group>"; };
@@ -816,6 +819,8 @@
4C69A73916D589DF00EC1B1A /* HNHGradientView.m */, 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */,
4C01C243176500C40016D5D0 /* HNHLevelIndicatorCell.h */, 4C01C243176500C40016D5D0 /* HNHLevelIndicatorCell.h */,
4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */, 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */,
4C37A6711769393300AD0A40 /* HNHTableHeaderCell.h */,
4C37A6721769393300AD0A40 /* HNHTableHeaderCell.m */,
); );
path = HNHUi; path = HNHUi;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -1068,6 +1073,7 @@
4C569DA417653F3500595B62 /* KdbEntry+MPTreeTools.m in Sources */, 4C569DA417653F3500595B62 /* KdbEntry+MPTreeTools.m in Sources */,
4C79DF2A176685870083708F /* HNHRoundedTextField.m in Sources */, 4C79DF2A176685870083708F /* HNHRoundedTextField.m in Sources */,
4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */, 4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */,
4C37A6731769393300AD0A40 /* HNHTableHeaderCell.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@@ -446,6 +446,14 @@
</object> </object>
<int key="connectionID">710</int> <int key="connectionID">710</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">bottomBar</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="816254670"/>
</object>
<int key="connectionID">711</int>
</object>
</array> </array>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects"> <array key="orderedObjects">
@@ -1614,7 +1622,7 @@
<nil key="activeLocalization"/> <nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/> <dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">710</int> <int key="maxID">711</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions"> <array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1674,6 +1682,7 @@
</object> </object>
<dictionary class="NSMutableDictionary" key="outlets"> <dictionary class="NSMutableDictionary" key="outlets">
<string key="URLTextField">NSTextField</string> <string key="URLTextField">NSTextField</string>
<string key="bottomBar">HNHGradientView</string>
<string key="itemImageView">MPPopupImageView</string> <string key="itemImageView">MPPopupImageView</string>
<string key="itemNameTextfield">NSTextField</string> <string key="itemNameTextfield">NSTextField</string>
<string key="passwordTextField">NSTextField</string> <string key="passwordTextField">NSTextField</string>
@@ -1686,6 +1695,10 @@
<string key="name">URLTextField</string> <string key="name">URLTextField</string>
<string key="candidateClassName">NSTextField</string> <string key="candidateClassName">NSTextField</string>
</object> </object>
<object class="IBToOneOutletInfo" key="bottomBar">
<string key="name">bottomBar</string>
<string key="candidateClassName">HNHGradientView</string>
</object>
<object class="IBToOneOutletInfo" key="itemImageView"> <object class="IBToOneOutletInfo" key="itemImageView">
<string key="name">itemImageView</string> <string key="name">itemImageView</string>
<string key="candidateClassName">MPPopupImageView</string> <string key="candidateClassName">MPPopupImageView</string>

View File

@@ -58,7 +58,6 @@
<string key="NSFrame">{{7, 5}, {32, 19}}</string> <string key="NSFrame">{{7, 5}, {32, 19}}</string>
<reference key="NSSuperview" ref="163272962"/> <reference key="NSSuperview" ref="163272962"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="160641004"> <object class="NSButtonCell" key="NSCell" id="160641004">
@@ -108,7 +107,7 @@
<string key="NSFrameSize">{684, 548}</string> <string key="NSFrameSize">{684, 548}</string>
<reference key="NSSuperview" ref="262664416"/> <reference key="NSSuperview" ref="262664416"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="788738248"/> <reference key="NSNextKeyView" ref="736877784"/>
<string key="NSReuseIdentifierKey">_NS:13</string> <string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool> <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -393,7 +392,7 @@
<string key="NSFrame">{{0, 30}, {684, 565}}</string> <string key="NSFrame">{{0, 30}, {684, 565}}</string>
<reference key="NSSuperview" ref="997686550"/> <reference key="NSSuperview" ref="997686550"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="736877784"/> <reference key="NSNextKeyView" ref="262664416"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133680</int> <int key="NSsFlags">133680</int>
<reference key="NSVScroller" ref="1037276411"/> <reference key="NSVScroller" ref="1037276411"/>
@@ -455,6 +454,14 @@
</object> </object>
<int key="connectionID">686</int> <int key="connectionID">686</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">bottomBar</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="163272962"/>
</object>
<int key="connectionID">744</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">textField</string> <string key="label">textField</string>
@@ -1735,7 +1742,7 @@
<nil key="activeLocalization"/> <nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/> <dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">743</int> <int key="maxID">744</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions"> <array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1751,6 +1758,7 @@
<string key="className">MPEntryViewController</string> <string key="className">MPEntryViewController</string>
<string key="superclassName">MPViewController</string> <string key="superclassName">MPViewController</string>
<dictionary class="NSMutableDictionary" key="outlets"> <dictionary class="NSMutableDictionary" key="outlets">
<string key="bottomBar">HNHGradientView</string>
<string key="entryTable">NSTableView</string> <string key="entryTable">NSTableView</string>
<string key="filterBar">NSView</string> <string key="filterBar">NSView</string>
<string key="filterDoneButton">NSButton</string> <string key="filterDoneButton">NSButton</string>
@@ -1762,6 +1770,10 @@
<string key="tableToTop">NSLayoutConstraint</string> <string key="tableToTop">NSLayoutConstraint</string>
</dictionary> </dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="bottomBar">
<string key="name">bottomBar</string>
<string key="candidateClassName">HNHGradientView</string>
</object>
<object class="IBToOneOutletInfo" key="entryTable"> <object class="IBToOneOutletInfo" key="entryTable">
<string key="name">entryTable</string> <string key="name">entryTable</string>
<string key="candidateClassName">NSTableView</string> <string key="candidateClassName">NSTableView</string>

View File

@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
typedef enum { typedef NS_ENUM(NSUInteger, MPActionType) {
MPActionAddEntry, // Add an new entry MPActionAddEntry, // Add an new entry
MPActionAddGroup, // Add a new group MPActionAddGroup, // Add a new group
MPActionEdit, // Edit entry or group MPActionEdit, // Edit entry or group
@@ -19,8 +19,7 @@ typedef enum {
MPActionOpenURL, // open url in default browser MPActionOpenURL, // open url in default browser
MPActionToggleInspector, MPActionToggleInspector,
MPActionLock, // show the lock screen MPActionLock, // show the lock screen
} };
MPActionType;
@interface MPActionHelper : NSObject @interface MPActionHelper : NSObject

View File

@@ -9,9 +9,9 @@
#ifndef MacPass_MPDatabaseVersion_h #ifndef MacPass_MPDatabaseVersion_h
#define MacPass_MPDatabaseVersion_h #define MacPass_MPDatabaseVersion_h
typedef enum { typedef NS_ENUM(NSUInteger, MPDatabaseVersion) {
MPDatabaseVersion3, MPDatabaseVersion3,
MPDatabaseVersion4 MPDatabaseVersion4
} MPDatabaseVersion; };
#endif #endif

View File

@@ -21,23 +21,25 @@
#import "MPContextMenuHelper.h" #import "MPContextMenuHelper.h"
#import "MPConstants.h" #import "MPConstants.h"
#import "MPEntryTableDataSource.h" #import "MPEntryTableDataSource.h"
#import "HNHTableHeaderCell.h"
#import "HNHGradientView.h"
NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification"; NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification";
#define STATUS_BAR_ANIMATION_TIME 0.2 #define STATUS_BAR_ANIMATION_TIME 0.2
typedef enum { typedef NS_OPTIONS(NSUInteger, MPFilterModeType) {
MPFilterNone = 0, MPFilterNone = 0,
MPFilterUrls = 2, MPFilterUrls = (1<<0),
MPFilterUsernames = 4, MPFilterUsernames = (1<<1),
MPFilterTitles = 8, MPFilterTitles = (1<<2),
} MPFilterModeType; };
typedef enum { typedef NS_ENUM(NSUInteger,MPOVerlayInfoType) {
MPOverlayInfoPassword, MPOverlayInfoPassword,
MPOverlayInfoUsername, MPOverlayInfoUsername,
MPOverlayInfoURL, MPOverlayInfoURL,
} MPOVerlayInfoType; };
NSString *const MPEntryTableUserNameColumnIdentifier = @"MPUserNameColumnIdentifier"; NSString *const MPEntryTableUserNameColumnIdentifier = @"MPUserNameColumnIdentifier";
NSString *const MPEntryTableTitleColumnIdentifier = @"MPTitleColumnIdentifier"; NSString *const MPEntryTableTitleColumnIdentifier = @"MPTitleColumnIdentifier";
@@ -67,6 +69,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
@property (assign) IBOutlet NSButton *filterURLButton; @property (assign) IBOutlet NSButton *filterURLButton;
@property (assign) IBOutlet NSTextField *filterLabelTextField; @property (assign) IBOutlet NSTextField *filterLabelTextField;
@property (assign) IBOutlet NSSearchField *filterSearchField; @property (assign) IBOutlet NSSearchField *filterSearchField;
@property (assign) IBOutlet HNHGradientView *bottomBar;
@property (assign) KdbEntry *selectedEntry; @property (assign) KdbEntry *selectedEntry;
@@ -115,6 +118,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
- (void)didLoadView { - (void)didLoadView {
[self.view setWantsLayer:YES]; [self.view setWantsLayer:YES];
[self _hideFilterBarAnimated:NO]; [self _hideFilterBarAnimated:NO];
[_bottomBar setBorderType:HNHBorderTop];
MPDocumentWindowController *windowController = [self windowController]; MPDocumentWindowController *windowController = [self windowController];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
@@ -135,6 +139,11 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
NSTableColumn *passwordColumn = [self.entryTable tableColumns][3]; NSTableColumn *passwordColumn = [self.entryTable tableColumns][3];
NSTableColumn *urlColumn = [self.entryTable tableColumns][4]; NSTableColumn *urlColumn = [self.entryTable tableColumns][4];
for(NSTableColumn *column in [self.entryTable tableColumns]) {
[column setHeaderCell:[[HNHTableHeaderCell alloc] init]];
}
[parentColumn setIdentifier:MPEntryTableParentColumnIdentifier]; [parentColumn setIdentifier:MPEntryTableParentColumnIdentifier];
[titleColumn setIdentifier:MPEntryTableTitleColumnIdentifier]; [titleColumn setIdentifier:MPEntryTableTitleColumnIdentifier];
[userNameColumn setIdentifier:MPEntryTableUserNameColumnIdentifier]; [userNameColumn setIdentifier:MPEntryTableUserNameColumnIdentifier];
@@ -237,7 +246,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
#pragma mark Filtering #pragma mark Filtering
- (void)showFilter:(id)sender { - (void)showFilter:(id)sender {
//[self _showFilterBarAnimated:NO]; [self _showFilterBarAnimated:NO];
} }
- (BOOL)hasFilter { - (BOOL)hasFilter {

View File

@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
typedef enum { typedef NS_ENUM(NSUInteger, MPIconType) {
MPIconPassword, MPIconPassword,
MPIconPackageNetwork, MPIconPackageNetwork,
MPIconWarning, MPIconWarning,
@@ -20,7 +20,7 @@ typedef enum {
MPIconIdentity, MPIconIdentity,
MPIconContact, MPIconContact,
MPIconCamera MPIconCamera
} MPIconType; };
@interface MPIconHelper : NSObject @interface MPIconHelper : NSObject

View File

@@ -11,6 +11,7 @@
@class MPPopupImageView; @class MPPopupImageView;
@class KdbEntry; @class KdbEntry;
@class KdbGroup; @class KdbGroup;
@class HNHGradientView;
@interface MPInspectorViewController : MPViewController @interface MPInspectorViewController : MPViewController
@@ -22,6 +23,7 @@
@property (assign) IBOutlet NSTextField *URLTextField; @property (assign) IBOutlet NSTextField *URLTextField;
@property (assign) IBOutlet NSTextField *passwordTextField; @property (assign) IBOutlet NSTextField *passwordTextField;
@property (assign) IBOutlet NSTextField *titleOrNameLabel; @property (assign) IBOutlet NSTextField *titleOrNameLabel;
@property (assign) IBOutlet HNHGradientView *bottomBar;
- (void)closeActivePopup:(id)sender; - (void)closeActivePopup:(id)sender;

View File

@@ -17,6 +17,7 @@
#import "KdbLib.h" #import "KdbLib.h"
#import "KdbGroup+Undo.h" #import "KdbGroup+Undo.h"
#import "KdbEntry+Undo.h" #import "KdbEntry+Undo.h"
#import "HNHGradientView.h"
@interface MPInspectorViewController () { @interface MPInspectorViewController () {
BOOL _visible; BOOL _visible;
@@ -58,6 +59,7 @@
[[self.itemImageView cell] setBackgroundStyle:NSBackgroundStyleRaised]; [[self.itemImageView cell] setBackgroundStyle:NSBackgroundStyleRaised];
[self.itemImageView setTarget:self]; [self.itemImageView setTarget:self];
[_bottomBar setBorderType:HNHBorderTop];
/* Register for Entry selection */ /* Register for Entry selection */
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didChangeSelectedEntry:) selector:@selector(_didChangeSelectedEntry:)

View File

@@ -10,10 +10,12 @@
@class MPOutlineViewDelegate; @class MPOutlineViewDelegate;
@class KdbGroup; @class KdbGroup;
@class HNHGradientView;
@interface MPOutlineViewController : MPViewController @interface MPOutlineViewController : MPViewController
@property (retain, readonly) MPOutlineViewDelegate *outlineDelegate; @property (retain, readonly) MPOutlineViewDelegate *outlineDelegate;
@property (assign) IBOutlet HNHGradientView *bottomBar;
- (void)clearSelection; - (void)clearSelection;
- (void)showOutline; - (void)showOutline;

View File

@@ -15,6 +15,7 @@
#import "KdbGroup+Undo.h" #import "KdbGroup+Undo.h"
#import "MPContextMenuHelper.h" #import "MPContextMenuHelper.h"
#import "MPConstants.h" #import "MPConstants.h"
#import "HNHGradientView.h"
@interface MPOutlineViewController () { @interface MPOutlineViewController () {
@@ -64,6 +65,7 @@
[self.outlineView setFloatsGroupRows:NO]; [self.outlineView setFloatsGroupRows:NO];
[_outlineView registerForDraggedTypes:@[ MPPasteBoardType ]]; [_outlineView registerForDraggedTypes:@[ MPPasteBoardType ]];
[self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES]; [self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
[_bottomBar setBorderType:HNHBorderTop];
} }
- (void)showOutline { - (void)showOutline {

View File

@@ -13,10 +13,10 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyClearPasteboardOnQuit;
APPKIT_EXTERN NSString *const kMPSettingsKeyPasswordEncoding; APPKIT_EXTERN NSString *const kMPSettingsKeyPasswordEncoding;
APPKIT_EXTERN NSString *const kMPSettingsKeyOpenEmptyDatabaseOnLaunch; APPKIT_EXTERN NSString *const kMPSettingsKeyOpenEmptyDatabaseOnLaunch;
typedef enum { typedef NS_ENUM(NSUInteger, MPPasswordEncoding) {
MPPasswordEncodingUTF8, MPPasswordEncodingUTF8,
MPPasswordEncodingASCII, MPPasswordEncodingASCII,
} MPPasswordEncoding; };
@interface MPSettingsHelper : NSObject @interface MPSettingsHelper : NSObject

View File

@@ -8,11 +8,11 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
typedef enum { typedef NS_OPTIONS(NSUInteger, MPShadowDisplay) {
MPShadowTop = 1 << 0, MPShadowTop = (1<<0),
MPShadowBottom = 1 << 1, MPShadowBottom = (1<<1),
MPShadowTopAndBottom = MPShadowTop | MPShadowBottom MPShadowTopAndBottom = MPShadowTop | MPShadowBottom
} MPShadowDisplay; };
@interface MPShadowBox : NSView @interface MPShadowBox : NSView

View File

@@ -48,7 +48,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>CC5</string> <string>CDC</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>

View File

@@ -8,13 +8,13 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
typedef enum { typedef NS_ENUM(NSUInteger, MPPasswordStrength) {
MPPasswordWeak, MPPasswordWeak,
MPPasswordOK, MPPasswordOK,
MPPasswordGood, MPPasswordGood,
MPPasswordStrong, MPPasswordStrong,
MPPasswordExcelent, MPPasswordExcelent,
} MPPasswordStrength; };
@interface NSString (MPPasswordAnalysis) @interface NSString (MPPasswordAnalysis)

View File

@@ -8,13 +8,13 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
typedef enum { typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
MPPasswordCharactersUpperCase = (1<<0), // NSCharacterset lowerCaseCharacterSet MPPasswordCharactersUpperCase = (1<<0), // NSCharacterset lowerCaseCharacterSet
MPPasswordCharactersLowerCase = (1<<1), // NSCharacterSet upperCaseCharacterSet MPPasswordCharactersLowerCase = (1<<1), // NSCharacterSet upperCaseCharacterSet
MPPasswordCharactersNumbers = (1<<2), // NSCharacterSet numberCharacterSet MPPasswordCharactersNumbers = (1<<2), // NSCharacterSet numberCharacterSet
MPPasswordCharactersSymbols = (1<<3), // NSCharacterSet symbolCharacterSet MPPasswordCharactersSymbols = (1<<3), // NSCharacterSet symbolCharacterSet
MPPasswordCharactersAll = MPPasswordCharactersUpperCase | MPPasswordCharactersLowerCase | MPPasswordCharactersNumbers | MPPasswordCharactersSymbols MPPasswordCharactersAll = MPPasswordCharactersUpperCase | MPPasswordCharactersLowerCase | MPPasswordCharactersNumbers | MPPasswordCharactersSymbols
} MPPasswordCharacterFlags; };
/* /*
Generates a random integer in between (inkluding) minimum and maxium Generates a random integer in between (inkluding) minimum and maxium

View File

@@ -56,8 +56,6 @@
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{7, 5}, {32, 19}}</string> <string key="NSFrame">{{7, 5}, {32, 19}}</string>
<reference key="NSSuperview" ref="789399035"/> <reference key="NSSuperview" ref="789399035"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="573415016"> <object class="NSButtonCell" key="NSCell" id="573415016">
@@ -87,7 +85,6 @@
</array> </array>
<string key="NSFrameSize">{272, 30}</string> <string key="NSFrameSize">{272, 30}</string>
<reference key="NSSuperview" ref="595437442"/> <reference key="NSSuperview" ref="595437442"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="483226599"/> <reference key="NSNextKeyView" ref="483226599"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">HNHGradientView</string> <string key="NSClassName">HNHGradientView</string>
@@ -106,7 +103,6 @@
<array class="NSMutableArray" key="NSSubviews"/> <array class="NSMutableArray" key="NSSubviews"/>
<string key="NSFrameSize">{272, 419}</string> <string key="NSFrameSize">{272, 419}</string>
<reference key="NSSuperview" ref="100228705"/> <reference key="NSSuperview" ref="100228705"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="352201595"/> <reference key="NSNextKeyView" ref="352201595"/>
<string key="NSReuseIdentifierKey">_NS:13</string> <string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@@ -221,7 +217,6 @@
</array> </array>
<string key="NSFrameSize">{272, 419}</string> <string key="NSFrameSize">{272, 419}</string>
<reference key="NSSuperview" ref="628894392"/> <reference key="NSSuperview" ref="628894392"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="920491699"/> <reference key="NSNextKeyView" ref="920491699"/>
<string key="NSReuseIdentifierKey">_NS:11</string> <string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="920491699"/> <reference key="NSDocView" ref="920491699"/>
@@ -233,7 +228,6 @@
<int key="NSvFlags">-2147483392</int> <int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 17}, {15, 102}}</string> <string key="NSFrame">{{224, 17}, {15, 102}}</string>
<reference key="NSSuperview" ref="628894392"/> <reference key="NSSuperview" ref="628894392"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="578225175"/> <reference key="NSNextKeyView" ref="578225175"/>
<string key="NSReuseIdentifierKey">_NS:15</string> <string key="NSReuseIdentifierKey">_NS:15</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool> <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -246,7 +240,6 @@
<int key="NSvFlags">-2147483392</int> <int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 119}, {238, 15}}</string> <string key="NSFrame">{{1, 119}, {238, 15}}</string>
<reference key="NSSuperview" ref="628894392"/> <reference key="NSSuperview" ref="628894392"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="789399035"/> <reference key="NSNextKeyView" ref="789399035"/>
<string key="NSReuseIdentifierKey">_NS:60</string> <string key="NSReuseIdentifierKey">_NS:60</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool> <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -258,7 +251,6 @@
</array> </array>
<string key="NSFrame">{{0, 30}, {272, 419}}</string> <string key="NSFrame">{{0, 30}, {272, 419}}</string>
<reference key="NSSuperview" ref="595437442"/> <reference key="NSSuperview" ref="595437442"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="100228705"/> <reference key="NSNextKeyView" ref="100228705"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133680</int> <int key="NSsFlags">133680</int>
@@ -273,7 +265,6 @@
</array> </array>
<string key="NSFrameSize">{272, 449}</string> <string key="NSFrameSize">{272, 449}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="628894392"/> <reference key="NSNextKeyView" ref="628894392"/>
<string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string> <string key="NSClassName">NSView</string>
@@ -297,6 +288,14 @@
</object> </object>
<int key="connectionID">273</int> <int key="connectionID">273</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">bottomBar</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="789399035"/>
</object>
<int key="connectionID">433</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">textField</string> <string key="label">textField</string>
@@ -1119,71 +1118,9 @@
<nil key="activeLocalization"/> <nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/> <dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">432</int> <int key="maxID">433</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">HNHBadgedTextField</string>
<string key="superclassName">NSTextField</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/HNHBadgedTextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">HNHBadgedTextFieldCell</string>
<string key="superclassName">NSTextFieldCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/HNHBadgedTextFieldCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">HNHGradientView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/HNHGradientView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MPOutlineViewController</string>
<string key="superclassName">MPViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">outlineView</string>
<string key="NS.object.0">NSOutlineView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">outlineView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">outlineView</string>
<string key="candidateClassName">NSOutlineView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MPOutlineViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MPViewController</string>
<string key="superclassName">NSViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MPViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
</object>
</object>
</array>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int> <int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>