diff --git a/ClashX/Base.lproj/Main.storyboard b/ClashX/Base.lproj/Main.storyboard index 1ff25e6..99d2aa7 100644 --- a/ClashX/Base.lproj/Main.storyboard +++ b/ClashX/Base.lproj/Main.storyboard @@ -1587,10 +1587,10 @@ - - + + - + @@ -1598,7 +1598,7 @@ - + + + + + + + + + + + + + - + + + diff --git a/ClashX/General/Managers/ICloudManager.swift b/ClashX/General/Managers/ICloudManager.swift index 97c6431..0505ef5 100644 --- a/ClashX/General/Managers/ICloudManager.swift +++ b/ClashX/General/Managers/ICloudManager.swift @@ -15,7 +15,7 @@ class ICloudManager { private let queue = DispatchQueue(label: "com.clashx.icloud") private var metaQuery: NSMetadataQuery? private var enableMenuItem: NSMenuItem? - private var icloudAvailable = false { + private(set) var icloudAvailable = false { didSet { useiCloud.accept(userEnableiCloud && icloudAvailable) } } private var disposeBag = DisposeBag() diff --git a/ClashX/Support Files/en.lproj/Localizable.strings b/ClashX/Support Files/en.lproj/Localizable.strings index b111297..83da592 100644 --- a/ClashX/Support Files/en.lproj/Localizable.strings +++ b/ClashX/Support Files/en.lproj/Localizable.strings @@ -88,6 +88,9 @@ /* No comment provided by engineer. */ "hours" = "hours"; +/* No comment provided by engineer. */ +"iCloud not available" = "iCloud not available"; + /* No comment provided by engineer. */ "If you can not find ClashX in the settings, you can try reset daemon" = "If you can not find ClashX in the settings, you can try reset daemon"; diff --git a/ClashX/Support Files/zh-Hans.lproj/Localizable.strings b/ClashX/Support Files/zh-Hans.lproj/Localizable.strings index cc21ccb..5de949f 100644 --- a/ClashX/Support Files/zh-Hans.lproj/Localizable.strings +++ b/ClashX/Support Files/zh-Hans.lproj/Localizable.strings @@ -88,6 +88,9 @@ /* No comment provided by engineer. */ "hours" = "小时"; +/* No comment provided by engineer. */ +"iCloud not available" = "iCloud 不可用"; + /* No comment provided by engineer. */ "If you can not find ClashX in the settings, you can try reset daemon" = "如果在设置里没找到ClashX,可以尝试重置守护程序"; diff --git a/ClashX/Support Files/zh-Hant.lproj/Localizable.strings b/ClashX/Support Files/zh-Hant.lproj/Localizable.strings index 99dc32c..3475f72 100644 --- a/ClashX/Support Files/zh-Hant.lproj/Localizable.strings +++ b/ClashX/Support Files/zh-Hant.lproj/Localizable.strings @@ -88,6 +88,9 @@ /* No comment provided by engineer. */ "hours" = "小時"; +/* No comment provided by engineer. */ +"iCloud not available" = "iCloud 不可用"; + /* No comment provided by engineer. */ "If you can not find ClashX in the settings, you can try reset daemon" = "如果在設定裡沒找到ClashX,可以嘗試重置守護程序"; diff --git a/ClashX/ViewControllers/Settings/DebugSettingViewController.swift b/ClashX/ViewControllers/Settings/DebugSettingViewController.swift index b87e067..2d528e2 100644 --- a/ClashX/ViewControllers/Settings/DebugSettingViewController.swift +++ b/ClashX/ViewControllers/Settings/DebugSettingViewController.swift @@ -25,4 +25,21 @@ class DebugSettingViewController: NSViewController { @IBAction func actionOpenLogFolder(_ sender: Any) { NSWorkspace.shared.openFile(Logger.shared.logFolder()) } + @IBAction func actionOpenLocalConfig(_ sender: Any) { + NSWorkspace.shared.openFile(kConfigFolderPath) + + + } + @IBAction func actionOpenIcloudConfig(_ sender: Any) { + if ICloudManager.shared.icloudAvailable { + ICloudManager.shared.getUrl { + url in + if let url = url { + NSWorkspace.shared.open(url) + } + } + } else { + NSAlert.alert(with: NSLocalizedString("iCloud not available", comment: "")) + } + } } diff --git a/ClashX/zh-Hans.lproj/Main.strings b/ClashX/zh-Hans.lproj/Main.strings index ff21bfd..cb7cabd 100644 --- a/ClashX/zh-Hans.lproj/Main.strings +++ b/ClashX/zh-Hans.lproj/Main.strings @@ -288,3 +288,12 @@ /* Class = "NSTextFieldCell"; title = "Api Secret:"; ObjectID = "ckH-Er-PfX"; */ "ckH-Er-PfX.title" = "Api秘钥"; + +/* Class = "NSButtonCell"; title = "iCloud"; ObjectID = "URV-fZ-bJf"; */ +"URV-fZ-bJf.title" = "iCloud"; + +/* Class = "NSButtonCell"; title = "Local"; ObjectID = "YF4-uZ-A0M"; */ +"YF4-uZ-A0M.title" = "本地"; + +/* Class = "NSTextFieldCell"; title = "Config Folder"; ObjectID = "ZA9-qc-wi4"; */ +"ZA9-qc-wi4.title" = "配置文件夹"; diff --git a/ClashX/zh-Hant.lproj/Main.strings b/ClashX/zh-Hant.lproj/Main.strings index e3356bf..4af9600 100644 --- a/ClashX/zh-Hant.lproj/Main.strings +++ b/ClashX/zh-Hant.lproj/Main.strings @@ -283,11 +283,17 @@ /* Class = "NSTextFieldCell"; title = "Core Version"; ObjectID = "zwo-q5-k5N"; */ "zwo-q5-k5N.title" = "核心版本"; -/* Class = "NSTextFieldCell"; title = "Proxy Helper"; ObjectID = "aSG-9A-eeG"; */ -"aSG-9A-eeG.title" = "代理程式"; - /* Class = "NSButtonCell"; title = "Override Config Setting"; ObjectID = "LW4-cA-3bB"; */ "LW4-cA-3bB.title" = "覆蓋配置文件設置"; /* Class = "NSTextFieldCell"; title = "Api Secret:"; ObjectID = "ckH-Er-PfX"; */ "ckH-Er-PfX.title" = "API 秘鑰"; + +/* Class = "NSButtonCell"; title = "iCloud"; ObjectID = "URV-fZ-bJf"; */ +"URV-fZ-bJf.title" = "iCloud"; + +/* Class = "NSButtonCell"; title = "Local"; ObjectID = "YF4-uZ-A0M"; */ +"YF4-uZ-A0M.title" = "本地"; + +/* Class = "NSTextFieldCell"; title = "Config Folder"; ObjectID = "ZA9-qc-wi4"; */ +"ZA9-qc-wi4.title" = "配置文件夾";