Merge branch 'develop' into develop

This commit is contained in:
Chester Liu
2017-04-14 23:26:01 +08:00
committed by GitHub
24 changed files with 76 additions and 56 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12118"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -37,7 +37,7 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1" customClass="HNHUIGradientView">
<rect key="frame" x="0.0" y="0.0" width="576" height="30"/>
<subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6">
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6">
<rect key="frame" x="6" y="8" width="47" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Search:" id="7">
<font key="font" metaFont="smallSystemBold"/>
@@ -184,7 +184,7 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="S8L-rB-h0h" customClass="HNHUIGradientView">
<rect key="frame" x="0.0" y="0.0" width="576" height="30"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gGR-f0-dcr">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gGR-f0-dcr">
<rect key="frame" x="18" y="6" width="37" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="8LU-cT-rsU">
<font key="font" metaFont="system"/>
@@ -224,7 +224,7 @@
</connections>
</tabViewItem>
</tabViewItems>
<point key="canvasLocation" x="157" y="476"/>
<point key="canvasLocation" x="104" y="293"/>
</tabView>
</objects>
</document>

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

@@ -346,6 +346,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
return;
}
self.tree = nil;
self.compositeKey = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidLockDatabaseNotification object:self];
}
@@ -666,11 +667,11 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
}
- (void)duplicateEntry:(id)sender {
/*
KPKEntry *duplicate = [self.selectedEntry copyWithTitle:nil options:kKPKCopyOptionNone];
[duplicate addToGroup:self.selectedEntry.parent];
[self.undoManager setActionName:NSLocalizedString(@"DUPLICATE_ENTRY", "")];
*/
for(KPKEntry *entry in self.selectedEntries) {
KPKEntry *duplicate = [entry copyWithTitle:nil options:kKPKCopyOptionNone];
[duplicate addToGroup:entry.parent];
}
[self.undoManager setActionName:NSLocalizedString(@"DUPLICATE_ENTRY", "")];
}
- (void)duplicateEntryWithOptions:(id)sender {

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

@@ -55,8 +55,6 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
@property (strong) NSPopover *activePopover;
@property (nonatomic, readonly) KPKEntry *representedEntry;
//@property (nonatomic, weak) KPKEntry *entry;
@property (strong) MPTemporaryFileStorage *quicklookStorage;
@end

View File

@@ -252,6 +252,8 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
NSTableCellView *view = nil;
if(isTitleColumn || isGroupColumn) {
view = [tableView makeViewWithIdentifier:_MPTableImageCellView owner:self];
[view.textField unbind:NSValueBinding];
[view.imageView unbind:NSValueBinding];
if( isTitleColumn ) {
NSString *titleKeyPath = [NSString stringWithFormat:@"%@.%@",
NSStringFromSelector(@selector(objectValue)),

View File

@@ -43,6 +43,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
NSString *const MPToolbarItemSearch = @"TOOLBAR_SEARCH";
NSString *const MPToolbarItemCopyUsername = @"TOOLBAR_COPY_USERNAME";
NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
@interface MPToolbarDelegate() {
MPAddEntryContextMenuDelegate *_entryMenuDelegate;
@@ -75,7 +76,8 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
NSToolbarFlexibleSpaceItemIdentifier,
MPToolbarItemSearch,
MPToolbarItemLock,
MPToolbarItemInspector ];
MPToolbarItemInspector,
MPToolbarItemHistory ];
_defaultToolbarIdentifiers = @[ MPToolbarItemAddEntry,
MPToolbarItemDelete,
MPToolbarItemAddGroup,
@@ -211,6 +213,7 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
MPToolbarItemDelete: [MPIconHelper icon:MPIconTrash],
MPToolbarItemAction: [NSImage imageNamed:NSImageNameActionTemplate],
MPToolbarItemInspector: [MPIconHelper icon:MPIconInfo],
MPToolbarItemHistory: [MPIconHelper icon:MPIconHistory]
};
return imageDict;
}
@@ -233,7 +236,8 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
MPToolbarItemCopyUsername: NSLocalizedString(@"COPY_USERNAME", @""),
MPToolbarItemDelete: NSLocalizedString(@"DELETE", @""),
MPToolbarItemInspector: NSLocalizedString(@"INSPECTOR", @""),
MPToolbarItemSearch: NSLocalizedString(@"SEARCH", @"")
MPToolbarItemSearch: NSLocalizedString(@"SEARCH", @""),
MPToolbarItemHistory: NSLocalizedString(@"SHOW_HISTORY", @""),
};
});
return labelDict[identifier];
@@ -249,7 +253,8 @@ NSString *const MPToolbarItemCopyPassword = @"TOOLBAR_COPY_PASSWORD";
MPToolbarItemDelete: @(MPActionDelete),
MPToolbarItemCopyPassword: @(MPActionCopyPassword),
MPToolbarItemCopyUsername: @(MPActionCopyUsername),
MPToolbarItemInspector: @(MPActionToggleInspector)
MPToolbarItemInspector: @(MPActionToggleInspector),
MPToolbarItemHistory: @(MPActionShowEntryHistory),
};
});
MPActionType actionType = (MPActionType)[actionDict[identifier] integerValue];

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>

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPSavePanelAccessoryViewController">
@@ -19,7 +20,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2">
<rect key="frame" x="183" y="53" width="142" height="26"/>
<rect key="frame" x="180" y="53" width="148" height="26"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="3">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@@ -32,15 +33,15 @@
</popUpButtonCell>
</popUpButton>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="11">
<rect key="frame" x="126" y="58" width="53" height="17"/>
<rect key="frame" x="125" y="58" width="51" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Format:" id="12">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="51">
<rect key="frame" x="126" y="20" width="362" height="28"/>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" preferredMaxLayoutWidth="358" translatesAutoresizingMaskIntoConstraints="NO" id="51">
<rect key="frame" x="125" y="20" width="363" height="28"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Not all Information inside your current database can be stored with this format." id="52">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -60,6 +61,7 @@
<constraint firstItem="51" firstAttribute="top" secondItem="2" secondAttribute="bottom" constant="8" symbolic="YES" id="101"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="51" secondAttribute="bottom" constant="20" symbolic="YES" id="103"/>
</constraints>
<point key="canvasLocation" x="-38" y="-82"/>
</customView>
</objects>
</document>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.