Add policy for builtin message sources
Some notifications, despite being emitted by shell code, should appear to be from application or "separable" system components. Do that by associating them with a notification-daemon policy. Note that for this to look really good, empathy should rename itself to Chat. https://bugzilla.gnome.org/show_bug.cgi?id=685926
This commit is contained in:
parent
8cb3884fae
commit
9794e71a86
@ -13,6 +13,7 @@ const Tp = imports.gi.TelepathyGLib;
|
|||||||
const History = imports.misc.history;
|
const History = imports.misc.history;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
|
|
||||||
@ -415,6 +416,8 @@ const TelepathyClient = new Lang.Class({
|
|||||||
_ensureAppSource: function() {
|
_ensureAppSource: function() {
|
||||||
if (this._appSource == null) {
|
if (this._appSource == null) {
|
||||||
this._appSource = new MessageTray.Source(_("Chat"), 'empathy');
|
this._appSource = new MessageTray.Source(_("Chat"), 'empathy');
|
||||||
|
this._appSource.policy = new NotificationDaemon.NotificationApplicationPolicy('empathy');
|
||||||
|
|
||||||
Main.messageTray.add(this._appSource);
|
Main.messageTray.add(this._appSource);
|
||||||
this._appSource.connect('destroy', Lang.bind(this, function () {
|
this._appSource.connect('destroy', Lang.bind(this, function () {
|
||||||
this._appSource = null;
|
this._appSource = null;
|
||||||
@ -484,6 +487,10 @@ const ChatSource = new Lang.Class({
|
|||||||
return rightClickMenu;
|
return rightClickMenu;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_createPolicy: function() {
|
||||||
|
return new NotificationDaemon.NotificationApplicationPolicy('empathy');
|
||||||
|
},
|
||||||
|
|
||||||
_updateAlias: function() {
|
_updateAlias: function() {
|
||||||
let oldAlias = this.title;
|
let oldAlias = this.title;
|
||||||
let newAlias = this._contact.get_alias();
|
let newAlias = this._contact.get_alias();
|
||||||
@ -1048,6 +1055,10 @@ const ApproverSource = new Lang.Class({
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_createPolicy: function() {
|
||||||
|
return new NotificationDaemon.NotificationApplicationPolicy('empathy');
|
||||||
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
if (this._invalidId != 0) {
|
if (this._invalidId != 0) {
|
||||||
this._dispatchOp.disconnect(this._invalidId);
|
this._dispatchOp.disconnect(this._invalidId);
|
||||||
|
@ -9,6 +9,7 @@ const St = imports.gi.St;
|
|||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||||
const PanelMenu = imports.ui.panelMenu;
|
const PanelMenu = imports.ui.panelMenu;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
|
|
||||||
@ -286,6 +287,7 @@ const Indicator = new Lang.Class({
|
|||||||
_ensureSource: function() {
|
_ensureSource: function() {
|
||||||
if (!this._source) {
|
if (!this._source) {
|
||||||
this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active');
|
this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active');
|
||||||
|
this._source.policy = new NotificationDaemon.NotificationApplicationPolicy('gnome-bluetooth-panel');
|
||||||
Main.messageTray.add(this._source);
|
Main.messageTray.add(this._source);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -20,6 +20,7 @@ const Main = imports.ui.main;
|
|||||||
const PanelMenu = imports.ui.panelMenu;
|
const PanelMenu = imports.ui.panelMenu;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||||
const ModemManager = imports.misc.modemManager;
|
const ModemManager = imports.misc.modemManager;
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
@ -1783,6 +1784,7 @@ const NMApplet = new Lang.Class({
|
|||||||
if (!this._source) {
|
if (!this._source) {
|
||||||
this._source = new MessageTray.Source(_("Network Manager"),
|
this._source = new MessageTray.Source(_("Network Manager"),
|
||||||
'network-transmit-receive');
|
'network-transmit-receive');
|
||||||
|
this._source.policy = new NotificationDaemon.NotificationApplicationPolicy('gnome-network-panel');
|
||||||
|
|
||||||
this._source.connect('destroy', Lang.bind(this, function() {
|
this._source.connect('destroy', Lang.bind(this, function() {
|
||||||
this._source = null;
|
this._source = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user