Added autotype button to toolbar

This commit is contained in:
Michael Starke
2018-03-06 18:15:00 +01:00
parent ee604337f8
commit d58b406c37
7 changed files with 20 additions and 5 deletions

Binary file not shown.

View File

@@ -414,8 +414,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
*/
// only lock if we do not have user interaction that cannot be dismissed!
if(!self.lockedForFileChange) {
for(NSWindow *sheet in [self windowForSheet].sheets) {
[[self windowForSheet] endSheet:sheet];
for(NSWindow *sheet in self.windowForSheet.sheets) {
[self.windowForSheet endSheet:sheet];
}
if(self.documentEdited) {
[self saveDocumentWithDelegate:self didSaveSelector:@selector(_lockDatabaseForDocument:didSave:contextInfo:) contextInfo:NULL];

View File

@@ -109,6 +109,7 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
MPIconContextTriangle,
MPIconExpiredEntry,
MPIconExpiredGroup,
MPIconKeyboard
};
/**

View File

@@ -162,6 +162,7 @@
@(MPIconCreated): @"createdTemplate",
@(MPIconAddEntry): @"addEntryTemplate",
@(MPIconContextTriangle): @"contextTriangleTemplate",
@(MPIconKeyboard): @"keyboardTemplate",
@(MPIconExpiredEntry): NSImageNameCaution,
@(MPIconExpiredGroup): NSImageNameCaution

View File

@@ -44,6 +44,7 @@ NSString *const MPToolbarItemSearch = @"TOOLBAR_SEARCH";
NSString *const MPToolbarItemCopyUsername = @"TOOLBAR_COPY_USERNAME";
NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE";
@interface MPToolbarDelegate() {
MPAddEntryContextMenuDelegate *_entryMenuDelegate;
@@ -77,10 +78,12 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
MPToolbarItemSearch,
MPToolbarItemLock,
MPToolbarItemInspector,
MPToolbarItemHistory ];
MPToolbarItemHistory,
MPToolbarItemAutotype ];
_defaultToolbarIdentifiers = @[ MPToolbarItemAddEntry,
MPToolbarItemDelete,
MPToolbarItemAddGroup,
MPToolbarItemAutotype,
MPToolbarItemAction,
NSToolbarFlexibleSpaceItemIdentifier,
MPToolbarItemSearch,
@@ -214,7 +217,8 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
MPToolbarItemDelete: [MPIconHelper icon:MPIconTrash],
MPToolbarItemAction: [NSImage imageNamed:NSImageNameActionTemplate],
MPToolbarItemInspector: [MPIconHelper icon:MPIconInfo],
MPToolbarItemHistory: [MPIconHelper icon:MPIconHistory]
MPToolbarItemHistory: [MPIconHelper icon:MPIconHistory],
MPToolbarItemAutotype : [MPIconHelper icon:MPIconKeyboard]
};
return imageDict;
}
@@ -247,7 +251,8 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
MPToolbarItemDelete: NSLocalizedString(@"DELETE", @"Toolbar item delete item"),
MPToolbarItemInspector: NSLocalizedString(@"INSPECTOR", @"Toolbar item toggle inspector"),
MPToolbarItemSearch: NSLocalizedString(@"SEARCH", @"Search input in Toolbar "),
MPToolbarItemHistory: NSLocalizedString(@"SHOW_HISTORY", @"Toolbar item to toggel history display"),
MPToolbarItemHistory: NSLocalizedString(@"SHOW_HISTORY", @"Toolbar item to toggle history display"),
MPToolbarItemAutotype: NSLocalizedString(@"TOOLBAR_PERFORM_AUTOTYPE_FOR_ENTRY", @"Toolbar item to perform autotype")
};
});
return labelDict[identifier];
@@ -265,6 +270,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
MPToolbarItemCopyUsername: @(MPActionCopyUsername),
MPToolbarItemInspector: @(MPActionToggleInspector),
MPToolbarItemHistory: @(MPActionShowEntryHistory),
MPToolbarItemAutotype: @(MPActionPerformAutotypeForSelectedEntry)
};
});
MPActionType actionType = (MPActionType)[actionDict[identifier] integerValue];

View File

@@ -532,6 +532,9 @@
/* preset to expire tomorrow */
"TOMORROW" = "Tomorrow";
/* Toolbar item to perform autotype */
"TOOLBAR_PERFORM_AUTOTYPE_FOR_ENTRY" = "Autotype";
/* Move Entry to Trash */
"TRASH_ENTRY" = "Trash Entry";