From 5057470adbfe43b44a99fb65038eed83a0727ae5 Mon Sep 17 00:00:00 2001 From: Qiu Yuzhou Date: Sun, 8 Sep 2019 15:28:45 +0800 Subject: [PATCH] Add a `Open plugins folder` button on server profile window. --- .../PreferencesWindowController.xib | 329 +++++++++--------- .../PreferencesWindowController.swift | 6 + .../PreferencesWindowController.strings | 36 -- .../PreferencesWindowController.strings | 3 + 4 files changed, 183 insertions(+), 191 deletions(-) delete mode 100644 ShadowsocksX-NG/en.lproj/PreferencesWindowController.strings diff --git a/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib b/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib index 04bc87b..5bff36a 100644 --- a/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib +++ b/ShadowsocksX-NG/Base.lproj/PreferencesWindowController.xib @@ -1,8 +1,8 @@ - + - + @@ -29,20 +29,20 @@ - + - + - + - + - + @@ -89,13 +89,13 @@ - + - + - + @@ -103,9 +103,9 @@ - + - + @@ -114,7 +114,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -130,7 +130,10 @@ - + + + + @@ -138,23 +141,15 @@ - + - - - - - - - - - + @@ -162,7 +157,7 @@ - + @@ -170,9 +165,9 @@ - + - + @@ -187,7 +182,7 @@ - + @@ -208,10 +203,10 @@ - - - - + + + + @@ -230,16 +225,16 @@ - - - + + + - + - - - - - - - - - + @@ -273,7 +260,7 @@ + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + diff --git a/ShadowsocksX-NG/PreferencesWindowController.swift b/ShadowsocksX-NG/PreferencesWindowController.swift index f426446..0da23f1 100644 --- a/ShadowsocksX-NG/PreferencesWindowController.swift +++ b/ShadowsocksX-NG/PreferencesWindowController.swift @@ -169,6 +169,12 @@ class PreferencesWindowController: NSWindowController NSWorkspace.shared.open(url!) } + @IBAction func openPluginFolder(_ sender: Any) { + let folderPath = NSHomeDirectory() + APP_SUPPORT_DIR + "plugins/" + let url = URL(fileURLWithPath: folderPath, isDirectory: true) + NSWorkspace.shared.open(url) + } + @IBAction func copyCurrentProfileURL2Pasteboard(_ sender: NSButton) { let index = profilesTableView.selectedRow if index >= 0 { diff --git a/ShadowsocksX-NG/en.lproj/PreferencesWindowController.strings b/ShadowsocksX-NG/en.lproj/PreferencesWindowController.strings deleted file mode 100644 index 75e163e..0000000 --- a/ShadowsocksX-NG/en.lproj/PreferencesWindowController.strings +++ /dev/null @@ -1,36 +0,0 @@ - -/* Class = "NSTextFieldCell"; title = "Text"; ObjectID = "COZ-Qr-bmU"; */ -"COZ-Qr-bmU.title" = "Text"; - -/* Class = "NSWindow"; title = "Server Preferences"; ObjectID = "F0z-JX-Cv5"; */ -"F0z-JX-Cv5.title" = "Server Preferences"; - -/* Class = "NSBox"; title = "Box"; ObjectID = "Gqv-5O-Wwf"; */ -"Gqv-5O-Wwf.title" = "Box"; - -/* Class = "NSTextFieldCell"; title = ":"; ObjectID = "Ibr-Gs-5Js"; */ -"Ibr-Gs-5Js.title" = ":"; - -/* Class = "NSTextFieldCell"; title = "Remarks:"; ObjectID = "MiN-VE-FtC"; */ -"MiN-VE-FtC.title" = "Remarks:"; - -/* Class = "NSButtonCell"; title = "Enable OTA"; ObjectID = "hRZ-Rp-I5e"; */ -"hRZ-Rp-I5e.title" = "Enable OTA"; - -/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "j03-9E-uHW"; */ -"j03-9E-uHW.title" = "Cancel"; - -/* Class = "NSTextFieldCell"; title = "Password:"; ObjectID = "kil-xC-HPD"; */ -"kil-xC-HPD.title" = "Password:"; - -/* Class = "NSTextFieldCell"; title = "Encryption:"; ObjectID = "mOh-nD-7EX"; */ -"mOh-nD-7EX.title" = "Encryption:"; - -/* Class = "NSButtonCell"; title = "Copy URL to Clipboard"; ObjectID = "t3T-Kd-5La"; */ -"t3T-Kd-5La.title" = "Copy URL to Clipboard"; - -/* Class = "NSTextFieldCell"; title = "Address:"; ObjectID = "yHs-XE-XEB"; */ -"yHs-XE-XEB.title" = "Address:"; - -/* Class = "NSButtonCell"; title = "OK"; ObjectID = "zPE-oD-PwK"; */ -"zPE-oD-PwK.title" = "OK"; diff --git a/ShadowsocksX-NG/zh-Hans.lproj/PreferencesWindowController.strings b/ShadowsocksX-NG/zh-Hans.lproj/PreferencesWindowController.strings index c3ee3a4..c3ef9a8 100644 --- a/ShadowsocksX-NG/zh-Hans.lproj/PreferencesWindowController.strings +++ b/ShadowsocksX-NG/zh-Hans.lproj/PreferencesWindowController.strings @@ -43,3 +43,6 @@ /* Class = "NSTextFieldCell"; title = "Plugin Opts:"; ObjectID = "orT-7j-dxE"; */ "orT-7j-dxE.title" = "插件选项:"; + +/* Class = "NSButtonCell"; title = "Open Plugin Folder..."; ObjectID = "T8q-g1-qjN"; */ +"T8q-g1-qjN.title" = "打开插件目录...";