diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib
index 2641ec93..f84423f0 100644
--- a/MacPass/Base.lproj/InspectorView.xib
+++ b/MacPass/Base.lproj/InspectorView.xib
@@ -68,7 +68,6 @@
{{20, 461}, {48, 48}}
-
_NS:9
YES
@@ -93,7 +92,6 @@
268
{{73, 477}, {203, 17}}
-
_NS:1535
{200, 750}
@@ -136,7 +134,6 @@
{293, 30}
-
_NS:9
HNHGradientView
@@ -145,7 +142,6 @@
268
{{64, 429}, {165, 25}}
-
_NS:9
YES
@@ -200,7 +196,7 @@
12
{{0, 31}, {293, 399}}
-
+
_NS:9
3
2
-
+
- 17
+ 36
-700448768
@@ -865,7 +865,7 @@
_NS:11
- 4
+ 2
Fields
@@ -1118,7 +1110,6 @@
{293, 529}
-
_NS:11
@@ -1303,7 +1294,7 @@
NeXT Encapsulated PostScript v1.2 pasteboard type
NeXT TIFF v4.0 pasteboard type
- {{3, 0}, {17, 17}}
+ {{3, 2}, {32, 32}}
_NS:11
@@ -1327,7 +1318,7 @@
- {{1, 1}, {248, 17}}
+ {{1, 1}, {248, 36}}
_NS:9
@@ -1378,8 +1369,8 @@
_NS:9
YES
-
- 1573
-
-
-
-
- 1574
-
-
-
-
- 1576
-
-
-
1577
-
- 1578
-
-
-
1567
@@ -3511,7 +3466,23 @@
1566
-
+
+
+ 8
+ 0
+
+ 0
+ 1
+
+ 32
+
+ 1000
+
+ 3
+ 9
+ 1
+
+
7
0
@@ -3519,7 +3490,7 @@
0
1
- 17
+ 32
1000
@@ -3531,11 +3502,6 @@
-
- 1572
-
-
-
1569
@@ -3902,8 +3868,8 @@
1000
- 6
- 24
+ 9
+ 40
3
@@ -3922,6 +3888,22 @@
40
3
+
+
+ 3
+ 0
+
+ 3
+ 1
+
+ 0.0
+
+ 1000
+
+ 9
+ 40
+ 3
+
6
@@ -3973,7 +3955,7 @@
0
1
- 100
+ 80
1000
@@ -3984,7 +3966,7 @@
8
- 0
+ 1
0
1
@@ -4183,6 +4165,36 @@
+
+ 2180
+
+
+
+
+ 2181
+
+
+
+
+ 2182
+
+
+
+
+ 2183
+
+
+
+
+ 2184
+
+
+
+
+ 2185
+
+
+
@@ -4287,6 +4299,7 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
+ HNHScrollView
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
@@ -4327,15 +4340,15 @@
com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
+
+
+
com.apple.InterfaceBuilder.CocoaPlugin
-
+
+
com.apple.InterfaceBuilder.CocoaPlugin
@@ -4343,13 +4356,8 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
@@ -4472,6 +4480,7 @@
+
@@ -4480,7 +4489,7 @@
com.apple.InterfaceBuilder.CocoaPlugin
-
+
@@ -4522,6 +4531,12 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
@@ -4568,222 +4583,9 @@
- 2175
-
-
-
-
- HNHGradientView
- NSView
-
- IBProjectSource
- ./Classes/HNHGradientView.h
-
-
-
- HNHLevelIndicatorCell
- NSLevelIndicatorCell
-
- IBProjectSource
- ./Classes/HNHLevelIndicatorCell.h
-
-
-
- HNHRoundedSecureTextFieldCell
- HNHRoundedTextFieldCell
-
- IBProjectSource
- ./Classes/HNHRoundedSecureTextFieldCell.h
-
-
-
- HNHRoundedTextField
- NSTextField
-
- IBProjectSource
- ./Classes/HNHRoundedTextField.h
-
-
-
- HNHRoundedTextFieldCell
- NSTextFieldCell
-
- IBProjectSource
- ./Classes/HNHRoundedTextFieldCell.h
-
-
-
- HNHScrollView
- NSScrollView
-
- IBProjectSource
- ./Classes/HNHScrollView.h
-
-
-
- MPCustomFieldTableCellView
- NSTableCellView
-
- NSTextField
- NSButton
- NSTextField
-
-
-
- labelTextField
- NSTextField
-
-
- removeButton
- NSButton
-
-
- valueTextField
- NSTextField
-
-
-
- IBProjectSource
- ./Classes/MPCustomFieldTableCellView.h
-
-
-
- MPInspectorViewController
- MPViewController
-
- id
- id
-
-
-
- addCustomField:
- id
-
-
- removeCustomField:
- id
-
-
-
- NSTextField
- NSTableView
- HNHGradientView
- NSTextField
- NSTableView
- NSTextField
- NSButton
- NSSegmentedControl
- MPPopupImageView
- NSTextField
- NSTextField
- NSTextView
- NSTextField
- NSTabView
- NSTextField
- NSTextField
- NSTextField
-
-
-
- URLTextField
- NSTextField
-
-
- attachmentTableView
- NSTableView
-
-
- bottomBar
- HNHGradientView
-
-
- createdTextField
- NSTextField
-
-
- customFieldsTableView
- NSTableView
-
-
- customFieldsTextField
- NSTextField
-
-
- generatePasswordButton
- NSButton
-
-
- infoTabControl
- NSSegmentedControl
-
-
- itemImageView
- MPPopupImageView
-
-
- itemNameTextfield
- NSTextField
-
-
- modifiedTextField
- NSTextField
-
-
- notesTextView
- NSTextView
-
-
- passwordTextField
- NSTextField
-
-
- tabView
- NSTabView
-
-
- titleOrNameLabel
- NSTextField
-
-
- titleTextField
- NSTextField
-
-
- usernameTextField
- NSTextField
-
-
-
- IBProjectSource
- ./Classes/MPInspectorViewController.h
-
-
-
- MPPopupImageView
- NSImageView
-
- IBProjectSource
- ./Classes/MPPopupImageView.h
-
-
-
- MPViewController
- NSViewController
-
- IBProjectSource
- ./Classes/MPViewController.h
-
-
-
- NSLayoutConstraint
- NSObject
-
- IBProjectSource
- ./Classes/NSLayoutConstraint.h
-
-
-
+ 2189
+
0
IBCocoaFramework
YES
diff --git a/MacPass/KdbGroup+MPTreeTools.m b/MacPass/KdbGroup+MPTreeTools.m
index 5f7e8a29..4853e5e1 100644
--- a/MacPass/KdbGroup+MPTreeTools.m
+++ b/MacPass/KdbGroup+MPTreeTools.m
@@ -14,6 +14,7 @@
- (NSArray *)childGroups {
NSMutableArray *childGroups = [NSMutableArray arrayWithCapacity:[self.groups count]];
+ [childGroups addObjectsFromArray:self.groups];
for(KdbGroup *childGroup in self.groups) {
[childGroups addObjectsFromArray:[childGroup childGroups]];
}
diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m
index 586e1bf0..5009ed60 100644
--- a/MacPass/MPDocument.m
+++ b/MacPass/MPDocument.m
@@ -8,14 +8,15 @@
#import "MPDocument.h"
#import "MPDocumentWindowController.h"
+
+#import "MPDatabaseVersion.h"
+#import "MPRootAdapter.h"
+#import "MPIconHelper.h"
+
#import "KdbLib.h"
#import "Kdb3Node.h"
#import "Kdb4Node.h"
#import "KdbPassword.h"
-
-#import "MPDatabaseVersion.h"
-#import "MPRootAdapter.h"
-
#import "KdbGroup+Undo.h"
#import "KdbGroup+KVOAdditions.h"
#import "Kdb4Entry+KVOAdditions.h"
@@ -265,8 +266,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
- (KdbGroup *)recyleBin {
+ static KdbGroup *_recycleBin;
if(self.useRecylceBin) {
- return [self findGroup:self.treeV4.recycleBinUuid];
+ if(!_recycleBin) {
+ _recycleBin = [self findGroup:self.treeV4.recycleBinUuid];
+ }
+ return _recycleBin;
}
return nil;
}
@@ -318,7 +323,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
[[[self undoManager] prepareWithInvocationTarget:self] moveGroup:group toGroup:group.parent index:oldIndex];
if(self.recyleBin == target) {
- [[self undoManager] setActionName:@"DELETE_GROUP"];
+ [[self undoManager] setActionName:@"UNDO_DELETE_GROUP"];
}
else {
[[self undoManager] setActionName:@"MOVE_GROUP"];
@@ -353,7 +358,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
return; // No changes
}
[[[self undoManager] prepareWithInvocationTarget:self] moveEntry:entry toGroup:entry.parent index:oldIndex];
- [[self undoManager] setActionName:@"MOVE_ENTRY"];
+ if(self.recyleBin == target || self.recyleBin == entry.parent) {
+ [[self undoManager] setActionName:@"UNDO_DELETE_ENTRY"];
+ }
+ else {
+ [[self undoManager] setActionName:@"MOVE_ENTRY"];
+ }
[entry.parent removeObjectFromEntriesAtIndex:oldIndex];
if(index < 0 || index > [target.groups count] ) {
index = [target.groups count];
@@ -378,6 +388,13 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
if(NSNotFound == index) {
return; // No object found;
}
+ if(self.useRecylceBin) {
+ if(!self.recyleBin) {
+ [self _createRecylceBin];
+ }
+ [self moveEntry:entry toGroup:self.recyleBin index:[self.recyleBin.entries count]];
+ return;
+ }
[[[self undoManager] prepareWithInvocationTarget:self] group:group addEntry:entry atIndex:index];
[[self undoManager] setActionName:NSLocalizedString(@"UNDO_DELETE_ENTRY", "Undo deleting of entry")];
[group removeObjectFromEntriesAtIndex:index];
@@ -396,7 +413,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
if(!self.recyleBin) {
[self _createRecylceBin];
}
- [self moveGroup:group toGroup:self.recyleBin index:[self.recyleBin.groups count]];
+ [self moveGroup:aGroup toGroup:self.recyleBin index:[self.recyleBin.groups count]];
return; // Done!
}
[[[self undoManager] prepareWithInvocationTarget:self] group:group addGroup:aGroup atIndex:index];
@@ -430,13 +447,18 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
- (void)_createRecylceBin {
+ /* Maybe push the stuff to the Tree? */
if(self.version == MPDatabaseVersion3) {
- // create backup?
}
else if(self.version == MPDatabaseVersion4) {
-
+ KdbGroup *recycleBin = [self.tree createGroup:self.tree.root];
+ recycleBin.name = NSLocalizedString(@"RECYLEBIN", @"Name for the recycle bin group");
+ recycleBin.image = MPIconTrash;
+ [self.tree.root insertObject:recycleBin inGroupsAtIndex:[self.tree.root.groups count]];
+ self.treeV4.recycleBinUuid = ((Kdb4Group *)recycleBin).uuid;
}
else {
+ NSAssert(NO, @"Database with unknown version: %ld", _version);
}
}
diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m
index 82e8e107..6bf3e4e1 100644
--- a/MacPass/MPInspectorViewController.m
+++ b/MacPass/MPInspectorViewController.m
@@ -95,7 +95,9 @@ enum {
[_infoTabControl bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
[_tabView bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
-
+
+ /* Set background to clearcolor so we can draw in the scrollview */
+ [_attachmentTableView setBackgroundColor:[NSColor clearColor]];
[_attachmentTableView bind:NSContentBinding toObject:self.attachmentsController withKeyPath:@"arrangedObjects" options:nil];
[_attachmentTableView setDelegate:self];
/* Set background to clearcolor so we can draw in the scrollview */
@@ -337,6 +339,7 @@ enum {
#pragma mark NSTableViewDelegate
+/* TODO: Divide this into single delegates */
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
if(tableView == self.attachmentTableView) {
return [self _viewForAttachmentTableColumn:tableColumn row:row];
@@ -350,14 +353,16 @@ enum {
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
BinaryRef *binaryRef = entry.binaries[row];
[[view textField] bind:NSValueBinding toObject:binaryRef withKeyPath:@"key" options:nil];
- MPDocument *document = [[self windowController] document];
- Binary *binary = [document binaryForRef:binaryRef];
- NSLog(@"%@", binary.data);
+ [[view imageView] setImage:[[NSWorkspace sharedWorkspace] iconForFileType:[binaryRef.key pathExtension]]];
+ //MPDocument *document = [[self windowController] document];
+ //Binary *binary = [document binaryForRef:binaryRef];
+ //NSLog(@"%@", binary.data);
}
return view;
}
- (NSView *)_viewForCustomFieldTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
MPCustomFieldTableCellView *view = [_customFieldsTableView makeViewWithIdentifier:[tableColumn identifier] owner:_customFieldsTableView];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_customFieldFrameChanged:) name:NSViewFrameDidChangeNotification object:view];
if([self.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
StringField *stringField = entry.stringFields[row];
@@ -370,5 +375,9 @@ enum {
return view;
}
+- (void)_customFieldFrameChanged:(NSNotification *)notification {
+ NSView *sender = [notification object];
+ NSLog(@"didChangeFrameFor: %@ to: %@", sender, NSStringFromRect([sender frame]));
+}
@end
diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist
index cff1a21f..e3715c82 100644
--- a/MacPass/MacPass-Info.plist
+++ b/MacPass/MacPass-Info.plist
@@ -48,7 +48,7 @@
CFBundleSignature
????
CFBundleVersion
- 1645
+ 1686
LSMinimumSystemVersion
${MACOSX_DEPLOYMENT_TARGET}
NSHumanReadableCopyright
diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings
index f08f5a9e..56a65ed3 100644
Binary files a/MacPass/de.lproj/Localizable.strings and b/MacPass/de.lproj/Localizable.strings differ
diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings
index 1c552d5a..ad586bb7 100644
Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