UseAlphaCore warning.

This commit is contained in:
mrFq1 2022-07-31 10:31:33 +08:00
parent 2aa3e5ca1e
commit 1454197d67
1 changed files with 16 additions and 0 deletions

View File

@ -1089,6 +1089,22 @@ extension AppDelegate {
}
@IBAction func useAlphaMeta(_ sender: NSMenuItem) {
if UserDefaults.standard.object(forKey: "useAlphaCore") as? Bool == nil {
let alert = NSAlert()
alert.messageText = """
If you don't know what you're doing, never turn this switch on.
, .
Running Meta Core without any authentication under sudo privileges can have devastating consequences.
sudo Meta , .
"""
alert.alertStyle = .warning
alert.addButton(withTitle: NSLocalizedString("Continue", comment: ""))
alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
if alert.runModal() != .alertFirstButtonReturn {
return
}
}
let use = sender.state != .on
MenuItemFactory.useAlphaCore = use
sender.state = use ? .on : .off