Permalink
Browse files

Removed messageTray and added the status icons back in the panel

  • Loading branch information...
1 parent d1733eb commit 5c2b928e6eb7e1dc84d1c4c2133ae96fd78e1e3e @glebihan glebihan committed Dec 14, 2011
View
@@ -321,7 +321,7 @@ AutorunResidentSource.prototype = {
this._notification.updateForMounts(this._mounts);
// add ourselves as a source, and push the notification
- if (!Main.messageTray.contains(this)) {
+ if (Main.messageTray && !Main.messageTray.contains(this)) {
Main.messageTray.add(this);
this.pushNotification(this._notification);
}
@@ -534,7 +534,7 @@ AutorunTransientSource.prototype = {
this._setSummaryIcon(this.createNotificationIcon());
// add ourselves as a source, and popup the notification
- Main.messageTray.add(this);
+ if (Main.messageTray) Main.messageTray.add(this);
this.notify(this._notification);
},
View
@@ -326,7 +326,7 @@ Keyboard.prototype = {
style_class: 'keyboard-key' });
trayButton.key_width = 1;
trayButton.connect('button-press-event', Lang.bind(this, function () {
- Main.messageTray.toggle();
+ if (Main.messageTray) Main.messageTray.toggle();
}));
Main.overview.connect('showing', Lang.bind(this, function () {
@@ -455,7 +455,7 @@ Keyboard.prototype = {
if (this._source == null) {
this._source = new KeyboardSource(this);
this._source.setTransient(true);
- Main.messageTray.add(this._source);
+ if (Main.messageTray) Main.messageTray.add(this._source);
}
},
View
@@ -267,7 +267,7 @@ LayoutManager.prototype = {
},
showKeyboard: function () {
- Main.messageTray.hide();
+ if (Main.messageTray) Main.messageTray.hide();
this.keyboardBox.raise_top();
Tweener.addTween(this.keyboardBox,
{ anchor_y: this.keyboardBox.height,
@@ -295,7 +295,7 @@ LayoutManager.prototype = {
},
hideKeyboard: function (immediate) {
- Main.messageTray.hide();
+ if (Main.messageTray) Main.messageTray.hide();
if (this._keyboardHeightNotifyId) {
this.keyboardBox.disconnect(this._keyboardHeightNotifyId);
this._keyboardHeightNotifyId = 0;
View
@@ -214,7 +214,7 @@ function start() {
statusIconDispatcher = new StatusIconDispatcher.StatusIconDispatcher();
panel = new Panel.Panel();
wm = new WindowManager.WindowManager();
- messageTray = new MessageTray.MessageTray();
+ //messageTray = new MessageTray.MessageTray();
keyboard = new Keyboard.Keyboard();
notificationDaemon = new NotificationDaemon.NotificationDaemon();
windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler();
@@ -232,7 +232,7 @@ function start() {
if (global.session_type == Shell.SessionType.USER)
_initUserSession();
- statusIconDispatcher.start(messageTray.actor);
+ statusIconDispatcher.start(panel.actor);
// Provide the bus object for gnome-session to
// initiate logouts.
@@ -480,7 +480,7 @@ function loadTheme() {
*/
function notify(msg, details) {
let source = new MessageTray.SystemNotificationSource();
- messageTray.add(source);
+ //messageTray.add(source);
let notification = new MessageTray.Notification(source, msg, details);
notification.setTransient(true);
source.notify(notification);
@@ -191,7 +191,7 @@ NotificationDaemon.prototype = {
}));
}
- Main.messageTray.add(source);
+ if (Main.messageTray) Main.messageTray.add(source);
return source;
},
View
@@ -72,7 +72,7 @@ ShellInfo.prototype = {
function() {
this._source = null;
}));
- Main.messageTray.add(this._source);
+ if (Main.messageTray) Main.messageTray.add(this._source);
}
let notification = null;
@@ -495,7 +495,7 @@ Overview.prototype = {
let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);
let contentY = Main.panel.actor.height;
- let contentHeight = primary.height - contentY - Main.messageTray.actor.height;
+ let contentHeight = primary.height - contentY - (Main.messageTray ? Main.messageTray.actor.height : 0);
this._group.set_position(primary.x, primary.y);
this._group.set_size(primary.width, primary.height);
@@ -253,7 +253,7 @@ ShellMountPasswordSource.prototype = {
this._notification = new ShellMountPasswordNotification(this, strings, icon, reaskPassword);
// add ourselves as a source, and popup the notification
- Main.messageTray.add(this);
+ if (Main.messageTray) Main.messageTray.add(this);
this.notify(this._notification);
},
}
@@ -312,7 +312,7 @@ Indicator.prototype = {
_ensureSource: function() {
if (!this._source) {
this._source = new Source();
- Main.messageTray.add(this._source);
+ if (Main.messageTray) Main.messageTray.add(this._source);
}
},
View
@@ -1681,7 +1681,7 @@ NMApplet.prototype = {
this._source.connect('destroy', Lang.bind(this, function() {
this._source = null;
}));
- Main.messageTray.add(this._source);
+ if (Main.messageTray) Main.messageTray.add(this._source);
}
},
@@ -48,19 +48,12 @@ StatusIconDispatcher.prototype = {
_onTrayIconAdded: function(o, icon) {
let wmClass = (icon.wm_class || 'unknown').toLowerCase();
let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
- if (role)
- this.emit('status-icon-added', icon, role);
- else
- this.emit('message-icon-added', icon);
+ if (!role) role = wmClass;
+ this.emit('status-icon-added', icon, role);
},
_onTrayIconRemoved: function(o, icon) {
- let wmClass = (icon.wm_class || 'unknown').toLowerCase();
- let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
- if (role)
- this.emit('status-icon-removed', icon);
- else
- this.emit('message-icon-removed', icon);
+ this.emit('status-icon-removed', icon);
}
};
Signals.addSignalMethods(StatusIconDispatcher.prototype);
View
@@ -258,7 +258,7 @@ Client.prototype = {
// system-users for now as Empathy does.
let source = new ApproverSource(dispatchOp, _("Invitation"),
Gio.icon_new_for_string('system-users'));
- Main.messageTray.add(source);
+ if (Main.messageTray) Main.messageTray.add(source);
let notif = new RoomInviteNotification(source, dispatchOp, channel, contacts[0]);
source.notify(notif);
@@ -327,7 +327,7 @@ Client.prototype = {
let source = new ApproverSource(dispatchOp, _("Call"), isVideo ?
Gio.icon_new_for_string('camera-web') :
Gio.icon_new_for_string('audio-input-microphone'));
- Main.messageTray.add(source);
+ if (Main.messageTray) Main.messageTray.add(source);
let notif = new AudioVideoNotification(source, dispatchOp, channel, contacts[0], isVideo);
source.notify(notif);
@@ -355,7 +355,7 @@ Client.prototype = {
// We got the TpContact
let source = new ApproverSource(dispatchOp, _("File Transfer"), gicon);
- Main.messageTray.add(source);
+ if (Main.messageTray) Main.messageTray.add(source);
let notif = new FileTransferNotification(source, dispatchOp, channel, contacts[0]);
source.notify(notif);
@@ -436,7 +436,7 @@ Client.prototype = {
if (this._subscriptionSource == null) {
this._subscriptionSource = new MultiNotificationSource(
_("Subscription request"), 'gtk-dialog-question');
- Main.messageTray.add(this._subscriptionSource);
+ if (Main.messageTray) Main.messageTray.add(this._subscriptionSource);
this._subscriptionSource.connect('destroy', Lang.bind(this, function () {
this._subscriptionSource = null;
}));
@@ -472,7 +472,7 @@ Client.prototype = {
if (this._accountSource == null) {
this._accountSource = new MultiNotificationSource(
_("Connection error"), 'gtk-dialog-error');
- Main.messageTray.add(this._accountSource);
+ if (Main.messageTray) Main.messageTray.add(this._accountSource);
this._accountSource.connect('destroy', Lang.bind(this, function () {
this._accountSource = null;
}));
@@ -531,7 +531,7 @@ ChatSource.prototype = {
this._presenceChangedId = this._contact.connect('presence-changed', Lang.bind(this, this._presenceChanged));
// Add ourselves as a source.
- Main.messageTray.add(this);
+ if (Main.messageTray) Main.messageTray.add(this);
this.pushNotification(this._notification);
this._getLogMessages();
@@ -30,7 +30,7 @@ WindowAttentionHandler.prototype = {
let app = this._tracker.get_window_app(window);
let source = new Source(app, window);
- Main.messageTray.add(source);
+ if (Main.messageTray) Main.messageTray.add(source);
let banner = _("'%s' is ready").format(window.title);
let title = app.get_name();

0 comments on commit 5c2b928

Please sign in to comment.