diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 16:58:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 17:01:48 +0000 |
commit | 9d0562bcff0121ce0af8cfacff3c3264266c1651 (patch) | |
tree | c11b9bf73e81078c02b68c096f124b87975b0125 | |
parent | Adding gnome-shell version 47 in 46/disable-workspace-switcher metadata.json. (diff) | |
download | gnome-shell-extensions-extra-9d0562bcff0121ce0af8cfacff3c3264266c1651.tar.xz gnome-shell-extensions-extra-9d0562bcff0121ce0af8cfacff3c3264266c1651.zip |
Updating 46/hibernate-status to version 1.16~rc1 [d56e571].
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r-- | extensions/46/hibernate-status/extension.js | 17 | ||||
-rw-r--r-- | extensions/46/hibernate-status/prefs.js | 3 |
2 files changed, 17 insertions, 3 deletions
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; + diff --git a/extensions/46/hibernate-status/prefs.js b/extensions/46/hibernate-status/prefs.js index 1407a6b..3a04ca6 100644 --- a/extensions/46/hibernate-status/prefs.js +++ b/extensions/46/hibernate-status/prefs.js @@ -101,7 +101,6 @@ export default class Prefs extends ExtensionPreferences { const suspend_row = new Adw.SwitchRow({ title: __('Suspend'), - subtitle: __('Not implemented yet'), }); modes_group.add(suspend_row); const hibernate_row = new Adw.SwitchRow({ @@ -118,12 +117,10 @@ export default class Prefs extends ExtensionPreferences { modes_group.add(suspend_then_hibernate_row); const restart_row = new Adw.SwitchRow({ title: __('Restart...'), - subtitle: __('Not implemented yet'), }); modes_group.add(restart_row); const shutdown_row = new Adw.SwitchRow({ title: __('Shutdown...'), - subtitle: __('Not implemented yet'), }); modes_group.add(shutdown_row); |