In some situation, use toast instead of system user notifications.
This commit is contained in:
@ -262,12 +262,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
} else {
|
} else {
|
||||||
errMsg = "No current server profile.".localized
|
errMsg = "No current server profile.".localized
|
||||||
}
|
}
|
||||||
let userNote = NSUserNotification()
|
if let msg = errMsg {
|
||||||
userNote.title = errMsg
|
self.makeToast(msg)
|
||||||
userNote.soundName = NSUserNotificationDefaultSoundName
|
}
|
||||||
|
|
||||||
NSUserNotificationCenter.default
|
|
||||||
.deliver(userNote);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func scanQRCodeFromScreen(_ sender: NSMenuItem) {
|
@IBAction func scanQRCodeFromScreen(_ sender: NSMenuItem) {
|
||||||
@ -358,11 +355,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
NSPasteboard.general().clearContents()
|
NSPasteboard.general().clearContents()
|
||||||
NSPasteboard.general().setString(command, forType: NSStringPboardType)
|
NSPasteboard.general().setString(command, forType: NSStringPboardType)
|
||||||
|
|
||||||
// Give a system notification.
|
// Show a toast notification.
|
||||||
let notification = NSUserNotification()
|
self.makeToast("Export Command Copied.".localized)
|
||||||
notification.title = "Export Command Copied.".localized
|
|
||||||
NSUserNotificationCenter.default
|
|
||||||
.deliver(notification)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func showLogs(_ sender: NSMenuItem) {
|
@IBAction func showLogs(_ sender: NSMenuItem) {
|
||||||
|
Reference in New Issue
Block a user