disabled scrolling to added entry while seach results are displayed

This commit is contained in:
michael starke
2016-06-03 10:14:12 +02:00
parent a11d2329de
commit 3ba98d2d00
3 changed files with 12 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
@@ -448,7 +448,7 @@
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="82" secondAttribute="trailing" constant="20" symbolic="YES" id="4df-0Y-ggz"/>
<constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/>
</constraints>
<point key="canvasLocation" x="232.5" y="281.5"/>
<point key="canvasLocation" x="19.5" y="144.5"/>
</view>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="252" height="457"/>
@@ -681,7 +681,7 @@
<constraint firstItem="0U8-TS-giU" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" id="kLH-Bj-C5m"/>
<constraint firstItem="57" firstAttribute="top" secondItem="59" secondAttribute="bottom" constant="8" symbolic="YES" id="lYe-am-xJx"/>
</constraints>
<point key="canvasLocation" x="515" y="-255.5"/>
<point key="canvasLocation" x="355" y="-371.5"/>
</customView>
<view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="301" height="424"/>
@@ -930,7 +930,7 @@
<constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/>
<constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/>
</constraints>
<point key="canvasLocation" x="190.5" y="-272"/>
<point key="canvasLocation" x="19.5" y="-388"/>
</view>
</objects>
<resources>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPEntryViewController">

View File

@@ -410,6 +410,10 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
}
- (void)_didAddItem:(NSNotification *)notification {
MPDocument *document = notification.object;
if(document.hasSearch) {
return; // Search should not react to new Entries as it's displaying search results
}
NSDictionary *dict = notification.userInfo;
KPKEntry *entry = dict[MPDocumentEntryKey];
NSUInteger row = [self.entryArrayController.arrangedObjects indexOfObject:entry];
@@ -424,7 +428,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
self.filteredEntries = result;
[self.entryArrayController unbind:NSContentArrayBinding];
[self.entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:NSStringFromSelector(@selector(filteredEntries)) options:nil];
[[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:NO];
[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = NO;
}
@@ -445,7 +449,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
}
- (void)_didUnlockDatabase:(NSNotification *)notificiation {
MPDocument *document = [[self windowController] document];
MPDocument *document = self.windowController.document;
/* If the document was locked and unlocked we do not need to recheck */
if(document.unlockCount != 1) {
/* TODO add another method to display this!