Files
MacPass/MacPass/KdbGroup+Undo.m
michael starke cb18013964 Fixed #23 Revert to saved now working
Fixed KVO issues with active items not being updated on tree reset
Fixed #6 Moved all move/delete/create functions into MPDocument
Intigrated OutlineViewDelegate into OutlineViewController
2013-06-26 01:19:44 +02:00

31 lines
761 B
Objective-C

//
// KdbGroup+Undo.m
// MacPass
//
// Created by Michael Starke on 18.05.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KdbGroup+Undo.h"
#import "KdbGroup+KVOAdditions.h"
NSString *const MPGroupNameUndoableKey = @"nameUndoable";
@implementation KdbGroup (Undo)
- (NSUndoManager *)undoManager {
return [[[NSDocumentController sharedDocumentController] currentDocument] undoManager];
}
- (NSString *)nameUndoable {
return [self name];
}
- (void)setNameUndoable:(NSString *)newName {
[[self undoManager] registerUndoWithTarget:self selector:@selector(setNameUndoable:) object:self.name];
[[self undoManager] setActionName:NSLocalizedString(@"UNDO_SET_NAME", "Undo set name")];
self.name = newName;
}
@end