[gnome-shell-extensions] alternative-status-menu: take GSettings in consideration for item visibility
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] alternative-status-menu: take GSettings in consideration for item visibility
- Date: Fri, 24 May 2013 17:16:06 +0000 (UTC)
commit ae244569ef080c305bf057a1a249ec85197b4354
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Fri May 24 19:14:24 2013 +0200
alternative-status-menu: take GSettings in consideration for item visibility
Seems this was lost at some point.
extensions/alternative-status-menu/extension.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/extensions/alternative-status-menu/extension.js b/extensions/alternative-status-menu/extension.js
index ac033bf..44c4f75 100644
--- a/extensions/alternative-status-menu/extension.js
+++ b/extensions/alternative-status-menu/extension.js
@@ -76,8 +76,8 @@ function statusMenu_updateHaveHibernate() {
function statusMenu_updateSuspendOrPowerOff() {
this._suspendOrPowerOffItem.actor.hide();
- extension.suspendItem.actor.visible = this._haveSuspend;
- extension.hibernateItem.actor.visible = this._haveHibernate;
+ extension.suspendItem.actor.visible = this._haveSuspend &&
extension.settings.get_boolean('allow-suspend');
+ extension.hibernateItem.actor.visible = this._haveHibernate &&
extension.settings.get_boolean('allow-hibernate');
extension.powerOffItem.actor.visible = this._haveShutdown;
}
@@ -104,7 +104,7 @@ const Extension = new Lang.Class({
this.powerOffItem = null;
Convenience.initTranslations();
- this._settings = Convenience.getSettings();
+ this.settings = Convenience.getSettings();
},
enable: function() {
@@ -145,7 +145,7 @@ const Extension = new Lang.Class({
this._previousUpdateSuspendOrPowerOff = statusMenu._updateSuspendOrPowerOff;
statusMenu._updateSuspendOrPowerOff = statusMenu_updateSuspendOrPowerOff;
- this._settingsChangedId = this._settings.connect('changed', function() {
+ this._settingsChangedId = this.settings.connect('changed', function() {
statusMenu._updateSuspendOrPowerOff();
});
},
@@ -158,7 +158,7 @@ const Extension = new Lang.Class({
this.powerOffItem.destroy();
statusMenu.menu.disconnect(this._openStateChangedId);
- this._settings.disconnect(this._settingsChangedId);
+ this.settings.disconnect(this._settingsChangedId);
statusMenu._updateSuspendOrPowerOff = this._previousUpdateSuspendOrPowerOff;
statusMenu._updateSuspendOrPowerOff();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]