AppDelegate // Implement the Uninstallation feature.
This commit is contained in:
parent
993c8fc22b
commit
1a43644cc8
|
@ -276,8 +276,18 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func selfUninstall() {
|
||||||
|
self.currentAlertType = "Uninstall"
|
||||||
|
let content = String(format: NSLocalizedString("This will remove vChewing Input Method from this user account, requiring your confirmation.", comment: ""))
|
||||||
|
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("Uninstallation", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("OK", comment: ""), cancelButtonTitle: NSLocalizedString("Not Now", comment: ""), cancelAsDefault: false, delegate: self)
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
|
}
|
||||||
|
|
||||||
func ctlNonModalAlertWindowDidConfirm(_ controller: ctlNonModalAlertWindow) {
|
func ctlNonModalAlertWindowDidConfirm(_ controller: ctlNonModalAlertWindow) {
|
||||||
switch self.currentAlertType {
|
switch self.currentAlertType {
|
||||||
|
case "Uninstall":
|
||||||
|
NSWorkspace.shared.openFile(mgrLangModel.dataFolderPath(isDefaultFolder: true), withApplication: "Finder")
|
||||||
|
IME.uninstall(isSudo: false, selfKill: true)
|
||||||
case "Update":
|
case "Update":
|
||||||
if let updateNextStepURL = self.updateNextStepURL {
|
if let updateNextStepURL = self.updateNextStepURL {
|
||||||
NSWorkspace.shared.open(updateNextStepURL)
|
NSWorkspace.shared.open(updateNextStepURL)
|
||||||
|
|
Loading…
Reference in New Issue