Fixed spelling errors in comments and some strings, as well as fixed a compilation error (KPKEntry has no entry key, but does have a name field

This commit is contained in:
Maarten Terpstra
2015-10-11 11:25:36 +02:00
parent 9e2012dac9
commit c3cb8ad6a3
56 changed files with 124 additions and 124 deletions

View File

@@ -12,8 +12,8 @@ typedef NS_ENUM(NSUInteger, MPActionType) {
MPUnkownAction, // Neutral element to be used for returns MPUnkownAction, // Neutral element to be used for returns
MPActionAddEntry, // Add an new entry MPActionAddEntry, // Add an new entry
MPActionAddGroup, // Add a new group MPActionAddGroup, // Add a new group
MPActionDuplicateEntry, // Simply duplicate an entry (inlcuding history) MPActionDuplicateEntry, // Simply duplicate an entry (including history)
MPActionDuplicateEntryWithOptions, // Request user inptu on what to duplicate MPActionDuplicateEntryWithOptions, // Request user input on what to duplicate
MPActionDelete, // Delete entry or group MPActionDelete, // Delete entry or group
MPActionCopyUsername, // copy username to pasteboard MPActionCopyUsername, // copy username to pasteboard
MPActionCopyPassword, // copy password to pasteboard MPActionCopyPassword, // copy password to pasteboard
@@ -25,11 +25,11 @@ typedef NS_ENUM(NSUInteger, MPActionType) {
MPActionEditPassword, // change the database password MPActionEditPassword, // change the database password
MPActionDatabaseSettings, // Show the settings for the database MPActionDatabaseSettings, // Show the settings for the database
MPActionEditTemplateGroup, // Edit the Template group MPActionEditTemplateGroup, // Edit the Template group
MPActionExportXML, // Exporte as XML MPActionExportXML, // Export as XML
MPActionImportXML, // Import form XML MPActionImportXML, // Import form XML
MPActionToggleQuicklook, MPActionToggleQuicklook,
MPActionShowHistory, // History anzeigen MPActionShowHistory, // show history
MPActionExitHistory, // History ausblenden MPActionExitHistory, // exit history
MPActionPerformAutotypeForSelectedEntry // Perform Autotype for selected Entry MPActionPerformAutotypeForSelectedEntry // Perform Autotype for selected Entry
}; };
/** /**

View File

@@ -65,7 +65,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
- (instancetype)init { - (instancetype)init {
self = [super init]; self = [super init];
if(self) { if(self) {
/* We know that we do not use the varibale after instancation */ /* We know that we do not use the variable after instantiation */
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-variable"
MPDocumentController *documentController = [[MPDocumentController alloc] init]; MPDocumentController *documentController = [[MPDocumentController alloc] init];
@@ -97,7 +97,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
/* Update the at the save menu */ /* Update the at the save menu */
[[self.saveMenuItem menu] setDelegate:self]; [[self.saveMenuItem menu] setDelegate:self];
/* We want to inform anyone about the changes to keyFile remmebering */ /* We want to inform anyone about the changes to keyFile remembering */
[self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile)) [self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile))
toObject:[NSUserDefaultsController sharedUserDefaultsController] toObject:[NSUserDefaultsController sharedUserDefaultsController]
withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyRememberKeyFilesForDatabases] withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyRememberKeyFilesForDatabases]

View File

@@ -11,9 +11,9 @@
@class MPAutotypeContext; @class MPAutotypeContext;
/** /**
* The Autotype command reperesent a capsualted Action that was determined by interpreting * The Autotype command represents a capsuled Action that was determined by interpreting
* Autotype field for a given entry. This is a class cluster and schould be considered the sole * Autotype field for a given entry. This is a class cluster and should be considered the sole
* enty point for creating AutotypeCommands. You should never need to build a command on your own. * entry point for creating AutotypeCommands. You should never need to build a command on your own.
*/ */
@interface MPAutotypeCommand : NSObject @interface MPAutotypeCommand : NSObject
@@ -21,10 +21,10 @@
/** /**
* Creates a command sequence for the given context. The context's keystroke sequence is * Creates a command sequence for the given context. The context's keystroke sequence is
* is evaluated (Placholders filled, references resolved) and the commands are created in the * is evaluated (Placeholders filled, references resolved) and the commands are created in the
* order of their execution * order of their execution
* *
* @param context the context to create the comamnds from. * @param context the context to create the commands from.
* *
* @return NSArray of MPAutotypeCommand * @return NSArray of MPAutotypeCommand
*/ */
@@ -46,7 +46,7 @@
- (void)sendPasteKeyCode; - (void)sendPasteKeyCode;
/** /**
* Exectues the Autotype Command. * Executes the Autotype Command.
*/ */
- (void)execute; - (void)execute;

View File

