Skip to content

Commit

Permalink
Make compatible with Gnome 44
Browse files Browse the repository at this point in the history
- Change in API for quick settings - title instead of label
- Make use of the new subtitle to show currently selected setting
  • Loading branch information
tomflannaghan committed Apr 29, 2023
1 parent dec14a0 commit 51b7d49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function enable() {

// make the menu
switcherMenu = new QuickSettings.QuickMenuToggle({
label: _("Proxy"),
title: _("Proxy"),
iconName: "preferences-system-network-proxy-symbolic",
});
switcherMenu.menu.setHeader("preferences-system-network-proxy-symbolic", _("Proxy"));
Expand Down Expand Up @@ -89,8 +89,14 @@ function reflectSettings() {
// Synchronises the menu indicator with the Gnome Settings,
// allowing us to reflect changes made externally to the extension.
const mode = settings.get_string(PROXY_MODE);
switcherMenu.checked = (mode != "none");

if (mode == "none") {
switcherMenu.checked = false;
switcherMenu.subtitle = null;
} else {
switcherMenu.checked = true;
switcherMenu.subtitle = _(modeText[mode]);
}

for (const item of items) {
item.item.setOrnament(
(mode == item.mode) ? PopupMenu.Ornament.DOT
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"uuid": "[email protected]",
"name": "Proxy Switcher",
"description": "Switches between the system proxy settings profiles defined in Network Settings.",
"shell-version": ["43"],
"shell-version": ["44"],
"url": "https://github.com/tomflannaghan/proxy-switcher"
}

0 comments on commit 51b7d49

Please sign in to comment.