mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-02 09:33:49 +03:00
Protect from accidental quitting with alert
This commit is contained in:
parent
8430084163
commit
c754187819
@ -92,8 +92,16 @@ class Agent: NSObject {
|
||||
}()
|
||||
|
||||
@objc private func didSelectQuitMenuItem() {
|
||||
// TODO: show alert
|
||||
NSApp.terminate(nil)
|
||||
Window.activateWindow(nil)
|
||||
let alert = NSAlert()
|
||||
alert.messageText = "Quit Encrypted Ink?"
|
||||
alert.informativeText = "It will not be able to show sign requests."
|
||||
alert.alertStyle = .warning
|
||||
alert.addButton(withTitle: "OK")
|
||||
alert.addButton(withTitle: "Cancel")
|
||||
if alert.runModal() == .alertFirstButtonReturn {
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
}
|
||||
|
||||
func setupStatusBarItem() {
|
||||
|
Loading…
Reference in New Issue
Block a user