messageTray: Make addButton/addAction take a callback

This is a much simpler API for consumers to manage.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
This commit is contained in:
Jasper St. Pierre
2013-10-13 23:06:09 -04:00
parent 5f081b8f8d
commit 43f4682ec4
5 changed files with 99 additions and 137 deletions

View File

@ -78,10 +78,8 @@ const ShellInfo = new Lang.Class({
}
this._undoCallback = undoCallback;
if (undoCallback) {
notification.addAction('system-undo', _("Undo"));
notification.connect('action-invoked', Lang.bind(this, this._onUndoClicked));
}
if (undoCallback)
notification.addAction(_("Undo"), Lang.bind(this, this._onUndoClicked));
this._source.notify(notification);
}