all status area indicators: adapt to gnome-shell API changes

removeFromStatusArea was replaced with a destroy method on the
indicator itself. Cope with that.
This commit is contained in:
Giovanni Campagna
2011-08-25 11:26:27 +02:00
parent dad3c317a7
commit 8276e6d583
5 changed files with 21 additions and 11 deletions

View File

@@ -102,8 +102,7 @@ function enable() {
}
function disable() {
appsMenuButton.actor.destroy();
appsMenuButton.menu.destroy();
appsMenuButton.destroy();
}
function init() {

View File

@@ -94,10 +94,13 @@ function init(metadata) {
imports.gettext.bindtextdomain('gnome-shell-extensions', metadata.localedir);
}
let _indicator;
function enable() {
Main.panel.addToStatusArea('drive-menu', new DriveMenu);
_indicator = new DriveMenu;
Main.panel.addToStatusArea('drive-menu', _indicator);
}
function disable() {
Main.panel.removeFromStatusArea('drive-menu');
_indicator.destroy();
}

View File

@@ -115,13 +115,15 @@ PlacesMenu.prototype = {
function init(metadata) {
imports.gettext.bindtextdomain('gnome-shell-extensions', metadata.localedir);
Panel.STANDARD_TRAY_ICON_ORDER.unshift('places-menu');
}
let _indicator;
function enable() {
Main.panel.addToStatusArea('places-menu', new PlacesMenu);
_indicator = new PlacesMenu;
Main.panel.addToStatusArea('places-menu', _indicator);
}
function disable() {
Main.panel.removeFromStatusArea('places-menu');
_indicator.destroy();
}

View File

@@ -97,10 +97,13 @@ function init(meta) {
Panel.STANDARD_TRAY_ICON_ORDER.unshift('workspace-indicator');
}
let _indicator;
function enable() {
Main.panel.addToStatusArea('workspace-indicator', new WorkspaceIndicator);
_indicator = new WorkspaceIndicator;
Main.panel.addToStatusArea('workspace-indicator', _indicator);
}
function disable() {
Main.panel.removeFromStatusArea('workspace-indicator');
_indicator.destroy();
}

View File

@@ -140,10 +140,13 @@ function init(metadata) {
imports.gettext.bindtextdomain('gnome-shell-extensions', metadata.localedir);
}
let _indicator;
function enable() {
Main.panel.addToStatusArea('display', new Indicator());
_indicator = new Indicator();
Main.panel.addToStatusArea('display', _indicator);
}
function disable() {
Main.panel.removeFromStatusArea('display');
_indicator.destroy();
}