~ubuntu-branches/ubuntu/maverick/gnome-shell/maverick

« back to all changes in this revision

Viewing changes to js/ui/notificationDaemon.js

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2010-08-16 21:24:15 UTC
  • mfrom: (19.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100816212415-xg81p4jiw6quy6gq
Tags: 2.31.5-2ubuntu1
* Merge from debian experimental. Remaining changes:
  - debian/patches/04_workaround_libmozjs_build.patch:
    + workaround build issues due to libmozjs not being installed as a lib
* Drop debian/patches/01_favorite_apps.diff: Keep firefox as default browser

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
          replacement: '$2 <$1>' }
81
81
    ]
82
82
};
 
83
 
 
84
// The notification spec stipulates using formal names for the appName the applications
 
85
// pass in. However, not all applications do that. Here is a list of the offenders we
 
86
// encountered so far.
 
87
const appNameMap = {
 
88
    'evolution-mail-notification': 'Evolution Mail',
 
89
    'rhythmbox': 'Rhythmbox'
 
90
};
 
91
 
83
92
function NotificationDaemon() {
84
93
    this._init();
85
94
}
157
166
        // from this app or if all notifications from this app have
158
167
        // been acknowledged.
159
168
        if (source == null) {
160
 
            source = new Source(this._sourceId(appName), icon, hints);
 
169
            let title = appNameMap[appName] || appName;
 
170
            source = new Source(this._sourceId(appName), title, icon, hints);
161
171
            Main.messageTray.add(source);
162
172
 
163
173
            source.connect('clicked', Lang.bind(this,
235
245
            // 'body-images',
236
246
            'body-markup',
237
247
            // 'icon-multi',
238
 
            'icon-static'
 
248
            'icon-static',
239
249
            // 'sound',
 
250
            'x-gnome-icon-buttons'
240
251
        ];
241
252
    },
242
253
 
278
289
 
279
290
DBus.conformExport(NotificationDaemon.prototype, NotificationDaemonIface);
280
291
 
281
 
function Source(sourceId, icon, hints) {
282
 
    this._init(sourceId, icon, hints);
 
292
function Source(sourceId, title, icon, hints) {
 
293
    this._init(sourceId, title, icon, hints);
283
294
}
284
295
 
285
296
Source.prototype = {
286
297
    __proto__:  MessageTray.Source.prototype,
287
298
 
288
 
    _init: function(sourceId, icon, hints) {
289
 
        MessageTray.Source.prototype._init.call(this, sourceId);
 
299
    _init: function(sourceId, title, icon, hints) {
 
300
        MessageTray.Source.prototype._init.call(this, sourceId, title);
290
301
 
291
302
        this.app = null;
292
303
        this._openAppRequested = false;