notificationDaemon: separate out GtkNotification creation
This way, source subclasses can easily use a notification subclass if different functionality is required. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/258
This commit is contained in:
parent
ca3f4cfb41
commit
80a7547129
@ -660,6 +660,10 @@ var GtkNotificationDaemonAppSource = new Lang.Class({
|
|||||||
return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback);
|
return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_createNotification(params) {
|
||||||
|
return new GtkNotificationDaemonNotification(this, params);
|
||||||
|
},
|
||||||
|
|
||||||
activateAction(actionId, target) {
|
activateAction(actionId, target) {
|
||||||
this._createApp((app, error) => {
|
this._createApp((app, error) => {
|
||||||
if (error == null)
|
if (error == null)
|
||||||
@ -688,7 +692,7 @@ var GtkNotificationDaemonAppSource = new Lang.Class({
|
|||||||
if (this._notifications[notificationId])
|
if (this._notifications[notificationId])
|
||||||
this._notifications[notificationId].destroy();
|
this._notifications[notificationId].destroy();
|
||||||
|
|
||||||
let notification = new GtkNotificationDaemonNotification(this, notificationParams);
|
let notification = this._createNotification(notificationParams);
|
||||||
notification.connect('destroy', () => {
|
notification.connect('destroy', () => {
|
||||||
delete this._notifications[notificationId];
|
delete this._notifications[notificationId];
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user