Merge pull request #134 from cseng/master

Some bug fixes and enhancements
This commit is contained in:
Michael Starke
2014-01-03 11:05:14 -08:00
10 changed files with 115 additions and 26 deletions

View File

@@ -475,9 +475,9 @@
4C52A88C1788628B00868229 /* 13_KeysTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 13_KeysTemplate.pdf; sourceTree = "<group>"; };
4C52A88D1788628B00868229 /* 18_DisplayTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 18_DisplayTemplate.pdf; sourceTree = "<group>"; };
4C52A891178863B000868229 /* 68_PhoneTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 68_PhoneTemplate.pdf; sourceTree = "<group>"; };
4C53A7A81864C3A1000DFF0D /* de */ = {isa = PBXFileReference; lastKnownFileType = file; name = de; path = de.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C53A7A91864C3A2000DFF0D /* en */ = {isa = PBXFileReference; lastKnownFileType = file; name = en; path = en.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C53A7AA1864C3A2000DFF0D /* fr */ = {isa = PBXFileReference; lastKnownFileType = file; name = fr; path = fr.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C53A7A81864C3A1000DFF0D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C53A7A91864C3A2000DFF0D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C53A7AA1864C3A2000DFF0D /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/KPKLocalizeable.strings; sourceTree = "<group>"; };
4C5426F217BEEA8700A4424C /* Autotype_test.kdbx */ = {isa = PBXFileReference; lastKnownFileType = file; name = Autotype_test.kdbx; path = Databases/Autotype_test.kdbx; sourceTree = "<group>"; };
4C569D9C17652AC800595B62 /* MPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPConstants.h; sourceTree = "<group>"; };
4C569D9D17652B0600595B62 /* MPConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPConstants.m; sourceTree = "<group>"; };
@@ -2306,7 +2306,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch";
@@ -2322,7 +2322,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch";

View File

@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1080</int>
<string key="IBDocument.SystemVersion">13A603</string>
<string key="IBDocument.SystemVersion">13B42</string>
<string key="IBDocument.InterfaceBuilderVersion">4514</string>
<string key="IBDocument.AppKitVersion">1265</string>
<string key="IBDocument.HIToolboxVersion">695.00</string>
<string key="IBDocument.HIToolboxVersion">696.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">4514</string>
@@ -328,6 +328,14 @@
</object>
<int key="connectionID">3122</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">handleEditButtonClickEvent:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="348505851"/>
</object>
<int key="connectionID">3125</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -988,7 +996,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">3123</int>
<int key="maxID">3125</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1003,17 +1011,20 @@
<object class="IBPartialClassDescription">
<string key="className">MPInspectorViewController</string>
<string key="superclassName">MPViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showImagePopup:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showImagePopup:</string>
<object class="IBActionInfo" key="NS.object.0">
<dictionary class="NSMutableDictionary" key="actions">
<string key="handleEditButtonClickEvent:">id</string>
<string key="showImagePopup:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="handleEditButtonClickEvent:">
<string key="name">handleEditButtonClickEvent:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="showImagePopup:">
<string key="name">showImagePopup:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="bottomBar">HNHGradientView</string>
<string key="createdTextField">NSTextField</string>

View File

@@ -354,18 +354,18 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) {
options:0
metrics:nil
views:views]];
/* Restore the State the inspector view was in before the view change */
if(removeInspector) {
[inspectorView removeFromSuperview];
}
[contentView layoutSubtreeIfNeeded];
[_entryViewController updateResponderChain];
[_inspectorViewController updateResponderChain];
[_outlineViewController updateResponderChain];
/* Custom setup after being added to window */
[_inspectorViewController prepareView];
[_outlineViewController showOutline];
/* Restore the State the inspector view was in before the view change */
if(removeInspector) {
[inspectorView removeFromSuperview];
}
[contentView layoutSubtreeIfNeeded];
}
#pragma mark Validation

View File

@@ -44,6 +44,7 @@
- (IBAction)addCustomField:(id)sender;
- (IBAction)removeCustomField:(id)sender;
- (void)beginEditing;
- (void)endEditing;
@end

View File

@@ -184,6 +184,39 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
[self.entry removeBinary:binary];
}
// CS: could there be a better way?
- (void)beginEditing
{
NSLog(@"beganEditing:");
_titleTextField.editable = YES;
_usernameTextField.editable = YES;
_URLTextField.editable = YES;
_passwordTextField.editable = YES;
_createdTextField.editable = YES;
_modifiedTextField.editable = YES;
_notesTextView.editable = YES;
}
// CS: could there be a better way?
- (void)endEditing
{
NSLog(@"endEditing");
_titleTextField.editable = NO;
_usernameTextField.editable = NO;
_URLTextField.editable = NO;
_passwordTextField.editable = NO;
_createdTextField.editable = NO;
_modifiedTextField.editable = NO;
_notesTextView.editable = NO;
}
#pragma mark -
#pragma mark Popovers

View File

@@ -469,6 +469,23 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
if(![document validateMenuItem:menuItem]) {
return NO;
}
// CS: don't know how to iterate through KPKEntry properties to check for blanks so just check the declared properties
KPKEntry *targetEntry = [self _clickedOrSelectedEntry];
MPActionType actionType = [MPActionHelper typeForAction:[menuItem action]];
if (([[targetEntry username] length] == 0) && (actionType == MPActionCopyUsername)) {
return NO;
}
if (([[targetEntry password] length] == 0) && (actionType == MPActionCopyPassword)) {
return NO;
}
if (([[targetEntry url] length] == 0) && (actionType == MPActionCopyURL || actionType == MPActionOpenURL)) {
return NO;
}
return YES;
/* TODO handle _clickedOrSlectedEnty */
}

View File

@@ -22,6 +22,7 @@
@property (weak) IBOutlet NSButton *editButton;
- (IBAction)showImagePopup:(id)sender;
- (IBAction)handleEditButtonClickEvent:(id)sender;
/* Seperate call to ensure alle registered objects are in place */
- (void)setupNotifications:(NSWindowController *)windowController;

View File

@@ -156,6 +156,28 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
}
#pragma mark -
#pragma mark Click Edit Button
// button title can be used as a status indicator
- (IBAction)handleEditButtonClickEvent:(id)sender
{
NSString *buttonTitle;
buttonTitle = self.editButton.title;
if ([buttonTitle isEqualToString:@"Edit"]) {
NSLog(@"begin editing");
[_entryViewController beginEditing];
self.editButton.title = @"Done";
}
else if ([buttonTitle isEqualToString:@"Done"]) {
NSLog(@"finished editing");
[_entryViewController endEditing];
self.editButton.title = @"Edit";
}
}
#pragma mark -
#pragma mark Popup
- (IBAction)showImagePopup:(id)sender {
@@ -246,5 +268,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
}
}
[self _updateItemBindings:document.selectedItem];
// disable the entry text fields whenever the entry selection changes
[_entryViewController endEditing];
self.editButton.title = @"Edit";
}
@end

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="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment defaultVersion="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
@@ -15,7 +15,7 @@
<window title="Welcome" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<rect key="contentRect" x="196" y="240" width="448" height="255"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="448" height="255"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>