mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
More work on undo/redo
Updated README
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
<string key="NS.object.0">3084</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBNSLayoutConstraint</string>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSCustomView</string>
|
||||
<string>NSSplitView</string>
|
||||
@@ -80,7 +81,6 @@
|
||||
<string key="NSFrame">{{527, 0}, {200, 449}}</string>
|
||||
<reference key="NSSuperview" ref="947682332"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
@@ -110,7 +110,7 @@
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="947682332"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string>
|
||||
<string key="NSMinSize">{400, 422}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -198,6 +198,70 @@
|
||||
<reference key="object" ref="1006"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="947682332"/>
|
||||
<object class="IBNSLayoutConstraint" id="631622849">
|
||||
<reference key="firstItem" ref="947682332"/>
|
||||
<int key="firstAttribute">5</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="1006"/>
|
||||
<int key="secondAttribute">5</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<reference key="containingView" ref="1006"/>
|
||||
<int key="scoringType">8</int>
|
||||
<float key="scoringTypeFloat">29</float>
|
||||
<int key="contentType">3</int>
|
||||
</object>
|
||||
<object class="IBNSLayoutConstraint" id="645864882">
|
||||
<reference key="firstItem" ref="947682332"/>
|
||||
<int key="firstAttribute">4</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="1006"/>
|
||||
<int key="secondAttribute">4</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<reference key="containingView" ref="1006"/>
|
||||
<int key="scoringType">8</int>
|
||||
<float key="scoringTypeFloat">29</float>
|
||||
<int key="contentType">3</int>
|
||||
</object>
|
||||
<object class="IBNSLayoutConstraint" id="855545557">
|
||||
<reference key="firstItem" ref="947682332"/>
|
||||
<int key="firstAttribute">3</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="1006"/>
|
||||
<int key="secondAttribute">3</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<reference key="containingView" ref="1006"/>
|
||||
<int key="scoringType">8</int>
|
||||
<float key="scoringTypeFloat">29</float>
|
||||
<int key="contentType">3</int>
|
||||
</object>
|
||||
<object class="IBNSLayoutConstraint" id="667679916">
|
||||
<reference key="firstItem" ref="947682332"/>
|
||||
<int key="firstAttribute">6</int>
|
||||
<int key="relation">0</int>
|
||||
<reference key="secondItem" ref="1006"/>
|
||||
<int key="secondAttribute">6</int>
|
||||
<float key="multiplier">1</float>
|
||||
<object class="IBLayoutConstant" key="constant">
|
||||
<double key="value">0.0</double>
|
||||
</object>
|
||||
<float key="priority">1000</float>
|
||||
<reference key="containingView" ref="1006"/>
|
||||
<int key="scoringType">8</int>
|
||||
<float key="scoringTypeFloat">29</float>
|
||||
<int key="contentType">3</int>
|
||||
</object>
|
||||
</array>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
@@ -227,6 +291,26 @@
|
||||
<reference key="object" ref="350501330"/>
|
||||
<reference key="parent" ref="947682332"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">677</int>
|
||||
<reference key="object" ref="667679916"/>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">678</int>
|
||||
<reference key="object" ref="855545557"/>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">679</int>
|
||||
<reference key="object" ref="645864882"/>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">680</int>
|
||||
<reference key="object" ref="631622849"/>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -238,17 +322,28 @@
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
|
||||
<boolean value="NO" key="1.NSWindowTemplate.visibleAtLaunch"/>
|
||||
<array key="2.IBNSViewMetadataConstraints">
|
||||
<reference ref="667679916"/>
|
||||
<reference ref="855545557"/>
|
||||
<reference ref="645864882"/>
|
||||
<reference ref="631622849"/>
|
||||
</array>
|
||||
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="603.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
|
||||
<string key="603.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="605.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="628.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="675.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="677.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="678.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="679.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="680.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">676</int>
|
||||
<int key="maxID">680</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -305,11 +400,20 @@
|
||||
<string key="minorKey">./Classes/MPDocumentWindowController.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>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<bool key="IBDocument.UseAutolayout">YES</bool>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
@interface KdbEntry (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager;
|
||||
|
||||
- (NSString *)titleUndoable;
|
||||
- (NSString *)usernameUndoable;
|
||||
- (NSString *)passwordUndoable;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
@implementation KdbEntry (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager {
|
||||
return [[[NSDocumentController sharedDocumentController] currentDocument] undoManager];
|
||||
}
|
||||
|
||||
- (NSString *)titleUndoable {
|
||||
return [self title];
|
||||
}
|
||||
@@ -33,37 +37,32 @@
|
||||
|
||||
|
||||
- (void)setTitleUndoable:(NSString *)title {
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.title];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_TITLE", "Undo set title")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.title];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_TITLE", "Undo set title")];
|
||||
[self setTitle:title];
|
||||
}
|
||||
|
||||
- (void)setUsernameUndoable:(NSString *)username {
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(setUsernameUndoable:) object:self.username];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_USERNAME", "Undo set username")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setUsernameUndoable:) object:self.username];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_USERNAME", "Undo set username")];
|
||||
[self setUsername:username];
|
||||
}
|
||||
|
||||
- (void)setPasswordUndoable:(NSString *)password {
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.password];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_PASSWORT", "Undo set password")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.password];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_PASSWORT", "Undo set password")];
|
||||
[self setPassword:password];
|
||||
}
|
||||
|
||||
- (void)setUrlUndoable:(NSString *)url {
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.url];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_URL", "Undo set URL")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.url];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_URL", "Undo set URL")];
|
||||
[self setUrl:url];
|
||||
}
|
||||
|
||||
- (void)setNotesUndoable:(NSString *)notes {
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.notes];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_NOTES", "Undo set notes")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.notes];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_NOTES", "Undo set notes")];
|
||||
[self setNotes:notes];
|
||||
}
|
||||
|
||||
@@ -73,9 +72,8 @@
|
||||
}
|
||||
NSUInteger iIndex = [index unsignedIntegerValue];
|
||||
NSNumber *oldIndex = @([self.parent.entries indexOfObject:self]);
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(moveToIndexUndoable:) object:oldIndex];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_SET_POSITION", "Undo set entry position")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(moveToIndexUndoable:) object:oldIndex];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_POSITION", "Undo set entry position")];
|
||||
|
||||
[self.parent moveEntry:self toIndex:iIndex];
|
||||
}
|
||||
@@ -87,9 +85,8 @@
|
||||
if(!self.parent || !newGroup) {
|
||||
return;
|
||||
}
|
||||
NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[[document undoManager] registerUndoWithTarget:self selector:@selector(moveToGroupUndoable:) object:self.parent];
|
||||
[[document undoManager] setActionName:NSLocalizedString(@"UNDO_MOVE_ENTRY", "Undo move entry to group")];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(moveToGroupUndoable:) object:self.parent];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_MOVE_ENTRY", "Undo move entry to group")];
|
||||
[self.parent moveEntry:self toGroup:newGroup];
|
||||
}
|
||||
@end
|
||||
@@ -10,4 +10,9 @@
|
||||
|
||||
@interface KdbGroup (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager;
|
||||
|
||||
- (void)removeEntryUndoable:(KdbEntry *)entry;
|
||||
- (void)addEntryUndoable:(KdbEntry *)entry;
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,4 +10,20 @@
|
||||
|
||||
@implementation KdbGroup (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager {
|
||||
return [[[NSDocumentController sharedDocumentController] currentDocument] undoManager];
|
||||
}
|
||||
|
||||
- (void)removeEntryUndoable:(KdbEntry *)entry {
|
||||
[[KdbGroup undoManager] registerUndoWithTarget:self selector:@selector(addEntryUndoable:) object:entry];
|
||||
[[KdbGroup undoManager] setActionName:NSLocalizedString(@"UNDO_DELETE_ENTRY", "Undo deleting of entry")];
|
||||
[self removeEntry:entry];
|
||||
}
|
||||
|
||||
- (void)addEntryUndoable:(KdbEntry *)entry {
|
||||
[[KdbGroup undoManager] registerUndoWithTarget:self selector:@selector(removeEntryUndoable:) object:entry];
|
||||
[[KdbGroup undoManager] setActionName:NSLocalizedString(@"UNDO_ADD_ENTRY", "Undo adding of entry")];
|
||||
[self addEntry:entry];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -83,17 +83,19 @@
|
||||
[self.toolbar setDelegate:self.toolbarDelegate];
|
||||
[self.window setToolbar:self.toolbar];
|
||||
|
||||
[self.splitView setTranslatesAutoresizingMaskIntoConstraints:NO];
|
||||
|
||||
/* Add outlineview */
|
||||
const NSRect outlineFrame = [self.outlineView frame];
|
||||
[self.outlineViewController.view setFrame:outlineFrame];
|
||||
[self.outlineViewController.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
//const NSRect outlineFrame = [self.outlineView frame];
|
||||
//[self.outlineViewController.view setFrame:outlineFrame];
|
||||
//[self.outlineViewController.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
[self.splitView replaceSubview:self.outlineView with:[self.outlineViewController view]];
|
||||
[self.outlineViewController updateResponderChain];
|
||||
|
||||
/* Add inspector view */
|
||||
const NSRect inspectorFrame = [self.inspectorView frame];
|
||||
[self.inspectorTabViewController.view setFrame:inspectorFrame];
|
||||
[self.inspectorTabViewController.view setAutoresizesSubviews:NSViewWidthSizable | NSViewHeightSizable ];
|
||||
//const NSRect inspectorFrame = [self.inspectorView frame];
|
||||
//[self.inspectorTabViewController.view setFrame:inspectorFrame];
|
||||
//[self.inspectorTabViewController.view setAutoresizesSubviews:NSViewWidthSizable | NSViewHeightSizable ];
|
||||
[self.splitView replaceSubview:self.inspectorView with:[self.inspectorTabViewController view]];
|
||||
[self.inspectorTabViewController updateResponderChain];
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef enum {
|
||||
- (void)openURL:(id)sender;
|
||||
|
||||
/* Entry Handling*/
|
||||
- (void)createEntry:(id)sender;
|
||||
- (void)deleteEntry:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#import "MPPasteBoardController.h"
|
||||
#import "MPOverlayWindowController.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
#import "KdbEntry+Undo.h"
|
||||
|
||||
NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification";
|
||||
|
||||
@@ -472,12 +473,12 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)deleteEntry:(id)sender {
|
||||
KdbEntry *selectedEntry = [self _clickedOrSelectedEntry];
|
||||
if(selectedEntry) {
|
||||
[self.entryArrayController removeObject:selectedEntry];
|
||||
[selectedEntry.parent removeEntry:selectedEntry];
|
||||
- (void)createEntry:(id)sender {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
- (void)deleteEntry:(id)sender {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
- (void)_toggleFilterSpace:(id)sender {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>6EE</string>
|
||||
<string>6F7</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
@@ -6,13 +6,20 @@ KeePass can be used via Mono on OS X but lacks vital functionality and feels slu
|
||||
|
||||
This is an attempt to create an OS X port that should at least be able to read KeePass files.
|
||||
|
||||
Status
|
||||
------
|
||||
|
||||
The Project is in heavy development and it's likely to take some time till it reaches a usable state.
|
||||
Beware that I'm going to shift things around so stuff is going to break. A lot.
|
||||
|
||||
|
||||
Alternatives
|
||||
------------
|
||||
|
||||
Currently there is an alpha Version available of [KeePassX](http://www.keepassx.org).
|
||||
It's Qt based KeePass manager, than can handle KeePass 1 and 2 containers rather nicely.
|
||||
Compared to running KeePass with Mono it very fast and remarkably stable for an alpha relaese.
|
||||
Feel free to give it a try.
|
||||
Feel free to give it a try. The biggest draw-back is it's inablity to create passwords via a wizzard.
|
||||
|
||||
What does it look like?
|
||||
-----------------------
|
||||
|
||||
Reference in New Issue
Block a user