From dc4ed1d7d273c8fd7d2d8204170a835b6336d6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 27 Jul 2022 04:38:21 +0200 Subject: [PATCH] status/location: Remove submenu Location services aren't expected to change frequently: They are either disabled globally, or permissions are granted on a per-app basis. This is less of a concern while the setting is exposed in a small submenu, but as we moving to quick settings, it does not deserve the prominence of a quick toggle. Just the top bar icon and Settings' privacy panel should be enough. Part-of: --- js/ui/status/location.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/js/ui/status/location.js b/js/ui/status/location.js index aa849d64a..52f374fb2 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -4,9 +4,7 @@ const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi; const Dialog = imports.ui.dialog; -const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; -const PopupMenu = imports.ui.popupMenu; const ModalDialog = imports.ui.modalDialog; const PermissionStore = imports.misc.permissionStore; @@ -220,44 +218,6 @@ class Indicator extends PanelMenu.SystemIndicator { this._indicator, 'visible', GObject.BindingFlags.SYNC_CREATE); - - this._item = new PopupMenu.PopupSubMenuMenuItem('', true); - this._item.icon.icon_name = 'find-location-symbolic'; - this._agent.bind_property('in-use', - this._item, - 'visible', - GObject.BindingFlags.SYNC_CREATE); - - this._item.label.text = _('Location Enabled'); - this._onOffAction = this._item.menu.addAction(_('Disable'), - () => (this._agent.enabled = !this._agent.enabled)); - this._item.menu.addSettingsAction(_('Privacy Settings'), 'gnome-location-panel.desktop'); - - this.menu.addMenuItem(this._item); - - this._agent.connectObject( - 'notify::enabled', () => this._sync(), - 'notify::in-use', () => this._sync(), this); - - Main.sessionMode.connect('updated', this._onSessionUpdated.bind(this)); - this._onSessionUpdated(); - } - - _onSessionUpdated() { - let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter; - this.menu.setSensitive(sensitive); - } - - _sync() { - if (this._agent.enabled) { - this._item.label.text = this._indicator.visible - ? _('Location In Use') - : _('Location Enabled'); - this._onOffAction.label.text = _('Disable'); - } else { - this._item.label.text = _('Location Disabled'); - this._onOffAction.label.text = _('Enable'); - } } });