ctlIME // Implement the Uninstallation feature.

This commit is contained in:
ShikiSuen 2022-03-31 19:00:00 +08:00
parent 2960a4057e
commit 9bb9ef60f6
1 changed files with 6 additions and 1 deletions

View File

@ -136,9 +136,10 @@ class ctlInputMethod: IMKInputController {
if !optionKeyPressed {
menu.addItem(withTitle: NSLocalizedString("Check for Updates…", comment: ""), action: #selector(checkForUpdate(_:)), keyEquivalent: "")
}
menu.addItem(withTitle: NSLocalizedString("Reboot vChewing…", comment: ""), action: #selector(selfTerminate(_:)), keyEquivalent: "")
menu.addItem(withTitle: NSLocalizedString("About vChewing…", comment: ""), action: #selector(showAbout(_:)), keyEquivalent: "")
if optionKeyPressed {
menu.addItem(withTitle: NSLocalizedString("Reboot vChewing…", comment: ""), action: #selector(selfTerminate(_:)), keyEquivalent: "")
menu.addItem(withTitle: NSLocalizedString("Uninstall vChewing…", comment: ""), action: #selector(selfUninstall(_:)), keyEquivalent: "")
}
// NSMenu modified key
@ -273,6 +274,10 @@ class ctlInputMethod: IMKInputController {
NotifierController.notify(message: String(format: "%@%@%@", NSLocalizedString("Use Phrase Replacement", comment: ""), "\n", mgrPrefs.togglePhraseReplacementEnabled() ? NSLocalizedString("NotificationSwitchON", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")))
}
@objc func selfUninstall(_ sender: Any?) {
(NSApp.delegate as? AppDelegate)?.selfUninstall()
}
@objc func selfTerminate(_ sender: Any?) {
NSApp.terminate(nil)
}