@@ -136,16 +136,16 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
[self appendAppropriatePasteCommandForEntry:context.entry withContent:pasteValue toCommands:commands]; [self appendAppropriatePasteCommandForEntry:context.entry withContent:pasteValue toCommands:commands];
} }
} }
/* Test for modifer Key */ /* Test for modifier Key */
NSString *commandString = [context.evaluatedCommand substringWithRange:commandRange]; NSString *commandString = [context.evaluatedCommand substringWithRange:commandRange];
/* append commands for non-modifer keys */ /* append commands for non-modifier keys */
if(![self updateModifierMask:&collectedModifers forCommand:commandString]) { if(![self updateModifierMask:&collectedModifers forCommand:commandString]) {
[self appendCommandForEntry:context.entry withString:commandString toCommands:commands activeModifer:collectedModifers]; [self appendCommandForEntry:context.entry withString:commandString toCommands:commands activeModifer:collectedModifers];
collectedModifers = 0; // Reset the modifers; collectedModifers = 0; // Reset the modifiers;
} }
lastLocation = commandRange.location + commandRange.length; lastLocation = commandRange.location + commandRange.length;
} }
/* Collect any part that isn't a command or if onyl paste is used */ /* Collect any part that isn't a command or if only paste is used */
if(lastLocation < [context.evaluatedCommand length]) { if(lastLocation < [context.evaluatedCommand length]) {
/* We might have some dangling modifiers */ /* We might have some dangling modifiers */
NSRange lastRange = NSMakeRange(lastLocation, [context.evaluatedCommand length] - lastLocation); NSRange lastRange = NSMakeRange(lastLocation, [context.evaluatedCommand length] - lastLocation);
@@ -174,7 +174,7 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
} }
+ (void)appendPasteCommandForContent:(NSString *)pasteContent toCommands:(NSMutableArray *)commands { + (void)appendPasteCommandForContent:(NSString *)pasteContent toCommands:(NSMutableArray *)commands {
/* Update an already inserted paste command with the new conents */ /* Update an already inserted paste command with the new contents */
if([[commands lastObject] isKindOfClass:[MPAutotypePaste class]]) { if([[commands lastObject] isKindOfClass:[MPAutotypePaste class]]) {
[[commands lastObject] appendString:pasteContent]; [[commands lastObject] appendString:pasteContent];
} }
@@ -303,7 +303,7 @@ static CGKeyCode kMPFunctionKeyCodes[] = { kVK_F1, kVK_F2, kVK_F3, kVK_F4, kVK_F
if([numberScanner scanInteger:&value]) { if([numberScanner scanInteger:&value]) {
if([kKPKAutotypeDelay isEqualToString:uppercaseCommand]) { if([kKPKAutotypeDelay isEqualToString:uppercaseCommand]) {
if(MAX(0, value) <= 0) { if(MAX(0, value) <= 0) {
return; // Value too low, just skipp return; // Value too low, just skip
} }
[commands addObject:[[MPAutotypeDelay alloc] initWithDelay:value]]; [commands addObject:[[MPAutotypeDelay alloc] initWithDelay:value]];
return; // Done return; // Done

View File

@@ -12,7 +12,7 @@
@class KPKEntry; @class KPKEntry;
/** /**
* The autotype daemon is repsonsible for registering the globa hotkey and to perform any autotype actions * The autotype daemon is responsible for registering the global hotkey and to perform any autotype actions
*/ */
@interface MPAutotypeDaemon : NSObject @interface MPAutotypeDaemon : NSObject

View File

@@ -142,7 +142,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
} }
MPAutotypeContext *context = [self _autotypeContextInDocument:document forWindowTitle:self.targetWindowTitle preferredEntry:entryOrNil]; MPAutotypeContext *context = [self _autotypeContextInDocument:document forWindowTitle:self.targetWindowTitle preferredEntry:entryOrNil];
/* TODO: that's popping up if the mulit seleciton dialog goes up! */ /* TODO: that's popping up if the multi selection dialog goes up! */
if(!entryOrNil) { if(!entryOrNil) {
NSImage *appIcon = [[NSApplication sharedApplication] applicationIconImage]; NSImage *appIcon = [[NSApplication sharedApplication] applicationIconImage];
NSString *label = context ? NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH", "") : NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH", ""); NSString *label = context ? NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH", "") : NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH", "");
@@ -192,7 +192,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
} }
if([self _orderApplicationToFront:self.targetPID]) { if([self _orderApplicationToFront:self.targetPID]) {
/* Sleep a bit after the app was activated */ /* Sleep a bit after the app was activated */
/* TODO - we can use a saver way and use a notification to chekc if the app actally was activated */ /* TODO - we can use a saver way and use a notification to check if the app actually was activated */
usleep(1 * NSEC_PER_MSEC); usleep(1 * NSEC_PER_MSEC);
} }
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

View File

@@ -9,7 +9,7 @@
#import "MPAutotypeCommand.h" #import "MPAutotypeCommand.h"
/** /**
* Autotype command to press a single key. Can be used with modifer keys as well * Autotype command to press a single key. Can be used with modifier keys as well
*/ */
@interface MPAutotypeKeyPress : MPAutotypeCommand @interface MPAutotypeKeyPress : MPAutotypeCommand

View File

@@ -47,7 +47,7 @@
} }
- (BOOL)isValid { - (BOOL)isValid {
/* Pasting shoudl always be valid */ /* Pasting should always be valid */
return YES; return YES;
} }

View File

@@ -10,7 +10,7 @@
/** /**
* Default Connection to handle the KeepassHttp POST requests. The Connection doesn't do anything, * Default Connection to handle the KeepassHttp POST requests. The Connection doesn't do anything,
* besides using the MPRequestHandlerService to handle any request from KeePassHttp and send's back the replies * besides using the MPRequestHandlerService to handle any request from KeePassHttp and sends back the replies
*/ */
@interface MPConnection : HTTPConnection @interface MPConnection : HTTPConnection

View File

@@ -63,7 +63,7 @@
} }
/* /*
Block the segment setter to prevent accidential settings Block the segment setter to prevent accidental settings
*/ */
- (void)setImage:(NSImage *)image forSegment:(NSInteger)segment { - (void)setImage:(NSImage *)image forSegment:(NSInteger)segment {
if(segment < 2) { if(segment < 2) {

View File

@@ -123,7 +123,7 @@
*/ */
metaData.rounds = MAX(0,[self.encryptionRoundsTextField integerValue]); metaData.rounds = MAX(0,[self.encryptionRoundsTextField integerValue]);
/* Register an action to enable promts when user cloeses without saving */ /* Register an action to enable prompts when user closes without saving */
[self.document updateChangeCount:NSChangeDone]; [self.document updateChangeCount:NSChangeDone];
[self close:nil]; [self close:nil];
} }

View File

@@ -57,7 +57,7 @@
for(KPKEntry *entry in autotypeEntries) { for(KPKEntry *entry in autotypeEntries) {
/* TODO: /* TODO:
KeePass for Windows hase the following options for matching: KeePass for Windows has the following options for matching:
Title is contained Title is contained
URL is contained URL is contained
Host component is contained Host component is contained

View File

@@ -16,7 +16,7 @@ FOUNDATION_EXTERN NSString *const MPDocumentDidExitSearchNotification;
/** /**
* Posted by the document, when the search results have been updated. This is only called when searching. * Posted by the document, when the search results have been updated. This is only called when searching.
* If the search is exited, it will be notified by MPDocumentDidExitSearchNotification * If the search is exited, it will be notified by MPDocumentDidExitSearchNotification
* The userInfo dictionary has one key kMPDocumentSearchResultsKey with an NSArray of KPKEntries mathching the search. * The userInfo dictionary has one key kMPDocumentSearchResultsKey with an NSArray of KPKEntries matching the search.
*/ */
FOUNDATION_EXTERN NSString *const MPDocumentDidChangeSearchResults; FOUNDATION_EXTERN NSString *const MPDocumentDidChangeSearchResults;

View File

@@ -101,9 +101,9 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
#pragma mark Lock/Decrypt #pragma mark Lock/Decrypt
- (IBAction)lockDatabase:(id)sender; - (IBAction)lockDatabase:(id)sender;
/** /**
* Decrypts the databse with the given password and keyfile * Decrypts the database with the given password and keyfile
* *
* @param password The password to unlock the db with, can be nil. This is not the same as an empty stirng @"" * @param password The password to unlock the db with, can be nil. This is not the same as an empty string @""
* @param keyFileURL URL for the keyfile to use, can be nil * @param keyFileURL URL for the keyfile to use, can be nil
* @param error Pointer to an NSError pointer of error reporting. * @param error Pointer to an NSError pointer of error reporting.
* *
@@ -111,7 +111,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
*/ */
- (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error; - (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error;
/** /**
* Changes the password of the database. Some sanity checks are applied and the change is aborted if the new values arent valid * Changes the password of the database. Some sanity checks are applied and the change is aborted if the new values aren't valid
* *
* @param password new password, can be nil * @param password new password, can be nil
* @param keyFileURL new key URL can be nil * @param keyFileURL new key URL can be nil
@@ -132,7 +132,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
/** /**
* Finds an entry with the given UUID. If none is found, nil is returned * Finds an entry with the given UUID. If none is found, nil is returned
* @param uuid The UUID for the searched Entry * @param uuid The UUID for the searched Entry
* @return enty, matching the UUID, nil if none was found * @return entry, matching the UUID, nil if none was found
*/ */
- (KPKEntry *)findEntry:(NSUUID *)uuid; - (KPKEntry *)findEntry:(NSUUID *)uuid;
/** /**
@@ -170,7 +170,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
#pragma mark Actions #pragma mark Actions
/** /**
* Empties the Trash group. Removing all Groups and Entries inside. This aciton is not undoable * Empties the Trash group. Removing all Groups and Entries inside. This action is not undo-able
* @param sender sender * @param sender sender
*/ */
- (IBAction)emptyTrash:(id)sender; - (IBAction)emptyTrash:(id)sender;

View File

@@ -235,8 +235,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
- (void)close { - (void)close {
[self _cleanupLock]; [self _cleanupLock];
/* /*
We store the last url. Restored windows are automatically handeld. We store the last url. Restored windows are automatically handled.
If closeAllDocuments is set, all docs get this messgae If closeAllDocuments is set, all docs get this message
*/ */
if([[self fileURL] isFileURL]) { if([[self fileURL] isFileURL]) {
[[NSUserDefaults standardUserDefaults] setObject:[self.fileURL absoluteString] forKey:kMPSettingsKeyLastDatabasePath]; [[NSUserDefaults standardUserDefaults] setObject:[self.fileURL absoluteString] forKey:kMPSettingsKeyLastDatabasePath];
@@ -331,8 +331,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
/* Key change is not undoable so just recored the change as done */ /* Key change is not undoable so just recored the change as done */
[self updateChangeCount:NSChangeDone]; [self updateChangeCount:NSChangeDone];
/* /*
If the user opted to remeber key files for documents, we should update this information. If the user opted to remember key files for documents, we should update this information.
But it's impossible to know, if he actaully saves the changes! But it's impossible to know, if he actually saves the changes!
*/ */
return YES; return YES;
} }
@@ -646,7 +646,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
- (void)createEntryFromTemplate:(id)sender { - (void)createEntryFromTemplate:(id)sender {
if(![sender respondsToSelector:@selector(representedObject)]) { if(![sender respondsToSelector:@selector(representedObject)]) {
return; // sender cannot provide usefull data return; // sender cannot provide useful data
} }
id obj = [sender representedObject]; id obj = [sender representedObject];
if(![obj isKindOfClass:[NSUUID class]]) { if(![obj isKindOfClass:[NSUUID class]]) {

View File

@@ -12,7 +12,7 @@
@class MPDocument; @class MPDocument;
/** /**
* Service for querying for resultis withing a request * Service for querying for result is withing a request
* This shared instance handles creating of config entries, * This shared instance handles creating of config entries,
* and abstracts all open documents for the KeePassHttp interface. * and abstracts all open documents for the KeePassHttp interface.
*/ */

View File

@@ -46,7 +46,7 @@ static NSUUID *_rootUuid = nil;
} }
- (KPKEntry *)configurationEntry { - (KPKEntry *)configurationEntry {
/* TODO: lazy getter or do something differen like init at first call? */ /* TODO: lazy getter or do something different like init at first call? */
if(nil != _configurationEntry) { if(nil != _configurationEntry) {
return _configurationEntry; return _configurationEntry;
} }

View File

@@ -200,7 +200,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
NSAlert *alert = [[NSAlert alloc] init]; NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSWarningAlertStyle]; [alert setAlertStyle:NSWarningAlertStyle];
[alert setMessageText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE", "")]; [alert setMessageText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE", "")];
[alert setInformativeText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE_DESCRIPTION", "Informative Text displayed when saving woudl yield data loss")]; [alert setInformativeText:NSLocalizedString(@"WARNING_ON_LOSSY_SAVE_DESCRIPTION", "Informative Text displayed when saving would yield data loss")];
[alert addButtonWithTitle:NSLocalizedString(@"SAVE_LOSSY", "Save lossy")]; [alert addButtonWithTitle:NSLocalizedString(@"SAVE_LOSSY", "Save lossy")];
[alert addButtonWithTitle:NSLocalizedString(@"CHANGE_FORMAT", "")]; [alert addButtonWithTitle:NSLocalizedString(@"CHANGE_FORMAT", "")];
[alert addButtonWithTitle:NSLocalizedString(@"CANCEL", "Cancel")]; [alert addButtonWithTitle:NSLocalizedString(@"CANCEL", "Cancel")];
@@ -417,8 +417,8 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
NSView *entryView = [self.entryViewController view]; NSView *entryView = [self.entryViewController view];
/* /*
The current easy way to prevent layout hickups is to add the inspect The current easy way to prevent layout hiccups is to add the inspect
Add all neded contraints an then remove it again, if it was hidden Add all needed constraints an then remove it again, if it was hidden
*/ */
BOOL removeInspector = NO; BOOL removeInspector = NO;
if(![inspectorView superview]) { if(![inspectorView superview]) {

View File

@@ -45,7 +45,7 @@ static NSUInteger const kMPAttachmentsMenuItem = 2000;
if([lastItem isSeparatorItem]) { if([lastItem isSeparatorItem]) {
[menu removeItem:lastItem]; [menu removeItem:lastItem];
} }
/* since we can get opend on the non-selected entry, we have to resolve the target node */ /* since we can get opened on the non-selected entry, we have to resolve the target node */
id<MPTargetNodeResolving> entryResolver = [NSApp targetForAction:@selector(currentTargetEntry)]; id<MPTargetNodeResolving> entryResolver = [NSApp targetForAction:@selector(currentTargetEntry)];
KPKEntry *entry = [entryResolver currentTargetEntry]; KPKEntry *entry = [entryResolver currentTargetEntry];

View File

@@ -301,18 +301,18 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
} }
- (void)popoverDidClose:(NSNotification *)notification { - (void)popoverDidClose:(NSNotification *)notification {
/* We do not enable the button all the time, but it's wokring find this way */ /* We do not enable the button all the time, but it's working find this way */
[self.generatePasswordButton setEnabled:YES]; [self.generatePasswordButton setEnabled:YES];
id controller = _activePopover.contentViewController; id controller = _activePopover.contentViewController;
/* Check for password wizzard */ /* Check for password wizzard */
if([controller respondsToSelector:@selector(generatedPassword)]) { if([controller respondsToSelector:@selector(generatedPassword)]) {
NSString *password = [controller generatedPassword]; NSString *password = [controller generatedPassword];
/* We should only use the password if there is actally one */ /* We should only use the password if there is actually one */
if([password length] > 0) { if([password length] > 0) {
self.entry.password = [controller generatedPassword]; self.entry.password = [controller generatedPassword];
} }
} }
/* TODO: Check for Icon wizzard */ /* TODO: Check for Icon wizard */
_activePopover = nil; _activePopover = nil;
} }

View File

@@ -17,10 +17,10 @@ typedef NS_OPTIONS(NSUInteger, MPEntrySearchFlags) {
MPEntrySearchNotes = (1<<4), MPEntrySearchNotes = (1<<4),
MPEntrySearchAllAttributes = (1<<5), MPEntrySearchAllAttributes = (1<<5),
/* The following two flags should be used like enums. /* The following two flags should be used like enums.
They are not intented to be used in conjunktion with any other flag */ They are not intended to be used in conjunction with any other flag */
MPEntrySearchDoublePasswords = (1<<6), MPEntrySearchDoublePasswords = (1<<6),
MPEntrySearchExpiredEntries = (1<<7), MPEntrySearchExpiredEntries = (1<<7),
/* All combinebale search flags combined */ /* All combine-able search flags combined */
MPEntrySearchAllCombineableFlags = (MPEntrySearchDoublePasswords | MPEntrySearchAllCombineableFlags = (MPEntrySearchDoublePasswords |
MPEntrySearchExpiredEntries | MPEntrySearchExpiredEntries |
MPEntrySearchNotes | MPEntrySearchNotes |
@@ -33,11 +33,11 @@ typedef NS_OPTIONS(NSUInteger, MPEntrySearchFlags) {
MPEntrySearchAllFlags = (MPEntrySearchAllCombineableFlags | MPEntrySearchSingleFlags ) MPEntrySearchAllFlags = (MPEntrySearchAllCombineableFlags | MPEntrySearchSingleFlags )
}; };
/* Wrap serach criteria to be able to store them */ /* Wrap search criteria to be able to store them */
@interface MPEntrySearchContext : NSObject <NSSecureCoding,NSCopying> @interface MPEntrySearchContext : NSObject <NSSecureCoding,NSCopying>
/** /**
* Returns a default search context initalized with sane values. * Returns a default search context initialized with sane values.
* *
* @return The default search context * @return The default search context
*/ */

View File

@@ -37,7 +37,7 @@ typedef NS_ENUM( NSUInteger, MPCopyContentTypeTag) {
@property (weak,readonly) NSTableView *entryTable; @property (weak,readonly) NSTableView *entryTable;
@property (readonly, strong) NSArrayController *entryArrayController; @property (readonly, strong) NSArrayController *entryArrayController;
/* Call this after alle viewcontroller are loaded */ /* Call this after all view controllers are loaded */
- (void)regsiterNotificationsForDocument:(MPDocument *)document; - (void)regsiterNotificationsForDocument:(MPDocument *)document;
/* Copy/Paste */ /* Copy/Paste */

View File

@@ -250,7 +250,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row { - (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
/* /*
bind bakground color to entry color bind background color to entry color
*/ */
} }
@@ -357,7 +357,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
} }
- (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row { - (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
/* Rows being removed for data change should be chekced here to clear selections */ /* Rows being removed for data change should be checked here to clear selections */
if(row == -1) { if(row == -1) {
[self tableViewSelectionDidChange:nil]; [self tableViewSelectionDidChange:nil];
} }
@@ -376,7 +376,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
#pragma mark MPTargetItemResolving #pragma mark MPTargetItemResolving
- (KPKEntry *)currentTargetEntry { - (KPKEntry *)currentTargetEntry {
NSInteger activeRow = [self.entryTable clickedRow]; NSInteger activeRow = [self.entryTable clickedRow];
/* Fallback to selection e.g. for toolbar actions */ /* Fall back to selection e.g. for toolbar actions */
if(activeRow < 0 ) { if(activeRow < 0 ) {
activeRow = [self.entryTable selectedRow]; activeRow = [self.entryTable selectedRow];
} }
@@ -531,7 +531,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
[[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contextBar]|" options:0 metrics:nil views:views]]; [[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contextBar]|" options:0 metrics:nil views:views]];
/* Pin height and to top of entry table */ /* Pin height and to top of entry table */
[[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[contextBar(==30)]-0-[scrollView]" options:0 metrics:nil views:views]]; [[self view] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[contextBar(==30)]-0-[scrollView]" options:0 metrics:nil views:views]];
/* Create the top constraint for the filter bar where we can change the contanst instaed of removing/adding constraints all the time */ /* Create the top constraint for the filter bar where we can change the constant instead of removing/adding constraints all the time */
self.contextBarTopConstraint = [NSLayoutConstraint constraintWithItem:contextBar self.contextBarTopConstraint = [NSLayoutConstraint constraintWithItem:contextBar
attribute:NSLayoutAttributeTop attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual relatedBy:NSLayoutRelationEqual
@@ -594,7 +594,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
case MPOverlayInfoCustom: case MPOverlayInfoCustom:
infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"]; infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"];
infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field nam that was copied to the pasteboard"), name]; infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field name that was copied to the pasteboard"), name];
break; break;
} }
[[MPOverlayWindowController sharedController] displayOverlayImage:infoImage label:infoText atView:self.view]; [[MPOverlayWindowController sharedController] displayOverlayImage:infoImage label:infoText atView:self.view];
@@ -602,7 +602,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
#pragma mark Validation #pragma mark Validation
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
/* Validation is soley handeld in the document */ /* Validation is solely handled in the document */
MPDocument *document = [[self windowController] document]; MPDocument *document = [[self windowController] document];
return [document validateMenuItem:menuItem]; return [document validateMenuItem:menuItem];
} }
@@ -722,7 +722,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
} }
NSInteger columnIndex = [self.entryTable clickedColumn]; NSInteger columnIndex = [self.entryTable clickedColumn];
if(columnIndex < 0 || columnIndex >= [[self.entryTable tableColumns] count]) { if(columnIndex < 0 || columnIndex >= [[self.entryTable tableColumns] count]) {
return; // No Colum to use return; // No Column to use
} }
NSTableColumn *column = [self.entryTable tableColumns][[self.entryTable clickedColumn]]; NSTableColumn *column = [self.entryTable tableColumns][[self.entryTable clickedColumn]];
NSString *identifier = [column identifier]; NSString *identifier = [column identifier];

View File

@@ -63,7 +63,7 @@
dispatch_source_set_event_handler(self.source, self.block); dispatch_source_set_event_handler(self.source, self.block);
// close the file descriptor when the dispatch source is cancelled // close the file descriptor when the dispatch source is canceled
dispatch_source_set_cancel_handler(self.source, ^{ dispatch_source_set_cancel_handler(self.source, ^{
close(self.fileDescriptor); close(self.fileDescriptor);

View File

@@ -12,7 +12,7 @@
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
/** /**
* Tests if the given flag is set in the mode options. * Tests if the given flag is set in the mode options.
* The test operatats on bit flag leve. Hence it will return YES * The test operates on bit flag left. Hence it will return YES
* if only one single bit is common in both parameters! * if only one single bit is common in both parameters!
* *
* @param options single flag to test for * @param options single flag to test for

View File

@@ -95,7 +95,7 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
}; };
/** /**
* Helper class to retrieve Icons for Keys. KDB sortes Icons as an Integer * Helper class to retrieve Icons for Keys. KDB sorts Icons as an Integer
* The Helper maps those numbers to icons. * The Helper maps those numbers to icons.
* It can furthermore be used to retrieve other Icons, that are non-Database Icons * It can furthermore be used to retrieve other Icons, that are non-Database Icons
*/ */
@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
/** /**
* Available Icon names (all) * Available Icon names (all)
* @return Dictioary with MPIconType keys and NSString values containing their names * @return Dictionary with MPIconType keys and NSString values containing their names
*/ */
+ (NSDictionary *)availableIconNames; + (NSDictionary *)availableIconNames;

View File

@@ -26,7 +26,7 @@
- (IBAction)pickExpiryDate:(id)sender; - (IBAction)pickExpiryDate:(id)sender;
- (IBAction)toggleEdit:(id)sender; - (IBAction)toggleEdit:(id)sender;
/* Seperate call to ensure alle registered objects are in place */ /* Separate call to ensure all registered objects are in place */
- (void)regsiterNotificationsForDocument:(NSDocument *)document; - (void)regsiterNotificationsForDocument:(NSDocument *)document;
@end @end

View File

@@ -177,7 +177,7 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
[self.entryViewController endEditing]; [self.entryViewController endEditing];
/* /*
We need to be carefull to only undo the things we actually changed We need to be careful to only undo the things we actually changed
otherwise we undo older actions otherwise we undo older actions
*/ */
if(didCancel) { if(didCancel) {
@@ -312,7 +312,7 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
- (void)_didChangeCurrentItem:(NSNotification *)notification { - (void)_didChangeCurrentItem:(NSNotification *)notification {
MPDocument *document = [notification object]; MPDocument *document = [notification object];
if(!document.selectedItem) { if(!document.selectedItem) {
/* show emty tab and hide edit button */ /* show empty tab and hide edit button */
self.activeTab = MPEmptyTab; self.activeTab = MPEmptyTab;
} }
else { else {

View File

@@ -21,7 +21,7 @@ FOUNDATION_EXTERN uint16_t const kMPUnknownKeyCode;
+ (NSString *)stringForKey:(CGKeyCode)keyCode; + (NSString *)stringForKey:(CGKeyCode)keyCode;
/** /**
* Determines the keyCode (if possible) for the charater * Determines the keyCode (if possible) for the character
* *
* @param character NSString with a single character to be transformed * @param character NSString with a single character to be transformed
* @return virtual Keycode for the supplied string. If none is found, kMPUnkonwKeyCode is returned * @return virtual Keycode for the supplied string. If none is found, kMPUnkonwKeyCode is returned

View File

@@ -86,7 +86,7 @@
NSTimeInterval currentInterval = ([NSDate timeIntervalSinceReferenceDate] - self.lastLocalEventTime); NSTimeInterval currentInterval = ([NSDate timeIntervalSinceReferenceDate] - self.lastLocalEventTime);
if(self.idleLockTime < currentInterval) { if(self.idleLockTime < currentInterval) {
[(MPAppDelegate *)[NSApp delegate] lockAllDocuments]; [(MPAppDelegate *)[NSApp delegate] lockAllDocuments];
/* Reset the timer to full intervall */ /* Reset the timer to full interval */
[self.idleCheckTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:_idleLockTime]]; [self.idleCheckTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:_idleLockTime]];
} }
else { else {

View File

@@ -62,7 +62,7 @@
NSDragOperation operationMask = NSDragOperationMove; NSDragOperation operationMask = NSDragOperationMove;
/* /*
If we can support copy on drag, this can be used If we can support copy on drag, this can be used
to optain the dragging modifier mask the user presses to obtain the dragging modifier mask the user presses
*/ */
BOOL localCopy = NO; BOOL localCopy = NO;
if([info draggingSourceOperationMask] == NSDragOperationCopy) { if([info draggingSourceOperationMask] == NSDragOperationCopy) {

View File

@@ -13,7 +13,7 @@
+ (MPOverlayWindowController *)sharedController; + (MPOverlayWindowController *)sharedController;
/** /**
* Displays an overlay HUD style image with the given text, image centerd at the given view. * Displays an overlay HUD style image with the given text, image centered at the given view.
* There are two use cases. Either displaying information over a view by providing on, * There are two use cases. Either displaying information over a view by providing on,
* or displaying information on the main screen by using nil for the view. * or displaying information on the main screen by using nil for the view.
* *

View File

@@ -23,7 +23,7 @@
56 - 85 Excellent 56 - 85 Excellent
85 - Fantastic 85 - Fantastic
Skale 0-90 Scale 0-90
*/ */
typedef NS_ENUM(NSUInteger, MPPasswordRating) { typedef NS_ENUM(NSUInteger, MPPasswordRating) {
MPPasswordTerrible = 10, MPPasswordTerrible = 10,
@@ -205,7 +205,7 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
[[NSUserDefaults standardUserDefaults] setObject:[self.customCharactersTextField stringValue] forKey:kMPSettingsKeyPasswordCustomString]; [[NSUserDefaults standardUserDefaults] setObject:[self.customCharactersTextField stringValue] forKey:kMPSettingsKeyPasswordCustomString];
} }
else { else {
NSLog(@"Cannot set password generator defaults. Inconsitent state. Aborting."); NSLog(@"Cannot set password generator defaults. Inconsistent state. Aborting.");
} }
self.setDefaultButton.enabled = NO; self.setDefaultButton.enabled = NO;
} }

View File

@@ -16,7 +16,7 @@
@optional @optional
/** /**
* Get's called on dismissing the password editor. * Get's called on dismissing the password editor.
* @param changedPasswordOrKey YES if the password and/or key was saved (not necessairly changed!); * @param changedPasswordOrKey YES if the password and/or key was saved (not necessarily changed!);
*/ */
- (void)didFinishPasswordEditing:(BOOL)changedPasswordOrKey; - (void)didFinishPasswordEditing:(BOOL)changedPasswordOrKey;

View File

@@ -175,7 +175,7 @@
if(!hasPasswordOrKey) { if(!hasPasswordOrKey) {
[self.errorTextField setTextColor:[NSColor controlTextColor]]; [self.errorTextField setTextColor:[NSColor controlTextColor]];
[self.errorTextField setStringValue:NSLocalizedString(@"WARNING_NO_PASSWORD_OR_KEYFILE", "No Key or Password")]; [self.errorTextField setStringValue:NSLocalizedString(@"WARNING_NO_PASSWORD_OR_KEYFILE", "No Key or Password")];
return; // alldone return; // all done
} }
[self.errorTextField setTextColor:[NSColor redColor]]; [self.errorTextField setTextColor:[NSColor redColor]];
if(!passwordOk && !keyOk ) { if(!passwordOk && !keyOk ) {

View File

@@ -67,7 +67,7 @@
} }
- (void)requestPassword { - (void)requestPassword {
// show Warnign if read-only mode! // show warning if read-only mode!
[self _reset]; [self _reset];
} }
@@ -102,7 +102,7 @@
} }
- (IBAction)resetKeyFile:(id)sender { - (IBAction)resetKeyFile:(id)sender {
/* If the reset was triggerd by ourselves we want to preselct the keyfile */ /* If the reset was triggered by ourselves we want to preselect the keyfile */
if(sender == self) { if(sender == self) {
[self _selectKeyURL]; [self _selectKeyURL];
} }

View File

@@ -12,7 +12,7 @@
/** /**
* The PasteBoardController did copy new items to the pasteboard * The PasteBoardController did copy new items to the pasteboard
* The userInfo dictionary is empty. You can optain the timeout via the clearTimeout property * The userInfo dictionary is empty. You can obtain the timeout via the clearTimeout property
*/ */
FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidCopyObjects; FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidCopyObjects;
/** /**
@@ -22,7 +22,7 @@ FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidCopyObjects;
FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidClearClipboard; FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidClearClipboard;
/* /*
This time sets the time interval after which a copied entry shoudl be purged from the pasteboard This time sets the time interval after which a copied entry should be purged from the pasteboard
*/ */
@property (assign, nonatomic) NSTimeInterval clearTimeout; @property (assign, nonatomic) NSTimeInterval clearTimeout;
@property (assign, nonatomic) BOOL clearPasteboardOnShutdown; @property (assign, nonatomic) BOOL clearPasteboardOnShutdown;

View File

@@ -17,7 +17,7 @@ FOUNDATION_EXPORT NSString *const MPRequestTypeSetLogin;
FOUNDATION_EXPORT NSString *const MPRequestTypeGeneratePassword; FOUNDATION_EXPORT NSString *const MPRequestTypeGeneratePassword;
/** /**
* Servive class to be called for getting specific request handler for indifidual reuqest * Service class to be called for getting specific request handler for individual request
* The service is identified by a string * The service is identified by a string
*/ */
@interface MPRequestHandlerService : NSObject @interface MPRequestHandlerService : NSObject

View File

@@ -23,7 +23,7 @@
/** /**
* Formulate a response to the request passed in as Dictionary * Formulate a response to the request passed in as Dictionary
* *
* @param data An NSDictionary containing the parsed JSON reuest * @param data An NSDictionary containing the parsed JSON request
*/ */
- (void)respondTo:(NSDictionary *)data; - (void)respondTo:(NSDictionary *)data;

View File

@@ -41,14 +41,14 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideNotes;
APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideURL; APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideURL;
/* Document/Key Location store */ /* Document/Key Location store */
APPKIT_EXTERN NSString *const kMPSettingsKeyLastDatabasePath; // Path to the last opened Database. Workaround if users have disabled the feautere in the OS APPKIT_EXTERN NSString *const kMPSettingsKeyLastDatabasePath; // Path to the last opened Database. Workaround if users have disabled the feature in the OS
APPKIT_EXTERN NSString *const kMPSettingsKeyRememeberdKeysForDatabases; // NSDictionary of all db file urls and the corresponding key file url APPKIT_EXTERN NSString *const kMPSettingsKeyRememeberdKeysForDatabases; // NSDictionary of all db file urls and the corresponding key file url
APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases; // YES if key files should be rememberd APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases; // YES if key files should be remembers
/* Autotype */ /* Autotype */
APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey; // Should MacPass swap control for command. This is usefull in a cross plattform environment APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey; // Should MacPass swap control for command. This is useful in a cross platform environment
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype; // Is Global Autotype enabled? APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype; // Is Global Autotype enabled?
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the useder defined global autotype key APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the user defined global autotype key
APPKIT_EXTERN NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence; // Default sequence used for Autotype APPKIT_EXTERN NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence; // Default sequence used for Autotype
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup included entry URL APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup included entry URL
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup included host part of entry URL APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup included host part of entry URL
@@ -92,12 +92,12 @@ typedef NS_ENUM(NSUInteger, MPPasswordEncoding) {
@interface MPSettingsHelper : NSObject @interface MPSettingsHelper : NSObject
/** /**
* Registers all the defaults for the applciaiton * Registers all the defaults for the application
*/ */
+ (void)setupDefaults; + (void)setupDefaults;
/** /**
* Brings the defaults to a current status. Removes obsoltes entries. * Brings the defaults to a current status. Removes obsolete entries.
*/ */
+ (void)migrateDefaults; + (void)migrateDefaults;
/** /**

View File

@@ -10,7 +10,7 @@
/* /*
Protrocoll to be implemented by ViewControllers that can be added to Protrocoll to be implemented by ViewControllers that can be added to
the settings windows. Tabs are orded as the controllers are included. the settings windows. Tabs are ordered as the controllers are included.
*/ */
@protocol MPSettingsTab <NSObject> @protocol MPSettingsTab <NSObject>
@@ -22,7 +22,7 @@
- (NSImage *)image; - (NSImage *)image;
/* Called when the tab is about to be selected and displayed */ /* Called when the tab is about to be selected and displayed */
- (void)willShowTab; - (void)willShowTab;
/* Called whent the tab was selected and is being displayed */ /* Called when the tab was selected and is being displayed */
- (void)didShowTab; - (void)didShowTab;
@end @end

View File

@@ -60,7 +60,7 @@
} }
id<MPSettingsTab> tab = self.settingsController[identifier]; id<MPSettingsTab> tab = self.settingsController[identifier];
if(tab == nil){ if(tab == nil){
NSLog(@"Warning. Unknow settingscontroller for identifier: %@. Did you miss to add the controller?", identifier); NSLog(@"Warning. Unknown settingscontroller for identifier: %@. Did you miss to add the controller?", identifier);
return; return;
} }
[self.toolbar setSelectedItemIdentifier:identifier]; [self.toolbar setSelectedItemIdentifier:identifier];
@@ -112,7 +112,7 @@
} }
NSString *identifier = [tabController identifier]; NSString *identifier = [tabController identifier];
if(nil != self.settingsController[identifier]) { if(nil != self.settingsController[identifier]) {
NSLog(@"Warning: Settingscontroller with identifer %@ already present!", identifier); NSLog(@"Warning: Settingscontroller with identifier %@ already present!", identifier);
} }
else { else {
self.settingsController[identifier] = tabController; self.settingsController[identifier] = tabController;
@@ -165,7 +165,7 @@
item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
/* /*
Setup the item to use the controllers label if one is present Setup the item to use the controllers label if one is present
and supports the appropriate @optional protocoll messages and supports the appropriate @optional protocol messages
*/ */
id<MPSettingsTab> tab = self.settingsController[itemIdentifier]; id<MPSettingsTab> tab = self.settingsController[itemIdentifier];
if([tab respondsToSelector:@selector(label)]) { if([tab respondsToSelector:@selector(label)]) {

View File

@@ -12,18 +12,18 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
/** /**
* Generic Windowcontroller to be used for sheets * Generic Windowcontroller to be used for sheets
* Subclasses are able to initalize their views within updateView * Subclasses are able to initialize their views within updateView
* and thus are able to reset themself befor being displayed as sheets * and thus are able to reset themselves before being displayed as sheets
*/ */
@interface MPSheetWindowController : NSWindowController @interface MPSheetWindowController : NSWindowController
/** /**
* Flag to indicate that the view might need resetting. * Flag to indicate that the view might need resetting.
* The default implementation of dismissi sheet and the * The default implementation of dismiss sheet and the
* designate initalizer both set the value to YES * designate initializer both set the value to YES
*/ */
@property (nonatomic, assign) BOOL isDirty; @property (nonatomic, assign) BOOL isDirty;
/** /**
* This method is a entry point to ensure updated ui befor being presented * This method is a entry point to ensure updated ui before being presented
* The method is called every time the window message is sent to the controller * The method is called every time the window message is sent to the controller
*/ */
- (void)updateView; - (void)updateView;

View File

@@ -296,7 +296,7 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
if(_displayModeBeforeSearch == NSToolbarDisplayModeLabelOnly) { if(_displayModeBeforeSearch == NSToolbarDisplayModeLabelOnly) {
[self.toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel]; [self.toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
} }
/* only make the searchfield first responder if it's not aleady in an active search */ /* only make the searchfield first responder if it's not already in an active search */
if(![self.searchField currentEditor]) { if(![self.searchField currentEditor]) {
[[self.searchField window] makeFirstResponder:self.searchField]; [[self.searchField window] makeFirstResponder:self.searchField];
[self.searchField selectText:self]; [self.searchField selectText:self];

View File

@@ -19,10 +19,10 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
@interface NSString (MPPasswordCreation) @interface NSString (MPPasswordCreation)
/** /**
* Creates a Password using the supplied password character set with the given lenght * Creates a Password using the supplied password character set with the given length
* *
* @param allowedCharacters Characters allowed for the password * @param allowedCharacters Characters allowed for the password
* @param theLength lenght of the password to be created * @param theLength length of the password to be created
* *
* @return new password with only the allowed characters. * @return new password with only the allowed characters.
*/ */
@@ -33,9 +33,9 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
* Creats a password based on the supplied string * Creats a password based on the supplied string
* *
* @param source String containing the allowed characters * @param source String containing the allowed characters
* @param length Lenght for the password to be chreated * @param length Length for the password to be created
* *
* @return Password consisint only of allowed characters * @return Password consistent only of allowed characters
*/ */
+ (NSString *)passwordFromString:(NSString *)source length:(NSUInteger)length; + (NSString *)passwordFromString:(NSString *)source length:(NSUInteger)length;
@@ -46,7 +46,7 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
* *
* @param length Length of the password to be created * @param length Length of the password to be created
* *
* @return Password containing only the charactesr in receiver * @return Password containing only the characters in receiver
*/ */
- (NSString *)passwordWithLength:(NSUInteger)length; - (NSString *)passwordWithLength:(NSUInteger)length;
/** /**
@@ -54,12 +54,12 @@ typedef NS_OPTIONS(NSUInteger, MPPasswordCharacterFlags) {
*/ */
- (NSString *)randomCharacter; - (NSString *)randomCharacter;
/** /**
* Calculates the entropy of the receiver based on the allowed characers. The caluclation consideres the characters chosen randomly. * Calculates the entropy of the receiver based on the allowed characters. The calculation considers the characters chosen randomly.
* If the password supplied was not created randomly based on the full character set, the calulated entropy is NOT correct. * If the password supplied was not created randomly based on the full character set, the calculated entropy is NOT correct.
* Do NOT use this method to estrimate unknown passwords * Do NOT use this method to estimate unknown passwords
* *
* @param allowedCharacters set of allowed Characters * @param allowedCharacters set of allowed Characters
* @param customCharacters alternative string of unique allowed charactes (String is not stripped of duplicates!) * @param customCharacters alternative string of unique allowed characters (String is not stripped of duplicates!)
* *
* @return entropy of the receiver as bits * @return entropy of the receiver as bits
*/ */

View File

@@ -20,8 +20,8 @@
/* Class = "NSBox"; title = "Preview"; ObjectID = "VVs-b5-cX9"; */ /* Class = "NSBox"; title = "Preview"; ObjectID = "VVs-b5-cX9"; */
"VVs-b5-cX9.title" = "Preview"; "VVs-b5-cX9.title" = "Preview";
/* Class = "NSTextFieldCell"; title = "If enabled attached files will be copied to a tempoary location for preview and deleted after the preview is closed."; ObjectID = "WmI-IB-Aso"; */ /* Class = "NSTextFieldCell"; title = "If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed."; ObjectID = "WmI-IB-Aso"; */
"WmI-IB-Aso.title" = "If enabled attached files will be copied to a tempoary location for preview and deleted after the preview is closed. This is a potential security risk!"; "WmI-IB-Aso.title" = "If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed. This is a potential security risk!";
/* Class = "NSButtonCell"; title = "Interpret ⌃ as ⌘"; ObjectID = "QfO-yG-l3F"; */ /* Class = "NSButtonCell"; title = "Interpret ⌃ as ⌘"; ObjectID = "QfO-yG-l3F"; */
"QfO-yG-l3F.title" = "Interpret ⌃ as ⌘"; "QfO-yG-l3F.title" = "Interpret ⌃ as ⌘";

View File

@@ -20,7 +20,7 @@
"ERROR_INVALID_FIELD_SIZE" = "Incorrect size at data field. Password wrong?"; "ERROR_INVALID_FIELD_SIZE" = "Incorrect size at data field. Password wrong?";
"ERROR_INVALID_FIELD_TYPE" = "Unknown data field. Password wrong?"; "ERROR_INVALID_FIELD_TYPE" = "Unknown data field. Password wrong?";
"ERROR_UNSUPPORTED_DATABASER_VERSION" = "The Database version is not supported"; "ERROR_UNSUPPORTED_DATABASER_VERSION" = "The Database version is not supported";
"ERROR_UNSUPPORTED_CHIPHER" = "Unsupported chipher algorithm"; "ERROR_UNSUPPORTED_CHIPHER" = "Unsupported cipher algorithm";
"ERROR_UNKNOWN_FILE_FORMAT" = "Unknown file format"; "ERROR_UNKNOWN_FILE_FORMAT" = "Unknown file format";
"ERROR_HEADER_CORRUPTED" = "Header is corrupted"; "ERROR_HEADER_CORRUPTED" = "Header is corrupted";
"ERROR_UNSUPPORTED_KDBX_COMPRESSION_ALGORITHM" = "Unsported compression algorithm"; "ERROR_UNSUPPORTED_KDBX_COMPRESSION_ALGORITHM" = "Unsported compression algorithm";
@@ -32,6 +32,6 @@
"ERROR_GROUP_ELEMENT_MISSING" = "The XML file contains no Group node"; "ERROR_GROUP_ELEMENT_MISSING" = "The XML file contains no Group node";
"ERROR_HEADER_HASH_MISSMATCH" = "The header hash doesn't match. File corrupted"; "ERROR_HEADER_HASH_MISSMATCH" = "The header hash doesn't match. File corrupted";
"ERROR_XML_KEYFILE_WITHOUT_KEY_ELEMENT" = "The XML keyfile is missing the key element"; "ERROR_XML_KEYFILE_WITHOUT_KEY_ELEMENT" = "The XML keyfile is missing the key element";
"ERROR_XML_KEYFILE_WITHOUT_DATA_ELEMENT" = "The XML keyfiel is missing the data element"; "ERROR_XML_KEYFILE_WITHOUT_DATA_ELEMENT" = "The XML keyfile is missing the data element";
"ERROR_XML_KEYFILE_DATA_PARSING_ERROR" = "Unable to read the data of the XML keyfile"; "ERROR_XML_KEYFILE_DATA_PARSING_ERROR" = "Unable to read the data of the XML keyfile";
"ERROR_HEADER_HASH_VERIFICATION_FAILED" = "The database header hash is wrong. Data integritiy might be broken!"; "ERROR_HEADER_HASH_VERIFICATION_FAILED" = "The database header hash is wrong. Data integrity might be broken!";

Binary file not shown.

View File

@@ -53,7 +53,7 @@
NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:4 freeWhenDone:NO]; NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:4 freeWhenDone:NO];
NSColor *color = [NSColor colorWithData:colorData]; NSColor *color = [NSColor colorWithData:colorData];
NSData *newData = [color colorData]; NSData *newData = [color colorData];
XCTAssertEqualObjects(colorData, newData, @"Convertion should result in same data"); XCTAssertEqualObjects(colorData, newData, @"Conversion should result in same data");
} }
@end @end

View File

@@ -44,7 +44,7 @@
- (void)testLegacyKeyfileGeneration { - (void)testLegacyKeyfileGeneration {
NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion]; NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion];
// test if strucutre is sound; // test if structure is sound;
XCTAssertNotNil(data, @"Keydata should have been generated"); XCTAssertNotNil(data, @"Keydata should have been generated");
} }

View File

@@ -25,7 +25,7 @@
XCTAssertNotNil(tree, @"Tree should be created"); XCTAssertNotNil(tree, @"Tree should be created");
error = nil; error = nil;
NSData *data = [tree encryptWithPassword:password forVersion:KPKLegacyVersion error:&error]; NSData *data = [tree encryptWithPassword:password forVersion:KPKLegacyVersion error:&error];
XCTAssertNotNil(data, @"Serialized Data shoudl be created"); XCTAssertNotNil(data, @"Serialized Data should be created");
NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234.kdb"]; NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234.kdb"];
NSLog(@"Saved to %@", tempFile); NSLog(@"Saved to %@", tempFile);
[data writeToFile:tempFile atomically:YES]; [data writeToFile:tempFile atomically:YES];

View File

@@ -70,11 +70,11 @@
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match"); XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match");
XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match"); XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match");
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
KPKBinary *copiedBinary = [copyEntry.binaries lastObject]; KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
} }
- (void)testIconCoding { - (void)testIconCoding {

View File

@@ -59,11 +59,11 @@
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
XCTAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match"); XCTAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match");
XCTAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match"); XCTAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match");
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
KPKBinary *copiedBinary = [copyEntry.binaries lastObject]; KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
} }
@end @end

View File

@@ -17,7 +17,7 @@
- (void)testUndelemitedUUID { - (void)testUndelemitedUUID {
NSUUID *uuid1 = [[NSUUID alloc] initWithUUIDString:@"31C1F2E6-BF71-4350-BE58-05216AFC5AFF"]; NSUUID *uuid1 = [[NSUUID alloc] initWithUUIDString:@"31C1F2E6-BF71-4350-BE58-05216AFC5AFF"];
NSUUID *uuid2 = [[NSUUID alloc] initWithUndelemittedUUIDString:@"31C1F2E6BF714350BE5805216AFC5AFF"]; NSUUID *uuid2 = [[NSUUID alloc] initWithUndelemittedUUIDString:@"31C1F2E6BF714350BE5805216AFC5AFF"];
XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs shoudl match"); XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs should match");
} }
@end @end

View File

@@ -25,7 +25,7 @@
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error; NSError *error;
KPKTree *tree = [reader tree:&error]; KPKTree *tree = [reader tree:&error];
XCTAssertNil(tree, @"No Tree form emptry data"); XCTAssertNil(tree, @"No Tree from empty data");
XCTAssertNotNil(error, @"Error Object should be provided"); XCTAssertNotNil(error, @"Error Object should be provided");
XCTAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data"); XCTAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data");
} }
@@ -35,7 +35,7 @@
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error; NSError *error;
KPKTree *tree = [reader tree:&error]; KPKTree *tree = [reader tree:&error];
XCTAssertNil(tree, @"No Tree form emptry data"); XCTAssertNil(tree, @"No Tree from empty data");
XCTAssertNotNil(error, @"Error Object should be provided"); XCTAssertNotNil(error, @"Error Object should be provided");
XCTAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing"); XCTAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing");
} }
@@ -45,7 +45,7 @@
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
NSError *error; NSError *error;
KPKTree *tree = [reader tree:&error]; KPKTree *tree = [reader tree:&error];
XCTAssertNil(tree, @"No Tree form emptry data"); XCTAssertNil(tree, @"No Tree from empty data");
XCTAssertNotNil(error, @"Error Object should be provided"); XCTAssertNotNil(error, @"Error Object should be provided");
XCTAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing"); XCTAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing");
} }

View File

@@ -21,7 +21,7 @@
- (void)testCreateNewDatabase { - (void)testCreateNewDatabase {
MPDocument *document = [[MPDocument alloc] init]; MPDocument *document = [[MPDocument alloc] init];
XCTAssertNotNil(document, @"Document should be created"); XCTAssertNotNil(document, @"Document should be created");
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in defautl case"); XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in default case");
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation"); XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation");
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured"); XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");
} }