From 9d0562bcff0121ce0af8cfacff3c3264266c1651 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 16 Sep 2024 18:58:16 +0200 Subject: Updating 46/hibernate-status to version 1.16~rc1 [d56e571]. Signed-off-by: Daniel Baumann --- extensions/46/hibernate-status/extension.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'extensions/46/hibernate-status/extension.js') diff --git a/extensions/46/hibernate-status/extension.js b/extensions/46/hibernate-status/extension.js index d0c7708..b0a26c7 100644 --- a/extensions/46/hibernate-status/extension.js +++ b/extensions/46/hibernate-status/extension.js @@ -219,6 +219,22 @@ export default class HibernateButtonExtension extends Extension { _updateDefaults() { console.log("Update defaults"); + let menuItems = this.systemMenu._systemItem.menu._getMenuItems() + for (let menuItem of menuItems) { + console.log(menuItem.label.get_text()) + if ( menuItem.label.get_text() === _('Suspend') ) { + console.log(`Show suspend button: ${this._setting.get_boolean('show-suspend')}`) + menuItem.visible = this._setting.get_boolean('show-suspend'); + } + if ( menuItem.label.get_text() === _('Restart…') ) { + console.log(`Show restart button: ${this._setting.get_boolean('show-restart')}`) + menuItem.visible = this._setting.get_boolean('show-restart'); + } + if ( menuItem.label.get_text() === _('Power Off…') ) { + console.log(`Show shutdown button: ${this._setting.get_boolean('show-shutdown')}`) + menuItem.visible = this._setting.get_boolean('show-shutdown'); + } + } } _onHibernateClicked() { @@ -571,3 +587,4 @@ var ConfirmDialog = GObject.registerClass( ); const _DIALOG_ICON_SIZE = 32; + -- cgit v1.2.3