main: Add Main.notify() for simple system messages
... similar to Main.notifyError(), but don't duplicate the message on stderr/in the log. https://bugzilla.gnome.org/show_bug.cgi?id=652718
This commit is contained in:
parent
3dc07d48c5
commit
8bc85d4a79
@ -420,6 +420,19 @@ function loadTheme() {
|
||||
themeContext.set_theme (theme);
|
||||
}
|
||||
|
||||
/**
|
||||
* notify:
|
||||
* @msg: A message
|
||||
* @details: Additional information
|
||||
*/
|
||||
function notify(msg, details) {
|
||||
let source = new MessageTray.SystemNotificationSource();
|
||||
messageTray.add(source);
|
||||
let notification = new MessageTray.Notification(source, msg, details);
|
||||
notification.setTransient(true);
|
||||
source.notify(notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* notifyError:
|
||||
* @msg: An error message
|
||||
@ -434,11 +447,7 @@ function notifyError(msg, details) {
|
||||
else
|
||||
log("error: " + msg)
|
||||
|
||||
let source = new MessageTray.SystemNotificationSource();
|
||||
messageTray.add(source);
|
||||
let notification = new MessageTray.Notification(source, msg, details);
|
||||
notification.setTransient(true);
|
||||
source.notify(notification);
|
||||
notify(msg, details);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user