From e25f18765a4806e60cee6dd9a356c8e04bb8cd10 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:40:50 +0200 Subject: [PATCH 1/3] Enable "Show IPs" option for gnome version >= 40 --- lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.js b/lib.js index ae20954..0ebd6f0 100644 --- a/lib.js +++ b/lib.js @@ -151,7 +151,7 @@ function canShowIPs() { let version_array = splitVersion(Config.PACKAGE_VERSION); - if (version_array[0] == 3 && (version_array[1] < 28 || version_array[1] >= 34)) { + if (version_array[0] >= 40 || (version_array[0] == 3 && (version_array[1] < 28 || version_array[1] >= 34))) { getLogger().debug(`Show IP can be enabled. Gjs version: '${Config.PACKAGE_VERSION}'`); return true; } From 411bfc60688389b2c1d5e4698501eb88b57dc0c1 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sat, 14 Jan 2023 19:39:57 +0100 Subject: [PATCH 2/3] better logging --- lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.js b/lib.js index 0ebd6f0..d3eec7d 100644 --- a/lib.js +++ b/lib.js @@ -152,7 +152,7 @@ function canShowIPs() { let version_array = splitVersion(Config.PACKAGE_VERSION); if (version_array[0] >= 40 || (version_array[0] == 3 && (version_array[1] < 28 || version_array[1] >= 34))) { - getLogger().debug(`Show IP can be enabled. Gjs version: '${Config.PACKAGE_VERSION}'`); + getLogger().debug(`Show IP can be enabled. Gjs version: '${Config.PACKAGE_VERSION}' - Parsed: ${version_array[0]}.${version_array[1]} - Compared: ${version_array[0] >= 40}`); return true; } getLogger().warning(`Show IP cannot be enabled. Gjs version: '${Config.PACKAGE_VERSION}'`); From 722a5a523464e86ecd48e7a4b2be8344dc78374b Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 17:30:35 +0100 Subject: [PATCH 3/3] fix: show ips follow prefs --- net_speed.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net_speed.js b/net_speed.js index 848e386..1e2ed6f 100644 --- a/net_speed.js +++ b/net_speed.js @@ -302,8 +302,14 @@ var NetSpeed = class NetSpeed { this.menu_label_size = this._setting.get_int('menu-label-size'); this.use_bytes = this._setting.get_boolean('use-bytes'); this.bin_prefixes = this._setting.get_boolean('bin-prefixes'); - this.show_ips = this._setting.get_boolean('show-ips'); this.vert_align = this._setting.get_boolean('vert-align'); + + let show_ips = this._setting.get_boolean('show-ips'); + if (show_ips !== this.show_ips && show_ips) { + // trigger ip reload + this._trigger_ips_reload(); + } + this.show_ips = show_ips; } /** @@ -364,6 +370,8 @@ var NetSpeed = class NetSpeed { let schema = schemaSource.lookup('org.gnome.shell.extensions.netspeed', false); this._setting = new Gio.Settings({ settings_schema: schema }); this._saving = 0; + this.show_ips = this._setting.get_boolean('show-ips'); + this._load(); this._updateDefaultGw();