refactoring for history browsing

This commit is contained in:
michael starke
2017-04-04 16:22:32 +02:00
parent e28f0a3bdf
commit 69a4c9e175
5 changed files with 24 additions and 13 deletions

View File

@@ -37,8 +37,8 @@
@(MPActionExportXML): NSStringFromSelector(@selector(exportAsXML:)),
@(MPActionImportXML): NSStringFromSelector(@selector(importFromXML:)),
@(MPActionToggleQuicklook): NSStringFromSelector(@selector(toggleQuicklookPreview:)),
@(MPActionShowEntryHistory): NSStringFromSelector(@selector(showHistoryForEntry:)),
@(MPActionHideEntryHistory): NSStringFromSelector(@selector(hideHistoryForEntry:)),
@(MPActionShowEntryHistory): NSStringFromSelector(@selector(showEntryHistory:)),
@(MPActionHideEntryHistory): NSStringFromSelector(@selector(hideEntryHistory:)),
@(MPActionPerformAutotypeForSelectedEntry): NSStringFromSelector(@selector(performAutotypeForEntry:))
};
});

View File

@@ -69,7 +69,7 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
//self.emptyTrashButton.textColor = [NSColor whiteColor];
}
[[self view] bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
[self.view bind:NSSelectedIndexBinding toObject:self withKeyPath:NSStringFromSelector(@selector(activeTab)) options:nil];
/* Setup Filter Bar buttons and menu */
NSInteger tags[] = { MPEntrySearchTitles, MPEntrySearchUsernames, MPEntrySearchPasswords, MPEntrySearchNotes, MPEntrySearchUrls };
@@ -87,7 +87,7 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
[[specialMenu itemAtIndex:0] setAction:@selector(toggleSearchFlags:)];
for(NSInteger iIndex = 0; iIndex < (sizeof(specialTags)/sizeof(NSInteger)); iIndex++) {
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:titles[iIndex] action:@selector(toggleSearchFlags:) keyEquivalent:@""];
[item setTag:specialTags[iIndex]];
item.tag = specialTags[iIndex];
[specialMenu addItem:item];
}
[self.specialFilterPopUpButton setMenu:specialMenu];

View File

@@ -53,8 +53,8 @@
- (IBAction)pickExpiryDate:(id)sender;
- (IBAction)performAutotypeForEntry:(id)sender;
- (IBAction)showHistoryForEntry:(id)sender;
- (IBAction)hideHistoryForEntry:(id)sender;
- (IBAction)showEntryHistory:(id)sender;
- (IBAction)hideEntryHistory:(id)sender;
#pragma mark Helper
- (IBAction)fixAutotype:(id)sender;

View File

@@ -495,11 +495,11 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
[contentView layoutSubtreeIfNeeded];
}
- (IBAction)showHistoryForEntry:(id)sender {
[self.document showHistoryForEntry:nil];
- (void)showEntryHistory:(id)sender {
}
- (IBAction)hideHistoryForEntry:(id)sender {
- (void)hideEntryHistory:(id)sender {
}

View File

@@ -14,7 +14,7 @@
<key>CFBundleTypeIconFile</key>
<string>FileTypeIcon</string>
<key>CFBundleTypeName</key>
<string>kdbxFileType</string>
<string>KDBX Database</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
@@ -34,7 +34,7 @@
<key>CFBundleTypeIconFile</key>
<string>FileTypeIcon</string>
<key>CFBundleTypeName</key>
<string>kdbFileType</string>
<string>KDB Database</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
@@ -83,7 +83,7 @@
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Keepass 2 Database</string>
<string>KDBX Database</string>
<key>UTTypeIdentifier</key>
<string>com.hicknhack.macpass.kdbx</string>
<key>UTTypeTagSpecification</key>
@@ -100,7 +100,7 @@
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Keepass Database</string>
<string>KDB Database</string>
<key>UTTypeIdentifier</key>
<string>com.hicknhack.macpass.kdb</string>
<key>UTTypeTagSpecification</key>
@@ -131,5 +131,16 @@
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>XML</string>
<key>UTTypeIdentifier</key>
<string>public.xml</string>
<key>UTTypeTagSpecification</key>
<dict/>
</dict>
</array>
</dict>
</plist>