From d776d1d8a0bfbfaf625910ce0c5e9deb94f0469b Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 24 Aug 2016 11:46:50 +0200 Subject: [PATCH] Using custom NSNumberFormatter to prevent errors on validation. --- MacPass.xcodeproj/project.pbxproj | 6 ++ MacPass/Base.lproj/PasswordCreatorView.xib | 93 +++++++++++----------- MacPass/Base.lproj/PasswordInputView.xib | 14 +--- MacPass/MPEntryInspectorViewController.m | 13 +-- MacPass/MPNumberFormatter.h | 16 ++++ MacPass/MPNumberFormatter.m | 33 ++++++++ 6 files changed, 105 insertions(+), 70 deletions(-) create mode 100644 MacPass/MPNumberFormatter.h create mode 100644 MacPass/MPNumberFormatter.m diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index a3efbc8a..b3649612 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -130,6 +130,7 @@ 4C63B8FB17A3154D0091BD72 /* MPContextToolbarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C63B8FA17A3154D0091BD72 /* MPContextToolbarButton.m */; }; 4C65C79C16DD283900E32CFF /* MPToolbarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C65C79B16DD283900E32CFF /* MPToolbarButton.m */; }; 4C65FAE916D16DDB006E0577 /* MPPasswordInputController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */; }; + 4C663D411D6D91A900CB6237 /* MPNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C663D401D6D91A900CB6237 /* MPNumberFormatter.m */; }; 4C6AEEF91A043E2B00CA2420 /* MPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6AEEF81A043E2B00CA2420 /* MPDocumentController.m */; }; 4C6AEF031A04400E00CA2420 /* OpenPanelAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C6AEF021A04400E00CA2420 /* OpenPanelAccessoryView.xib */; }; 4C6B7C7D18BE7EB0001D5D77 /* MPDocument+HistoryBrowsing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B7C7C18BE7EB0001D5D77 /* MPDocument+HistoryBrowsing.m */; }; @@ -469,6 +470,8 @@ 4C65C79B16DD283900E32CFF /* MPToolbarButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPToolbarButton.m; sourceTree = ""; }; 4C65FAE616D16DDB006E0577 /* MPPasswordInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordInputController.h; sourceTree = ""; }; 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordInputController.m; sourceTree = ""; }; + 4C663D3F1D6D91A900CB6237 /* MPNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNumberFormatter.h; sourceTree = ""; }; + 4C663D401D6D91A900CB6237 /* MPNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNumberFormatter.m; sourceTree = ""; }; 4C6AEEF71A043E2B00CA2420 /* MPDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDocumentController.h; sourceTree = ""; }; 4C6AEEF81A043E2B00CA2420 /* MPDocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocumentController.m; sourceTree = ""; }; 4C6AEF021A04400E00CA2420 /* OpenPanelAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OpenPanelAccessoryView.xib; sourceTree = ""; }; @@ -876,6 +879,8 @@ 4C569D9D17652B0600595B62 /* MPConstants.m */, 4CCEDE2C179F2122008402BE /* MPNotifications.h */, 4CCEDE2D179F213B008402BE /* MPNotifications.m */, + 4C663D3F1D6D91A900CB6237 /* MPNumberFormatter.h */, + 4C663D401D6D91A900CB6237 /* MPNumberFormatter.m */, ); name = Common; sourceTree = ""; @@ -1754,6 +1759,7 @@ 4CC0D2CE17974A47000B4BDA /* MPCustomFieldTableViewDelegate.m in Sources */, 4CC0D2D117974A5A000B4BDA /* MPAttachmentTableViewDelegate.m in Sources */, 4C26C33F18D8C92100CF1A1C /* MPTemporaryFileStorage.m in Sources */, + 4C663D411D6D91A900CB6237 /* MPNumberFormatter.m in Sources */, 4CD2B9061849424B0051B395 /* MPAutotypeContext.m in Sources */, 4CFB18E418A17FA20097A34B /* MPUpdateSettingsController.m in Sources */, 4C7B63771C0CB51F00D7038C /* TTTStringTransformers.m in Sources */, diff --git a/MacPass/Base.lproj/PasswordCreatorView.xib b/MacPass/Base.lproj/PasswordCreatorView.xib index 0c47adca..beade0ee 100644 --- a/MacPass/Base.lproj/PasswordCreatorView.xib +++ b/MacPass/Base.lproj/PasswordCreatorView.xib @@ -1,8 +1,8 @@ - + - + @@ -31,16 +31,16 @@ - - + + - - + + @@ -50,8 +50,8 @@ - - + + @@ -62,36 +62,34 @@ - - + + - + - - - + - - + + - + - - + + - - - - - - - - - - + + @@ -211,8 +209,8 @@ - - + + @@ -220,8 +218,11 @@ - - - @@ -46,7 +44,6 @@ DQ - @@ -57,12 +54,10 @@ DQ - - @@ -74,7 +69,6 @@ DQ - @@ -86,7 +80,6 @@ DQ