Lock files are generated and internal state is stored (#22)

Feed back for the user missing
Protection missing
This commit is contained in:
michael starke
2013-06-26 21:55:41 +02:00
parent 0df7ed4458
commit 9b074eb6b6
5 changed files with 36 additions and 34 deletions

View File

@@ -58,6 +58,7 @@
<string key="NSFrame">{{7, 5}, {32, 19}}</string>
<reference key="NSSuperview" ref="163272962"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="160641004">
@@ -107,7 +108,7 @@
<string key="NSFrameSize">{684, 548}</string>
<reference key="NSSuperview" ref="262664416"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="736877784"/>
<reference key="NSNextKeyView" ref="788738248"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -392,7 +393,7 @@
<string key="NSFrame">{{0, 30}, {684, 565}}</string>
<reference key="NSSuperview" ref="997686550"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="262664416"/>
<reference key="NSNextKeyView" ref="736877784"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133680</int>
<reference key="NSVScroller" ref="1037276411"/>
@@ -1467,22 +1468,6 @@
<int key="objectID">690</int>
<reference key="object" ref="163272962"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="187301323">
<reference key="firstItem" ref="276578969"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="163272962"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">7</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="163272962"/>
<int key="scoringType">9</int>
<float key="scoringTypeFloat">40</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="244975730">
<reference key="firstItem" ref="276578969"/>
<int key="firstAttribute">10</int>
@@ -1499,6 +1484,22 @@
<float key="scoringTypeFloat">22</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="187301323">
<reference key="firstItem" ref="276578969"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="163272962"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">7</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="163272962"/>
<int key="scoringType">9</int>
<float key="scoringTypeFloat">40</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="337191559">
<reference key="firstItem" ref="163272962"/>
<int key="firstAttribute">8</int>
@@ -1573,11 +1574,6 @@
<reference key="object" ref="160641004"/>
<reference key="parent" ref="276578969"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">736</int>
<reference key="object" ref="244975730"/>
<reference key="parent" ref="163272962"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">741</int>
<reference key="object" ref="187301323"/>
@@ -1588,6 +1584,11 @@
<reference key="object" ref="677071530"/>
<reference key="parent" ref="276578969"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">774</int>
<reference key="object" ref="244975730"/>
<reference key="parent" ref="163272962"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -1726,8 +1727,8 @@
<string key="683.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array class="NSMutableArray" key="690.IBNSViewMetadataConstraints">
<reference ref="337191559"/>
<reference ref="244975730"/>
<reference ref="187301323"/>
<reference ref="244975730"/>
</array>
<boolean value="NO" key="690.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="690.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1742,15 +1743,15 @@
<boolean value="NO" key="732.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="732.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="733.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="736.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="741.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="743.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="774.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">745</int>
<int key="maxID">778</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1776,6 +1777,7 @@
<string key="filterTitleButton">NSButton</string>
<string key="filterURLButton">NSButton</string>
<string key="filterUsernameButton">NSButton</string>
<string key="readOnlyImageView">NSImageView</string>
<string key="tableToTop">NSLayoutConstraint</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -1819,6 +1821,10 @@
<string key="name">filterUsernameButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="readOnlyImageView">
<string key="name">readOnlyImageView</string>
<string key="candidateClassName">NSImageView</string>
</object>
<object class="IBToOneOutletInfo" key="tableToTop">
<string key="name">tableToTop</string>
<string key="candidateClassName">NSLayoutConstraint</string>

View File

@@ -123,6 +123,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
else {
[[NSFileManager defaultManager] createFileAtPath:[_lockFileURL path] contents:nil attributes:nil];
_didLockFile = YES;
self.readOnly = NO;
}
self.decrypted = NO;
return YES;
@@ -146,11 +147,6 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
[super close];
}
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)anItem {
NSLog(@"Validating %@", anItem);
return YES;
}
#pragma mark Protection
- (BOOL)decryptWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL {

View File

@@ -181,9 +181,8 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
}
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
NSLog(@"Validate ToolbarItem: %@", theItem);
MPDocument *document = [self document];
if(document.isLocked) {
if(document.isLocked || document.isReadOnly) {
return NO;
}
SEL itemAction = [theItem action];

View File

@@ -124,6 +124,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
- (void)didLoadView {
[self.view setWantsLayer:YES];
[self _hideFilterBarAnimated:NO];
[_bottomBar setBorderType:HNHBorderTop];
[self.addEntryButton setAction:[MPActionHelper actionOfType:MPActionAddEntry]];

View File

@@ -48,7 +48,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1224</string>
<string>1244</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>