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:
Florian Müllner 2011-07-28 20:06:24 +02:00
parent 3dc07d48c5
commit 8bc85d4a79

View File

@ -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);
}
/**