mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
Renamed Categories better
Introduced Drag'n'Drop of Entries to outline view. Unfinished and fragile!
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
4C1DDCDD1711ECEB00C98DA3 /* PasswordCreatorWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */; };
|
||||
4C22040D1746ED160054C916 /* KdbGroup+Undo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C22040C1746ED160054C916 /* KdbGroup+Undo.m */; };
|
||||
4C25D58716CF0FAA00F6806C /* EntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C25D58616CF0FAA00F6806C /* EntryView.xib */; };
|
||||
4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPAdditions.m */; };
|
||||
4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPTreeTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPTreeTools.m */; };
|
||||
4C2E381D16D11FF900037A9D /* 03_ServerTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381A16D11FF900037A9D /* 03_ServerTemplate.pdf */; };
|
||||
4C2E381E16D11FF900037A9D /* 04_KlipperTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381B16D11FF900037A9D /* 04_KlipperTemplate.pdf */; };
|
||||
4C2E381F16D11FF900037A9D /* 05_LanguagesTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */; };
|
||||
@@ -32,6 +32,9 @@
|
||||
4C46B88B1706D16E0046109A /* NSData+MPRandomBytes.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88A1706D16E0046109A /* NSData+MPRandomBytes.m */; };
|
||||
4C4A100F176286FD00BBF2CA /* MPTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A100E176286FD00BBF2CA /* MPTableView.m */; };
|
||||
4C4A101217629DA900BBF2CA /* KdbGroup+KVOAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A101117629DA900BBF2CA /* KdbGroup+KVOAdditions.m */; };
|
||||
4C569D9E17652B0600595B62 /* MPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C569D9D17652B0600595B62 /* MPConstants.m */; };
|
||||
4C569DA117652BFE00595B62 /* MPEntryTableDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C569DA017652BFE00595B62 /* MPEntryTableDataSource.m */; };
|
||||
4C569DA417653F3500595B62 /* KdbEntry+MPTreeTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C569DA317653F3500595B62 /* KdbEntry+MPTreeTools.m */; };
|
||||
4C586F9E16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */; };
|
||||
4C586FA016D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */; };
|
||||
4C586FA216D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */; };
|
||||
@@ -141,8 +144,8 @@
|
||||
4C22040B1746ED160054C916 /* KdbGroup+Undo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+Undo.h"; sourceTree = "<group>"; };
|
||||
4C22040C1746ED160054C916 /* KdbGroup+Undo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbGroup+Undo.m"; sourceTree = "<group>"; };
|
||||
4C25D58616CF0FAA00F6806C /* EntryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EntryView.xib; sourceTree = "<group>"; };
|
||||
4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+MPAdditions.h"; sourceTree = "<group>"; };
|
||||
4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbGroup+MPAdditions.m"; sourceTree = "<group>"; };
|
||||
4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPTreeTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+MPTreeTools.h"; sourceTree = "<group>"; };
|
||||
4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPTreeTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbGroup+MPTreeTools.m"; sourceTree = "<group>"; };
|
||||
4C2E381A16D11FF900037A9D /* 03_ServerTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 03_ServerTemplate.pdf; sourceTree = "<group>"; };
|
||||
4C2E381B16D11FF900037A9D /* 04_KlipperTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 04_KlipperTemplate.pdf; sourceTree = "<group>"; };
|
||||
4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 05_LanguagesTemplate.pdf; sourceTree = "<group>"; };
|
||||
@@ -174,6 +177,12 @@
|
||||
4C4A100E176286FD00BBF2CA /* MPTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTableView.m; sourceTree = "<group>"; };
|
||||
4C4A101017629DA900BBF2CA /* KdbGroup+KVOAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+KVOAdditions.h"; sourceTree = "<group>"; };
|
||||
4C4A101117629DA900BBF2CA /* KdbGroup+KVOAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbGroup+KVOAdditions.m"; sourceTree = "<group>"; };
|
||||
4C569D9C17652AC800595B62 /* MPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPConstants.h; sourceTree = "<group>"; };
|
||||
4C569D9D17652B0600595B62 /* MPConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPConstants.m; sourceTree = "<group>"; };
|
||||
4C569D9F17652BFE00595B62 /* MPEntryTableDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntryTableDataSource.h; sourceTree = "<group>"; };
|
||||
4C569DA017652BFE00595B62 /* MPEntryTableDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEntryTableDataSource.m; sourceTree = "<group>"; };
|
||||
4C569DA217653F3500595B62 /* KdbEntry+MPTreeTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbEntry+MPTreeTools.h"; sourceTree = "<group>"; };
|
||||
4C569DA317653F3500595B62 /* KdbEntry+MPTreeTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbEntry+MPTreeTools.m"; sourceTree = "<group>"; };
|
||||
4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 00_PasswordTemplate.pdf; sourceTree = "<group>"; };
|
||||
4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 01_PackageNetworkTemplate.pdf; sourceTree = "<group>"; };
|
||||
4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 02_MessageBoxWarningTemplate.pdf; sourceTree = "<group>"; };
|
||||
@@ -411,12 +420,14 @@
|
||||
4C2C4C2516D3BCEA00D49295 /* KeePassLibAdditions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C01C23D1764D2980016D5D0 /* KdbEntry+Undo.h */,
|
||||
4C01C23E1764D2980016D5D0 /* KdbEntry+Undo.m */,
|
||||
4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPAdditions.h */,
|
||||
4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPAdditions.m */,
|
||||
4C569DA217653F3500595B62 /* KdbEntry+MPTreeTools.h */,
|
||||
4C569DA317653F3500595B62 /* KdbEntry+MPTreeTools.m */,
|
||||
4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPTreeTools.h */,
|
||||
4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPTreeTools.m */,
|
||||
4CC1AEBC16D4467C006D2AAB /* KdbTree+MPAdditions.h */,
|
||||
4CC1AEBD16D4467C006D2AAB /* KdbTree+MPAdditions.m */,
|
||||
4C01C23D1764D2980016D5D0 /* KdbEntry+Undo.h */,
|
||||
4C01C23E1764D2980016D5D0 /* KdbEntry+Undo.m */,
|
||||
4C22040B1746ED160054C916 /* KdbGroup+Undo.h */,
|
||||
4C22040C1746ED160054C916 /* KdbGroup+Undo.m */,
|
||||
4C4A101017629DA900BBF2CA /* KdbGroup+KVOAdditions.h */,
|
||||
@@ -438,6 +449,8 @@
|
||||
4C5BF67A175C01F300D53DF7 /* MPUppercaseStringValueTransformer.m */,
|
||||
4C01C2401764D8980016D5D0 /* MPContextMenuHelper.h */,
|
||||
4C01C2411764D8980016D5D0 /* MPContextMenuHelper.m */,
|
||||
4C569D9C17652AC800595B62 /* MPConstants.h */,
|
||||
4C569D9D17652B0600595B62 /* MPConstants.m */,
|
||||
);
|
||||
name = Helper;
|
||||
sourceTree = "<group>";
|
||||
@@ -462,6 +475,8 @@
|
||||
children = (
|
||||
4C37A83E15B8B474005EF8EE /* MPOutlineDataSource.h */,
|
||||
4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */,
|
||||
4C569D9F17652BFE00595B62 /* MPEntryTableDataSource.h */,
|
||||
4C569DA017652BFE00595B62 /* MPEntryTableDataSource.m */,
|
||||
6E719715172058BA00E4C5FC /* MPDatabaseVersion.h */,
|
||||
4CE5B548173AFBA700207B39 /* MPDocument.h */,
|
||||
4CE5B549173AFBA700207B39 /* MPDocument.m */,
|
||||
@@ -1001,7 +1016,7 @@
|
||||
4CDF01A316D1B76700D0AC08 /* MPEntryViewController.m in Sources */,
|
||||
4C3BD51516D276F800389F1F /* MPToolbarDelegate.m in Sources */,
|
||||
4C61EA0316D2FD0800AC519E /* MPOutlineViewController.m in Sources */,
|
||||
4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPAdditions.m in Sources */,
|
||||
4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPTreeTools.m in Sources */,
|
||||
4CC1AEBE16D4467C006D2AAB /* KdbTree+MPAdditions.m in Sources */,
|
||||
4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */,
|
||||
4C920E2A16DCDFA00083839B /* MPLoggerProxy.m in Sources */,
|
||||
@@ -1036,6 +1051,9 @@
|
||||
4C01C23F1764D2980016D5D0 /* KdbEntry+Undo.m in Sources */,
|
||||
4C01C2421764D8980016D5D0 /* MPContextMenuHelper.m in Sources */,
|
||||
4C01C245176500C40016D5D0 /* HNHLevelIndicatorCell.m in Sources */,
|
||||
4C569D9E17652B0600595B62 /* MPConstants.m in Sources */,
|
||||
4C569DA117652BFE00595B62 /* MPEntryTableDataSource.m in Sources */,
|
||||
4C569DA417653F3500595B62 /* KdbEntry+MPTreeTools.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1502,17 +1502,6 @@
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPEntryViewController</string>
|
||||
<string key="superclassName">MPViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">_toggleFilterSpace:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">_toggleFilterSpace:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">_toggleFilterSpace:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="entryTable">NSTableView</string>
|
||||
<string key="filterBar">NSView</string>
|
||||
@@ -1522,7 +1511,6 @@
|
||||
<string key="filterTitleButton">NSButton</string>
|
||||
<string key="filterURLButton">NSButton</string>
|
||||
<string key="filterUsernameButton">NSButton</string>
|
||||
<string key="tableToBottom">NSLayoutConstraint</string>
|
||||
<string key="tableToTop">NSLayoutConstraint</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
@@ -1558,10 +1546,6 @@
|
||||
<string key="name">filterUsernameButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="tableToBottom">
|
||||
<string key="name">tableToBottom</string>
|
||||
<string key="candidateClassName">NSLayoutConstraint</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="tableToTop">
|
||||
<string key="name">tableToTop</string>
|
||||
<string key="candidateClassName">NSLayoutConstraint</string>
|
||||
|
||||
15
MacPass/KdbEntry+MPTreeTools.h
Normal file
15
MacPass/KdbEntry+MPTreeTools.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// KdbEntry+MPTreeTools.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 10.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Kdb.h"
|
||||
|
||||
@interface KdbEntry (MPTreeTools)
|
||||
|
||||
- (NSUInteger)indexInParent;
|
||||
|
||||
@end
|
||||
20
MacPass/KdbEntry+MPTreeTools.m
Normal file
20
MacPass/KdbEntry+MPTreeTools.m
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// KdbEntry+MPTreeTools.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 10.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KdbEntry+MPTreeTools.h"
|
||||
|
||||
@implementation KdbEntry (MPTreeTools)
|
||||
|
||||
- (NSUInteger)indexInParent {
|
||||
if(self.parent) {
|
||||
return [self.parent.entries indexOfObject:self];
|
||||
}
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "KdbEntry+Undo.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
|
||||
NSString *const MPEntryTitleUndoableKey = @"titleUndoable";
|
||||
NSString *const MPEntryUsernameUndoableKey = @"usernameUndoable";
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// KdbGroup+MPAdditions.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by michael starke on 19.02.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KdbLib.h"
|
||||
|
||||
@interface KdbGroup (MPAdditions)
|
||||
|
||||
- (NSArray *)childGroups;
|
||||
|
||||
- (NSArray *)childEntries;
|
||||
|
||||
- (void)moveEntry:(KdbEntry *)entry toIndex:(NSUInteger)index;
|
||||
|
||||
@end
|
||||
21
MacPass/KdbGroup+MPTreeTools.h
Normal file
21
MacPass/KdbGroup+MPTreeTools.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// KdbGroup+MPTreeTools.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by michael starke on 19.02.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Kdb.h"
|
||||
@class UUID;
|
||||
|
||||
@interface KdbGroup (MPTreeTools)
|
||||
|
||||
/* Returns all groups under this group and it's subgroups */
|
||||
- (NSArray *)childGroups;
|
||||
/* Returns all entries under this group and it's subgroups */
|
||||
- (NSArray *)childEntries;
|
||||
|
||||
- (KdbEntry *)entryForUUID:(UUID *)uuid;
|
||||
|
||||
@end
|
||||
@@ -1,14 +1,16 @@
|
||||
//
|
||||
// KdbGroup+MPAdditions.m
|
||||
// KdbGroup+MPTreeTools.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by michael starke on 19.02.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
#import "Kdb4Node.h"
|
||||
#import "Kdb3Node.h"
|
||||
|
||||
@implementation KdbGroup (MPAdditions)
|
||||
@implementation KdbGroup (MPTreeTools)
|
||||
|
||||
- (NSArray *)childGroups {
|
||||
NSMutableArray *childGroups = [NSMutableArray arrayWithCapacity:[self.groups count]];
|
||||
@@ -27,15 +29,11 @@
|
||||
return childEntries;
|
||||
}
|
||||
|
||||
- (void)moveEntry:(KdbEntry *)entry toIndex:(NSUInteger)index {
|
||||
if([entries count] > index) {
|
||||
return;
|
||||
}
|
||||
NSUInteger oldIndex = [entries indexOfObject:entry];
|
||||
if(oldIndex == NSNotFound) {
|
||||
return;
|
||||
}
|
||||
[entries exchangeObjectAtIndex:oldIndex withObjectAtIndex:index];
|
||||
- (KdbEntry *)entryForUUID:(UUID *)uuid {
|
||||
NSArray *childEntries = [self childEntries];
|
||||
NSArray *filterdEntries = [childEntries filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
|
||||
return [uuid isEqual:(UUID *)[evaluatedObject uuid]];
|
||||
}]];
|
||||
return [filterdEntries lastObject];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "KdbTree+MPAdditions.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
|
||||
@implementation KdbTree (MPAdditions)
|
||||
|
||||
|
||||
16
MacPass/MPConstants.h
Normal file
16
MacPass/MPConstants.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MPConstants.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 09.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef MacPass_MPConstants_h
|
||||
#define MacPass_MPConstants_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
FOUNDATION_EXPORT NSString *const MPPasteBoardType;
|
||||
|
||||
#endif
|
||||
11
MacPass/MPConstants.m
Normal file
11
MacPass/MPConstants.m
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// MPConstants.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 09.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPConstants.h"
|
||||
|
||||
NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
|
||||
@@ -43,4 +43,6 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
- (void)moveGroup:(KdbGroup *)group toGroup:(KdbGroup *)target index:(NSInteger)index;
|
||||
- (BOOL)group:(KdbGroup *)group isMoveableToGroup:(KdbGroup *)target;
|
||||
|
||||
- (void)moveEntry:(KdbEntry *)entry toGroup:(KdbGroup *)target index:(NSInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@@ -184,4 +184,19 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
}
|
||||
return isMovable;
|
||||
}
|
||||
|
||||
- (void)moveEntry:(KdbEntry *)entry toGroup:(KdbGroup *)target index:(NSInteger)index {
|
||||
NSInteger oldIndex = [entry.parent.entries indexOfObject:entry];
|
||||
if(entry.parent == target && oldIndex == index) {
|
||||
return; // No changes
|
||||
}
|
||||
[[[self undoManager] prepareWithInvocationTarget:self] moveEntry:entry toGroup:entry.parent index:oldIndex];
|
||||
[[self undoManager] setActionName:@"MOVE_ENTRY"];
|
||||
[entry.parent removeObjectFromEntriesAtIndex:oldIndex];
|
||||
if(index < 0 || index > [target.groups count] ) {
|
||||
index = [target.groups count];
|
||||
}
|
||||
[target insertObject:entry inEntriesAtIndex:index];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
@class MPCreationViewController;
|
||||
|
||||
|
||||
@interface MPDocumentWindowController : NSWindowController
|
||||
@interface MPDocumentWindowController : NSWindowController <NSSplitViewDelegate> {
|
||||
@private
|
||||
NSArray *_inspectorContraints;
|
||||
}
|
||||
|
||||
@property (readonly, retain) MPPasswordInputController *passwordInputController;
|
||||
@property (readonly, retain) MPPasswordEditViewController *passwordEditController;
|
||||
@@ -34,4 +37,6 @@
|
||||
- (IBAction)editPassword:(id)sender;
|
||||
- (void)lock:(id)sender;
|
||||
|
||||
- (void)toggleInspector:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
@property (retain) MPToolbarDelegate *toolbarDelegate;
|
||||
|
||||
- (void)_setContentViewController:(MPViewController *)viewController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPDocumentWindowController
|
||||
@@ -69,7 +67,6 @@
|
||||
}
|
||||
|
||||
#pragma mark View Handling
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
[super windowDidLoad];
|
||||
@@ -90,7 +87,8 @@
|
||||
[_splitView setHoldingPriority:NSLayoutPriorityDefaultLow+2 forSubviewAtIndex:0];
|
||||
[_splitView setHoldingPriority:NSLayoutPriorityDefaultLow+1 forSubviewAtIndex:2];
|
||||
|
||||
//TODO: Fix setup on start
|
||||
[_splitView setDelegate:self];
|
||||
|
||||
MPDocument *document = [self document];
|
||||
if(!document.isDecrypted) {
|
||||
[self showPasswordInput];
|
||||
@@ -100,6 +98,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)_setContentViewController:(MPViewController *)viewController {
|
||||
|
||||
NSView *newContentView = nil;
|
||||
@@ -172,6 +174,10 @@
|
||||
[self showPasswordInput];
|
||||
}
|
||||
|
||||
- (void)toggleInspector:(id)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)showEntries {
|
||||
NSView *contentView = [[self window] contentView];
|
||||
if(_splitView == contentView) {
|
||||
|
||||
16
MacPass/MPEntryTableDataSource.h
Normal file
16
MacPass/MPEntryTableDataSource.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MPEntyTableDataSource.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 09.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class MPEntryViewController;
|
||||
@interface MPEntryTableDataSource : NSObject <NSTableViewDataSource>
|
||||
|
||||
@property (assign, nonatomic) MPEntryViewController *viewController;
|
||||
|
||||
@end
|
||||
42
MacPass/MPEntryTableDataSource.m
Normal file
42
MacPass/MPEntryTableDataSource.m
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// MPEntyTableDataSource.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 09.06.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPEntryTableDataSource.h"
|
||||
#import "MPEntryViewController.h"
|
||||
#import "UUID.h"
|
||||
#import "MPConstants.h"
|
||||
|
||||
@interface MPEntryTableDataSource ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPEntryTableDataSource
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
|
||||
|
||||
if([rowIndexes count] != 1) {
|
||||
return NO; // No valid drag
|
||||
}
|
||||
|
||||
id entry = [self.viewController.entryArrayController arrangedObjects][[rowIndexes firstIndex]];
|
||||
|
||||
if(![entry respondsToSelector:@selector(uuid)]) {
|
||||
return NO; // Invalid item for dragging
|
||||
}
|
||||
UUID *uuid = (UUID *)[entry uuid];
|
||||
NSPasteboardItem *pBoardItem = [[NSPasteboardItem alloc] init];
|
||||
[pBoardItem setString:[uuid description] forType:MPPasteBoardType];
|
||||
[pboard writeObjects:@[pBoardItem]];
|
||||
[pBoardItem release];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
//TODO: Validation and adding
|
||||
|
||||
@end
|
||||
@@ -15,10 +15,12 @@
|
||||
#import "MPDocumentWindowController.h"
|
||||
#import "MPPasteBoardController.h"
|
||||
#import "MPOverlayWindowController.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
#import "KdbEntry+Undo.h"
|
||||
#import "MPContextMenuHelper.h"
|
||||
#import "MPConstants.h"
|
||||
#import "MPEntryTableDataSource.h"
|
||||
|
||||
NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification";
|
||||
|
||||
@@ -68,6 +70,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
|
||||
@property (assign) KdbEntry *selectedEntry;
|
||||
|
||||
@property (nonatomic, retain) MPEntryTableDataSource *dataSource;
|
||||
|
||||
@property (assign, nonatomic) MPFilterModeType filterMode;
|
||||
@property (retain, nonatomic) NSDictionary *filterButtonToMode;
|
||||
@@ -90,6 +93,8 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
_toggleFilterURLButton : @(MPFilterUrls)
|
||||
} retain];
|
||||
_entryArrayController = [[NSArrayController alloc] init];
|
||||
_dataSource = [[MPEntryTableDataSource alloc] init];
|
||||
_dataSource.viewController = self;
|
||||
_selectedEntry = nil;
|
||||
}
|
||||
return self;
|
||||
@@ -103,6 +108,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
self.filterBar = nil;
|
||||
self.tableToTop = nil;
|
||||
self.filterButtonToMode = nil;
|
||||
self.dataSource = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -120,6 +126,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
[self.entryTable setDoubleAction:@selector(_columnDoubleClick:)];
|
||||
[self.entryTable setTarget:self];
|
||||
[self.entryTable setFloatsGroupRows:NO];
|
||||
[self.entryTable registerForDraggedTypes:@[MPPasteBoardType]];
|
||||
[self _setupEntryMenu];
|
||||
|
||||
NSTableColumn *parentColumn = [self.entryTable tableColumns][0];
|
||||
@@ -150,6 +157,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
|
||||
[self.entryTable bind:NSContentBinding toObject:self.entryArrayController withKeyPath:@"arrangedObjects" options:nil];
|
||||
[self.entryTable bind:NSSortDescriptorsBinding toObject:self.entryArrayController withKeyPath:@"sortDescriptors" options:nil];
|
||||
[self.entryTable setDataSource:_dataSource];
|
||||
|
||||
[parentColumn setHidden:YES];
|
||||
}
|
||||
@@ -197,7 +205,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
}
|
||||
|
||||
- (void)tableViewSelectionDidChange:(NSNotification *)notification {
|
||||
if([self.entryTable selectedRow] < 0) {
|
||||
if([self.entryTable selectedRow] < 0 || [[_entryTable selectedRowIndexes] count] > 1) {
|
||||
self.selectedEntry = nil;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
|
||||
NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab";
|
||||
|
||||
@interface MPGeneralSettingsController ()
|
||||
|
||||
- (void)didLoadView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPGeneralSettingsController
|
||||
|
||||
+ (NSString *)identifier {
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
APPKIT_EXTERN NSString *const MPPasteBoardType;
|
||||
|
||||
@class KdbGroup;
|
||||
|
||||
@interface MPOutlineDataSource : NSObject <NSOutlineViewDataSource> {
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
#import "MPDocument.h"
|
||||
#import "KdbLib.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
|
||||
NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
#import "KdbEntry+MPTreeTools.h"
|
||||
#import "MPConstants.h"
|
||||
#import "UUID.h"
|
||||
|
||||
@implementation MPOutlineDataSource
|
||||
|
||||
@@ -43,12 +45,20 @@ NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
|
||||
return NSDragOperationMove;
|
||||
}
|
||||
}
|
||||
NSPasteboard *pasteBoard = [info draggingPasteboard];
|
||||
NSArray *items = [pasteBoard pasteboardItems];
|
||||
if([items count] > 0) {
|
||||
if( index != NSOutlineViewDropOnItemIndex ) {
|
||||
[outlineView setDropItem:item dropChildIndex:NSOutlineViewDropOnItemIndex];
|
||||
}
|
||||
return NSDragOperationMove;
|
||||
}
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id<NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index {
|
||||
NSLog(@"Drag %@ to: %@ index: %ld", _draggedItem, [item representedObject], index);
|
||||
KdbGroup *target = [item representedObject];
|
||||
if(_draggedItem) {
|
||||
BOOL accepted = YES;
|
||||
if( _draggedItem.parent == target ) {
|
||||
accepted &= index != NSOutlineViewDropOnItemIndex;
|
||||
@@ -61,5 +71,22 @@ NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
|
||||
}
|
||||
info.animatesToDestination = !accepted;
|
||||
return accepted;
|
||||
}
|
||||
NSPasteboard *pasteBoard = [info draggingPasteboard];
|
||||
NSArray *items = [pasteBoard pasteboardItems];
|
||||
if([items count] > 0) {
|
||||
NSPasteboardItem *item = items[0];
|
||||
UUID *uuid = [[UUID alloc] initWithString:[item stringForType:MPPasteBoardType]];
|
||||
MPDocument *document = [[[outlineView window] windowController] document];
|
||||
KdbGroup *rootGroup = [document root];
|
||||
KdbEntry *draggedEntry = [rootGroup entryForUUID:uuid];
|
||||
if(draggedEntry) {
|
||||
if(draggedEntry.parent != target && index == NSOutlineViewDropOnItemIndex) {
|
||||
[document moveEntry:draggedEntry toGroup:target index:index];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#import "KdbLib.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
#import "MPContextMenuHelper.h"
|
||||
#import "MPConstants.h"
|
||||
|
||||
|
||||
@interface MPOutlineViewController () {
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
@property (assign) IBOutlet NSTextField *errorInfoTextField;
|
||||
|
||||
- (IBAction)_decrypt:(id)sender;
|
||||
- (void)_showError;
|
||||
- (void)_reset;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
|
||||
@property (assign) BOOL isEmpty;
|
||||
|
||||
- (void)_clearPasteboardContents;
|
||||
- (void)_setupBindings;
|
||||
- (void)_updateNotifications;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPPasteBoardController
|
||||
|
||||
@@ -12,12 +12,6 @@ NSString *const kMPSettingsKeyPasteboardClearTimeout = @"ClipboardClearTimeout";
|
||||
NSString *const kMPSettingsKeyClearPasteboardOnQuit = @"ClearClipboardOnQuit";
|
||||
NSString *const kMPSettingsKeyOpenEmptyDatabaseOnLaunch = @"OpenEmptyDatabaseOnLaunch";
|
||||
|
||||
@interface MPSettingsHelper ()
|
||||
|
||||
+ (NSDictionary *)_standardDefaults;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPSettingsHelper
|
||||
|
||||
+ (void)setupDefaults {
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
@property (retain, nonatomic) NSMutableDictionary *settingsController;
|
||||
@property (retain, nonatomic) NSMutableDictionary *toolbarItems;
|
||||
|
||||
- (void)_addSettingsTab:(id<MPSettingsTab>)tabController;
|
||||
- (void)_setupDefaultSettingsTabs;
|
||||
- (void)_showSettingsTab:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPSettingsWindowController
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>B23</string>
|
||||
<string>B85</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
Reference in New Issue
Block a user