diff --git a/ShadowsocksX-NG.xcodeproj/project.pbxproj b/ShadowsocksX-NG.xcodeproj/project.pbxproj index 8b4850a..2eef0df 100755 --- a/ShadowsocksX-NG.xcodeproj/project.pbxproj +++ b/ShadowsocksX-NG.xcodeproj/project.pbxproj @@ -18,6 +18,8 @@ 9B0BFFEB1D0460A70040E62B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9B0BFFEA1D0460A70040E62B /* Assets.xcassets */; }; 9B0BFFEE1D0460A70040E62B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9B0BFFEC1D0460A70040E62B /* MainMenu.xib */; }; 9B0BFFF91D0460A70040E62B /* ShadowsocksX_NGTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0BFFF81D0460A70040E62B /* ShadowsocksX_NGTests.swift */; }; + 9B16E59A1F99FD0700E54DC5 /* icons8-Eye Filled-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B16E5971F99FD0700E54DC5 /* icons8-Eye Filled-50.png */; }; + 9B16E59B1F99FD0700E54DC5 /* icons8-Blind Filled-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B16E5991F99FD0700E54DC5 /* icons8-Blind Filled-50.png */; }; 9B2491B41D0ACC3A003BBECC /* PreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9B2491B61D0ACC3A003BBECC /* PreferencesWindowController.xib */; }; 9B3546721E802B1200B510B4 /* ToastWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B3546701E802B1200B510B4 /* ToastWindowController.swift */; }; 9B3546731E802B1200B510B4 /* ToastWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9B3546711E802B1200B510B4 /* ToastWindowController.xib */; }; @@ -155,6 +157,8 @@ 9B0BFFF41D0460A70040E62B /* ShadowsocksX-NGTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ShadowsocksX-NGTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 9B0BFFF81D0460A70040E62B /* ShadowsocksX_NGTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShadowsocksX_NGTests.swift; sourceTree = ""; }; 9B0BFFFA1D0460A70040E62B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9B16E5971F99FD0700E54DC5 /* icons8-Eye Filled-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icons8-Eye Filled-50.png"; sourceTree = ""; }; + 9B16E5991F99FD0700E54DC5 /* icons8-Blind Filled-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icons8-Blind Filled-50.png"; sourceTree = ""; }; 9B172A601D0ADA5B00B87B9A /* genstrings.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = genstrings.py; sourceTree = ""; }; 9B172A6B1D0ADDDD00B87B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 9B172A6D1D0ADDE800B87B9A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; @@ -288,6 +292,8 @@ 9B07EFB01D048E900052D9DF /* Support Files */ = { isa = PBXGroup; children = ( + 9B16E5991F99FD0700E54DC5 /* icons8-Blind Filled-50.png */, + 9B16E5971F99FD0700E54DC5 /* icons8-Eye Filled-50.png */, 9B938D931E864B38005F5636 /* menu_g_icon.png */, 9B938D941E864B38005F5636 /* menu_g_icon@2x.png */, 9B938D951E864B38005F5636 /* menu_m_icon.png */, @@ -602,6 +608,7 @@ C8E42A6E1D4F2CAF0074C7EA /* UserRulesController.xib in Resources */, 9BEEF06A1D04D4D500FC52B3 /* start_ss_local.sh in Resources */, 9B5832111E742632009D5B7D /* kcptun_1.png in Resources */, + 9B16E59A1F99FD0700E54DC5 /* icons8-Eye Filled-50.png in Resources */, 9B938D9C1E864B38005F5636 /* menu_m_icon@2x.png in Resources */, 9B3546731E802B1200B510B4 /* ToastWindowController.xib in Resources */, C6D429941DA75988002A5711 /* privoxy in Resources */, @@ -619,6 +626,7 @@ C6D429931DA75988002A5711 /* install_privoxy.sh in Resources */, 9B58320B1E7422DB009D5B7D /* http.png in Resources */, 9BC70EDC1D2E3E3100EDA4CA /* Localizable.strings in Resources */, + 9B16E59B1F99FD0700E54DC5 /* icons8-Blind Filled-50.png in Resources */, 9B0BFFEE1D0460A70040E62B /* MainMenu.xib in Resources */, 9B3FFF4C1D09D8F70019A709 /* install_helper.sh in Resources */, C6D429961DA75988002A5711 /* start_privoxy.sh in Resources */, diff --git a/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib b/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib index ace1a31..b8940d8 100644 --- a/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib +++ b/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib @@ -1,8 +1,8 @@ - + - + @@ -23,12 +23,15 @@ - + + + + @@ -37,19 +40,19 @@ - + - + - + - + @@ -96,23 +99,23 @@ - + - + - - + + - - + + - + @@ -120,59 +123,40 @@ - - + + - - + + - - - - - - - - NSAllRomanInputSourcesLocaleIdentifier - - - - - - - - - - - - - + + - - + + - - + + @@ -180,37 +164,37 @@ - + - + - + - - + + - + @@ -218,8 +202,8 @@ - - + + @@ -229,7 +213,7 @@ - + @@ -244,7 +228,7 @@ - + @@ -252,16 +236,16 @@ - - + + - - + + @@ -274,7 +258,7 @@ - + @@ -288,7 +272,7 @@ - + @@ -299,7 +283,7 @@ - + @@ -307,7 +291,7 @@ - + @@ -324,15 +308,15 @@ - - + + - + @@ -340,7 +324,7 @@ - + @@ -348,15 +332,15 @@ - - + + - + @@ -416,8 +400,8 @@ - - + + @@ -430,54 +414,125 @@ + + + + + + + + + + + + + + + + + NSAllRomanInputSourcesLocaleIdentifier + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -600,5 +656,6 @@ Gw + diff --git a/ShadowsocksX-NG/PreferencesWindowController.swift b/ShadowsocksX-NG/PreferencesWindowController.swift index 883af37..b9a5ecf 100644 --- a/ShadowsocksX-NG/PreferencesWindowController.swift +++ b/ShadowsocksX-NG/PreferencesWindowController.swift @@ -23,7 +23,11 @@ class PreferencesWindowController: NSWindowController @IBOutlet weak var kcptunPortTextField: NSTextField! @IBOutlet weak var methodTextField: NSComboBox! + @IBOutlet weak var passwordTabView: NSTabView! @IBOutlet weak var passwordTextField: NSTextField! + @IBOutlet weak var passwordSecureTextField: NSSecureTextField! + @IBOutlet weak var togglePasswordVisibleButton: NSButton! + @IBOutlet weak var remarkTextField: NSTextField! @IBOutlet weak var otaCheckBoxBtn: NSButton! @@ -188,6 +192,16 @@ class PreferencesWindowController: NSWindowController updateProfileBoxVisible() } + @IBAction func togglePasswordVisible(_ sender: Any) { + if passwordTabView.selectedTabViewItem?.identifier as! String == "secure" { + passwordTabView.selectTabViewItem(withIdentifier: "insecure") + togglePasswordVisibleButton.image = NSImage(named: "icons8-Eye Filled-50") + } else { + passwordTabView.selectTabViewItem(withIdentifier: "secure") + togglePasswordVisibleButton.image = NSImage(named: "icons8-Blind Filled-50") + } + } + @IBAction func copyCurrentProfileURL2Pasteboard(_ sender: NSButton) { let index = profilesTableView.selectedRow if index >= 0 { @@ -248,6 +262,8 @@ class PreferencesWindowController: NSWindowController , options: [NSContinuouslyUpdatesValueBindingOption: true]) passwordTextField.bind("value", to: editingProfile, withKeyPath: "password" , options: [NSContinuouslyUpdatesValueBindingOption: true]) + passwordSecureTextField.bind("value", to: editingProfile, withKeyPath: "password" + , options: [NSContinuouslyUpdatesValueBindingOption: true]) remarkTextField.bind("value", to: editingProfile, withKeyPath: "remark" , options: [NSContinuouslyUpdatesValueBindingOption: true]) diff --git a/ShadowsocksX-NG/icons8-Blind Filled-50.png b/ShadowsocksX-NG/icons8-Blind Filled-50.png new file mode 100644 index 0000000..287b38c Binary files /dev/null and b/ShadowsocksX-NG/icons8-Blind Filled-50.png differ diff --git a/ShadowsocksX-NG/icons8-Eye Filled-50.png b/ShadowsocksX-NG/icons8-Eye Filled-50.png new file mode 100644 index 0000000..5c1442c Binary files /dev/null and b/ShadowsocksX-NG/icons8-Eye Filled-50.png differ