From 1f1bd8b9574967e377ce463cdaf2a431b9286315 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 01/25] 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 b5a9da1c45e6b5767dca06907e684a4bd01b1513 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 02/25] 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 666feb799e2a5cd6ebb32ca031c3285ad5ef06de Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 02:05:54 +0100 Subject: [PATCH 03/25] fix: Remove Lang module Fix #139 --- net_speed.js | 21 ++++++++++----------- net_speed_status_icon.js | 7 +++---- prefs.js | 40 +++++++++++++++++++--------------------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/net_speed.js b/net_speed.js index 83162ca..db19283 100644 --- a/net_speed.js +++ b/net_speed.js @@ -15,7 +15,6 @@ * along with this program. If not, see . */ -const Lang = imports.lang; const Extension = imports.misc.extensionUtils.getCurrentExtension(); const Lib = Extension.imports.lib; const Gettext = imports.gettext; @@ -324,7 +323,7 @@ var NetSpeed = class NetSpeed { let m_timer = this._setting.get_int('timer'); if (m_timer !== this.timer) { Mainloop.source_remove(this._timerid); - this._timerid = Mainloop.timeout_add(m_timer, Lang.bind(this, this._update)); + this._timerid = Mainloop.timeout_add(m_timer, this._update.bind(this)); // this.timer will be updated within this._load, so no need to update it here } this._load(); @@ -346,12 +345,12 @@ var NetSpeed = class NetSpeed { this._devices = new Array(); this._client = NetworkManager.Client.new(null); this._nm_signals = new Array(); - this._nm_signals.push(this._client.connect('any-device-added', Lang.bind(this, this._nm_device_changed))); - this._nm_signals.push(this._client.connect('any-device-removed', Lang.bind(this, this._nm_device_changed))); - this._nm_signals.push(this._client.connect('connection-added', Lang.bind(this, this._nm_connection_changed))); - this._nm_signals.push(this._client.connect('connection-removed', Lang.bind(this, this._nm_connection_changed))); - this._nm_signals.push(this._client.connect('active-connection-added', Lang.bind(this, this._nm_connection_changed))); - this._nm_signals.push(this._client.connect('active-connection-removed', Lang.bind(this, this._nm_connection_changed))); + this._nm_signals.push(this._client.connect('any-device-added', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._client.connect('any-device-removed', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._client.connect('connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._client.connect('connection-removed', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._client.connect('active-connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._client.connect('active-connection-removed', this._nm_connection_changed.bind(this))); // store NM Device 'state-changed' signal bindings to disconnect on disable this._nm_devices_signals_map = new Map(); @@ -365,8 +364,8 @@ var NetSpeed = class NetSpeed { this._saving = 0; this._load(); - this._changed = this._setting.connect('changed', Lang.bind(this, this._reload)); - this._timerid = Mainloop.timeout_add(this.timer, Lang.bind(this, this._update)); + this._changed = this._setting.connect('changed', this._reload.bind(this)); + this._timerid = Mainloop.timeout_add(this.timer, this._update.bind(this)); this._status_icon = new NetSpeedStatusIcon.NetSpeedStatusIcon(this); let placement = this._setting.get_string('placement'); Panel.addToStatusArea('netspeed', this._status_icon, 0, placement); @@ -469,7 +468,7 @@ var NetSpeed = class NetSpeed { */ _connect_nm_device_state_changed(nm_device) { if (!this._nm_devices_signals_map.has(nm_device.get_iface())) { - let signal_id = nm_device.connect('state-changed', Lang.bind(this, this._nm_device_state_changed)); + let signal_id = nm_device.connect('state-changed', this._nm_device_state_changed.bind(this)); this._nm_devices_signals_map.set(nm_device.get_iface(), [nm_device, signal_id]); } } diff --git a/net_speed_status_icon.js b/net_speed_status_icon.js index aece34f..7fcc755 100644 --- a/net_speed_status_icon.js +++ b/net_speed_status_icon.js @@ -18,7 +18,6 @@ const ExtensionUtils = imports.misc.extensionUtils; const Extension = ExtensionUtils.getCurrentExtension(); const Gettext = imports.gettext; -const Lang = imports.lang; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const Clutter = imports.gi.Clutter; @@ -48,7 +47,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends // extension button this._box = new St.BoxLayout(); this.add_actor(this._box); - this.connect('button-release-event', Lang.bind(this, this._toggle_showsum)); + this.connect('button-release-event', this._toggle_showsum.bind(this)); // download this._download_box = new St.BoxLayout(); @@ -95,7 +94,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends }); this._menu_title = new NetSpeedLayoutMenuItem.NetSpeedLayoutMenuItem(_("Device"), this._pref, this._net_speed.menu_label_size); - this._menu_title.connect("activate", Lang.bind(this, this._change_device, "")); + this._menu_title.connect("activate", this._change_device.bind(this, "")); this._menu_title.update_speeds({ up: _("Up"), down: _("Down") }); this._menu_title.update_ips([_("IP")]); this._menu_title.show_ip(this._net_speed.show_ips); @@ -260,7 +259,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends let icon = this._get_icon(types[i]); let layout = new NetSpeedLayoutMenuItem.NetSpeedLayoutMenuItem(devices[i], icon, this._net_speed.menu_label_size); layout.show_ip(this._net_speed.show_ips); - layout.connect("activate", Lang.bind(this, this._change_device, devices[i])); + layout.connect("activate", this._change_device.bind(this, devices[i])); this._layouts.push(layout); this.menu.addMenuItem(layout); } diff --git a/prefs.js b/prefs.js index 837ffc1..6444ed8 100644 --- a/prefs.js +++ b/prefs.js @@ -1,20 +1,19 @@ - /* - * Copyright 2011-2019 Amir Hedayaty < hedayaty AT gmail DOT com > - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - +/* + * Copyright 2011-2019 Amir Hedayaty < hedayaty AT gmail DOT com > + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ const Extension = imports.misc.extensionUtils.getCurrentExtension(); const Lib = Extension.imports.lib; @@ -25,7 +24,6 @@ const Gdk = imports.gi.Gdk; const Gettext = imports.gettext; const Gio = imports.gi.Gio; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; const NM = imports.gi.NM; const _ = Gettext.domain('netspeed').gettext; @@ -309,10 +307,10 @@ const App = class NetSpeed_App { this._pick_dev(); this._factor = Schema.get_int('hi-dpi-factor'); - this.dev.connect('changed', Lang.bind(this, this._put_dev)); - Schema.connect('changed', Lang.bind(this, this._dpi_changed)); + this.dev.connect('changed', this._put_dev.bind(this)); + Schema.connect('changed', this._dpi_changed.bind(this)); - this.placement.connect('changed', Lang.bind(this, this._change_placement)) + this.placement.connect('changed', this._change_placement.bind(this)); } }; From 10c4f88d2bffa15c05caf4cbb9681a7301378dcd Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:11:45 +0100 Subject: [PATCH 04/25] style: code formatting and replace new Array with [] --- .jshintrc | 3 ++ extension.js | 34 +++++++------- lib.js | 2 +- net_speed.js | 26 +++++------ net_speed_layout_menu_item.js | 4 +- net_speed_status_icon.js | 22 ++++----- prefs.js | 84 +++++++++++++++++------------------ 7 files changed, 89 insertions(+), 86 deletions(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..8ab3485 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,3 @@ +{ + "esversion": 6 +} \ No newline at end of file diff --git a/extension.js b/extension.js index ddddb03..c105efa 100644 --- a/extension.js +++ b/extension.js @@ -1,19 +1,19 @@ - /* - * Copyright 2011-2013 Amir Hedayaty < hedayaty AT gmail DOT com > - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +/* + * Copyright 2011-2013 Amir Hedayaty < hedayaty AT gmail DOT com > + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ const Extension = imports.misc.extensionUtils.getCurrentExtension(); const NetSpeed = Extension.imports.net_speed; @@ -23,7 +23,7 @@ const NetSpeed = Extension.imports.net_speed; * run when gnome-shell loads */ function init() { - return new NetSpeed.NetSpeed(); + return new NetSpeed.NetSpeed(); } diff --git a/lib.js b/lib.js index d3eec7d..fa67848 100644 --- a/lib.js +++ b/lib.js @@ -105,7 +105,7 @@ var _loggerClass = class _Logger { critical(event) { this._makeLogFunction(GLib.LogLevelFlags.LEVEL_CRITICAL)(event); } -} +}; /** diff --git a/net_speed.js b/net_speed.js index 4a8dc2b..7d05181 100644 --- a/net_speed.js +++ b/net_speed.js @@ -161,14 +161,14 @@ var NetSpeed = class NetSpeed { * NetSpeed: _create_menu */ _create_menu() { - let types = new Array(); - let devices_text = new Array(); + let types = []; + let devices_text = []; for (let dev of this._devices) { types.push(this.get_device_type(dev)); let wifi_ssid = this._retrieve_wifi_ssid(dev); //Logger.info(`wifi_ssid is '${wifi_ssid}' for dev '${dev}'`); if (wifi_ssid != null) { - devices_text.push(dev + `\n${wifi_ssid}`) + devices_text.push(dev + `\n${wifi_ssid}`); continue; } devices_text.push(dev); @@ -205,11 +205,11 @@ var NetSpeed = class NetSpeed { let up = 0; // set initial let down = 0; this._oldvalues = this._values; - this._values = new Array(); - this._speeds = new Array(); - this._ips = new Array(); + this._values = []; + this._speeds = []; + this._ips = []; this._olddevices = this._devices; - this._devices = new Array(); + this._devices = []; let time = GLib.get_monotonic_time() / 1000; // current time 1000 is not the net_speed.timer! let delta = time - this._last_time; // Here the difference is evaluated @@ -342,10 +342,10 @@ var NetSpeed = class NetSpeed { this._last_time = 0; // time of the latest snapshot this._device_state_changed = true; // flag to trigger menu refreshing - this._values = new Array(); - this._devices = new Array(); + this._values = []; + this._devices = []; this._client = NetworkManager.Client.new(null); - this._nm_signals = new Array(); + this._nm_signals = []; this._nm_signals.push(this._client.connect('any-device-added', this._nm_device_changed.bind(this))); this._nm_signals.push(this._client.connect('any-device-removed', this._nm_device_changed.bind(this))); this._nm_signals.push(this._client.connect('connection-added', this._nm_connection_changed.bind(this))); @@ -513,16 +513,16 @@ var NetSpeed = class NetSpeed { if (ip_cfg == null) { //Logger.info(`No config for device '${nm_device.get_iface()}'`); - return new Array(); + return []; } let nm_addresses = ip_cfg.get_addresses(); if (nm_addresses.length == 0) { //Logger.info(`No IP addresses for device '${nm_device.get_iface()}'`); - return new Array(); + return []; } - let addresses = new Array(); + let addresses = []; for (let nm_address of nm_addresses) { let addr = nm_address.get_address(); let prefix = nm_address.get_prefix(); diff --git a/net_speed_layout_menu_item.js b/net_speed_layout_menu_item.js index 9ccd728..ece714d 100644 --- a/net_speed_layout_menu_item.js +++ b/net_speed_layout_menu_item.js @@ -34,8 +34,8 @@ var NetSpeedLayoutMenuItem = GObject.registerClass( this._icon = icon; this._device_title = new St.Label( { - text: device - , style_class: "ns-menuitem" + text: device, + style_class: "ns-menuitem" } ); this._device_title.get_clutter_text().set_line_wrap(true); diff --git a/net_speed_status_icon.js b/net_speed_status_icon.js index 7fcc755..f63de11 100644 --- a/net_speed_status_icon.js +++ b/net_speed_status_icon.js @@ -51,31 +51,31 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends // download this._download_box = new St.BoxLayout(); - this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER}); - this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER}); - this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER}); + this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); this._download_box.add_actor(this._down); this._download_box.add_actor(this._downunit); this._download_box.add_actor(this._downicon); // upload this._upload_box = new St.BoxLayout(); - this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER}); - this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER}); - this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER}); + this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); this._upload_box.add_actor(this._up); this._upload_box.add_actor(this._upunit); this._upload_box.add_actor(this._upicon); // sum this._sum_box = new St.BoxLayout(); - this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER}); - this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER}); + this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); this._sum_box.add_actor(this._sum); this._sum_box.add_actor(this._sumunit); // metrics box - this._metrics_box = new St.BoxLayout({y_align: Clutter.ActorAlign.CENTER}); + this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); this._metrics_box.add_actor(this._download_box); this._metrics_box.add_actor(this._upload_box); this._metrics_box.add_actor(this._sum_box); @@ -100,7 +100,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends this._menu_title.show_ip(this._net_speed.show_ips); this.menu.addMenuItem(this._menu_title); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this._layouts = new Array(); + this._layouts = []; this.updateui(); } @@ -254,7 +254,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends for (let layout of this._layouts) { layout.destroy(); } - this._layouts = new Array(); + this._layouts = []; for (let i = 0; i < devices.length; ++i) { let icon = this._get_icon(types[i]); let layout = new NetSpeedLayoutMenuItem.NetSpeedLayoutMenuItem(devices[i], icon, this._net_speed.menu_label_size); diff --git a/prefs.js b/prefs.js index 6444ed8..7f8096f 100644 --- a/prefs.js +++ b/prefs.js @@ -28,9 +28,9 @@ const NM = imports.gi.NM; const _ = Gettext.domain('netspeed').gettext; let schemaDir = Extension.dir.get_child('schemas'); -let schemaSource = schemaDir.query_exists(null)? - Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false): - Gio.SettingsSchemaSource.get_default(); +let schemaSource = schemaDir.query_exists(null) ? + Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false) : + Gio.SettingsSchemaSource.get_default(); let schema = schemaSource.lookup(Lib.SCHEMA, false); let Schema = new Gio.Settings({ settings_schema: schema }); @@ -43,7 +43,7 @@ function init() { Gettext.bindtextdomain('netspeed', localeDir.get_path()); } - if (!Lib.canShowIPs()){ + if (!Lib.canShowIPs()) { // Force to false at startup // FIXME: hide Schema key Schema.set_boolean('show-ips', false); @@ -53,18 +53,18 @@ function init() { const App = class NetSpeed_App { _get_dev_combo() { let listStore = new Gtk.ListStore(); - listStore.set_column_types ([GObject.TYPE_STRING, GObject.TYPE_STRING]); + listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); let all = listStore.append(); - listStore.set (all, [0], [_("ALL")]); - listStore.set (all, [1], ["network-workgroup-symbolic"]); + listStore.set(all, [0], [_("ALL")]); + listStore.set(all, [1], ["network-workgroup-symbolic"]); let defaultGw = listStore.append(); - listStore.set (defaultGw, [0], [_("Default Gateway")]); - listStore.set (defaultGw, [1], ["network-workgroup-symbolic"]); + listStore.set(defaultGw, [0], [_("Default Gateway")]); + listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); let nmc = NM.Client.new(null); - let devices = nmc.get_devices() || [ ]; + let devices = nmc.get_devices() || []; this._devices = []; for (let dev of devices) { @@ -93,41 +93,41 @@ const App = class NetSpeed_App { } this._devices.push(dev.interface); let iter = listStore.append(); - listStore.set (iter, [0], [dev.interface]); - listStore.set (iter, [1], [iconname]); + listStore.set(iter, [0], [dev.interface]); + listStore.set(iter, [1], [iconname]); } - let combo = new Gtk.ComboBox({model: listStore}); + let combo = new Gtk.ComboBox({ model: listStore }); let rendererPixbuf = new Gtk.CellRendererPixbuf(); let rendererText = new Gtk.CellRendererText(); // Pack the renderers into the combobox in the order we want to see - combo.pack_start (rendererPixbuf, false); - combo.pack_start (rendererText, false); + combo.pack_start(rendererPixbuf, false); + combo.pack_start(rendererText, false); // Set the renderers to use the information from our listStore - combo.add_attribute (rendererText, "text", 0); - combo.add_attribute (rendererPixbuf, "icon_name", 1); + combo.add_attribute(rendererText, "text", 0); + combo.add_attribute(rendererPixbuf, "icon_name", 1); return combo; } _put_dev() { let active = this.dev.get_active(); - if (active == -1){ + if (active == -1) { return; } switch (active) { - case 0: - Schema.set_string ('device', "all"); - break; - case 1: - Schema.set_string ('device', "defaultGW"); - break; - default: - Schema.set_string ('device', this._devices[active - 2]); + case 0: + Schema.set_string('device', "all"); + break; + case 1: + Schema.set_string('device', "defaultGW"); + break; + default: + Schema.set_string('device', this._devices[active - 2]); } - Logger.debug("device <- " + Schema.get_string('device')) + Logger.debug("device <- " + Schema.get_string('device')); } _change_placement() { @@ -139,12 +139,12 @@ const App = class NetSpeed_App { } switch (active) { case 0: - Schema.set_string('placement', 'right') - Logger.debug("placement <- right") + Schema.set_string('placement', 'right'); + Logger.debug("placement <- right"); break; case 1: - Schema.set_string('placement', 'left') - Logger.debug("placement <- left") + Schema.set_string('placement', 'left'); + Logger.debug("placement <- left"); break; } } @@ -194,15 +194,15 @@ const App = class NetSpeed_App { constructor() { this._factor = Schema.get_int('hi-dpi-factor'); - this.main = new Gtk.Grid({row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true}); - this.main.attach (new Gtk.Label({label: _("Device to monitor")}), 1, 1, 1, 1); - this.main.attach (new Gtk.Label({label: _("Timer (milliseconds)")}), 1, 4, 1, 1); - this.main.attach (new Gtk.Label({label: _("Digits")}), 1, 5, 1, 1); - this.main.attach (new Gtk.Label({label: _("Label Size")}), 1, 6, 1, 1); - this.main.attach (new Gtk.Label({label: _("Unit Label Size")}), 1, 7, 1, 1); - this.main.attach (new Gtk.Label({label: _("Menu Label Size")}), 1, 8, 1, 1); - this.main.attach (new Gtk.Label({label: _("HiDPI factor")}), 1, 11, 1, 1); - this.main.attach (new Gtk.Label({label: _("Placement")}), 1, 13, 1, 1); + this.main = new Gtk.Grid({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); + this.main.attach(new Gtk.Label({ label: _("Device to monitor") }), 1, 1, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); + this.main.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 11, 1, 1); + this.main.attach(new Gtk.Label({ label: _("Placement") }), 1, 13, 1, 1); //this.dev = new Gtk.Entry(); this.dev = this._get_dev_combo(); @@ -261,7 +261,7 @@ const App = class NetSpeed_App { }) }); - this.placement = new Gtk.ComboBoxText() + this.placement = new Gtk.ComboBoxText(); this.placement.append_text(_("Right")); this.placement.append_text(_("Left")); this.placement.set_active(0); @@ -318,4 +318,4 @@ const App = class NetSpeed_App { function buildPrefsWidget() { let widget = new App(); return widget.main; -}; +} From fc257daef627e8f145759020ebacaefcb1762cca Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:19:08 +0100 Subject: [PATCH 05/25] rebuild translations --- po/ca.po | 74 +++++++++++++++++++++++----------------------- po/de.po | 74 +++++++++++++++++++++++----------------------- po/en_CA.po | 74 +++++++++++++++++++++++----------------------- po/es_ES.po | 74 +++++++++++++++++++++++----------------------- po/fa.po | 74 +++++++++++++++++++++++----------------------- po/fr.po | 74 +++++++++++++++++++++++----------------------- po/it.po | 74 +++++++++++++++++++++++----------------------- po/netspeed.pot | 74 +++++++++++++++++++++++----------------------- po/pt_BR.po | 74 +++++++++++++++++++++++----------------------- po/ru.po | 78 ++++++++++++++++++++++++------------------------- po/tr.po | 74 +++++++++++++++++++++++----------------------- po/zh_CN.po | 74 +++++++++++++++++++++++----------------------- po/zh_TW.po | 74 +++++++++++++++++++++++----------------------- 13 files changed, 483 insertions(+), 483 deletions(-) diff --git a/po/ca.po b/po/ca.po index 81abd82..4f0047b 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2019-07-28 13:37+0200\n" "Last-Translator: Jordi Mas i Hernandez \n" "Language-Team: \n" @@ -16,148 +16,148 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.2.1\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tots" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Passarel·la per defecte" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Dispositiu a fer seguiment" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporitzador (mil·lisegons)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Dígits" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Mida de l'etiqueta" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Mida de l'etiqueta de la unitat" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Mida de l'etiqueta del menú" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Mostra la suma (pujada + baixada)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Mostra la icona" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "Usa múltiples de byte" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "Usa prefixos binaris" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Dispositiu" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Pujada" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Baixada" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/de.po b/po/de.po index 58e3e36..bccbf87 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2013-11-13 20:39+0100\n" "Last-Translator: Jonatan Zeidler \n" "Language-Team: GERMAN \n" @@ -18,149 +18,149 @@ msgstr "" "X-Generator: Poedit 1.5.4\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALLE" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Gerät zur Überwachung" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Anzeigeinterval (Millisekunden)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Ziffern" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Anzeigegröße" -#: prefs.js:204 +#: prefs.js:202 #, fuzzy msgid "Unit Label Size" msgstr "Menügröße" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Menügröße" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Als Summe anzeigen (Hoch+Runter)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Symbol anzeigen" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Gerät" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Hoch" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Runter" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/en_CA.po b/po/en_CA.po index b307865..0329d6a 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: English\n" @@ -17,149 +17,149 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALL" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Device to monitor" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Timer (milisec)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Digits" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Label Size" -#: prefs.js:204 +#: prefs.js:202 #, fuzzy msgid "Unit Label Size" msgstr "Menu Label Size" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Menu Label Size" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Show sum(UP+Down)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Show the Icon" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Device" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Up" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Down" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 21facc8..ea75e80 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2016-10-12 20:53+0200\n" "Last-Translator: Javier Junquera \n" "Language-Team: Español; Castellano <>\n" @@ -19,148 +19,148 @@ msgstr "" "X-Generator: Gtranslator 2.91.7\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Todos" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Puerta de enlace predeterminadas" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Dispositivo a monitorizar" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizados (ms)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Digitos" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Tamaño de etiqueta" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Tamaño de etiqueta de unidades" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Tamaño de etiqueta de menú" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Mostrar suma (subida+bajada)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Mostrar icono" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Dispositivo" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Subida" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Bajada" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/fa.po b/po/fa.po index a6e43e1..eae21ab 100644 --- a/po/fa.po +++ b/po/fa.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2014-05-25 19:38-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: Persian\n" @@ -16,147 +16,147 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "همه" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "تجهیزات تحت نظارت" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "زمان‌سنج)بر حسب میلی‌ثانیه(" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "تعداد رقم‌ها" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "اندازه برچسب‌ها" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "اندازه واحدها در منو" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "اندازه برچسب‌ها در منو" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "نمایش مجموع)دریافت و ارسال(" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "نمایش نمایه" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "راست" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "چپ" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 msgid "b/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "تجهیزات" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "ارسال" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "دریافت" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/fr.po b/po/fr.po index 37923e9..297650f 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Lucien Aubert \n" "Language-Team: French\n" @@ -17,149 +17,149 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "TOUS" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Périphérique(s) à prendre en compte" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Rafraîchissement (milisecondes)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Chiffres" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Taille des champs" -#: prefs.js:204 +#: prefs.js:202 #, fuzzy msgid "Unit Label Size" msgstr "Taille des champs du menu" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Taille des champs du menu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Afficher la somme (reçu+envoyé)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Afficher l'icône" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Périphérique" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Envoyé" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Reçu" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/it.po b/po/it.po index fdc81be..3332afd 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2017-04-17 15:58+0200\n" "Last-Translator: l3nn4rt \n" "Language-Team: Italian\n" @@ -18,148 +18,148 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.0.1\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tutte" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Gateway di default" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Interfaccia da monitorare" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Frequenza di aggiornamento (ms)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Numero di cifre da mostrare" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Larghezza per le cifre" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Larghezza per le unità di misura" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Larghezza per le colonne del menu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Mostra la velocità complessiva (upload + download)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Mostra l'icona" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "Usa multipli del byte" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "Usa prefissi binari" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "Allinea verticalmente" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "Mostra indirizzi IP" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Interfaccia" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Upload" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Download" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/netspeed.pot b/po/netspeed.pot index 80e62d3..9cb0af7 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,146 +17,146 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "" -#: prefs.js:201 +#: prefs.js:199 msgid "Timer (milliseconds)" msgstr "" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 msgid "b/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index a786f2a..d513f99 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2016-02-04 17:44-0300\n" "Last-Translator: Fábio Nogueira \n" "Language-Team: \n" @@ -18,148 +18,148 @@ msgstr "" "X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "TUDO" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Gateway padrão" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Dispositivo para monitorar" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizador (miliseg)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Dígitos" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Tamanho do rótulo" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Tamanho do rótulo de unidade" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Tamanho do rótulo do menu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Exibir somatório (UP+Down)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Exibir o ícone" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Dispositivo" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Up" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Down" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/ru.po b/po/ru.po index 863a5fa..498b6d5 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2019-04-23 11:19+0500\n" "Last-Translator: Руслан Нигматьянов \n" "Language-Team: Russian\n" @@ -14,152 +14,152 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "X-Generator: Gtranslator 3.32.0\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Все" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Шлюз по умолчанию" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Интерфейс отображения" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Интервал обновления (милисек)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Цифр" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Длина текста" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Длина единиц измерения" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Длина заголовка меню" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Показывать общую сумму передачи" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Показывать иконку" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "Б/с" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "Б/с" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "МБ/с" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "ГБ/с" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Интерфейс" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Отправка" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Загрузка" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/tr.po b/po/tr.po index 876e85f..2258370 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2019-03-21 09:18+0300\n" "Last-Translator: Serdar Sağlam \n" "Language-Team: Türkçe \n" @@ -18,148 +18,148 @@ msgstr "" "X-Generator: Poedit 2.2.1\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tümü" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Öntanımlı Ağ Geçidi" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "İzlenecek Aygıt" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "Zaman (millisaniye)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Basamak" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Etiket Boyutu" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Birim Etiketi Boyutu" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Menü Etiket Boyutu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Toplamı Göster (Yükleme+İndirme)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Simgeyi Göster" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Aygıt" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Yükleme" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "İndirme" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 1c030ad..4a0e81a 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,148 +18,148 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "全部" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "默认网关" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "监控的设备" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "定时(毫秒)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "位数" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "标签大小" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "单位标签大小" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "菜单标签大小" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "显示总和(上传+下载)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "显示图标" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "设备" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "上传" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "下载" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index 9179879..78f8871 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:15+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,148 +18,148 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "全部" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "默認網關" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "監控的設備" -#: prefs.js:201 +#: prefs.js:199 #, fuzzy msgid "Timer (milliseconds)" msgstr "定時(毫秒)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "位數" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "標籤大小" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "單位標籤大小" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "菜單標籤大小" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "顯示總和(上傳+下載)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "顯示圖標" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "設備" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "上傳" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "下載" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "" From 46ac0f616c82f3ebd240d5c82dff01b6fac76e34 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:20:25 +0100 Subject: [PATCH 06/25] build(makefile): add useful commands uninstall and reload --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 86bbc3a..34c28ba 100644 --- a/Makefile +++ b/Makefile @@ -42,5 +42,13 @@ enable: disable: gnome-extensions disable $(UUID) -reload: +unistall: + gnome-extensions uninstall $(UUID) + +reset: gnome-extensions reset $(UUID) + +reload: + # Reloading shell; Sending SIGHUP signal to gnome-shell (equivalent to alt + f2 ; r ; enter) + # busctl --verbose --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")' + killall -HUP gnome-shell \ No newline at end of file From 0d568a6d6331d5163d078cf6e5c50a70140f4172 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:21:01 +0100 Subject: [PATCH 07/25] Add gnome version 43 (tested on gnome 43.2) --- metadata.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 76fbb5b..aa1f03c 100644 --- a/metadata.json +++ b/metadata.json @@ -3,8 +3,13 @@ "description": "Displays Internet Speed", "name": "NetSpeed", "original-author": "hedayaty@gmail.com", - "shell-version": [ "40", "41", "42" ], + "shell-version": [ + "40", + "41", + "42", + "43" + ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "version": 32 -} +} \ No newline at end of file From 9ac93b9efba7c3dc7028569eebff58f4c1cfad5c Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:23:05 +0100 Subject: [PATCH 08/25] style(gschema): code formatting --- ...nome.shell.extensions.netspeed.gschema.xml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/schemas/org.gnome.shell.extensions.netspeed.gschema.xml b/schemas/org.gnome.shell.extensions.netspeed.gschema.xml index 8b007eb..63bdfc4 100644 --- a/schemas/org.gnome.shell.extensions.netspeed.gschema.xml +++ b/schemas/org.gnome.shell.extensions.netspeed.gschema.xml @@ -7,38 +7,38 @@ false - Show sum of upload and download speed - If true shows the sum of upload and download speed; otherwise, shows them seperately. - + Show sum of upload and download speed + If true shows the sum of upload and download speed; otherwise, shows them seperately. + '' - Device used to monitor - By default, the sum of usages will be monitored. However, if you want to monitor just a specific device, set this value to that device. - + Device used to monitor + By default, the sum of usages will be monitored. However, if you want to monitor just a specific device, set this value to that device. + - 1000 - The interval between updates in miliseconds - The interval between updates in miliseconds + 1000 + The interval between updates in miliseconds + The interval between updates in miliseconds - 3 - The number of digits displayed - The number of digits displayed, minimum 3 - + 3 + The number of digits displayed + The number of digits displayed, minimum 3 + - 38 - The size of label, this may be removed later and automatically measured for 3 digits the size should be 38 + 38 + The size of label, this may be removed later and automatically measured for 3 digits the size should be 38 - 28 - The size of label, this may be removed later and automatically. For common units 28 works + 28 + The size of label, this may be removed later and automatically. For common units 28 works - 65 - The size of labels on the menus, this may be removed later and automatically measured for 3 digits the size should be 65 + 65 + The size of labels on the menus, this may be removed later and automatically measured for 3 digits the size should be 65 false From 50327eac4251584b1e6ef996499ac81c8efe56a0 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:43:39 +0100 Subject: [PATCH 09/25] fix(translations): rename nl to nl_NL --- po/netspeed.pot | 2 +- po/{nl.po => nl_NL.po} | 74 +++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 38 deletions(-) rename po/{nl.po => nl_NL.po} (76%) diff --git a/po/netspeed.pot b/po/netspeed.pot index 9cb0af7..7c768ac 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 13:15+0100\n" +"POT-Creation-Date: 2023-01-22 13:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/nl.po b/po/nl_NL.po similarity index 76% rename from po/nl.po rename to po/nl_NL.po index 94ef60b..10dc090 100644 --- a/po/nl.po +++ b/po/nl_NL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:41+0100\n" "PO-Revision-Date: 2021-09-13 19:16+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -18,146 +18,146 @@ msgstr "" "X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALLES" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Standaard toegangspoort" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Te monitoren apparaat" -#: prefs.js:201 +#: prefs.js:199 msgid "Timer (milliseconds)" msgstr "Tijdklok (milliseconden)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Getallen" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Labelgrootte" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Labelgrootte van eenheid" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Labelgrootte van menu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "HiDPI-factor" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "Locatie" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Som tonen (OMHOOG+omlaag)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Pictogram tonen" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "Bytevermeerdering gebruiken" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "Binaire voorvoegsels tonen" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "Verticaal uitlijnen" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "Rechts" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "Links" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "IP-adressen tonen" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "kiB/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "MiB/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "GiB/s" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 msgid "b/s" msgstr "b/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "kib/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "Mib/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "Gib/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "kB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "kb/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "Mb/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "Gb/s" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Apparaat" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Omhoog" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Omlaag" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "IP-adres" From 17375b3ad19e22d73ad004821d83a8e39a3f4ad5 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:43:39 +0100 Subject: [PATCH 10/25] fix(translations): rename nl to nl_NL --- po/netspeed.pot | 2 +- po/{nl.po => nl_NL.po} | 74 +++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 38 deletions(-) rename po/{nl.po => nl_NL.po} (76%) diff --git a/po/netspeed.pot b/po/netspeed.pot index 80e62d3..0bf109e 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/nl.po b/po/nl_NL.po similarity index 76% rename from po/nl.po rename to po/nl_NL.po index 94ef60b..10dc090 100644 --- a/po/nl.po +++ b/po/nl_NL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 13:41+0100\n" "PO-Revision-Date: 2021-09-13 19:16+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -18,146 +18,146 @@ msgstr "" "X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALLES" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Standaard toegangspoort" -#: prefs.js:200 +#: prefs.js:198 msgid "Device to monitor" msgstr "Te monitoren apparaat" -#: prefs.js:201 +#: prefs.js:199 msgid "Timer (milliseconds)" msgstr "Tijdklok (milliseconden)" -#: prefs.js:202 +#: prefs.js:200 msgid "Digits" msgstr "Getallen" -#: prefs.js:203 +#: prefs.js:201 msgid "Label Size" msgstr "Labelgrootte" -#: prefs.js:204 +#: prefs.js:202 msgid "Unit Label Size" msgstr "Labelgrootte van eenheid" -#: prefs.js:205 +#: prefs.js:203 msgid "Menu Label Size" msgstr "Labelgrootte van menu" -#: prefs.js:206 +#: prefs.js:204 msgid "HiDPI factor" msgstr "HiDPI-factor" -#: prefs.js:207 +#: prefs.js:205 msgid "Placement" msgstr "Locatie" -#: prefs.js:211 +#: prefs.js:209 msgid "Show sum(UP+Down)" msgstr "Som tonen (OMHOOG+omlaag)" -#: prefs.js:212 +#: prefs.js:210 msgid "Show the Icon" msgstr "Pictogram tonen" -#: prefs.js:255 +#: prefs.js:253 msgid "Use multiples of byte" msgstr "Bytevermeerdering gebruiken" -#: prefs.js:256 +#: prefs.js:254 msgid "Use binary prefixes" msgstr "Binaire voorvoegsels tonen" -#: prefs.js:257 +#: prefs.js:255 msgid "Align vertically" msgstr "Verticaal uitlijnen" -#: prefs.js:267 +#: prefs.js:265 msgid "Right" msgstr "Rechts" -#: prefs.js:268 +#: prefs.js:266 msgid "Left" msgstr "Links" -#: prefs.js:271 +#: prefs.js:269 msgid "Show IPs" msgstr "IP-adressen tonen" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:104 net_speed.js:108 net_speed.js:112 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "kiB/s" msgstr "kiB/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "MiB/s" msgstr "MiB/s" -#: net_speed.js:106 +#: net_speed.js:104 msgid "GiB/s" msgstr "GiB/s" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:105 net_speed.js:109 msgid "b/s" msgstr "b/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "kib/s" msgstr "kib/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Mib/s" msgstr "Mib/s" -#: net_speed.js:107 +#: net_speed.js:105 msgid "Gib/s" msgstr "Gib/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "kB/s" msgstr "kB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:108 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "kb/s" msgstr "kb/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Mb/s" msgstr "Mb/s" -#: net_speed.js:111 +#: net_speed.js:109 msgid "Gb/s" msgstr "Gb/s" -#: net_speed_status_icon.js:97 +#: net_speed_status_icon.js:96 msgid "Device" msgstr "Apparaat" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Up" msgstr "Omhoog" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:98 msgid "Down" msgstr "Omlaag" -#: net_speed_status_icon.js:100 +#: net_speed_status_icon.js:99 msgid "IP" msgstr "IP-adres" From fbf0e915494a36a50c26cd7f2d289468da7b7c47 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 16:11:27 +0100 Subject: [PATCH 11/25] feat: refactor settings and add extension placement and position --- Makefile | 2 +- lib.js | 2 +- metadata.json | 9 +- net_speed.js | 26 +- po/ca.po | 90 ++--- po/de.po | 90 ++--- po/en_CA.po | 90 ++--- po/es_ES.po | 90 ++--- po/fa.po | 90 ++--- po/fr.po | 90 ++--- po/it.po | 92 +++--- po/netspeed.pot | 90 ++--- po/nl_NL.po | 95 +++--- po/pt_BR.po | 90 ++--- po/ru.po | 94 +++--- po/tr.po | 90 ++--- po/zh_CN.po | 90 ++--- po/zh_TW.po | 90 ++--- prefs.js | 310 +++++++++--------- ...nome.shell.extensions.netspeed.gschema.xml | 7 +- stylesheet.css | 3 +- 21 files changed, 920 insertions(+), 710 deletions(-) diff --git a/Makefile b/Makefile index 86bbc3a..4109b20 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ EXTENSION_FILES=stylesheet.css metadata.json OUTPUT=$(DOC_FILES) $(SRC_FILES) $(MO_FILES) $(SCHEMA_FILES) $(EXTENSION_FILES) POT_FILE=po/$(GETTEXT_PACKAGE).pot LOCAL_INSTALL=~/.local/share/gnome-shell/extensions/$(UUID) -pack: $(OUTPUT) +pack: update-po schemas/gschemas.compiled $(OUTPUT) zip $(UUID).zip $(OUTPUT) $(POT_FILE): $(SRC_FILES) diff --git a/lib.js b/lib.js index ae20954..dc047e6 100644 --- a/lib.js +++ b/lib.js @@ -23,7 +23,7 @@ const Config = imports.misc.config; var SCHEMA = "org.gnome.shell.extensions.netspeed"; // Debug Mode Settings -var DEBUG = false; +var DEBUG = true; // Logging const LOG_DOMAIN = SCHEMA; diff --git a/metadata.json b/metadata.json index 76fbb5b..aa1f03c 100644 --- a/metadata.json +++ b/metadata.json @@ -3,8 +3,13 @@ "description": "Displays Internet Speed", "name": "NetSpeed", "original-author": "hedayaty@gmail.com", - "shell-version": [ "40", "41", "42" ], + "shell-version": [ + "40", + "41", + "42", + "43" + ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "version": 32 -} +} \ No newline at end of file diff --git a/net_speed.js b/net_speed.js index 83162ca..9c9c53c 100644 --- a/net_speed.js +++ b/net_speed.js @@ -332,6 +332,24 @@ var NetSpeed = class NetSpeed { } } + _positionInPanelChanged() { + this._status_icon.get_parent().remove_actor(this._status_icon); + + // small HACK with private boxes :) + let boxes = { + left: Panel._leftBox, + center: Panel._centerBox, + right: Panel._rightBox + }; + + let p = this._setting.get_string('placement'); + let i = this._setting.get_int('placement-index'); + + Logger.debug(`_positionInPanelChanged: ${p} at index ${i}`); + + boxes[p].insert_child_at_index(this._status_icon, i); + } + /** * NetSpeed: enable * exported to enable the extension @@ -368,10 +386,12 @@ var NetSpeed = class NetSpeed { this._changed = this._setting.connect('changed', Lang.bind(this, this._reload)); this._timerid = Mainloop.timeout_add(this.timer, Lang.bind(this, this._update)); this._status_icon = new NetSpeedStatusIcon.NetSpeedStatusIcon(this); - let placement = this._setting.get_string('placement'); - Panel.addToStatusArea('netspeed', this._status_icon, 0, placement); - this._updateDefaultGw(); + this._positionInPanelChanged(); + this._placement_changed_id = this._setting.connect('changed::placement', this._positionInPanelChanged.bind(this)); + this._placement_index_changed_id = this._setting.connect('changed::placement-index', this._positionInPanelChanged.bind(this)); + + this._updateDefaultGw(); } /** diff --git a/po/ca.po b/po/ca.po index 81abd82..a499b57 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2019-07-28 13:37+0200\n" "Last-Translator: Jordi Mas i Hernandez \n" "Language-Team: \n" @@ -16,133 +16,145 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.2.1\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tots" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Passarel·la per defecte" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Dispositiu a fer seguiment" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporitzador (mil·lisegons)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Dígits" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Mida de l'etiqueta" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Mida de l'etiqueta de la unitat" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Mida de l'etiqueta del menú" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Mostra la suma (pujada + baixada)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Mostra la icona" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "Usa múltiples de byte" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "Usa prefixos binaris" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/de.po b/po/de.po index 58e3e36..62a09fc 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2013-11-13 20:39+0100\n" "Last-Translator: Jonatan Zeidler \n" "Language-Team: GERMAN \n" @@ -18,134 +18,146 @@ msgstr "" "X-Generator: Poedit 1.5.4\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALLE" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Gerät zur Überwachung" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Anzeigeinterval (Millisekunden)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Ziffern" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Anzeigegröße" -#: prefs.js:204 +#: prefs.js:247 #, fuzzy msgid "Unit Label Size" msgstr "Menügröße" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Menügröße" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Als Summe anzeigen (Hoch+Runter)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Symbol anzeigen" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/en_CA.po b/po/en_CA.po index b307865..ce8e57b 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: English\n" @@ -17,134 +17,146 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "ALL" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Device to monitor" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Timer (milisec)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Digits" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Label Size" -#: prefs.js:204 +#: prefs.js:247 #, fuzzy msgid "Unit Label Size" msgstr "Menu Label Size" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Menu Label Size" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Show sum(UP+Down)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Show the Icon" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 21facc8..af9c255 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2016-10-12 20:53+0200\n" "Last-Translator: Javier Junquera \n" "Language-Team: Español; Castellano <>\n" @@ -19,133 +19,145 @@ msgstr "" "X-Generator: Gtranslator 2.91.7\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Todos" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Puerta de enlace predeterminadas" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Dispositivo a monitorizar" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizados (ms)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Digitos" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Tamaño de etiqueta" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Tamaño de etiqueta de unidades" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Tamaño de etiqueta de menú" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Mostrar suma (subida+bajada)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Mostrar icono" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/fa.po b/po/fa.po index a6e43e1..a5f772e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2014-05-25 19:38-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: Persian\n" @@ -16,132 +16,144 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "همه" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "تجهیزات تحت نظارت" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "زمان‌سنج)بر حسب میلی‌ثانیه(" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "تعداد رقم‌ها" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "اندازه برچسب‌ها" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "اندازه واحدها در منو" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "اندازه برچسب‌ها در منو" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "راست" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "چپ" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "نمایش مجموع)دریافت و ارسال(" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "نمایش نمایه" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "راست" - -#: prefs.js:268 -msgid "Left" -msgstr "چپ" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 msgid "b/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/fr.po b/po/fr.po index 37923e9..bb8aee2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Lucien Aubert \n" "Language-Team: French\n" @@ -17,134 +17,146 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "TOUS" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Périphérique(s) à prendre en compte" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Rafraîchissement (milisecondes)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Chiffres" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Taille des champs" -#: prefs.js:204 +#: prefs.js:247 #, fuzzy msgid "Unit Label Size" msgstr "Taille des champs du menu" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Taille des champs du menu" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Afficher la somme (reçu+envoyé)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Afficher l'icône" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/it.po b/po/it.po index fdc81be..e1ce6c4 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2017-04-17 15:58+0200\n" "Last-Translator: l3nn4rt \n" "Language-Team: Italian\n" @@ -18,133 +18,145 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.0.1\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tutte" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Gateway di default" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Interfaccia da monitorare" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "Impostazioni" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Frequenza di aggiornamento (ms)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Numero di cifre da mostrare" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Larghezza per le cifre" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Larghezza per le unità di misura" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Larghezza per le colonne del menu" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" -msgstr "" +msgstr "Posizione" + +#: prefs.js:261 +msgid "Right" +msgstr "Destra" + +#: prefs.js:262 +msgid "Center" +msgstr "Centro" + +#: prefs.js:263 +msgid "Left" +msgstr "Sinistra" -#: prefs.js:211 +#: prefs.js:267 +msgid "Placement Index" +msgstr "Posizione Relativa" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Mostra la velocità complessiva (upload + download)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Mostra l'icona" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "Usa multipli del byte" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "Usa prefissi binari" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "Allinea verticalmente" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "Mostra indirizzi IP" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/netspeed.pot b/po/netspeed.pot index 0bf109e..861b8a1 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 13:41+0100\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,131 +17,143 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 msgid "Timer (milliseconds)" msgstr "" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 msgid "b/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/nl_NL.po b/po/nl_NL.po index 10dc090..9113fca 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 13:41+0100\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2021-09-13 19:16+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -26,138 +26,151 @@ msgstr "ALLES" msgid "Default Gateway" msgstr "Standaard toegangspoort" -#: prefs.js:198 +#: prefs.js:221 msgid "Device to monitor" msgstr "Te monitoren apparaat" -#: prefs.js:199 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 msgid "Timer (milliseconds)" msgstr "Tijdklok (milliseconden)" -#: prefs.js:200 +#: prefs.js:239 msgid "Digits" msgstr "Getallen" -#: prefs.js:201 +#: prefs.js:243 msgid "Label Size" msgstr "Labelgrootte" -#: prefs.js:202 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Labelgrootte van eenheid" -#: prefs.js:203 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Labelgrootte van menu" -#: prefs.js:204 +#: prefs.js:255 msgid "HiDPI factor" msgstr "HiDPI-factor" -#: prefs.js:205 +#: prefs.js:259 msgid "Placement" msgstr "Locatie" -#: prefs.js:209 +#: prefs.js:261 +msgid "Right" +msgstr "Rechts" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "Links" + +#: prefs.js:267 +#, fuzzy +msgid "Placement Index" +msgstr "Locatie" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Som tonen (OMHOOG+omlaag)" -#: prefs.js:210 +#: prefs.js:278 msgid "Show the Icon" msgstr "Pictogram tonen" -#: prefs.js:253 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "Bytevermeerdering gebruiken" -#: prefs.js:254 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "Binaire voorvoegsels tonen" -#: prefs.js:255 +#: prefs.js:290 msgid "Align vertically" msgstr "Verticaal uitlijnen" -#: prefs.js:265 -msgid "Right" -msgstr "Rechts" - -#: prefs.js:266 -msgid "Left" -msgstr "Links" - -#: prefs.js:269 +#: prefs.js:297 msgid "Show IPs" msgstr "IP-adressen tonen" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:105 msgid "kiB/s" msgstr "kiB/s" -#: net_speed.js:104 +#: net_speed.js:105 msgid "MiB/s" msgstr "MiB/s" -#: net_speed.js:104 +#: net_speed.js:105 msgid "GiB/s" msgstr "GiB/s" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:106 net_speed.js:110 msgid "b/s" msgstr "b/s" -#: net_speed.js:105 +#: net_speed.js:106 msgid "kib/s" msgstr "kib/s" -#: net_speed.js:105 +#: net_speed.js:106 msgid "Mib/s" msgstr "Mib/s" -#: net_speed.js:105 +#: net_speed.js:106 msgid "Gib/s" msgstr "Gib/s" -#: net_speed.js:108 +#: net_speed.js:109 msgid "kB/s" msgstr "kB/s" -#: net_speed.js:108 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:110 msgid "kb/s" msgstr "kb/s" -#: net_speed.js:109 +#: net_speed.js:110 msgid "Mb/s" msgstr "Mb/s" -#: net_speed.js:109 +#: net_speed.js:110 msgid "Gb/s" msgstr "Gb/s" -#: net_speed_status_icon.js:96 +#: net_speed_status_icon.js:97 msgid "Device" msgstr "Apparaat" -#: net_speed_status_icon.js:98 +#: net_speed_status_icon.js:99 msgid "Up" msgstr "Omhoog" -#: net_speed_status_icon.js:98 +#: net_speed_status_icon.js:99 msgid "Down" msgstr "Omlaag" -#: net_speed_status_icon.js:99 +#: net_speed_status_icon.js:100 msgid "IP" msgstr "IP-adres" diff --git a/po/pt_BR.po b/po/pt_BR.po index a786f2a..ace255b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2016-02-04 17:44-0300\n" "Last-Translator: Fábio Nogueira \n" "Language-Team: \n" @@ -18,133 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "TUDO" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Gateway padrão" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Dispositivo para monitorar" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizador (miliseg)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Dígitos" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Tamanho do rótulo" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Tamanho do rótulo de unidade" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Tamanho do rótulo do menu" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Exibir somatório (UP+Down)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Exibir o ícone" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/ru.po b/po/ru.po index 863a5fa..1a76217 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2019-04-23 11:19+0500\n" "Last-Translator: Руслан Нигматьянов \n" "Language-Team: Russian\n" @@ -14,137 +14,149 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "X-Generator: Gtranslator 3.32.0\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Все" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Шлюз по умолчанию" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "Интерфейс отображения" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Интервал обновления (милисек)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Цифр" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Длина текста" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Длина единиц измерения" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Длина заголовка меню" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Показывать общую сумму передачи" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Показывать иконку" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "Б/с" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "Б/с" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "МБ/с" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "ГБ/с" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/tr.po b/po/tr.po index 876e85f..db60d28 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2019-03-21 09:18+0300\n" "Last-Translator: Serdar Sağlam \n" "Language-Team: Türkçe \n" @@ -18,133 +18,145 @@ msgstr "" "X-Generator: Poedit 2.2.1\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "Tümü" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "Öntanımlı Ağ Geçidi" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "İzlenecek Aygıt" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "Zaman (millisaniye)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "Basamak" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "Etiket Boyutu" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "Birim Etiketi Boyutu" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "Menü Etiket Boyutu" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "Toplamı Göster (Yükleme+İndirme)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "Simgeyi Göster" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 1c030ad..f245934 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,133 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "全部" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "默认网关" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "监控的设备" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "定时(毫秒)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "位数" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "标签大小" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "单位标签大小" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "菜单标签大小" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "显示总和(上传+下载)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "显示图标" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index 9179879..6cf945b 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"POT-Creation-Date: 2023-01-22 16:08+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,133 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:61 +#: prefs.js:59 msgid "ALL" msgstr "全部" -#: prefs.js:65 +#: prefs.js:63 msgid "Default Gateway" msgstr "默認網關" -#: prefs.js:200 +#: prefs.js:221 msgid "Device to monitor" msgstr "監控的設備" -#: prefs.js:201 +#: prefs.js:231 +msgid "Settings" +msgstr "" + +#: prefs.js:235 #, fuzzy msgid "Timer (milliseconds)" msgstr "定時(毫秒)" -#: prefs.js:202 +#: prefs.js:239 msgid "Digits" msgstr "位數" -#: prefs.js:203 +#: prefs.js:243 msgid "Label Size" msgstr "標籤大小" -#: prefs.js:204 +#: prefs.js:247 msgid "Unit Label Size" msgstr "單位標籤大小" -#: prefs.js:205 +#: prefs.js:251 msgid "Menu Label Size" msgstr "菜單標籤大小" -#: prefs.js:206 +#: prefs.js:255 msgid "HiDPI factor" msgstr "" -#: prefs.js:207 +#: prefs.js:259 msgid "Placement" msgstr "" -#: prefs.js:211 +#: prefs.js:261 +msgid "Right" +msgstr "" + +#: prefs.js:262 +msgid "Center" +msgstr "" + +#: prefs.js:263 +msgid "Left" +msgstr "" + +#: prefs.js:267 +msgid "Placement Index" +msgstr "" + +#: prefs.js:274 msgid "Show sum(UP+Down)" msgstr "顯示總和(上傳+下載)" -#: prefs.js:212 +#: prefs.js:278 msgid "Show the Icon" msgstr "顯示圖標" -#: prefs.js:255 +#: prefs.js:282 msgid "Use multiples of byte" msgstr "" -#: prefs.js:256 +#: prefs.js:286 msgid "Use binary prefixes" msgstr "" -#: prefs.js:257 +#: prefs.js:290 msgid "Align vertically" msgstr "" -#: prefs.js:267 -msgid "Right" -msgstr "" - -#: prefs.js:268 -msgid "Left" -msgstr "" - -#: prefs.js:271 +#: prefs.js:297 msgid "Show IPs" msgstr "" -#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +#: net_speed.js:105 net_speed.js:109 net_speed.js:113 msgid "B/s" msgstr "B/s" -#: net_speed.js:106 +#: net_speed.js:105 msgid "kiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "MiB/s" msgstr "" -#: net_speed.js:106 +#: net_speed.js:105 msgid "GiB/s" msgstr "" -#: net_speed.js:107 net_speed.js:111 +#: net_speed.js:106 net_speed.js:110 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:107 +#: net_speed.js:106 msgid "kib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Mib/s" msgstr "" -#: net_speed.js:107 +#: net_speed.js:106 msgid "Gib/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "kB/s" msgstr "" -#: net_speed.js:110 +#: net_speed.js:109 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:110 +#: net_speed.js:109 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:111 +#: net_speed.js:110 msgid "kb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Mb/s" msgstr "" -#: net_speed.js:111 +#: net_speed.js:110 msgid "Gb/s" msgstr "" diff --git a/prefs.js b/prefs.js index 837ffc1..d6346b3 100644 --- a/prefs.js +++ b/prefs.js @@ -1,20 +1,19 @@ - /* - * Copyright 2011-2019 Amir Hedayaty < hedayaty AT gmail DOT com > - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - +/* + * Copyright 2011-2019 Amir Hedayaty < hedayaty AT gmail DOT com > + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ const Extension = imports.misc.extensionUtils.getCurrentExtension(); const Lib = Extension.imports.lib; @@ -25,14 +24,13 @@ const Gdk = imports.gi.Gdk; const Gettext = imports.gettext; const Gio = imports.gi.Gio; const Gtk = imports.gi.Gtk; -const Lang = imports.lang; const NM = imports.gi.NM; const _ = Gettext.domain('netspeed').gettext; let schemaDir = Extension.dir.get_child('schemas'); -let schemaSource = schemaDir.query_exists(null)? - Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false): - Gio.SettingsSchemaSource.get_default(); +let schemaSource = schemaDir.query_exists(null) ? + Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false) : + Gio.SettingsSchemaSource.get_default(); let schema = schemaSource.lookup(Lib.SCHEMA, false); let Schema = new Gio.Settings({ settings_schema: schema }); @@ -45,7 +43,7 @@ function init() { Gettext.bindtextdomain('netspeed', localeDir.get_path()); } - if (!Lib.canShowIPs()){ + if (!Lib.canShowIPs()) { // Force to false at startup // FIXME: hide Schema key Schema.set_boolean('show-ips', false); @@ -55,18 +53,18 @@ function init() { const App = class NetSpeed_App { _get_dev_combo() { let listStore = new Gtk.ListStore(); - listStore.set_column_types ([GObject.TYPE_STRING, GObject.TYPE_STRING]); + listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); let all = listStore.append(); - listStore.set (all, [0], [_("ALL")]); - listStore.set (all, [1], ["network-workgroup-symbolic"]); + listStore.set(all, [0], [_("ALL")]); + listStore.set(all, [1], ["network-workgroup-symbolic"]); let defaultGw = listStore.append(); - listStore.set (defaultGw, [0], [_("Default Gateway")]); - listStore.set (defaultGw, [1], ["network-workgroup-symbolic"]); + listStore.set(defaultGw, [0], [_("Default Gateway")]); + listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); let nmc = NM.Client.new(null); - let devices = nmc.get_devices() || [ ]; + let devices = nmc.get_devices() || []; this._devices = []; for (let dev of devices) { @@ -95,41 +93,38 @@ const App = class NetSpeed_App { } this._devices.push(dev.interface); let iter = listStore.append(); - listStore.set (iter, [0], [dev.interface]); - listStore.set (iter, [1], [iconname]); + listStore.set(iter, [0], [dev.interface]); + listStore.set(iter, [1], [iconname]); } - let combo = new Gtk.ComboBox({model: listStore}); + let combo = new Gtk.ComboBox({ model: listStore }); let rendererPixbuf = new Gtk.CellRendererPixbuf(); let rendererText = new Gtk.CellRendererText(); // Pack the renderers into the combobox in the order we want to see - combo.pack_start (rendererPixbuf, false); - combo.pack_start (rendererText, false); + combo.pack_start(rendererPixbuf, false); + combo.pack_start(rendererText, false); // Set the renderers to use the information from our listStore - combo.add_attribute (rendererText, "text", 0); - combo.add_attribute (rendererPixbuf, "icon_name", 1); + combo.add_attribute(rendererText, "text", 0); + combo.add_attribute(rendererPixbuf, "icon_name", 1); return combo; } - _put_dev() { - let active = this.dev.get_active(); - if (active == -1){ - return; - } - switch (active) { - case 0: - Schema.set_string ('device', "all"); - break; - case 1: - Schema.set_string ('device', "defaultGW"); - break; - default: - Schema.set_string ('device', this._devices[active - 2]); + _pick_changement() { + var active = -1; + switch (Schema.get_string('placement')) { + case 'right': + active = 0; + break; + case 'center': + active = 1; + break; + case 'left': + active = 2; + break; } - - Logger.debug("device <- " + Schema.get_string('device')) + this.placement.set_active(active); } _change_placement() { @@ -141,12 +136,16 @@ const App = class NetSpeed_App { } switch (active) { case 0: - Schema.set_string('placement', 'right') - Logger.debug("placement <- right") + Schema.set_string('placement', 'right'); + Logger.debug("placement <- right"); break; case 1: - Schema.set_string('placement', 'left') - Logger.debug("placement <- left") + Schema.set_string('placement', 'center'); + Logger.debug("placement <- center"); + break; + case 2: + Schema.set_string('placement', 'left'); + Logger.debug("placement <- left"); break; } } @@ -158,6 +157,25 @@ const App = class NetSpeed_App { } } + _put_dev() { + let active = this.dev.get_active(); + if (active == -1) { + return; + } + switch (active) { + case 0: + Schema.set_string('device', "all"); + break; + case 1: + Schema.set_string('device', "defaultGW"); + break; + default: + Schema.set_string('device', this._devices[active - 2]); + } + + Logger.debug("device <- " + Schema.get_string('device')); + } + _pick_dev() { let activeDev = Schema.get_string('device'); this._device = activeDev; @@ -196,93 +214,96 @@ const App = class NetSpeed_App { constructor() { this._factor = Schema.get_int('hi-dpi-factor'); - this.main = new Gtk.Grid({row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true}); - this.main.attach (new Gtk.Label({label: _("Device to monitor")}), 1, 1, 1, 1); - this.main.attach (new Gtk.Label({label: _("Timer (milliseconds)")}), 1, 4, 1, 1); - this.main.attach (new Gtk.Label({label: _("Digits")}), 1, 5, 1, 1); - this.main.attach (new Gtk.Label({label: _("Label Size")}), 1, 6, 1, 1); - this.main.attach (new Gtk.Label({label: _("Unit Label Size")}), 1, 7, 1, 1); - this.main.attach (new Gtk.Label({label: _("Menu Label Size")}), 1, 8, 1, 1); - this.main.attach (new Gtk.Label({label: _("HiDPI factor")}), 1, 11, 1, 1); - this.main.attach (new Gtk.Label({label: _("Placement")}), 1, 13, 1, 1); - - //this.dev = new Gtk.Entry(); + + this.main = new Gtk.Grid({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); + + // Header: device selection + this.main.attach(new Gtk.Label({ label: _("Device to monitor") }), 2, 1, 1, 1); this.dev = this._get_dev_combo(); - this.sum = new Gtk.CheckButton({ label: _("Show sum(UP+Down)") }); - this.icon = new Gtk.CheckButton({ label: _("Show the Icon") }); - this.timer = new Gtk.SpinButton({ - adjustment: new Gtk.Adjustment({ - lower: 100, - upper: 10000, - step_increment: 100 - }) - }); - this.digits = new Gtk.SpinButton({ - adjustment: new Gtk.Adjustment({ - lower: 3, - upper: 10, - step_increment: 1 - }) - }); - - this._label_adjustment = new Gtk.Adjustment({ - lower: 1, - upper: 100 * this._factor, - step_increment: this._factor - }); - this.label_size = new Gtk.SpinButton({ - adjustment: this._label_adjustment - }); - - this._unit_label_adjustment = new Gtk.Adjustment({ - lower: 1, - upper: 100 * this._factor, - step_increment: this._factor - }); - this.unit_label_size = new Gtk.SpinButton({ - adjustment: this._unit_label_adjustment - }); - - this._menu_label_adjustment = new Gtk.Adjustment({ - lower: 1, - upper: 100 * this._factor, - step_increment: this._factor - }); - this.menu_label_size = new Gtk.SpinButton({ - adjustment: this._menu_label_adjustment - }); - - this.use_bytes = new Gtk.CheckButton({ label: _("Use multiples of byte") }); - this.bin_prefixes = new Gtk.CheckButton({ label: _("Use binary prefixes") }); - this.vert_align = new Gtk.CheckButton({ label: _("Align vertically") }); - this.hi_dpi_factor = new Gtk.SpinButton({ - adjustment: new Gtk.Adjustment({ - lower: 1, - upper: 100, - step_increment: 1 - }) - }); - - this.placement = new Gtk.ComboBoxText() - this.placement.append_text(_("Right")); - this.placement.append_text(_("Left")); - this.placement.set_active(0); + this.main.attach(this.dev, 3, 1, 1, 1); + + // Separator + let separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL, valign: Gtk.Align.CENTER }); + separator.set_vexpand(false); + this.main.attach(separator, 1, 2, 4, 1); - this.show_ip = new Gtk.CheckButton({ label: _("Show IPs") }); + // Title + this.main.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1); - this.main.attach(this.dev, 2, 1, 1, 1); - this.main.attach(this.sum, 1, 2, 2, 1); - this.main.attach(this.icon, 1, 3, 2, 1); + // Display options + + this.main.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); + this.timer = Gtk.SpinButton.new_with_range(100, 10000, 100); this.main.attach(this.timer, 2, 4, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); + this.digits = Gtk.SpinButton.new_with_range(3, 10, 1); this.main.attach(this.digits, 2, 5, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); + this.label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); this.main.attach(this.label_size, 2, 6, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); + this.unit_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); this.main.attach(this.unit_label_size, 2, 7, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); + this.menu_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); this.main.attach(this.menu_label_size, 2, 8, 1, 1); - this.main.attach(this.use_bytes, 1, 9, 1, 1); - this.main.attach(this.bin_prefixes, 1, 10, 1, 1); - this.main.attach(this.hi_dpi_factor, 2, 11, 2, 1); - this.main.attach(this.vert_align, 1, 12, 1, 1); - this.main.attach(this.placement, 2, 13, 2, 1); + + this.main.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 9, 1, 1); + this.hi_dpi_factor = Gtk.SpinButton.new_with_range(1, 100, 1); + this.main.attach(this.hi_dpi_factor, 2, 9, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Placement") }), 1, 10, 1, 1); + this.placement = new Gtk.ComboBoxText(); + this.placement.append_text(_("Right")); + this.placement.append_text(_("Center")); + this.placement.append_text(_("Left")); + this.placement.set_active(0); + this.main.attach(this.placement, 2, 10, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Placement Index") }), 1, 11, 1, 1); + this.placement_index = Gtk.SpinButton.new_with_range(-1, 20, 1); + this.main.attach(this.placement_index, 2, 11, 1, 1); + + + // Extension Settings + + this.main.attach(new Gtk.Label({ label: _("Show sum(UP+Down)") }), 3, 4, 1, 1); + this.sum = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.main.attach(this.sum, 4, 4, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Show the Icon") }), 3, 5, 1, 1); + this.icon = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.main.attach(this.icon, 4, 5, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Use multiples of byte") }), 3, 6, 1, 1); + this.use_bytes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.main.attach(this.use_bytes, 4, 6, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Use binary prefixes") }), 3, 7, 1, 1); + this.bin_prefixes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.main.attach(this.bin_prefixes, 4, 7, 1, 1); + + this.main.attach(new Gtk.Label({ label: _("Align vertically") }), 3, 8, 1, 1); + this.vert_align = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.main.attach(this.vert_align, 4, 8, 1, 1); + + + this.show_ip = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + if (Lib.canShowIPs()) { + this.main.attach(new Gtk.Label({ label: _("Show IPs") }), 3, 9, 1, 1); + this.main.attach(this.show_ip, 4, 9, 1, 1); + this.show_ip.show(); + } else { + this.show_ip.hide(); + } + + // Initialize values + this._pick_dev(); + this.dev.connect('changed', this._put_dev.bind(this)); Schema.bind('show-sum', this.sum, 'active', Gio.SettingsBindFlags.DEFAULT); Schema.bind('icon-display', this.icon, 'active', Gio.SettingsBindFlags.DEFAULT); @@ -298,26 +319,17 @@ const App = class NetSpeed_App { Schema.bind('show-ips', this.show_ip, 'active', Gio.SettingsBindFlags.DEFAULT); Schema.bind_writable('show-ips', this.show_ip, 'visible', false); - if (Lib.canShowIPs()) { - this.main.attach(this.show_ip, 1, 14, 2, 1); - this.show_ip.show(); - } else { - this.show_ip.hide(); - } - - - this._pick_dev(); - this._factor = Schema.get_int('hi-dpi-factor'); - - this.dev.connect('changed', Lang.bind(this, this._put_dev)); - Schema.connect('changed', Lang.bind(this, this._dpi_changed)); + Schema.connect('changed', this._dpi_changed.bind(this)); + this._dpi_changed(); - this.placement.connect('changed', Lang.bind(this, this._change_placement)) + this._pick_changement(); + this.placement.connect('changed', this._change_placement.bind(this)); + Schema.bind('placement-index', this.placement_index, 'value', Gio.SettingsBindFlags.DEFAULT); } }; function buildPrefsWidget() { let widget = new App(); return widget.main; -}; +} diff --git a/schemas/org.gnome.shell.extensions.netspeed.gschema.xml b/schemas/org.gnome.shell.extensions.netspeed.gschema.xml index 8b007eb..3d3ddc6 100644 --- a/schemas/org.gnome.shell.extensions.netspeed.gschema.xml +++ b/schemas/org.gnome.shell.extensions.netspeed.gschema.xml @@ -63,7 +63,12 @@ 'right' Where to place the UI - You can use left/right to place the items. + You can use left/center/right to place the items. + + + 0 + Index in panel box + Index within the selected panel box (0: first, 1: second, ..., -1: last) false diff --git a/stylesheet.css b/stylesheet.css index 1661b23..fb9d5dd 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -36,5 +36,4 @@ * menu items */ -.ns-menuitem { -} +.ns-menuitem {} \ No newline at end of file From 50408da2494d3f6f1080b639421e176d54a2c545 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 12/25] 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 83162ca..85d326f 100644 --- a/net_speed.js +++ b/net_speed.js @@ -301,8 +301,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; } /** @@ -363,6 +369,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._changed = this._setting.connect('changed', Lang.bind(this, this._reload)); From 6807d37cdbbcdcf4a8166af0e24fe385985a9102 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 22 Jan 2023 19:30:43 +0100 Subject: [PATCH 13/25] switch to debug false --- lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.js b/lib.js index 0192b2b..fa67848 100644 --- a/lib.js +++ b/lib.js @@ -23,7 +23,7 @@ const Config = imports.misc.config; var SCHEMA = "org.gnome.shell.extensions.netspeed"; // Debug Mode Settings -var DEBUG = true; +var DEBUG = false; // Logging const LOG_DOMAIN = SCHEMA; From 10217dc82e7e32479448ec58ffe1da94555d0805 Mon Sep 17 00:00:00 2001 From: NorwayFun <72336380+NorwayFun@users.noreply.github.com> Date: Wed, 22 Feb 2023 08:11:39 +0100 Subject: [PATCH 14/25] po: Add Georgian translation --- po/ka.po | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 po/ka.po diff --git a/po/ka.po b/po/ka.po new file mode 100644 index 0000000..1c3f602 --- /dev/null +++ b/po/ka.po @@ -0,0 +1,163 @@ +# Georgian translation for netspeed. +# Copyright (C) 2023 netspeed's authors. +# This file is distributed under the same license as the netspeed package. +# Temuri Doghonadze , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: netspeed\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-05-30 15:48-0700\n" +"PO-Revision-Date: 2023-02-22 08:09+0100\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.2.2\n" + +#: prefs.js:61 +msgid "ALL" +msgstr "ყველა" + +#: prefs.js:65 +msgid "Default Gateway" +msgstr "ნაგულისხმები რაუტერი" + +#: prefs.js:200 +msgid "Device to monitor" +msgstr "მოწყობილობა მონიტორინგისთვის" + +#: prefs.js:201 +msgid "Timer (milliseconds)" +msgstr "ტაიმერი (მილიწამები)" + +#: prefs.js:202 +msgid "Digits" +msgstr "ციფრები" + +#: prefs.js:203 +msgid "Label Size" +msgstr "ჭდის ზომა" + +#: prefs.js:204 +msgid "Unit Label Size" +msgstr "ერთეულის ჭდის ზომა" + +#: prefs.js:205 +msgid "Menu Label Size" +msgstr "მენიუს ჭდის ზომა" + +#: prefs.js:206 +msgid "HiDPI factor" +msgstr "HiDPI ფაქტორი" + +#: prefs.js:207 +msgid "Placement" +msgstr "განლაგება" + +#: prefs.js:211 +msgid "Show sum(UP+Down)" +msgstr "ჯამის ჩვენება(ზემოთ+ქვემოთ)" + +#: prefs.js:212 +msgid "Show the Icon" +msgstr "ხატულის ჩვენება" + +#: prefs.js:255 +msgid "Use multiples of byte" +msgstr "ბევრი ბაიტის გამოყენება" + +#: prefs.js:256 +msgid "Use binary prefixes" +msgstr "ბინარული პრეფიქსების გამოყენება" + +#: prefs.js:257 +msgid "Align vertically" +msgstr "ვერტიკალურად სწორება" + +#: prefs.js:267 +msgid "Right" +msgstr "მარჯვენა" + +#: prefs.js:268 +msgid "Left" +msgstr "მარცხენა" + +#: prefs.js:271 +msgid "Show IPs" +msgstr "IP-ების ჩვენება" + +#: net_speed.js:106 net_speed.js:110 net_speed.js:114 +msgid "B/s" +msgstr "ბ/წმ" + +#: net_speed.js:106 +msgid "kiB/s" +msgstr "კიბ/წმ" + +#: net_speed.js:106 +msgid "MiB/s" +msgstr "მიბ/წმ" + +#: net_speed.js:106 +msgid "GiB/s" +msgstr "გიბ/წმ" + +#: net_speed.js:107 net_speed.js:111 +msgid "b/s" +msgstr "ბ/წმ" + +#: net_speed.js:107 +msgid "kib/s" +msgstr "კიბ/წმ" + +#: net_speed.js:107 +msgid "Mib/s" +msgstr "მიბ/წმ" + +#: net_speed.js:107 +msgid "Gib/s" +msgstr "გიბ/წმ" + +#: net_speed.js:110 +msgid "kB/s" +msgstr "კბ/წმ" + +#: net_speed.js:110 +msgid "MB/s" +msgstr "მბ/წმ" + +#: net_speed.js:110 +msgid "GB/s" +msgstr "გბ/წმ" + +#: net_speed.js:111 +msgid "kb/s" +msgstr "კბ/წმ" + +#: net_speed.js:111 +msgid "Mb/s" +msgstr "მბ/წმ" + +#: net_speed.js:111 +msgid "Gb/s" +msgstr "გბ/წმ" + +#: net_speed_status_icon.js:97 +msgid "Device" +msgstr "მოწყობილობა" + +#: net_speed_status_icon.js:99 +msgid "Up" +msgstr "მაღლა" + +#: net_speed_status_icon.js:99 +msgid "Down" +msgstr "ქვემოთ" + +#: net_speed_status_icon.js:100 +msgid "IP" +msgstr "IP" From af4b0a5e6b1a0994cdb91ae914f23d24423c7f34 Mon Sep 17 00:00:00 2001 From: Muhammadyusuf <45625440+muhammadyusuf-kurbonov@users.noreply.github.com> Date: Wed, 10 May 2023 09:43:08 +0500 Subject: [PATCH 15/25] Add support for Gnome 43 and 44 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index aa1f03c..83a7f43 100644 --- a/metadata.json +++ b/metadata.json @@ -7,7 +7,8 @@ "40", "41", "42", - "43" + "43", + "44" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", From 232fae8d2feeb422ff1810c484e4098dd75bea6c Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sun, 14 May 2023 12:10:48 +0200 Subject: [PATCH 16/25] fix: typo --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b2be701..9dde22f 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ enable: disable: gnome-extensions disable $(UUID) -unistall: +uninstall: gnome-extensions uninstall $(UUID) reset: @@ -51,4 +51,4 @@ reset: reload: # Reloading shell; Sending SIGHUP signal to gnome-shell (equivalent to alt + f2 ; r ; enter) # busctl --verbose --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")' - killall -HUP gnome-shell \ No newline at end of file + killall -HUP gnome-shell From f27b0624b565cde75f5fb4350b08233876d91bf0 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Fri, 2 Feb 2024 00:46:17 +0100 Subject: [PATCH 17/25] Add support for Gnome 45 --- extension.js | 39 +- lib.js | 172 ++---- messages.js | 68 +++ metadata.json | 12 +- net_speed.js | 997 +++++++++++++++++----------------- net_speed_layout_menu_item.js | 150 ++--- net_speed_status_icon.js | 566 ++++++++++--------- po/ca.po | 72 +-- po/de.po | 72 +-- po/en_CA.po | 72 +-- po/es_ES.po | 72 +-- po/fa.po | 72 +-- po/fr.po | 72 +-- po/it.po | 72 +-- po/netspeed.pot | 72 +-- po/nl_NL.po | 72 +-- po/pt_BR.po | 72 +-- po/ru.po | 72 +-- po/tr.po | 72 +-- po/zh_CN.po | 72 +-- po/zh_TW.po | 72 +-- prefs.js | 520 +++++++++--------- 22 files changed, 1780 insertions(+), 1752 deletions(-) create mode 100644 messages.js diff --git a/extension.js b/extension.js index c105efa..ae31db1 100644 --- a/extension.js +++ b/extension.js @@ -15,16 +15,37 @@ * along with this program. If not, see . */ -const Extension = imports.misc.extensionUtils.getCurrentExtension(); -const NetSpeed = Extension.imports.net_speed; +import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; -/** - * init - * run when gnome-shell loads - */ -function init() { - return new NetSpeed.NetSpeed(); -} +import NetSpeedStatusIcon from './net_speed_status_icon.js'; +import { Logger } from './lib.js'; +import { NetSpeed } from './net_speed.js'; + + + + +export default class extends Extension { + enable() { + Logger.init(this); + + this._netSpeed = new NetSpeed(this); + this._netSpeedMenu = new NetSpeedStatusIcon(this, this._netSpeed); + + Main.panel.addToStatusArea('netSpeed', this._netSpeedMenu); + // reposition in panel trick + this._netSpeedMenu._positionInPanelChanged(); + + this._netSpeed.start(); + } + + disable() { + this._netSpeed?.stop(); + this._netSpeedMenu?.destroy(); + this._netSpeed = null; + this._netSpeedMenu = null; + } +} // vim: ts=2 sw=2 diff --git a/lib.js b/lib.js index fa67848..dfd3c1c 100644 --- a/lib.js +++ b/lib.js @@ -15,146 +15,66 @@ * along with this program. If not, see . */ -const Extension = imports.misc.extensionUtils.getCurrentExtension(); -const GLib = imports.gi.GLib; -const Config = imports.misc.config; - -// Schema name -var SCHEMA = "org.gnome.shell.extensions.netspeed"; - -// Debug Mode Settings -var DEBUG = false; - -// Logging -const LOG_DOMAIN = SCHEMA; -const LOG_PREFIX = `[${LOG_DOMAIN}]`; - -// Log all messages when connected to the journal -if (GLib.log_writer_is_journald(2) && DEBUG) { - GLib.setenv('G_MESSAGES_DEBUG', LOG_DOMAIN, false); -} else { - // FIXME: manage already existing env var - GLib.unsetenv('G_MESSAGES_DEBUG'); -} +// DEBUG const useful to debug on X11 +const DEBUG = false; /** - * A Logger class inspired to GJS doc/Logging.md - * - */ -var _loggerClass = class _Logger { - - constructor(module) { - } - - _getMessage(event, file, func, line) { - let timestamp = new Date(new Date().getTime()).toISOString(); - let message = `${event}`; - message = `[${Extension.uuid}:${file}:${func}:${line}] -> ${event}`; - return message; - } - - _makeLogFunction(level) { - return message => { - let stack = (new Error()).stack; - let caller = stack.split('\n')[2]; - - // caller example: message@/home/guser/.local/share/gnome-shell/extensions/netspeed@hedayaty.gmail.com/lib.js:75:9 - // Extension.path: /home/guser/.local/share/gnome-shell/extensions/netspeed@hedayaty.gmail.com - caller = caller.replace(Extension.path + "/", ""); - - let [code, line, _] = caller.split(':'); - let [func, file] = code.split(/\W*@/); - let msg = this._getMessage(message, file, func, line); - GLib.log_structured(LOG_DOMAIN, level, { - 'MESSAGE': msg, - //'SYSLOG_IDENTIFIER': LOG_DOMAIN, - 'CODE_FILE': file, - 'CODE_FUNC': func, - 'CODE_LINE': line - }); - }; - } + * A Logger class with format +*/ +export class Logger { - debug(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_DEBUG)(event); - } + static _formatMessage(message, file, func, line) { + return `[${this.extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`; + } - log(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE)(event); - } + static _makeMessage(message) { + /* FIXME: rretrieve logging stack + let stack = (new Error()).stack; + let caller = stack.split('\n').pop(); - message(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE)(event); - } - - info(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_INFO)(event); - } + console.log(stack.split('\n')); - warning(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_WARNING)(event); - } - - /* - error(event) { - // result in a core dump - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_ERROR)(event); - } + // caller example: enable@file:///home/cosimo/.local/share/gnome-shell/extensions/netspeed@hedayaty.gmail.com/extension.js:35:24 + // or: resource:///org/gnome/Shell/ + const [func, caller] = caller.split(/@(.+)/);; + const [code, line, _] = caller.split(':'); */ + return Logger._formatMessage(message, "", "", ""); + } - critical(event) { - this._makeLogFunction(GLib.LogLevelFlags.LEVEL_CRITICAL)(event); - } -}; + static init(extension) { + if (Logger._domain) + return; + this.extension = extension; -/** - * getLogger: - * @returns {_Logger} a new Logger instance if not exists - */ -let _loggerInstance; -function getLogger() { - if (!_loggerInstance) { - _loggerInstance = new _loggerClass(); - } - return _loggerInstance; -} + const { name: domain } = extension.metadata; + Logger._domain = domain.replaceAll(' ', '-'); + } + static debug(message) { + Logger._logMessage(console.debug, message); + } -/** - * splitVersion: - * @param {string} version - the version we have in semantic versioning format - * @returns {int[2]} - an array of int for and for @version - * - * @version must be in the format ... - * and are always ignored - */ + static info(message) { + Logger._logMessage(console.info, message); + } -function splitVersion(version) { - let currentArray = version.split('.'); - let major = parseInt(currentArray[0]); - let minor = parseInt(currentArray[1]); - return [major, minor]; -} + static warn(message) { + Logger._logMessage(console.warn, message); + } + static error(message) { + Logger._logMessage(console.critical, message); + } -/** - * canShowIPs: - * @returns {boolean} - true if panel can show IPs, false otherwise - * - * Gjs 1.56 (not sure) - 1.57 (Gnome 3.28 - 3.32) have a bug on Marshalling of GPtrArray, - * so NetworkManager js binding crash on returning ip_config. - * https://gitlab.gnome.org/GNOME/gjs/issues/9 - */ - -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}' - Parsed: ${version_array[0]}.${version_array[1]} - Compared: ${version_array[0] >= 40}`); - return true; + static _logMessage(logFunc, message) { + const msg = Logger._makeMessage(message); + if (DEBUG) { + console.log(msg); + return; } - getLogger().warning(`Show IP cannot be enabled. Gjs version: '${Config.PACKAGE_VERSION}'`); - return false; + + logFunc(msg); + } } diff --git a/messages.js b/messages.js new file mode 100644 index 0000000..5c72bde --- /dev/null +++ b/messages.js @@ -0,0 +1,68 @@ +/* + * Copyright 2011-2019 Amir Hedayaty < hedayaty AT gmail DOT com > + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import GObject from 'gi://GObject'; + + +const NetSpeedMessage = GObject.registerClass( + class NetSpeedMessage extends GObject.Object { + constructor(props = {}) { + super(); + this.set(props); + } + }); + +/* + * {NetSpeedGlobalStatsMessage} object has the properties: + * {object} sum + * {object} up + * {object} down + * + * Each property has the properties: + * {string} text + * {string} unit + */ +export const NetSpeedGlobalStatsMessage = GObject.registerClass( + class NetSpeedGlobalStatsMessage extends NetSpeedMessage { } +); + +/* + * {NetSpeedSpeedsMessage} object has the properties: + * {array} speeds: an array of object with properies: + * {string} up + * {string} down + */ +export const NetSpeedSpeedsMessage = GObject.registerClass( + class NetSpeedSpeedsMessage extends NetSpeedMessage { } +); + +/* + * {NetSpeedIPsMessage} object has the properties: + * {array} ips: an array of {string}s + */ +export const NetSpeedIPsMessage = GObject.registerClass( + class NetSpeedIPsMessage extends NetSpeedMessage { } +); + +/* + * {NetSpeedMenuMessage} object has the properties: + * {array} devices_text: an array of {string}s + * {array} types: an array of {string}s + */ +export const NetSpeedMenuMessage = GObject.registerClass( + class NetSpeedMenuMessage extends NetSpeedMessage { } +); \ No newline at end of file diff --git a/metadata.json b/metadata.json index 83a7f43..a893588 100644 --- a/metadata.json +++ b/metadata.json @@ -1,16 +1,14 @@ { "_generated": "Generated by SweetTooth, do not edit", - "description": "Displays Internet Speed", "name": "NetSpeed", + "description": "Displays Internet Speed", "original-author": "hedayaty@gmail.com", "shell-version": [ - "40", - "41", - "42", - "43", - "44" + "45" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", - "version": 32 + "settings-schema": "org.gnome.shell.extensions.netspeed", + "gettext-domain": "netspeed", + "version": 38 } \ No newline at end of file diff --git a/net_speed.js b/net_speed.js index 1d32e3c..feb558c 100644 --- a/net_speed.js +++ b/net_speed.js @@ -15,549 +15,546 @@ * along with this program. If not, see . */ -const Extension = imports.misc.extensionUtils.getCurrentExtension(); -const Lib = Extension.imports.lib; -const Gettext = imports.gettext; -const Gio = imports.gi.Gio; -const GObject = imports.gi.GObject; -const ByteArray = imports.byteArray; -const GLib = imports.gi.GLib; -const Mainloop = imports.mainloop; -const Panel = imports.ui.main.panel; +import GObject from 'gi://GObject'; +import GLib from 'gi://GLib'; +import NM from 'gi://NM'; -const NetworkManager = imports.gi.NM; +import { gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js'; -const _ = Gettext.domain('netspeed').gettext; -const NetSpeedStatusIcon = Extension.imports.net_speed_status_icon; - -const Logger = Lib.getLogger(); +import { Logger } from './lib.js'; +import * as Messages from './messages.js'; /** * Class NetSpeed - * The extension */ -var NetSpeed = class NetSpeed { - /** - * NetSpeed: _init - * Constructor - */ - constructor() { - let localeDir = Extension.dir.get_child('locale'); - if (localeDir.query_exists(null)) { - Gettext.bindtextdomain('netspeed', localeDir.get_path()); - } +export const NetSpeed = GObject.registerClass({ + Signals: { + 'reloaded': {}, + 'global-stats-changed': { + param_types: [ + Messages.NetSpeedGlobalStatsMessage.$gtype, + ], + }, + 'speeds-changed': { + param_types: [ + Messages.NetSpeedSpeedsMessage.$gtype, + ], + }, + 'ips-changed': { + param_types: [ + Messages.NetSpeedIPsMessage.$gtype, + ], + }, + 'menu-changed': { + param_types: [ + Messages.NetSpeedMenuMessage.$gtype, + ], } - - /** - * NetSpeed: _is_up2date - */ - _is_up2date() { - if (this._devices.length != this._olddevices.length) { - return 0; - } - for (let i = 0; i < this._devices.length; ++i) { - if (this._devices[i] != this._olddevices[i]) - return 0; - } - return 1; + }, +}, class NetSpeed extends GObject.Object { + /** + * NetSpeed: _init + * Constructor + */ + + constructor(extension) { + super(); + this._settings = extension.getSettings(); + + this._last_up = 0; // size of upload in previous snapshot + this._last_down = 0; // size of download in previous snapshot + this._last_time = 0; // time of the latest snapshot + this._device_state_changed = true; // flag to trigger menu refreshing + + this._values = []; + this._devices = []; + this._nm_client = NM.Client.new(null); + this._nm_signals = []; + this._nm_signals.push(this._nm_client.connect('any-device-added', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('any-device-removed', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('connection-removed', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('active-connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('active-connection-removed', this._nm_connection_changed.bind(this))); + + // store NM Device 'state-changed' signal bindings to disconnect on disable + this._nm_devices_signals_map = new Map(); + + + this._saving = 0; + this.show_ips = this._settings.get_boolean('show-ips'); + + this._load(); + + this._updateDefaultGw(); + } + + + /** + * NetSpeed: _is_up2date + */ + _is_up2date() { + if (this._devices.length !== this._olddevices.length) { + return 0; } - - /** - * NetSpeed: get_device_type - */ - get_device_type(device) { - let devices = this._client.get_devices() || []; - - for (let dev of devices) { - if (dev.interface == device) { - switch (dev.device_type) { - case NetworkManager.DeviceType.ETHERNET: - return "ethernet"; - case NetworkManager.DeviceType.WIFI: - return "wifi"; - case NetworkManager.DeviceType.BT: - return "bt"; - case NetworkManager.DeviceType.OLPC_MESH: - return "olpcmesh"; - case NetworkManager.DeviceType.WIMAX: - return "wimax"; - case NetworkManager.DeviceType.MODEM: - return "modem"; - default: - return "none"; - } - } - } - - return "none"; + for (let i = 0; i < this._devices.length; ++i) { + if (this._devices[i] !== this._olddevices[i]) + return 0; } - - /** - * NetSpeed: _speed_to_string - */ - _speed_to_string(amount) { - let m_digits = this.digits; - let divider, byte_speed_map, bit_speed_map; - if (this.bin_prefixes) { - divider = 1024; // 1MiB = 1024kiB - byte_speed_map = [_("B/s"), _("kiB/s"), _("MiB/s"), _("GiB/s")]; - bit_speed_map = [_("b/s"), _("kib/s"), _("Mib/s"), _("Gib/s")]; - } else { - divider = 1000; // 1MB = 1000kB - byte_speed_map = [_("B/s"), _("kB/s"), _("MB/s"), _("GB/s")]; - bit_speed_map = [_("b/s"), _("kb/s"), _("Mb/s"), _("Gb/s")]; - } - if (amount == 0) - return { text: "0", unit: _(this.use_bytes ? "B/s" : "b/s") }; - if (m_digits < 3) - m_digits = 3; - amount *= 1000 * (this.use_bytes ? 1 : 8); - let unit = 0; - while (amount >= divider && unit < 3) { // 1M=1024K, 1MB/s=1000MB/s - amount /= divider; - ++unit; + return 1; + } + + /** + * NetSpeed: get_device_type + */ + get_device_type(device) { + let devices = this._nm_client.get_devices() || []; + + for (let dev of devices) { + if (dev.interface === device) { + switch (dev.device_type) { + case NM.DeviceType.ETHERNET: + return "ethernet"; + case NM.DeviceType.WIFI: + return "wifi"; + case NM.DeviceType.BT: + return "bt"; + case NM.DeviceType.OLPC_MESH: + return "olpcmesh"; + case NM.DeviceType.WIMAX: + return "wimax"; + case NM.DeviceType.MODEM: + return "modem"; + default: + return "none"; } - - if (amount >= 100) - m_digits -= 2; - else if (amount >= 10) - m_digits -= 1; - - return { - text: amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: m_digits - 1 }), - unit: (this.use_bytes ? byte_speed_map : bit_speed_map)[unit] - }; + } } - /** - * NetSpeed: _set_labels - */ - _set_labels(sum, up, down) { - this._status_icon.set_labels(sum, up, down); + return "none"; + } + + /** + * NetSpeed: _speed_to_string + */ + _speed_to_string(amount) { + let m_digits = this.digits; + let divider, byte_speed_map, bit_speed_map; + if (this.bin_prefixes) { + divider = 1024; // 1MiB = 1024kiB + byte_speed_map = [_("B/s"), _("kiB/s"), _("MiB/s"), _("GiB/s")]; + bit_speed_map = [_("b/s"), _("kib/s"), _("Mib/s"), _("Gib/s")]; + } else { + divider = 1000; // 1MB = 1000kB + byte_speed_map = [_("B/s"), _("kB/s"), _("MB/s"), _("GB/s")]; + bit_speed_map = [_("b/s"), _("kb/s"), _("Mb/s"), _("Gb/s")]; } - - /** - * NetSpeed: _update_speeds - */ - _update_speeds() { - this._status_icon.update_speeds(this._speeds); - - // fix #131 by forcing a delayed redraw - GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => { - this._status_icon.queue_redraw(); - return GLib.SOURCE_REMOVE; - }); + if (amount === 0) + return { text: "0", unit: _(this.use_bytes ? "B/s" : "b/s") }; + if (m_digits < 3) + m_digits = 3; + amount *= 1000 * (this.use_bytes ? 1 : 8); + let unit = 0; + while (amount >= divider && unit < 3) { // 1M=1024K, 1MB/s=1000MB/s + amount /= divider; + ++unit; } - /** - * NetSpeed: _update_ips - */ - _update_ips() { - this._status_icon.update_ips(this._ips); + if (amount >= 100) + m_digits -= 2; + else if (amount >= 10) + m_digits -= 1; + + return { + text: amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: m_digits - 1 }), + unit: (this.use_bytes ? byte_speed_map : bit_speed_map)[unit] + }; + } + + /** + * NetSpeed: _emit_stats + */ + _sendStats(sum, up, down) { + this.emit( + 'global-stats-changed', + new Messages.NetSpeedGlobalStatsMessage( + { + sum: sum, up: up, down: down + }) + ); + } + + /** + * NetSpeed: _update_speeds + */ + _sendSpeeds() { + this.emit( + 'speeds-changed', + new Messages.NetSpeedSpeedsMessage({ speeds: this._speeds }) + ); + } + + /** + * NetSpeed: _update_ips + */ + _sendIps() { + this.emit( + 'ips-changed', + new Messages.NetSpeedIPsMessage({ ips: this._ips }) + ); + } + + /** + * NetSpeed: _create_menu + */ + _create_menu() { + let types = []; + let devices_text = []; + for (let dev of this._devices) { + types.push(this.get_device_type(dev)); + let wifi_ssid = this._retrieve_wifi_ssid(dev); + //Logger.info(`wifi_ssid is '${wifi_ssid}' for dev '${dev}'`); + if (wifi_ssid !== null) { + devices_text.push(dev + `\n${wifi_ssid}`); + continue; + } + devices_text.push(dev); } - /** - * NetSpeed: _create_menu - */ - _create_menu() { - let types = []; - let devices_text = []; - for (let dev of this._devices) { - types.push(this.get_device_type(dev)); - let wifi_ssid = this._retrieve_wifi_ssid(dev); - //Logger.info(`wifi_ssid is '${wifi_ssid}' for dev '${dev}'`); - if (wifi_ssid != null) { - devices_text.push(dev + `\n${wifi_ssid}`); - continue; - } - devices_text.push(dev); - } - this._status_icon.create_menu(devices_text, types); + this.emit( + 'menu-changed', + new Messages.NetSpeedMenuMessage( + { + devices_text: devices_text, + types: types, + }) + ); + } + + /** + * NetSpeed: _updateDefaultGw + */ + _updateDefaultGw() { + let flines = GLib.file_get_contents('/proc/net/route'); // Read the file + let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines + for (let nline of nlines) { //first 2 lines are for header + let line = nline.replace(/^ */g, ""); + let params = line.split("\t"); + if (params.length !== 11) // ignore empty lines + continue; + // So store up/down values + if (params[1] === "00000000") { + this._defaultGw = params[0]; + } } - - /** - * NetSpeed: _updateDefaultGw - */ - _updateDefaultGw() { - let flines = GLib.file_get_contents('/proc/net/route'); // Read the file - let nlines = ByteArray.toString(flines[1]).split("\n"); // Break to lines - for (let nline of nlines) { //first 2 lines are for header - let line = nline.replace(/^ */g, ""); - let params = line.split("\t"); - if (params.length != 11) // ignore empty lines - continue; - // So store up/down values - if (params[1] == "00000000") { - this._defaultGw = params[0]; - } - } + } + + /** + * NetSpeed: _update + */ + _update() { + this._updateDefaultGw(); + let flines = GLib.file_get_contents('/proc/net/dev'); // Read the file + let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines + + let up = 0; // set initial + let down = 0; + this._oldvalues = this._values; + this._values = []; + this._speeds = []; + this._ips = []; + this._olddevices = this._devices; + this._devices = []; + + let time = GLib.get_monotonic_time() / 1000; // current time 1000 is not the net_speed.timer! + let delta = time - this._last_time; // Here the difference is evaluated + this._last_time = time; + + // parse the file + for (let i = 2; i < nlines.length - 1; ++i) { //first 2 lines are for header + let line = nlines[i].replace(/ +/g, " ").replace(/^ */g, ""); + let params = line.split(" "); + if (params[0].replace(":", "") === "lo") // ignore local device + continue; + // So store up/down values + this._values.push([parseInt(params[9]), parseInt(params[1])]); + this._devices.push(params[0].replace(":", "")); } - /** - * NetSpeed: _update - */ - _update() { - this._updateDefaultGw(); - let flines = GLib.file_get_contents('/proc/net/dev'); // Read the file - let nlines = ByteArray.toString(flines[1]).split("\n"); // Break to lines - - let up = 0; // set initial - let down = 0; - this._oldvalues = this._values; - this._values = []; - this._speeds = []; - this._ips = []; - this._olddevices = this._devices; - this._devices = []; - - let time = GLib.get_monotonic_time() / 1000; // current time 1000 is not the net_speed.timer! - let delta = time - this._last_time; // Here the difference is evaluated - this._last_time = time; - - // parse the file - for (let i = 2; i < nlines.length - 1; ++i) { //first 2 lines are for header - let line = nlines[i].replace(/ +/g, " ").replace(/^ */g, ""); - let params = line.split(" "); - if (params[0].replace(":", "") == "lo") // ignore local device - continue; - // So store up/down values - this._values.push([parseInt(params[9]), parseInt(params[1])]); - this._devices.push(params[0].replace(":", "")); - } - - //log("[netspeed] Devices: " + this._devices); - - var total = 0; - var total_speed = null; - var up_speed = null; - var down_speed = null; - - if (this._is_up2date() == 1 && !this._device_state_changed) { - for (let i = 0; i < this._values.length; ++i) { - let _up = this._values[i][0] - this._oldvalues[i][0]; - let _down = this._values[i][1] - this._oldvalues[i][1]; - - // Avoid negetive speed in case of device going down, when device goes down, - if (_up < 0) - _up = 0; - if (_down < 0) - _down = 0; - - let _up_speed = this._speed_to_string(_up / delta); - let _down_speed = this._speed_to_string(_down / delta); - this._speeds.push({ - up: _up_speed.text + " " + _up_speed.unit, - down: _down_speed.text + " " + _down_speed.unit - }); - - total += _down + _up; - up += _up; - down += _down; - if (this.getDevice() == this._devices[i]) { - total_speed = this._speed_to_string((_up + _down) / delta); - up_speed = this._speed_to_string(_up / delta); - down_speed = this._speed_to_string(_down / delta); - } - } - if (total_speed == null) { - total_speed = this._speed_to_string(total / delta); - up_speed = this._speed_to_string(up / delta); - down_speed = this._speed_to_string(down / delta); - } - - this._set_labels(total_speed, up_speed, down_speed); - this._update_speeds(); - } else { - this._create_menu(); - } - - if (this._device_state_changed && this.show_ips) { - this._retrieve_ips(); - this._update_ips(); - Logger.debug("Retrieved ips"); - } - - // reset state - this._device_state_changed = false; - - return true; - } + //Logger.debug("Devices: " + this._devices); + + let total = 0; + let total_speed = null; + let up_speed = null; + let down_speed = null; + + if (this._is_up2date() === 1 && !this._device_state_changed) { + for (let i = 0; i < this._values.length; ++i) { + let _up = this._values[i][0] - this._oldvalues[i][0]; + let _down = this._values[i][1] - this._oldvalues[i][1]; + + // Avoid negetive speed in case of device going down, when device goes down, + if (_up < 0) + _up = 0; + if (_down < 0) + _down = 0; + + let _up_speed = this._speed_to_string(_up / delta); + let _down_speed = this._speed_to_string(_down / delta); + this._speeds.push({ + up: _up_speed.text + " " + _up_speed.unit, + down: _down_speed.text + " " + _down_speed.unit + }); - /** - * NetSpeed: _load - */ - _load() { - if (this._saving == 1) { - return; + total += _down + _up; + up += _up; + down += _down; + if (this.getDevice() === this._devices[i]) { + total_speed = this._speed_to_string((_up + _down) / delta); + up_speed = this._speed_to_string(_up / delta); + down_speed = this._speed_to_string(_down / delta); } - this.showsum = this._setting.get_boolean('show-sum'); - this.use_icon = this._setting.get_boolean('icon-display'); - this.digits = this._setting.get_int('digits'); - this._device = this._setting.get_string('device'); - this.timer = this._setting.get_int('timer'); - this.label_size = this._setting.get_int('label-size'); - this.unit_label_size = this._setting.get_int('unit-label-size'); - 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.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; + } + if (total_speed === null) { + total_speed = this._speed_to_string(total / delta); + up_speed = this._speed_to_string(up / delta); + down_speed = this._speed_to_string(down / delta); + } + + this._sendStats(total_speed, up_speed, down_speed); + this._sendSpeeds(); + } else { + this._create_menu(); } - /** - * NetSpeed: save - */ - save() { - this._saving = 1; // Disable Load - this._setting.set_boolean('show-sum', this.showsum); - this._setting.set_string('device', this._device); - this._setting.set_boolean('show-ips', this.show_ips); - this._saving = 0; // Enable Load + if (this._device_state_changed && this.show_ips) { + this._retrieve_ips(); + this._sendIps(); + Logger.debug("Retrieved ips"); } - /** - * NetSpeed: _reload - */ - _reload() { - if (this._setting !== null) { - let m_timer = this._setting.get_int('timer'); - if (m_timer !== this.timer) { - Mainloop.source_remove(this._timerid); - this._timerid = Mainloop.timeout_add(m_timer, this._update.bind(this)); - // this.timer will be updated within this._load, so no need to update it here - } - this._load(); - this._status_icon.updateui(); - } - } + // reset state + this._device_state_changed = false; - _positionInPanelChanged() { - this._status_icon.get_parent().remove_actor(this._status_icon); + // keep alive timer + return true; + } - // small HACK with private boxes :) - let boxes = { - left: Panel._leftBox, - center: Panel._centerBox, - right: Panel._rightBox - }; - - let p = this._setting.get_string('placement'); - let i = this._setting.get_int('placement-index'); - - Logger.debug(`_positionInPanelChanged: ${p} at index ${i}`); - - boxes[p].insert_child_at_index(this._status_icon, i); + /** + * NetSpeed: _load + */ + _load() { + if (this._saving === 1) { + return; } - - /** - * NetSpeed: enable - * exported to enable the extension - */ - enable() { - this._last_up = 0; // size of upload in previous snapshot - this._last_down = 0; // size of download in previous snapshot - this._last_time = 0; // time of the latest snapshot - this._device_state_changed = true; // flag to trigger menu refreshing - - this._values = []; - this._devices = []; - this._client = NetworkManager.Client.new(null); - this._nm_signals = []; - this._nm_signals.push(this._client.connect('any-device-added', this._nm_device_changed.bind(this))); - this._nm_signals.push(this._client.connect('any-device-removed', this._nm_device_changed.bind(this))); - this._nm_signals.push(this._client.connect('connection-added', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._client.connect('connection-removed', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._client.connect('active-connection-added', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._client.connect('active-connection-removed', this._nm_connection_changed.bind(this))); - - // store NM Device 'state-changed' signal bindings to disconnect on disable - this._nm_devices_signals_map = new Map(); - - let schemaDir = Extension.dir.get_child('schemas'); - let schemaSource = schemaDir.query_exists(null) ? - Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false) : - Gio.SettingsSchemaSource.get_default(); - 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(); - - this._changed = this._setting.connect('changed', this._reload.bind(this)); - this._timerid = Mainloop.timeout_add(this.timer, this._update.bind(this)); - this._status_icon = new NetSpeedStatusIcon.NetSpeedStatusIcon(this); - - this._positionInPanelChanged(); - this._placement_changed_id = this._setting.connect('changed::placement', this._positionInPanelChanged.bind(this)); - this._placement_index_changed_id = this._setting.connect('changed::placement-index', this._positionInPanelChanged.bind(this)); + this.digits = this._settings.get_int('digits'); + this._device = this._settings.get_string('device'); + this.timer = this._settings.get_int('timer'); + this.use_bytes = this._settings.get_boolean('use-bytes'); + this.bin_prefixes = this._settings.get_boolean('bin-prefixes'); + + let show_ips = this._settings.get_boolean('show-ips'); + if (show_ips !== this.show_ips && show_ips) { + // trigger ip reload + this._trigger_ips_reload(); } - - /** - * NetSpeed: disable - * exported to disable the extension - */ - disable() { - if (this._timerid != 0) { - Mainloop.source_remove(this._timerid); - this._timerid = 0; - } - this._devices = null; - this._values = null; - this._olddevices = null; - this._oldvalues = null; - this._setting = null; - - this._nm_signals.forEach(sig_id => { - this._client.disconnect(sig_id); - }); - - this._disconnect_all_nm_device_state_changed(); - this._client = null; - this._status_icon.destroy(); - this._status_icon = null; + this.show_ips = show_ips; + } + + /** + * NetSpeed: save + */ + save() { + this._saving = 1; // Disable Load + //this._settings.set_boolean('show-sum', this.showsum); + //this._settings.set_string('device', this._device); + this._settings.set_boolean('show-ips', this.show_ips); + this._saving = 0; // Enable Load + } + + /** + * NetSpeed: _reload + */ + _reload() { + if (this._settings !== null) { + let m_timer = this._settings.get_int('timer'); + if (m_timer !== this.timer) { + GLib.source_remove(this._timerid); + this._timerid = GLib.timeout_add(m_timer, this._update.bind(this)); + // this.timer will be updated within this._load, so no need to update it here + } + this._load(); + //this._status_icon.updateui(); + this.emit('reloaded'); } + } - getDevice() { - if (this._device == "defaultGW") { - return this._defaultGw; - } else { - return this._device; - } + /** + * NetSpeed: start + */ + start() { + this._changed = this._settings.connect('changed', this._reload.bind(this)); + this._timerid = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this.timer, this._update.bind(this)); + } + + /** + * NetSpeed: stop + */ + stop() { + if (this._timerid && this._timerid !== 0) { + GLib.source_remove(this._timerid); + this._timerid = 0; } - - setDevice(device) { - this._device = device; + this._devices = null; + this._values = null; + this._olddevices = null; + this._oldvalues = null; + this._settings = null; + + this._nm_signals.forEach(sig_id => { + this._nm_client.disconnect(sig_id); + }); + + this._disconnect_all_nm_device_state_changed(); + this._nm_client = null; + //this._status_icon.destroy(); + //this._status_icon = null; + } + + getDevice() { + if (this._device === "defaultGW") { + return this._defaultGw; + } else { + return this._device; } - - /** - * NetSpeed: _nm_device_changed - */ - _nm_device_changed(client, device) { - this._trigger_ips_reload(); + } + + /* + setDevice(device) { + this._device = device; + } + */ + + /** + * NetSpeed: _nm_device_changed + */ + _nm_device_changed(_client, _device) { + this._trigger_ips_reload(); + } + + /** + * NetSpeed: _nm_connection_changed + */ + _nm_connection_changed(_client, _connection) { + this._trigger_ips_reload(); + } + + /** + * NetSpeed: _trigger_ips_reload + */ + _trigger_ips_reload() { + this._device_state_changed = true; + } + + /** + * NetSpeed: _retrieve_ips + * get ips v4 + */ + _retrieve_ips() { + // remove previous connects + this._disconnect_all_nm_device_state_changed(); + + for (let dev of this._devices) { + let nm_dev = this._nm_client.get_device_by_iface(dev); + let addresses = this._getAddresses(nm_dev, GLib.SYSDEF_AF_INET); + this._ips.push(addresses); + this._connect_nm_device_state_changed(nm_dev); } - - /** - * NetSpeed: _nm_connection_changed - */ - _nm_connection_changed(client, connection) { - this._trigger_ips_reload(); + } + + /** + * NetSpeed: _retrieve_wifi_ssid + * Retrieve access point name (SSID) for wifi device interface + */ + _retrieve_wifi_ssid(iface) { + let nm_dev = this._nm_client.get_device_by_iface(iface); + if (nm_dev.get_device_type() === NM.DeviceType.WIFI) { + let active_ap = nm_dev.get_active_access_point(); + if (active_ap !== null) { + return new TextDecoder().decode(active_ap.get_ssid().toArray(), 'UTF-8'); + } } - - /** - * NetSpeed: _trigger_ips_reload - */ - _trigger_ips_reload() { - this._device_state_changed = true; + return null; + } + + /** + * NetSpeed: _connect_nm_device_state_changed + * @param {NM.Device} nm_device: NM Device instance + */ + _connect_nm_device_state_changed(nm_device) { + if (!this._nm_devices_signals_map.has(nm_device.get_iface())) { + let signal_id = nm_device.connect('state-changed', this._nm_device_state_changed.bind(this)); + this._nm_devices_signals_map.set(nm_device.get_iface(), [nm_device, signal_id]); } - - /** - * NetSpeed: _retrieve_ips - * get ips v4 - */ - _retrieve_ips() { - // remove previous connects - this._disconnect_all_nm_device_state_changed(); - - for (let dev of this._devices) { - let nm_dev = this._client.get_device_by_iface(dev); - let addresses = this._getAddresses(nm_dev, GLib.SYSDEF_AF_INET); - this._ips.push(addresses); - this._connect_nm_device_state_changed(nm_dev); - } + } + + /** + * NetSpeed: _disconnect_nm_device_state_changed + * Use GObject.signal_handler_disconnect to avoid override of disconnect + * due ot introspection on NM.Device . + */ + _disconnect_all_nm_device_state_changed() { + for (let [nm_device, signal_id] of this._nm_devices_signals_map.values()) { + GObject.signal_handler_disconnect(nm_device, signal_id); } - - /** - * NetSpeed: _retrieve_wifi_ssid - * Retrieve access point name (SSID) for wifi device interface - */ - _retrieve_wifi_ssid(iface) { - let nm_dev = this._client.get_device_by_iface(iface); - if (nm_dev.get_device_type() == NetworkManager.DeviceType.WIFI) { - let active_ap = nm_dev.get_active_access_point(); - if (active_ap != null) { - return ByteArray.toString(ByteArray.fromGBytes(active_ap.get_ssid()), 'UTF-8'); - } - } - return null; + this._nm_devices_signals_map.clear(); + } + + /** + * NetSpeed: _nm_device_state_changed + * Handler for NM.Device 'state-changed' signal + * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceState for states + * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceStateReason for reasons + */ + _nm_device_state_changed(_nm_device, _old_state, _new_state, _reason) { + //Logger.info(`${nm_device.get_iface()} move from ${old_state} to ${new_state}: reason ${reason}`); + this._trigger_ips_reload(); + } + + /** + * NetSpeed: _getAddresses + * function from https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/examples/js/get_ips.js#L16 + * @param {NM.Device}: NetWorkManager Device + * @param {Glib.SYSDEF_AF_INET}: family - Glib.SYSDEF_AF_INET or Glib.SYSDEF_AF_INET6 + * @returns {string[]}: Array of 'address/prefix' string + */ + _getAddresses(nm_device, family) { + let ip_cfg; + if (family === GLib.SYSDEF_AF_INET) + ip_cfg = nm_device.get_ip4_config(); + else + ip_cfg = nm_device.get_ip6_config(); + + if (ip_cfg === null) { + //Logger.info(`No config for device '${nm_device.get_iface()}'`); + return []; } - /** - * NetSpeed: _connect_nm_device_state_changed - * @param {NM.Device} nm_device: NetworkManager Device instance - */ - _connect_nm_device_state_changed(nm_device) { - if (!this._nm_devices_signals_map.has(nm_device.get_iface())) { - let signal_id = nm_device.connect('state-changed', this._nm_device_state_changed.bind(this)); - this._nm_devices_signals_map.set(nm_device.get_iface(), [nm_device, signal_id]); - } - } - - /** - * NetSpeed: _disconnect_nm_device_state_changed - * Use GObject.signal_handler_disconnect to avoid override of disconnect - * due ot introspection on NM.Device . - */ - _disconnect_all_nm_device_state_changed() { - for (let [nm_device, signal_id] of this._nm_devices_signals_map.values()) { - GObject.signal_handler_disconnect(nm_device, signal_id); - } - this._nm_devices_signals_map.clear(); + let nm_addresses = ip_cfg.get_addresses(); + if (nm_addresses.length === 0) { + //Logger.info(`No IP addresses for device '${nm_device.get_iface()}'`); + return []; } - /** - * NetSpeed: _nm_device_state_changed - * Handler for NM.Device 'state-changed' signal - * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceState for states - * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceStateReason for reasons - */ - _nm_device_state_changed(nm_device, old_state, new_state, reason) { - //Logger.info(`${nm_device.get_iface()} move from ${old_state} to ${new_state}: reason ${reason}`); - this._trigger_ips_reload(); + let addresses = []; + for (let nm_address of nm_addresses) { + let addr = nm_address.get_address(); + let prefix = nm_address.get_prefix(); + addresses.push(addr + "/" + prefix); } - /** - * NetSpeed: _getAddresses - * function from https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/examples/js/get_ips.js#L16 - * @param {NM.Device}: NetWorkManager Device - * @param {Glib.SYSDEF_AF_INET}: family - Glib.SYSDEF_AF_INET or Glib.SYSDEF_AF_INET6 - * @returns {string[]}: Array of 'address/prefix' string - */ - _getAddresses(nm_device, family) { - let ip_cfg; - if (family == GLib.SYSDEF_AF_INET) - ip_cfg = nm_device.get_ip4_config(); - else - ip_cfg = nm_device.get_ip6_config(); - - if (ip_cfg == null) { - //Logger.info(`No config for device '${nm_device.get_iface()}'`); - return []; - } - - let nm_addresses = ip_cfg.get_addresses(); - if (nm_addresses.length == 0) { - //Logger.info(`No IP addresses for device '${nm_device.get_iface()}'`); - return []; - } - - let addresses = []; - for (let nm_address of nm_addresses) { - let addr = nm_address.get_address(); - let prefix = nm_address.get_prefix(); - addresses.push(addr + "/" + prefix); - } - - return addresses; - } + return addresses; + } -}; +}); diff --git a/net_speed_layout_menu_item.js b/net_speed_layout_menu_item.js index ece714d..87f2002 100644 --- a/net_speed_layout_menu_item.js +++ b/net_speed_layout_menu_item.js @@ -15,90 +15,90 @@ * along with this program. If not, see . */ -const PopupMenu = imports.ui.popupMenu; -const St = imports.gi.St; -const { GObject } = imports.gi; +import GObject from 'gi://GObject'; +import St from 'gi://St'; + +import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; /** * Class: NetSpeedLayoutMenuItem */ -var NetSpeedLayoutMenuItem = GObject.registerClass( - class NetSpeedLayoutMenuItem extends PopupMenu.PopupBaseMenuItem { - /** - * NetSpeedLayoutMenuItem: _init - * Constructor - */ - _init(device, icon, menu_label_size) { - super._init(); - this.device = device; - this._icon = icon; - this._device_title = new St.Label( - { - text: device, - style_class: "ns-menuitem" - } - ); - this._device_title.get_clutter_text().set_line_wrap(true); +export const NetSpeedLayoutMenuItem = GObject.registerClass( + class NetSpeedLayoutMenuItem extends PopupMenu.PopupBaseMenuItem { + /** + * NetSpeedLayoutMenuItem: ctor + */ + constructor(device, icon, menu_label_size) { + super(); + this.device = device; + this._icon = icon; + this._device_title = new St.Label( + { + text: device, + style_class: "ns-menuitem" + } + ); + this._device_title.get_clutter_text().set_line_wrap(true); - this._down_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - this._up_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - this._ips_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._down_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._up_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._ips_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - if (this._icon != null) { - this.add(this._icon); - } else { - this.add(new St.Label()); - } - this.add(this._device_title); - this.add(this._down_label); - this.add(this._up_label); - this.add(this._ips_label); - this.update_ui(menu_label_size); - this.show_ip(false); + if (this._icon !== null) { + this.add(this._icon); + } else { + this.add(new St.Label()); + } + this.add(this._device_title); + this.add(this._down_label); + this.add(this._up_label); + this.add(this._ips_label); + this.update_ui(menu_label_size); + this.show_ip(false); - //log(`${getMethods(this)}`); - } + //log(`${getMethods(this)}`); + } - /** - * NetSpeedLayoutMenuItem: update_ui - * update settings - */ - update_ui(menu_label_size) { - this._down_label.set_width(menu_label_size); - this._up_label.set_width(menu_label_size); - this._device_title.set_width(menu_label_size); - this._ips_label.set_width(menu_label_size); - } + /** + * NetSpeedLayoutMenuItem: update_ui + * update settings + */ + update_ui(menu_label_size) { + this._down_label.set_width(menu_label_size); + this._up_label.set_width(menu_label_size); + this._device_title.set_width(menu_label_size); + this._ips_label.set_width(menu_label_size); + } - /** - * NetSpeedLayoutMenuItem: update_speeds - * update speeds - */ - update_speeds(speed) { - this._down_label.set_text(speed.down); - this._up_label.set_text(speed.up); - } + /** + * NetSpeedLayoutMenuItem: update_speeds + * update speeds + */ + update_speeds(speed) { + this._down_label.set_text(speed.down); + this._up_label.set_text(speed.up); + } - /** - * NetSpeedLayoutMenuItem: show_ip - * @param {boolean} value - */ - show_ip(value) { - if (value) { - this._ips_label.show(); - } - else { - this._ips_label.hide(); - } - } + /** + * NetSpeedLayoutMenuItem: show_ip + * @param {boolean} value + */ + show_ip(value) { + if (value) { + this._ips_label.show(); + } + else { + this._ips_label.hide(); + } + } - /** - * NetSpeedLayoutMenuItem: update_ips - * update ips - * @param {string[]} ips: IPs addresses array - */ - update_ips(ips) { - this._ips_label.set_text(ips.join("\n")); - } + /** + * NetSpeedLayoutMenuItem: update_ips + * update ips + * @param {string[]} ips: IPs addresses array + */ + update_ips(ips) { + this._ips_label.set_text(ips.join("\n")); + } - }); + }); diff --git a/net_speed_status_icon.js b/net_speed_status_icon.js index f63de11..2d097b6 100644 --- a/net_speed_status_icon.js +++ b/net_speed_status_icon.js @@ -15,286 +15,336 @@ * along with this program. If not, see . */ -const ExtensionUtils = imports.misc.extensionUtils; -const Extension = ExtensionUtils.getCurrentExtension(); -const Gettext = imports.gettext; -const PanelMenu = imports.ui.panelMenu; -const PopupMenu = imports.ui.popupMenu; -const Clutter = imports.gi.Clutter; -const GObject = imports.gi.GObject; -const Shell = imports.gi.Shell; -const St = imports.gi.St; - -const _ = Gettext.domain('netspeed').gettext; -const NetSpeedLayoutMenuItem = Extension.imports.net_speed_layout_menu_item; - -const Lib = Extension.imports.lib; -const Logger = Lib.getLogger(); +import Clutter from 'gi://Clutter'; +import GLib from 'gi://GLib'; +import GObject from 'gi://GObject'; +import St from 'gi://St'; + +import { gettext as _ } from 'resource:///org/gnome/shell/extensions/extension.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; +import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; +import * as Util from 'resource:///org/gnome/shell/misc/util.js'; + +import { NetSpeedLayoutMenuItem } from './net_speed_layout_menu_item.js'; +import { Logger } from './lib.js'; /** * Class NetSpeedStatusIcon * status icon, texts for speeds, the drop-down menu */ -var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu.Button { - /** - * NetSpeedStatusIcon: _init - * Constructor - */ - _init(net_speed) { - this._net_speed = net_speed; - super._init(0.0); - - // extension button - this._box = new St.BoxLayout(); - this.add_actor(this._box); - this.connect('button-release-event', this._toggle_showsum.bind(this)); - - // download - this._download_box = new St.BoxLayout(); - this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._download_box.add_actor(this._down); - this._download_box.add_actor(this._downunit); - this._download_box.add_actor(this._downicon); - - // upload - this._upload_box = new St.BoxLayout(); - this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._upload_box.add_actor(this._up); - this._upload_box.add_actor(this._upunit); - this._upload_box.add_actor(this._upicon); - - // sum - this._sum_box = new St.BoxLayout(); - this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._sum_box.add_actor(this._sum); - this._sum_box.add_actor(this._sumunit); - - // metrics box - this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); - this._metrics_box.add_actor(this._download_box); - this._metrics_box.add_actor(this._upload_box); - this._metrics_box.add_actor(this._sum_box); - this._box.add_actor(this._metrics_box); - - // interface icon - this._icon_box = new St.BoxLayout(); - this._icon = this._get_icon(this._net_speed.get_device_type(this._net_speed.getDevice())); - this._icon_box.add_actor(this._icon); - this._box.add_actor(this._icon_box); - - // Add pref luncher - this._pref = new St.Button({ child: this._get_icon("pref") }); - this._pref.connect("clicked", function () { - ExtensionUtils.openPrefs(); - }); - - this._menu_title = new NetSpeedLayoutMenuItem.NetSpeedLayoutMenuItem(_("Device"), this._pref, this._net_speed.menu_label_size); - this._menu_title.connect("activate", this._change_device.bind(this, "")); - this._menu_title.update_speeds({ up: _("Up"), down: _("Down") }); - this._menu_title.update_ips([_("IP")]); - this._menu_title.show_ip(this._net_speed.show_ips); - this.menu.addMenuItem(this._menu_title); - this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this._layouts = []; - this.updateui(); - } +export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu.Button { + /** + * NetSpeedStatusIcon: _init + * Constructor + */ + constructor(extension, net_speed) { + super(0.0); + this._extension = extension; + this._settings = extension.getSettings() + this._net_speed = net_speed; - /** - * NetSpeedStatusIcon :_change_device - */ - _change_device(param1, param2, device) { - this._net_speed.setDevice(device); - this.updateui(); - this._net_speed.save(); - } + // extension button + this._box = new St.BoxLayout(); + this.add_actor(this._box); + this.connect('button-release-event', this._toggle_showsum.bind(this)); - /** - * NetSpeedStatusIcon: _toggle_showsum - */ - _toggle_showsum(actor, event) { - let button = event.get_button(); - if (button == 2) { // middle - this._net_speed.showsum = !this._net_speed.showsum; - this.updateui(); - this._net_speed.save(); - } - } + // download + this._download_box = new St.BoxLayout(); + this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); + this._download_box.add_actor(this._down); + this._download_box.add_actor(this._downunit); + this._download_box.add_actor(this._downicon); + + // upload + this._upload_box = new St.BoxLayout(); + this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); + this._upload_box.add_actor(this._up); + this._upload_box.add_actor(this._upunit); + this._upload_box.add_actor(this._upicon); + + // sum + this._sum_box = new St.BoxLayout(); + this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._sum_box.add_actor(this._sum); + this._sum_box.add_actor(this._sumunit); + + // metrics box + this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); + this._metrics_box.add_actor(this._download_box); + this._metrics_box.add_actor(this._upload_box); + this._metrics_box.add_actor(this._sum_box); + this._box.add_actor(this._metrics_box); + + // interface icon + this._icon_box = new St.BoxLayout(); + this._icon = this._getIcon(this._net_speed.get_device_type(this._net_speed.getDevice())); + this._icon_box.add_actor(this._icon); + this._box.add_actor(this._icon_box); + + // Add pref luncher + this._pref = new St.Button({ child: this._getIcon("pref") }); + this._pref.connect("clicked", () => { + Util.spawn(["gnome-extensions", "prefs", this._extension.metadata.uuid]); + }); + + this._menu_title = new NetSpeedLayoutMenuItem(_("Device"), this._pref, this._settings.get_int('menu-label-size')); + this._menu_title.connect("activate", this._change_device.bind(this, "")); + this._menu_title.update_speeds({ up: _("Up"), down: _("Down") }); + this._menu_title.update_ips([_("IP")]); + this._menu_title.show_ip(this._settings.get_boolean('show-ips')); + this.menu.addMenuItem(this._menu_title); + this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + this._layouts = []; + this.updateui(); + + this._connectSignals(); + + + // connect settings for position in panel + this._placement_changed_id = this._settings.connect('changed::placement', this._positionInPanelChanged.bind(this)); + this._placement_index_changed_id = this._settings.connect('changed::placement-index', this._positionInPanelChanged.bind(this)); + } + + /** + * NetSpeedStatusIcon :_change_device + */ + _change_device(param1, param2, device) { + this._settings.set_string('device', device); + //this._net_speed.setDevice(device); + this.updateui(); + //this._net_speed.save(); + } - /** - * NetSpeedStatusIcon: updateui - * update ui according to settings - */ - updateui() { - // Set the size of labels - this._sum.set_width(this._net_speed.label_size); - this._sumunit.set_width(this._net_speed.unit_label_size); - this._up.set_width(this._net_speed.label_size); - this._upunit.set_width(this._net_speed.unit_label_size); - this._down.set_width(this._net_speed.label_size); - this._downunit.set_width(this._net_speed.unit_label_size); - - // Show up + down or sum - if (this._net_speed.showsum == false) { - this._sum.hide(); - this._sumunit.hide(); - this._upicon.show(); - this._up.show(); - this._upunit.show(); - this._downicon.show(); - this._down.show(); - this._downunit.show(); - this.set_vertical_alignment(this._net_speed.vert_align); - } else { - this._sum.show(); - this._sumunit.show(); - this._upicon.hide(); - this._up.hide(); - this._upunit.hide(); - this._downicon.hide(); - this._down.hide(); - this._downunit.hide(); - // ignore vertical alignment with sum - this.set_vertical_alignment(false); - } - - // Change the type of Icon - this._icon.destroy(); - const device = this._net_speed.getDevice(); - - Logger.debug("Device -> " + device); - - this._icon = this._get_icon(this._net_speed.get_device_type(device)); - this._icon_box.add_actor(this._icon); - // Show icon or not - if (this._net_speed.use_icon) - this._icon.show(); - else - this._icon.hide(); - // Update Menu sizes - this._menu_title.update_ui(this._net_speed.menu_label_size); - this._menu_title.show_ip(this._net_speed.show_ips); - for (let layout of this._layouts) { - layout.update_ui(this._net_speed.menu_label_size); - layout.show_ip(this._net_speed.show_ips); - } + /** + * NetSpeedStatusIcon: _toggle_showsum + */ + _toggle_showsum(actor, event) { + let button = event.get_button(); + if (button === 2) { // middle + this._settings.set_boolean('show-sum', !this._settings.get_boolean('show-sum')); + this.updateui(); } + } - /** - * NetSpeedStatusIcon: _get_icon - * Utility function to create icon from name - */ - _get_icon(name, size) { - if (arguments.length == 1) - size = 16; - let iconname = ""; - switch (name) { - case "none": - iconname = "network-transmit-receive-symbolic"; - break; - case "ethernet": - iconname = "network-wired-symbolic"; - break; - case "wifi": - iconname = "network-wireless-signal-excellent-symbolic"; - break; - case "bt": - iconname = "bluetooth-active-symbolic"; - break; - case "olpcmesh": - iconname = "network-wired-symbolic"; - break; - case "wimax": - iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi - break; - case "modem": - iconname = "gnome-modem"; // Hope works! - break; - case "up": - iconname = "go-up-symbolic"; - break; - case "down": - iconname = "go-down-symbolic"; - break; - case "pref": - iconname = "emblem-system-symbolic"; - break; - default: - iconname = "network-transmit-receive-symbolic"; - } - - return new St.Icon({ - icon_name: iconname, - icon_size: size, - }); + /** + * NetSpeedStatusIcon: updateui + * update ui according to settings + */ + updateui() { + // Set the size of labels + this._sum.set_width(this._settings.get_int('label-size')); + this._sumunit.set_width(this._settings.get_int('unit-label-size')); + this._up.set_width(this._settings.get_int('label-size')); + this._upunit.set_width(this._settings.get_int('unit-label-size')); + this._down.set_width(this._settings.get_int('label-size')); + this._downunit.set_width(this._settings.get_int('unit-label-size')); + + // Show up + down or sum + if (this._settings.get_boolean('show-sum') === false) { + this._sum.hide(); + this._sumunit.hide(); + this._upicon.show(); + this._up.show(); + this._upunit.show(); + this._downicon.show(); + this._down.show(); + this._downunit.show(); + this.set_vertical_alignment(this._settings.get_boolean('vert-align')); + } else { + this._sum.show(); + this._sumunit.show(); + this._upicon.hide(); + this._up.hide(); + this._upunit.hide(); + this._downicon.hide(); + this._down.hide(); + this._downunit.hide(); + // ignore vertical alignment with sum + this.set_vertical_alignment(false); } - /** - * NetSpeedStatusIcon: set_labels - */ - set_labels(sum, up, down) { - this._sum.set_text(sum.text); - this._sumunit.set_text(sum.unit); + // Change the type of Icon + this._icon.destroy(); + const device = this._net_speed.getDevice(); + + Logger.debug("Device -> " + device); - this._up.set_text(up.text); - this._upunit.set_text(up.unit); + this._icon = this._getIcon(this._net_speed.get_device_type(device)); + this._icon_box.add_actor(this._icon); + // Show icon or not + if (this._settings.get_boolean('icon-display')) + this._icon.show(); + else + this._icon.hide(); + // Update Menu sizes + this._menu_title.update_ui(this._settings.get_int('menu-label-size')); - this._down.set_text(down.text); - this._downunit.set_text(down.unit); + const show_ips = this._settings.get_boolean('show-ips'); + this._menu_title.show_ip(show_ips); + for (let layout of this._layouts) { + layout.update_ui(this._settings.get_int('menu-label-size')); + layout.show_ip(show_ips); } + } - /** - * NetSpeedStatusIcon: create_menu - */ - create_menu(devices, types) { - for (let layout of this._layouts) { - layout.destroy(); - } - this._layouts = []; - for (let i = 0; i < devices.length; ++i) { - let icon = this._get_icon(types[i]); - let layout = new NetSpeedLayoutMenuItem.NetSpeedLayoutMenuItem(devices[i], icon, this._net_speed.menu_label_size); - layout.show_ip(this._net_speed.show_ips); - layout.connect("activate", this._change_device.bind(this, devices[i])); - this._layouts.push(layout); - this.menu.addMenuItem(layout); - } + _connectSignals() { + this._net_speed.connect('reloaded', () => this.updateui()); + this._net_speed.connect('global-stats-changed', this._onGlobalStatsChanged.bind(this)); + this._net_speed.connect('speeds-changed', this._onSpeedsChanged.bind(this)); + this._net_speed.connect('ips-changed', this._onIPsChanged.bind(this)); + this._net_speed.connect('menu-changed', this._onCreateMenu.bind(this)); + } + + /** + * NetSpeedStatusIcon: _getIcon + * Utility function to create icon from name + */ + _getIcon(name, size) { + if (arguments.length === 1) + size = 16; + let iconname = ""; + switch (name) { + case "none": + iconname = "network-transmit-receive-symbolic"; + break; + case "ethernet": + iconname = "network-wired-symbolic"; + break; + case "wifi": + iconname = "network-wireless-signal-excellent-symbolic"; + break; + case "bt": + iconname = "bluetooth-active-symbolic"; + break; + case "olpcmesh": + iconname = "network-wired-symbolic"; + break; + case "wimax": + iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi + break; + case "modem": + iconname = "gnome-modem"; // Hope works! + break; + case "up": + iconname = "go-up-symbolic"; + break; + case "down": + iconname = "go-down-symbolic"; + break; + case "pref": + iconname = "emblem-system-symbolic"; + break; + default: + iconname = "network-transmit-receive-symbolic"; } - /** - * NetSpeedStatusIcon: update_speeds - */ - update_speeds(speeds) { - for (let i = 0; i < speeds.length; ++i) { - this._layouts[i].update_speeds(speeds[i]); - } + return new St.Icon({ + icon_name: iconname, + icon_size: size, + }); + } + + /** + * NetSpeedStatusIcon: _onGlobalStatsChanged(,NetSpeedGlobalStats) + * @param {*} sender + * @param {Messages.NetSpeedGlobalStatsMessage} stats + */ + _onGlobalStatsChanged(sender, stats) { + this._sum.set_text(stats.sum.text); + this._sumunit.set_text(stats.sum.unit); + + this._up.set_text(stats.up.text); + this._upunit.set_text(stats.up.unit); + + this._down.set_text(stats.down.text); + this._downunit.set_text(stats.down.unit); + } + + /** + * NetSpeedStatusIcon: create_menu + * @param {*} sender + * @param {Messages.NetSpeedMenuMessage} menu + */ + _onCreateMenu(sender, menu) { + for (let layout of this._layouts) { + layout.destroy(); + } + this._layouts = []; + for (let i = 0; i < menu.devices_text.length; ++i) { + let icon = this._getIcon(menu.types[i]); + let layout = new NetSpeedLayoutMenuItem(menu.devices_text[i], icon, this._settings.get_int('menu-label-size')); + layout.show_ip(this._settings.get_boolean('show-ips')); + layout.connect("activate", this._change_device.bind(this, menu.devices_text[i])); + this._layouts.push(layout); + this.menu.addMenuItem(layout); } + } - /** - * NetSpeedStatusIcon: set_vertical_alignment - */ - set_vertical_alignment(tof) { - this._metrics_box.set_vertical(tof); - let align = tof ? 'vertical' : 'horizontal'; - this._down.set_style_class_name('ns-' + align + '-label'); - this._downunit.set_style_class_name('ns-' + align + '-unit-label'); - this._downicon.set_style_class_name('ns-' + align + '-icon'); - this._up.set_style_class_name('ns-' + align + '-label'); - this._upunit.set_style_class_name('ns-' + align + '-unit-label'); - this._upicon.set_style_class_name('ns-' + align + '-icon'); + /** + * NetSpeedStatusIcon: _onSpeedsChanged + * + * @param {*} sender + * @param {Messages.NetSpeedSpeedsMessage} speeds + */ + _onSpeedsChanged(sender, speeds) { + for (let i = 0; i < speeds.speeds.length; ++i) { + this._layouts[i].update_speeds(speeds.speeds[i]); } - /** - * NetSpeedStatusIcon: update_ips - */ - update_ips(ips) { - for (let i = 0; i < ips.length; ++i) { - this._layouts[i].update_ips(ips[i]); - } + // fix #131 by forcing a delayed redraw + GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => { + this.queue_redraw(); + return GLib.SOURCE_REMOVE; + }); + } + + /** + * NetSpeedStatusIcon: set_vertical_alignment + */ + set_vertical_alignment(tof) { + this._metrics_box.set_vertical(tof); + let align = tof ? 'vertical' : 'horizontal'; + this._down.set_style_class_name('ns-' + align + '-label'); + this._downunit.set_style_class_name('ns-' + align + '-unit-label'); + this._downicon.set_style_class_name('ns-' + align + '-icon'); + this._up.set_style_class_name('ns-' + align + '-label'); + this._upunit.set_style_class_name('ns-' + align + '-unit-label'); + this._upicon.set_style_class_name('ns-' + align + '-icon'); + } + + /** + * NetSpeedStatusIcon: _onIPsChanged + * @param {*} sender + * @param {Messages.NetSpeedIPsMessage} ips + */ + _onIPsChanged(sender, ips) { + for (let i = 0; i < ips.ips.length; ++i) { + this._layouts[i].update_ips(ips.ips[i]); } + } + + _positionInPanelChanged() { + this.container.get_parent().remove_actor(this.container); + + // small HACK with private boxes :) + let boxes = { + left: Main.panel._leftBox, + center: Main.panel._centerBox, + right: Main.panel._rightBox + }; + + let p = this._settings.get_string('placement'); + let i = this._settings.get_int('placement-index'); + + Logger.debug(`_positionInPanelChanged: ${p} at index ${i}`); + + boxes[p].insert_child_at_index(this.container, i); + } }); diff --git a/po/ca.po b/po/ca.po index 6cff2c8..aae47fc 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2019-07-28 13:37+0200\n" "Last-Translator: Jordi Mas i Hernandez \n" "Language-Team: \n" @@ -16,145 +16,145 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.2.1\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "Tots" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Passarel·la per defecte" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Dispositiu a fer seguiment" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporitzador (mil·lisegons)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Dígits" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Mida de l'etiqueta" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Mida de l'etiqueta de la unitat" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Mida de l'etiqueta del menú" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Mostra la suma (pujada + baixada)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Mostra la icona" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "Usa múltiples de byte" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "Usa prefixos binaris" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/de.po b/po/de.po index 30551ef..7dc1fba 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2013-11-13 20:39+0100\n" "Last-Translator: Jonatan Zeidler \n" "Language-Team: GERMAN \n" @@ -18,146 +18,146 @@ msgstr "" "X-Generator: Poedit 1.5.4\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "ALLE" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Gerät zur Überwachung" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Anzeigeinterval (Millisekunden)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Ziffern" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Anzeigegröße" -#: prefs.js:247 +#: prefs.js:222 #, fuzzy msgid "Unit Label Size" msgstr "Menügröße" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Menügröße" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Als Summe anzeigen (Hoch+Runter)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Symbol anzeigen" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/en_CA.po b/po/en_CA.po index d0fbb84..7228a0d 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: English\n" @@ -17,146 +17,146 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "ALL" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Device to monitor" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Timer (milisec)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Digits" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Label Size" -#: prefs.js:247 +#: prefs.js:222 #, fuzzy msgid "Unit Label Size" msgstr "Menu Label Size" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Menu Label Size" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Show sum(UP+Down)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Show the Icon" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 0eb8c68..8a4736f 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2016-10-12 20:53+0200\n" "Last-Translator: Javier Junquera \n" "Language-Team: Español; Castellano <>\n" @@ -19,145 +19,145 @@ msgstr "" "X-Generator: Gtranslator 2.91.7\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "Todos" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Puerta de enlace predeterminadas" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Dispositivo a monitorizar" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizados (ms)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Digitos" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Tamaño de etiqueta" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Tamaño de etiqueta de unidades" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Tamaño de etiqueta de menú" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Mostrar suma (subida+bajada)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Mostrar icono" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/fa.po b/po/fa.po index 9ce92ef..5a40e5c 100644 --- a/po/fa.po +++ b/po/fa.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2014-05-25 19:38-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: Persian\n" @@ -16,144 +16,144 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "همه" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "تجهیزات تحت نظارت" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "زمان‌سنج)بر حسب میلی‌ثانیه(" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "تعداد رقم‌ها" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "اندازه برچسب‌ها" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "اندازه واحدها در منو" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "اندازه برچسب‌ها در منو" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "راست" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "چپ" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "نمایش مجموع)دریافت و ارسال(" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "نمایش نمایه" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 msgid "b/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/fr.po b/po/fr.po index 485b39d..0579ea9 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Lucien Aubert \n" "Language-Team: French\n" @@ -17,146 +17,146 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "TOUS" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Périphérique(s) à prendre en compte" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Rafraîchissement (milisecondes)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Chiffres" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Taille des champs" -#: prefs.js:247 +#: prefs.js:222 #, fuzzy msgid "Unit Label Size" msgstr "Taille des champs du menu" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Taille des champs du menu" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Afficher la somme (reçu+envoyé)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Afficher l'icône" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/it.po b/po/it.po index a5886ac..d0882fd 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2017-04-17 15:58+0200\n" "Last-Translator: l3nn4rt \n" "Language-Team: Italian\n" @@ -18,145 +18,145 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.0.1\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "Tutte" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Gateway di default" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Interfaccia da monitorare" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "Impostazioni" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Frequenza di aggiornamento (ms)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Numero di cifre da mostrare" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Larghezza per le cifre" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Larghezza per le unità di misura" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Larghezza per le colonne del menu" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "Posizione" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "Destra" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "Centro" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "Sinistra" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "Posizione Relativa" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Mostra la velocità complessiva (upload + download)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Mostra l'icona" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "Usa multipli del byte" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "Usa prefissi binari" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "Allinea verticalmente" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "Mostra indirizzi IP" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/netspeed.pot b/po/netspeed.pot index 804f602..cc5ba65 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 19:27+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,143 +17,143 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 msgid "Timer (milliseconds)" msgstr "" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 msgid "b/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/nl_NL.po b/po/nl_NL.po index 8b7e07e..b5069fb 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2021-09-13 19:16+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -18,144 +18,144 @@ msgstr "" "X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "ALLES" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Standaard toegangspoort" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Te monitoren apparaat" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 msgid "Timer (milliseconds)" msgstr "Tijdklok (milliseconden)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Getallen" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Labelgrootte" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Labelgrootte van eenheid" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Labelgrootte van menu" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "HiDPI-factor" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "Locatie" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "Rechts" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "Links" -#: prefs.js:267 +#: prefs.js:242 #, fuzzy msgid "Placement Index" msgstr "Locatie" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Som tonen (OMHOOG+omlaag)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Pictogram tonen" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "Bytevermeerdering gebruiken" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "Binaire voorvoegsels tonen" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "Verticaal uitlijnen" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "IP-adressen tonen" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "kiB/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "MiB/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "GiB/s" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 msgid "b/s" msgstr "b/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "kib/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "Mib/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "Gib/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "kB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "kb/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "Mb/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "Gb/s" diff --git a/po/pt_BR.po b/po/pt_BR.po index 7244e01..bc05853 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2016-02-04 17:44-0300\n" "Last-Translator: Fábio Nogueira \n" "Language-Team: \n" @@ -18,145 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "TUDO" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Gateway padrão" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Dispositivo para monitorar" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Temporizador (miliseg)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Dígitos" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Tamanho do rótulo" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Tamanho do rótulo de unidade" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Tamanho do rótulo do menu" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Exibir somatório (UP+Down)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Exibir o ícone" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/ru.po b/po/ru.po index fa3d152..24a0065 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2019-04-23 11:19+0500\n" "Last-Translator: Руслан Нигматьянов \n" "Language-Team: Russian\n" @@ -18,145 +18,145 @@ msgstr "" "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "X-Generator: Gtranslator 3.32.0\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "Все" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Шлюз по умолчанию" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "Интерфейс отображения" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Интервал обновления (милисек)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Цифр" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Длина текста" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Длина единиц измерения" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Длина заголовка меню" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Показывать общую сумму передачи" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Показывать иконку" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "Б/с" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "Б/с" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "МБ/с" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "ГБ/с" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/tr.po b/po/tr.po index 2e5640f..fe5692b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2019-03-21 09:18+0300\n" "Last-Translator: Serdar Sağlam \n" "Language-Team: Türkçe \n" @@ -18,145 +18,145 @@ msgstr "" "X-Generator: Poedit 2.2.1\n" "X-Poedit-SourceCharset: UTF-8\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "Tümü" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "Öntanımlı Ağ Geçidi" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "İzlenecek Aygıt" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "Zaman (millisaniye)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "Basamak" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "Etiket Boyutu" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "Birim Etiketi Boyutu" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "Menü Etiket Boyutu" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "Toplamı Göster (Yükleme+İndirme)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "Simgeyi Göster" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 80d03ef..5ff51b2 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,145 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "全部" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "默认网关" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "监控的设备" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "定时(毫秒)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "位数" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "标签大小" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "单位标签大小" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "菜单标签大小" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "显示总和(上传+下载)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "显示图标" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index afc54e1..6e8b6e6 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-22 16:19+0100\n" +"POT-Creation-Date: 2024-02-02 00:34+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -18,145 +18,145 @@ msgstr "" "X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: prefs.js:59 +#: prefs.js:32 msgid "ALL" msgstr "全部" -#: prefs.js:63 +#: prefs.js:36 msgid "Default Gateway" msgstr "默認網關" -#: prefs.js:221 +#: prefs.js:196 msgid "Device to monitor" msgstr "監控的設備" -#: prefs.js:231 +#: prefs.js:206 msgid "Settings" msgstr "" -#: prefs.js:235 +#: prefs.js:210 #, fuzzy msgid "Timer (milliseconds)" msgstr "定時(毫秒)" -#: prefs.js:239 +#: prefs.js:214 msgid "Digits" msgstr "位數" -#: prefs.js:243 +#: prefs.js:218 msgid "Label Size" msgstr "標籤大小" -#: prefs.js:247 +#: prefs.js:222 msgid "Unit Label Size" msgstr "單位標籤大小" -#: prefs.js:251 +#: prefs.js:226 msgid "Menu Label Size" msgstr "菜單標籤大小" -#: prefs.js:255 +#: prefs.js:230 msgid "HiDPI factor" msgstr "" -#: prefs.js:259 +#: prefs.js:234 msgid "Placement" msgstr "" -#: prefs.js:261 +#: prefs.js:236 msgid "Right" msgstr "" -#: prefs.js:262 +#: prefs.js:237 msgid "Center" msgstr "" -#: prefs.js:263 +#: prefs.js:238 msgid "Left" msgstr "" -#: prefs.js:267 +#: prefs.js:242 msgid "Placement Index" msgstr "" -#: prefs.js:274 +#: prefs.js:249 msgid "Show sum(UP+Down)" msgstr "顯示總和(上傳+下載)" -#: prefs.js:278 +#: prefs.js:253 msgid "Show the Icon" msgstr "顯示圖標" -#: prefs.js:282 +#: prefs.js:257 msgid "Use multiples of byte" msgstr "" -#: prefs.js:286 +#: prefs.js:261 msgid "Use binary prefixes" msgstr "" -#: prefs.js:290 +#: prefs.js:265 msgid "Align vertically" msgstr "" -#: prefs.js:297 +#: prefs.js:270 msgid "Show IPs" msgstr "" -#: net_speed.js:104 net_speed.js:108 net_speed.js:112 +#: net_speed.js:151 net_speed.js:155 net_speed.js:159 msgid "B/s" msgstr "B/s" -#: net_speed.js:104 +#: net_speed.js:151 msgid "kiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "MiB/s" msgstr "" -#: net_speed.js:104 +#: net_speed.js:151 msgid "GiB/s" msgstr "" -#: net_speed.js:105 net_speed.js:109 +#: net_speed.js:152 net_speed.js:156 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:105 +#: net_speed.js:152 msgid "kib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Mib/s" msgstr "" -#: net_speed.js:105 +#: net_speed.js:152 msgid "Gib/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "kB/s" msgstr "" -#: net_speed.js:108 +#: net_speed.js:155 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:108 +#: net_speed.js:155 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:109 +#: net_speed.js:156 msgid "kb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Mb/s" msgstr "" -#: net_speed.js:109 +#: net_speed.js:156 msgid "Gb/s" msgstr "" diff --git a/prefs.js b/prefs.js index 24dc7c5..a912ced 100644 --- a/prefs.js +++ b/prefs.js @@ -15,321 +15,295 @@ * along with this program. If not, see . */ -const Extension = imports.misc.extensionUtils.getCurrentExtension(); -const Lib = Extension.imports.lib; - -const GLib = imports.gi.GLib; -const GObject = imports.gi.GObject; -const Gdk = imports.gi.Gdk; -const Gettext = imports.gettext; -const Gio = imports.gi.Gio; -const Gtk = imports.gi.Gtk; -const NM = imports.gi.NM; -const _ = Gettext.domain('netspeed').gettext; - -let schemaDir = Extension.dir.get_child('schemas'); -let schemaSource = schemaDir.query_exists(null) ? - Gio.SettingsSchemaSource.new_from_directory(schemaDir.get_path(), Gio.SettingsSchemaSource.get_default(), false) : - Gio.SettingsSchemaSource.get_default(); -let schema = schemaSource.lookup(Lib.SCHEMA, false); -let Schema = new Gio.Settings({ settings_schema: schema }); - -let Logger = Lib.getLogger(); - - -function init() { - let localeDir = Extension.dir.get_child('locale'); - if (localeDir.query_exists(null)) { - Gettext.bindtextdomain('netspeed', localeDir.get_path()); +import GObject from 'gi://GObject'; +import Gio from 'gi://Gio'; +import Gtk from 'gi://Gtk'; +import NM from 'gi://NM'; + +import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; +import { Logger } from './lib.js'; + +const NetSpeedPreferences = new GObject.registerClass(class NetSpeedPreferences extends Gtk.Grid { + _get_dev_combo() { + let listStore = new Gtk.ListStore(); + listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); + + let all = listStore.append(); + listStore.set(all, [0], [_("ALL")]); + listStore.set(all, [1], ["network-workgroup-symbolic"]); + + let defaultGw = listStore.append(); + listStore.set(defaultGw, [0], [_("Default Gateway")]); + listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); + + let nmc = NM.Client.new(null); + let devices = nmc.get_devices() || []; + this._devices = []; + + for (let dev of devices) { + let iconname; + switch (dev.device_type) { + case NM.DeviceType.ETHERNET: + iconname = "network-wired-symbolic"; + break; + case NM.DeviceType.WIFI: + iconname = "network-wireless-signal-excellent-symbolic"; + break; + case NM.DeviceType.BT: + iconname = "bluetooth-active-symbolic"; + break; + case NM.DeviceType.OLPC_MESH: + iconname = "network-wired-symbolic"; + break; + case NM.DeviceType.WIMAX: + iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi + break; + case NM.DeviceType.MODEM: + iconname = "network-transmit-receive-symbolic"; + break; + default: + continue; + } + this._devices.push(dev.interface); + let iter = listStore.append(); + listStore.set(iter, [0], [dev.interface]); + listStore.set(iter, [1], [iconname]); } - if (!Lib.canShowIPs()) { - // Force to false at startup - // FIXME: hide Schema key - Schema.set_boolean('show-ips', false); + let combo = new Gtk.ComboBox({ model: listStore }); + let rendererPixbuf = new Gtk.CellRendererPixbuf(); + let rendererText = new Gtk.CellRendererText(); + + // Pack the renderers into the combobox in the order we want to see + combo.pack_start(rendererPixbuf, false); + combo.pack_start(rendererText, false); + + // Set the renderers to use the information from our listStore + combo.add_attribute(rendererText, "text", 0); + combo.add_attribute(rendererPixbuf, "icon_name", 1); + return combo; + } + + _pick_changement() { + let active = -1; + switch (this._settings.get_string('placement')) { + case 'right': + active = 0; + break; + case 'center': + active = 1; + break; + case 'left': + active = 2; + break; } -} - -const App = class NetSpeed_App { - _get_dev_combo() { - let listStore = new Gtk.ListStore(); - listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); - - let all = listStore.append(); - listStore.set(all, [0], [_("ALL")]); - listStore.set(all, [1], ["network-workgroup-symbolic"]); - - let defaultGw = listStore.append(); - listStore.set(defaultGw, [0], [_("Default Gateway")]); - listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); - - let nmc = NM.Client.new(null); - let devices = nmc.get_devices() || []; - this._devices = []; - - for (let dev of devices) { - let iconname; - switch (dev.device_type) { - case NM.DeviceType.ETHERNET: - iconname = "network-wired-symbolic"; - break; - case NM.DeviceType.WIFI: - iconname = "network-wireless-signal-excellent-symbolic"; - break; - case NM.DeviceType.BT: - iconname = "bluetooth-active-symbolic"; - break; - case NM.DeviceType.OLPC_MESH: - iconname = "network-wired-symbolic"; - break; - case NM.DeviceType.WIMAX: - iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi - break; - case NM.DeviceType.MODEM: - iconname = "network-transmit-receive-symbolic"; - break; - default: - continue; - } - this._devices.push(dev.interface); - let iter = listStore.append(); - listStore.set(iter, [0], [dev.interface]); - listStore.set(iter, [1], [iconname]); - } - - let combo = new Gtk.ComboBox({ model: listStore }); - let rendererPixbuf = new Gtk.CellRendererPixbuf(); - let rendererText = new Gtk.CellRendererText(); + this.placement.set_active(active); + } - // Pack the renderers into the combobox in the order we want to see - combo.pack_start(rendererPixbuf, false); - combo.pack_start(rendererText, false); + _change_placement() { + let active = this.placement.get_active(); + Logger.debug("_change_placement: active=" + active); - // Set the renderers to use the information from our listStore - combo.add_attribute(rendererText, "text", 0); - combo.add_attribute(rendererPixbuf, "icon_name", 1); - return combo; + if (active === -1) { + return; } - - _pick_changement() { - var active = -1; - switch (Schema.get_string('placement')) { - case 'right': - active = 0; - break; - case 'center': - active = 1; - break; - case 'left': - active = 2; - break; - } - this.placement.set_active(active); + switch (active) { + case 0: + this._settings.set_string('placement', 'right'); + Logger.debug("placement <- right"); + break; + case 1: + this._settings.set_string('placement', 'center'); + Logger.debug("placement <- center"); + break; + case 2: + this._settings.set_string('placement', 'left'); + Logger.debug("placement <- left"); + break; } + } - _change_placement() { - let active = this.placement.get_active(); - Logger.debug("_change_placement: active=" + active); + _dpi_changed() { + let factor = this._settings.get_int('hi-dpi-factor'); + if (factor !== this._factor) { + this._change_factor(); + } + } - if (active == -1) { - return; - } - switch (active) { - case 0: - Schema.set_string('placement', 'right'); - Logger.debug("placement <- right"); - break; - case 1: - Schema.set_string('placement', 'center'); - Logger.debug("placement <- center"); - break; - case 2: - Schema.set_string('placement', 'left'); - Logger.debug("placement <- left"); - break; - } + _put_dev() { + let active = this.dev.get_active(); + if (active === -1) { + return; + } + switch (active) { + case 0: + this._settings.set_string('device', "all"); + break; + case 1: + this._settings.set_string('device', "defaultGW"); + break; + default: + this._settings.set_string('device', this._devices[active - 2]); } - _dpi_changed() { - let factor = Schema.get_int('hi-dpi-factor'); - if (factor != this._factor) { - this._change_factor(); + Logger.debug("device <- " + this._settings.get_string('device')); + } + + _pick_dev() { + let activeDev = this._settings.get_string('device'); + this._device = activeDev; + let active = 0; + if (activeDev === "all") { + active = 0; + } else if (activeDev === "defaultGW") { + active = 1; + } else { + for (let i = 0; i < this._devices.length; ++i) { + if (this._devices[i] === activeDev) { + active = i + 2; } + } } + this.dev.set_active(active); + } - _put_dev() { - let active = this.dev.get_active(); - if (active == -1) { - return; - } - switch (active) { - case 0: - Schema.set_string('device', "all"); - break; - case 1: - Schema.set_string('device', "defaultGW"); - break; - default: - Schema.set_string('device', this._devices[active - 2]); - } + _change_factor() { + let old_factor = this._factor; + let factor = this._settings.get_int('hi-dpi-factor'); + this._factor = factor; - Logger.debug("device <- " + Schema.get_string('device')); - } + this._label_adjustment.upper = 100 * factor; + this._label_adjustment.step_increment = factor; + this._settings.set_int('label-size', this._settings.get_int('label-size') * factor / old_factor); - _pick_dev() { - let activeDev = Schema.get_string('device'); - this._device = activeDev; - let active = 0; - if (activeDev == "all") { - active = 0; - } else if (activeDev == "defaultGW") { - active = 1; - } else { - for (let i = 0; i < this._devices.length; ++i) { - if (this._devices[i] == activeDev) { - active = i + 2; - } - } - } - this.dev.set_active(active); - } + this._unit_label_adjustment.upper = 100 * factor; + this._unit_label_adjustment.step_increment = factor; + this._settings.set_int('unit-label-size', this._settings.get_int('unit-label-size') * factor / old_factor); - _change_factor() { - let old_factor = this._factor; - let factor = Schema.get_int('hi-dpi-factor'); - this._factor = factor; + this._menu_label_adjustment.upper = 100 * factor; + this._menu_label_adjustment.step_increment = factor; + this._settings.set_int('menu-label-size', this._settings.get_int('menu-label-size') * factor / old_factor); + } - this._label_adjustment.upper = 100 * factor; - this._label_adjustment.step_increment = factor; - Schema.set_int('label-size', Schema.get_int('label-size') * factor / old_factor); + constructor(extension) { + super({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); + + this._settings = extension.getSettings(); - this._unit_label_adjustment.upper = 100 * factor; - this._unit_label_adjustment.step_increment = factor; - Schema.set_int('unit-label-size', Schema.get_int('unit-label-size') * factor / old_factor); + this._factor = this._settings.get_int('hi-dpi-factor'); + + // Header: device selection + this.attach(new Gtk.Label({ label: _("Device to monitor") }), 2, 1, 1, 1); + this.dev = this._get_dev_combo(); + this.attach(this.dev, 3, 1, 1, 1); - this._menu_label_adjustment.upper = 100 * factor; - this._menu_label_adjustment.step_increment = factor; - Schema.set_int('menu-label-size', Schema.get_int('menu-label-size') * factor / old_factor); - } + // Separator + let separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL, valign: Gtk.Align.CENTER }); + separator.set_vexpand(false); + this.attach(separator, 1, 2, 4, 1); - constructor() { - this._factor = Schema.get_int('hi-dpi-factor'); + // Title + this.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1); - this.main = new Gtk.Grid({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); + // Display options - // Header: device selection - this.main.attach(new Gtk.Label({ label: _("Device to monitor") }), 2, 1, 1, 1); - this.dev = this._get_dev_combo(); - this.main.attach(this.dev, 3, 1, 1, 1); + this.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); + this.timer = Gtk.SpinButton.new_with_range(100, 10000, 100); + this.attach(this.timer, 2, 4, 1, 1); - // Separator - let separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL, valign: Gtk.Align.CENTER }); - separator.set_vexpand(false); - this.main.attach(separator, 1, 2, 4, 1); + this.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); + this.digits = Gtk.SpinButton.new_with_range(3, 10, 1); + this.attach(this.digits, 2, 5, 1, 1); - // Title - this.main.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1); + this.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); + this.label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.label_size, 2, 6, 1, 1); - // Display options + this.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); + this.unit_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.unit_label_size, 2, 7, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); - this.timer = Gtk.SpinButton.new_with_range(100, 10000, 100); - this.main.attach(this.timer, 2, 4, 1, 1); + this.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); + this.menu_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.menu_label_size, 2, 8, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); - this.digits = Gtk.SpinButton.new_with_range(3, 10, 1); - this.main.attach(this.digits, 2, 5, 1, 1); + this.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 9, 1, 1); + this.hi_dpi_factor = Gtk.SpinButton.new_with_range(1, 100, 1); + this.attach(this.hi_dpi_factor, 2, 9, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); - this.label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.main.attach(this.label_size, 2, 6, 1, 1); + this.attach(new Gtk.Label({ label: _("Placement") }), 1, 10, 1, 1); + this.placement = new Gtk.ComboBoxText(); + this.placement.append_text(_("Right")); + this.placement.append_text(_("Center")); + this.placement.append_text(_("Left")); + this.placement.set_active(0); + this.attach(this.placement, 2, 10, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); - this.unit_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.main.attach(this.unit_label_size, 2, 7, 1, 1); + this.attach(new Gtk.Label({ label: _("Placement Index") }), 1, 11, 1, 1); + this.placement_index = Gtk.SpinButton.new_with_range(-1, 20, 1); + this.attach(this.placement_index, 2, 11, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); - this.menu_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.main.attach(this.menu_label_size, 2, 8, 1, 1); - this.main.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 9, 1, 1); - this.hi_dpi_factor = Gtk.SpinButton.new_with_range(1, 100, 1); - this.main.attach(this.hi_dpi_factor, 2, 9, 1, 1); + // Extension Settings - this.main.attach(new Gtk.Label({ label: _("Placement") }), 1, 10, 1, 1); - this.placement = new Gtk.ComboBoxText(); - this.placement.append_text(_("Right")); - this.placement.append_text(_("Center")); - this.placement.append_text(_("Left")); - this.placement.set_active(0); - this.main.attach(this.placement, 2, 10, 1, 1); + this.attach(new Gtk.Label({ label: _("Show sum(UP+Down)") }), 3, 4, 1, 1); + this.sum = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.sum, 4, 4, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Placement Index") }), 1, 11, 1, 1); - this.placement_index = Gtk.SpinButton.new_with_range(-1, 20, 1); - this.main.attach(this.placement_index, 2, 11, 1, 1); + this.attach(new Gtk.Label({ label: _("Show the Icon") }), 3, 5, 1, 1); + this.icon = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.icon, 4, 5, 1, 1); + this.attach(new Gtk.Label({ label: _("Use multiples of byte") }), 3, 6, 1, 1); + this.use_bytes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.use_bytes, 4, 6, 1, 1); - // Extension Settings + this.attach(new Gtk.Label({ label: _("Use binary prefixes") }), 3, 7, 1, 1); + this.bin_prefixes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.bin_prefixes, 4, 7, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Show sum(UP+Down)") }), 3, 4, 1, 1); - this.sum = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.main.attach(this.sum, 4, 4, 1, 1); + this.attach(new Gtk.Label({ label: _("Align vertically") }), 3, 8, 1, 1); + this.vert_align = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.vert_align, 4, 8, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Show the Icon") }), 3, 5, 1, 1); - this.icon = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.main.attach(this.icon, 4, 5, 1, 1); + this.show_ip = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(new Gtk.Label({ label: _("Show IPs") }), 3, 9, 1, 1); + this.attach(this.show_ip, 4, 9, 1, 1); + this.show_ip.show(); - this.main.attach(new Gtk.Label({ label: _("Use multiples of byte") }), 3, 6, 1, 1); - this.use_bytes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.main.attach(this.use_bytes, 4, 6, 1, 1); - this.main.attach(new Gtk.Label({ label: _("Use binary prefixes") }), 3, 7, 1, 1); - this.bin_prefixes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.main.attach(this.bin_prefixes, 4, 7, 1, 1); + // Initialize values + this._pick_dev(); + this.dev.connect('changed', this._put_dev.bind(this)); - this.main.attach(new Gtk.Label({ label: _("Align vertically") }), 3, 8, 1, 1); - this.vert_align = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.main.attach(this.vert_align, 4, 8, 1, 1); + this._settings.bind('show-sum', this.sum, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('icon-display', this.icon, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('timer', this.timer, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('digits', this.digits, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('label-size', this.label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('unit-label-size', this.unit_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('menu-label-size', this.menu_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('use-bytes', this.use_bytes, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('bin-prefixes', this.bin_prefixes, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('vert-align', this.vert_align, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hi-dpi-factor', this.hi_dpi_factor, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-ips', this.show_ip, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind_writable('show-ips', this.show_ip, 'visible', false); + this._settings.connect('changed', this._dpi_changed.bind(this)); + this._dpi_changed(); - this.show_ip = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - if (Lib.canShowIPs()) { - this.main.attach(new Gtk.Label({ label: _("Show IPs") }), 3, 9, 1, 1); - this.main.attach(this.show_ip, 4, 9, 1, 1); - this.show_ip.show(); - } else { - this.show_ip.hide(); - } + this._pick_changement(); + this.placement.connect('changed', this._change_placement.bind(this)); + + this._settings.bind('placement-index', this.placement_index, 'value', Gio.SettingsBindFlags.DEFAULT); + + } +}); - // Initialize values - this._pick_dev(); - this.dev.connect('changed', this._put_dev.bind(this)); - - Schema.bind('show-sum', this.sum, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('icon-display', this.icon, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('timer', this.timer, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('digits', this.digits, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('label-size', this.label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('unit-label-size', this.unit_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('menu-label-size', this.menu_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('use-bytes', this.use_bytes, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('bin-prefixes', this.bin_prefixes, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('vert-align', this.vert_align, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('hi-dpi-factor', this.hi_dpi_factor, 'value', Gio.SettingsBindFlags.DEFAULT); - Schema.bind('show-ips', this.show_ip, 'active', Gio.SettingsBindFlags.DEFAULT); - Schema.bind_writable('show-ips', this.show_ip, 'visible', false); - - Schema.connect('changed', this._dpi_changed.bind(this)); - this._dpi_changed(); - - this._pick_changement(); - this.placement.connect('changed', this._change_placement.bind(this)); - - Schema.bind('placement-index', this.placement_index, 'value', Gio.SettingsBindFlags.DEFAULT); - } -}; -function buildPrefsWidget() { - let widget = new App(); - return widget.main; -} +export default class extends ExtensionPreferences { + getPreferencesWidget() { + return new NetSpeedPreferences(this); + } +} \ No newline at end of file From 99c022eb1c3a68831b41d067bf37de75af8396ea Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Fri, 2 Feb 2024 00:55:15 +0100 Subject: [PATCH 18/25] add style guide tools following https://gjs.guide/guides/gjs/style-guide.html#style-guide and start formatting code --- .editorconfig | 12 + .eslintrc.yml | 109 ++++ .gitignore | 1 + .jshintrc | 3 - Makefile | 2 +- lib.js | 84 +-- messages.js | 26 +- net_speed.js | 934 +++++++++++++-------------- net_speed_layout_menu_item.js | 140 ++-- net_speed_status_icon.js | 592 ++++++++--------- package-lock.json | 1135 +++++++++++++++++++++++++++++++++ package.json | 30 + prefs.js | 468 +++++++------- 13 files changed, 2410 insertions(+), 1126 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintrc.yml delete mode 100644 .jshintrc create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5326456 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +end_of_line = lf +insert_final_newline = true + +[*.js] +quote_type = single \ No newline at end of file diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..d9aaeaa --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,109 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: No rights reserved + +env: + es2021: true +extends: "eslint:recommended" +rules: + # See: https://eslint.org/docs/latest/rules/#possible-problems + array-callback-return: error + no-await-in-loop: error + no-constant-binary-expression: error + no-constructor-return: error + #no-duplicate-imports: error + no-new-native-nonconstructor: error + no-promise-executor-return: error + no-self-compare: error + no-template-curly-in-string: error + no-unmodified-loop-condition: error + no-unreachable-loop: error + no-unused-private-class-members: error + no-use-before-define: + - error + - functions: false + classes: true + variables: true + allowNamedExports: true + # See: https://eslint.org/docs/latest/rules/#suggestions + block-scoped-var: error + complexity: warn + consistent-return: error + default-param-last: error + eqeqeq: error + no-array-constructor: error + no-caller: error + no-extend-native: error + no-extra-bind: error + no-extra-label: error + no-iterator: error + no-label-var: error + no-loop-func: error + no-multi-assign: warn + no-new-object: error + no-new-wrappers: error + no-proto: error + no-shadow: warn + no-unused-vars: + - error + - varsIgnorePattern: ^_ + argsIgnorePattern: ^_ + no-var: warn + unicode-bom: error + # GJS Restrictions + no-restricted-globals: + - error + - name: Debugger + message: Internal use only + - name: GIRepositoryGType + message: Internal use only + - name: log + message: Use console.log() + - name: logError + message: Use console.warn() or console.error() + no-restricted-properties: + - error + - object: imports + property: format + message: Use template strings + - object: pkg + property: initFormat + message: Use template strings + - object: Lang + property: copyProperties + message: Use Object.assign() + - object: Lang + property: bind + message: Use arrow notation or Function.prototype.bind() + - object: Lang + property: Class + message: Use ES6 classes + no-restricted-syntax: + - error + - selector: >- + MethodDefinition[key.name="_init"] + CallExpression[arguments.length<=1][callee.object.type="Super"][callee.property.name="_init"] + message: Use constructor() and super() +# GJS Globals +globals: + ARGV: readonly + Debugger: readonly + GIRepositoryGType: readonly + globalThis: readonly + imports: readonly + Intl: readonly + log: readonly + logError: readonly + pkg: readonly + print: readonly + printerr: readonly + window: readonly + TextEncoder: readonly + TextDecoder: readonly + console: readonly + setTimeout: readonly + setInterval: readonly + clearTimeout: readonly + clearInterval: readonly +parserOptions: + ecmaVersion: 2022 + sourceType: module diff --git a/.gitignore b/.gitignore index 62856fd..6fc0a39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ locale/ schemas/gschemas.compiled *~ .idea/ +node_modules/ \ No newline at end of file diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 8ab3485..0000000 --- a/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "esversion": 6 -} \ No newline at end of file diff --git a/Makefile b/Makefile index 9dde22f..57fa280 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ UUID = netspeed@hedayaty.gmail.com LANGUAGES=ca de en_CA fa fr it pt_BR ru zh_CN zh_TW es_ES nl_NL ru tr zh_CN DOC_FILES=CHANGELOG README.md -SRC_FILES=extension.js prefs.js net_speed_layout_menu_item.js net_speed.js net_speed_status_icon.js lib.js +SRC_FILES=extension.js prefs.js net_speed_layout_menu_item.js net_speed.js net_speed_status_icon.js lib.js messages.js MO_FILES=$(foreach LANGUAGE, $(LANGUAGES), locale/$(LANGUAGE)/LC_MESSAGES/$(GETTEXT_PACKAGE).mo) SCHEMA_FILES=schemas/gschemas.compiled schemas/org.gnome.shell.extensions.netspeed.gschema.xml EXTENSION_FILES=stylesheet.css metadata.json diff --git a/lib.js b/lib.js index dfd3c1c..ceecc97 100644 --- a/lib.js +++ b/lib.js @@ -23,58 +23,58 @@ const DEBUG = false; */ export class Logger { - static _formatMessage(message, file, func, line) { - return `[${this.extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`; - } - - static _makeMessage(message) { - /* FIXME: rretrieve logging stack - let stack = (new Error()).stack; - let caller = stack.split('\n').pop(); + static _formatMessage(message, file, func, line) { + return `[${this.extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`; + } - console.log(stack.split('\n')); + static _makeMessage(message) { + /* FIXME: rretrieve logging stack + let stack = (new Error()).stack; + let caller = stack.split('\n').pop(); - // caller example: enable@file:///home/cosimo/.local/share/gnome-shell/extensions/netspeed@hedayaty.gmail.com/extension.js:35:24 - // or: resource:///org/gnome/Shell/ - const [func, caller] = caller.split(/@(.+)/);; - const [code, line, _] = caller.split(':'); - */ - return Logger._formatMessage(message, "", "", ""); - } + console.log(stack.split('\n')); - static init(extension) { - if (Logger._domain) - return; + // caller example: enable@file:///home/cosimo/.local/share/gnome-shell/extensions/netspeed@hedayaty.gmail.com/extension.js:35:24 + // or: resource:///org/gnome/Shell/ + const [func, caller] = caller.split(/@(.+)/);; + const [code, line, _] = caller.split(':'); + */ + return Logger._formatMessage(message, "", "", ""); + } - this.extension = extension; + static init(extension) { + if (Logger._domain) + return; - const { name: domain } = extension.metadata; - Logger._domain = domain.replaceAll(' ', '-'); - } + this.extension = extension; - static debug(message) { - Logger._logMessage(console.debug, message); - } + const { name: domain } = extension.metadata; + Logger._domain = domain.replaceAll(' ', '-'); + } - static info(message) { - Logger._logMessage(console.info, message); - } + static debug(message) { + Logger._logMessage(console.debug, message); + } - static warn(message) { - Logger._logMessage(console.warn, message); - } + static info(message) { + Logger._logMessage(console.info, message); + } - static error(message) { - Logger._logMessage(console.critical, message); - } + static warn(message) { + Logger._logMessage(console.warn, message); + } - static _logMessage(logFunc, message) { - const msg = Logger._makeMessage(message); - if (DEBUG) { - console.log(msg); - return; + static error(message) { + Logger._logMessage(console.critical, message); } - logFunc(msg); - } + static _logMessage(logFunc, message) { + const msg = Logger._makeMessage(message); + if (DEBUG) { + console.log(msg); + return; + } + + logFunc(msg); + } } diff --git a/messages.js b/messages.js index 5c72bde..d23e7ea 100644 --- a/messages.js +++ b/messages.js @@ -19,25 +19,25 @@ import GObject from 'gi://GObject'; const NetSpeedMessage = GObject.registerClass( - class NetSpeedMessage extends GObject.Object { - constructor(props = {}) { - super(); - this.set(props); - } - }); + class NetSpeedMessage extends GObject.Object { + constructor(props = {}) { + super(); + this.set(props); + } + }); /* * {NetSpeedGlobalStatsMessage} object has the properties: * {object} sum * {object} up * {object} down - * + * * Each property has the properties: * {string} text - * {string} unit + * {string} unit */ export const NetSpeedGlobalStatsMessage = GObject.registerClass( - class NetSpeedGlobalStatsMessage extends NetSpeedMessage { } + class NetSpeedGlobalStatsMessage extends NetSpeedMessage { } ); /* @@ -47,7 +47,7 @@ export const NetSpeedGlobalStatsMessage = GObject.registerClass( * {string} down */ export const NetSpeedSpeedsMessage = GObject.registerClass( - class NetSpeedSpeedsMessage extends NetSpeedMessage { } + class NetSpeedSpeedsMessage extends NetSpeedMessage { } ); /* @@ -55,7 +55,7 @@ export const NetSpeedSpeedsMessage = GObject.registerClass( * {array} ips: an array of {string}s */ export const NetSpeedIPsMessage = GObject.registerClass( - class NetSpeedIPsMessage extends NetSpeedMessage { } + class NetSpeedIPsMessage extends NetSpeedMessage { } ); /* @@ -64,5 +64,5 @@ export const NetSpeedIPsMessage = GObject.registerClass( * {array} types: an array of {string}s */ export const NetSpeedMenuMessage = GObject.registerClass( - class NetSpeedMenuMessage extends NetSpeedMessage { } -); \ No newline at end of file + class NetSpeedMenuMessage extends NetSpeedMessage { } +); diff --git a/net_speed.js b/net_speed.js index feb558c..6b33f77 100644 --- a/net_speed.js +++ b/net_speed.js @@ -29,532 +29,532 @@ import * as Messages from './messages.js'; * Class NetSpeed */ export const NetSpeed = GObject.registerClass({ - Signals: { - 'reloaded': {}, - 'global-stats-changed': { - param_types: [ - Messages.NetSpeedGlobalStatsMessage.$gtype, - ], - }, - 'speeds-changed': { - param_types: [ - Messages.NetSpeedSpeedsMessage.$gtype, - ], - }, - 'ips-changed': { - param_types: [ - Messages.NetSpeedIPsMessage.$gtype, - ], + Signals: { + 'reloaded': {}, + 'global-stats-changed': { + param_types: [ + Messages.NetSpeedGlobalStatsMessage.$gtype, + ], + }, + 'speeds-changed': { + param_types: [ + Messages.NetSpeedSpeedsMessage.$gtype, + ], + }, + 'ips-changed': { + param_types: [ + Messages.NetSpeedIPsMessage.$gtype, + ], + }, + 'menu-changed': { + param_types: [ + Messages.NetSpeedMenuMessage.$gtype, + ], + } }, - 'menu-changed': { - param_types: [ - Messages.NetSpeedMenuMessage.$gtype, - ], - } - }, }, class NetSpeed extends GObject.Object { - /** - * NetSpeed: _init - * Constructor - */ + /** + * NetSpeed: _init + * Constructor + */ - constructor(extension) { - super(); - this._settings = extension.getSettings(); + constructor(extension) { + super(); + this._settings = extension.getSettings(); - this._last_up = 0; // size of upload in previous snapshot - this._last_down = 0; // size of download in previous snapshot - this._last_time = 0; // time of the latest snapshot - this._device_state_changed = true; // flag to trigger menu refreshing + this._last_up = 0; // size of upload in previous snapshot + this._last_down = 0; // size of download in previous snapshot + this._last_time = 0; // time of the latest snapshot + this._device_state_changed = true; // flag to trigger menu refreshing - this._values = []; - this._devices = []; - this._nm_client = NM.Client.new(null); - this._nm_signals = []; - this._nm_signals.push(this._nm_client.connect('any-device-added', this._nm_device_changed.bind(this))); - this._nm_signals.push(this._nm_client.connect('any-device-removed', this._nm_device_changed.bind(this))); - this._nm_signals.push(this._nm_client.connect('connection-added', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._nm_client.connect('connection-removed', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._nm_client.connect('active-connection-added', this._nm_connection_changed.bind(this))); - this._nm_signals.push(this._nm_client.connect('active-connection-removed', this._nm_connection_changed.bind(this))); + this._values = []; + this._devices = []; + this._nm_client = NM.Client.new(null); + this._nm_signals = []; + this._nm_signals.push(this._nm_client.connect('any-device-added', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('any-device-removed', this._nm_device_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('connection-removed', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('active-connection-added', this._nm_connection_changed.bind(this))); + this._nm_signals.push(this._nm_client.connect('active-connection-removed', this._nm_connection_changed.bind(this))); - // store NM Device 'state-changed' signal bindings to disconnect on disable - this._nm_devices_signals_map = new Map(); + // store NM Device 'state-changed' signal bindings to disconnect on disable + this._nm_devices_signals_map = new Map(); - this._saving = 0; - this.show_ips = this._settings.get_boolean('show-ips'); + this._saving = 0; + this.show_ips = this._settings.get_boolean('show-ips'); - this._load(); + this._load(); - this._updateDefaultGw(); - } - - - /** - * NetSpeed: _is_up2date - */ - _is_up2date() { - if (this._devices.length !== this._olddevices.length) { - return 0; - } - for (let i = 0; i < this._devices.length; ++i) { - if (this._devices[i] !== this._olddevices[i]) - return 0; + this._updateDefaultGw(); } - return 1; - } - /** - * NetSpeed: get_device_type - */ - get_device_type(device) { - let devices = this._nm_client.get_devices() || []; - - for (let dev of devices) { - if (dev.interface === device) { - switch (dev.device_type) { - case NM.DeviceType.ETHERNET: - return "ethernet"; - case NM.DeviceType.WIFI: - return "wifi"; - case NM.DeviceType.BT: - return "bt"; - case NM.DeviceType.OLPC_MESH: - return "olpcmesh"; - case NM.DeviceType.WIMAX: - return "wimax"; - case NM.DeviceType.MODEM: - return "modem"; - default: - return "none"; + + /** + * NetSpeed: _is_up2date + */ + _is_up2date() { + if (this._devices.length !== this._olddevices.length) { + return 0; + } + for (let i = 0; i < this._devices.length; ++i) { + if (this._devices[i] !== this._olddevices[i]) + return 0; } - } + return 1; } - return "none"; - } + /** + * NetSpeed: get_device_type + */ + get_device_type(device) { + let devices = this._nm_client.get_devices() || []; + + for (let dev of devices) { + if (dev.interface === device) { + switch (dev.device_type) { + case NM.DeviceType.ETHERNET: + return "ethernet"; + case NM.DeviceType.WIFI: + return "wifi"; + case NM.DeviceType.BT: + return "bt"; + case NM.DeviceType.OLPC_MESH: + return "olpcmesh"; + case NM.DeviceType.WIMAX: + return "wimax"; + case NM.DeviceType.MODEM: + return "modem"; + default: + return "none"; + } + } + } - /** - * NetSpeed: _speed_to_string - */ - _speed_to_string(amount) { - let m_digits = this.digits; - let divider, byte_speed_map, bit_speed_map; - if (this.bin_prefixes) { - divider = 1024; // 1MiB = 1024kiB - byte_speed_map = [_("B/s"), _("kiB/s"), _("MiB/s"), _("GiB/s")]; - bit_speed_map = [_("b/s"), _("kib/s"), _("Mib/s"), _("Gib/s")]; - } else { - divider = 1000; // 1MB = 1000kB - byte_speed_map = [_("B/s"), _("kB/s"), _("MB/s"), _("GB/s")]; - bit_speed_map = [_("b/s"), _("kb/s"), _("Mb/s"), _("Gb/s")]; - } - if (amount === 0) - return { text: "0", unit: _(this.use_bytes ? "B/s" : "b/s") }; - if (m_digits < 3) - m_digits = 3; - amount *= 1000 * (this.use_bytes ? 1 : 8); - let unit = 0; - while (amount >= divider && unit < 3) { // 1M=1024K, 1MB/s=1000MB/s - amount /= divider; - ++unit; + return "none"; } - if (amount >= 100) - m_digits -= 2; - else if (amount >= 10) - m_digits -= 1; + /** + * NetSpeed: _speed_to_string + */ + _speed_to_string(amount) { + let m_digits = this.digits; + let divider, byte_speed_map, bit_speed_map; + if (this.bin_prefixes) { + divider = 1024; // 1MiB = 1024kiB + byte_speed_map = [_("B/s"), _("kiB/s"), _("MiB/s"), _("GiB/s")]; + bit_speed_map = [_("b/s"), _("kib/s"), _("Mib/s"), _("Gib/s")]; + } else { + divider = 1000; // 1MB = 1000kB + byte_speed_map = [_("B/s"), _("kB/s"), _("MB/s"), _("GB/s")]; + bit_speed_map = [_("b/s"), _("kb/s"), _("Mb/s"), _("Gb/s")]; + } + if (amount === 0) + return { text: "0", unit: _(this.use_bytes ? "B/s" : "b/s") }; + if (m_digits < 3) + m_digits = 3; + amount *= 1000 * (this.use_bytes ? 1 : 8); + let unit = 0; + while (amount >= divider && unit < 3) { // 1M=1024K, 1MB/s=1000MB/s + amount /= divider; + ++unit; + } - return { - text: amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: m_digits - 1 }), - unit: (this.use_bytes ? byte_speed_map : bit_speed_map)[unit] - }; - } + if (amount >= 100) + m_digits -= 2; + else if (amount >= 10) + m_digits -= 1; - /** - * NetSpeed: _emit_stats - */ - _sendStats(sum, up, down) { - this.emit( - 'global-stats-changed', - new Messages.NetSpeedGlobalStatsMessage( - { - sum: sum, up: up, down: down - }) - ); - } - - /** - * NetSpeed: _update_speeds - */ - _sendSpeeds() { - this.emit( - 'speeds-changed', - new Messages.NetSpeedSpeedsMessage({ speeds: this._speeds }) - ); - } - - /** - * NetSpeed: _update_ips - */ - _sendIps() { - this.emit( - 'ips-changed', - new Messages.NetSpeedIPsMessage({ ips: this._ips }) - ); - } - - /** - * NetSpeed: _create_menu - */ - _create_menu() { - let types = []; - let devices_text = []; - for (let dev of this._devices) { - types.push(this.get_device_type(dev)); - let wifi_ssid = this._retrieve_wifi_ssid(dev); - //Logger.info(`wifi_ssid is '${wifi_ssid}' for dev '${dev}'`); - if (wifi_ssid !== null) { - devices_text.push(dev + `\n${wifi_ssid}`); - continue; - } - devices_text.push(dev); + return { + text: amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: m_digits - 1 }), + unit: (this.use_bytes ? byte_speed_map : bit_speed_map)[unit] + }; } - this.emit( - 'menu-changed', - new Messages.NetSpeedMenuMessage( - { - devices_text: devices_text, - types: types, - }) - ); - } - - /** - * NetSpeed: _updateDefaultGw - */ - _updateDefaultGw() { - let flines = GLib.file_get_contents('/proc/net/route'); // Read the file - let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines - for (let nline of nlines) { //first 2 lines are for header - let line = nline.replace(/^ */g, ""); - let params = line.split("\t"); - if (params.length !== 11) // ignore empty lines - continue; - // So store up/down values - if (params[1] === "00000000") { - this._defaultGw = params[0]; - } + /** + * NetSpeed: _emit_stats + */ + _sendStats(sum, up, down) { + this.emit( + 'global-stats-changed', + new Messages.NetSpeedGlobalStatsMessage( + { + sum: sum, up: up, down: down + }) + ); } - } - /** - * NetSpeed: _update - */ - _update() { - this._updateDefaultGw(); - let flines = GLib.file_get_contents('/proc/net/dev'); // Read the file - let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines - - let up = 0; // set initial - let down = 0; - this._oldvalues = this._values; - this._values = []; - this._speeds = []; - this._ips = []; - this._olddevices = this._devices; - this._devices = []; - - let time = GLib.get_monotonic_time() / 1000; // current time 1000 is not the net_speed.timer! - let delta = time - this._last_time; // Here the difference is evaluated - this._last_time = time; - - // parse the file - for (let i = 2; i < nlines.length - 1; ++i) { //first 2 lines are for header - let line = nlines[i].replace(/ +/g, " ").replace(/^ */g, ""); - let params = line.split(" "); - if (params[0].replace(":", "") === "lo") // ignore local device - continue; - // So store up/down values - this._values.push([parseInt(params[9]), parseInt(params[1])]); - this._devices.push(params[0].replace(":", "")); + /** + * NetSpeed: _update_speeds + */ + _sendSpeeds() { + this.emit( + 'speeds-changed', + new Messages.NetSpeedSpeedsMessage({ speeds: this._speeds }) + ); } - //Logger.debug("Devices: " + this._devices); - - let total = 0; - let total_speed = null; - let up_speed = null; - let down_speed = null; - - if (this._is_up2date() === 1 && !this._device_state_changed) { - for (let i = 0; i < this._values.length; ++i) { - let _up = this._values[i][0] - this._oldvalues[i][0]; - let _down = this._values[i][1] - this._oldvalues[i][1]; - - // Avoid negetive speed in case of device going down, when device goes down, - if (_up < 0) - _up = 0; - if (_down < 0) - _down = 0; - - let _up_speed = this._speed_to_string(_up / delta); - let _down_speed = this._speed_to_string(_down / delta); - this._speeds.push({ - up: _up_speed.text + " " + _up_speed.unit, - down: _down_speed.text + " " + _down_speed.unit - }); + /** + * NetSpeed: _update_ips + */ + _sendIps() { + this.emit( + 'ips-changed', + new Messages.NetSpeedIPsMessage({ ips: this._ips }) + ); + } - total += _down + _up; - up += _up; - down += _down; - if (this.getDevice() === this._devices[i]) { - total_speed = this._speed_to_string((_up + _down) / delta); - up_speed = this._speed_to_string(_up / delta); - down_speed = this._speed_to_string(_down / delta); + /** + * NetSpeed: _create_menu + */ + _create_menu() { + let types = []; + let devices_text = []; + for (let dev of this._devices) { + types.push(this.get_device_type(dev)); + let wifi_ssid = this._retrieve_wifi_ssid(dev); + //Logger.info(`wifi_ssid is '${wifi_ssid}' for dev '${dev}'`); + if (wifi_ssid !== null) { + devices_text.push(dev + `\n${wifi_ssid}`); + continue; + } + devices_text.push(dev); } - } - if (total_speed === null) { - total_speed = this._speed_to_string(total / delta); - up_speed = this._speed_to_string(up / delta); - down_speed = this._speed_to_string(down / delta); - } - - this._sendStats(total_speed, up_speed, down_speed); - this._sendSpeeds(); - } else { - this._create_menu(); + + this.emit( + 'menu-changed', + new Messages.NetSpeedMenuMessage( + { + devices_text: devices_text, + types: types, + }) + ); } - if (this._device_state_changed && this.show_ips) { - this._retrieve_ips(); - this._sendIps(); - Logger.debug("Retrieved ips"); + /** + * NetSpeed: _updateDefaultGw + */ + _updateDefaultGw() { + let flines = GLib.file_get_contents('/proc/net/route'); // Read the file + let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines + for (let nline of nlines) { //first 2 lines are for header + let line = nline.replace(/^ */g, ""); + let params = line.split("\t"); + if (params.length !== 11) // ignore empty lines + continue; + // So store up/down values + if (params[1] === "00000000") { + this._defaultGw = params[0]; + } + } } - // reset state - this._device_state_changed = false; + /** + * NetSpeed: _update + */ + _update() { + this._updateDefaultGw(); + let flines = GLib.file_get_contents('/proc/net/dev'); // Read the file + let nlines = new TextDecoder().decode(flines[1]).split("\n"); // Break to lines + + let up = 0; // set initial + let down = 0; + this._oldvalues = this._values; + this._values = []; + this._speeds = []; + this._ips = []; + this._olddevices = this._devices; + this._devices = []; + + let time = GLib.get_monotonic_time() / 1000; // current time 1000 is not the net_speed.timer! + let delta = time - this._last_time; // Here the difference is evaluated + this._last_time = time; + + // parse the file + for (let i = 2; i < nlines.length - 1; ++i) { //first 2 lines are for header + let line = nlines[i].replace(/ +/g, " ").replace(/^ */g, ""); + let params = line.split(" "); + if (params[0].replace(":", "") === "lo") // ignore local device + continue; + // So store up/down values + this._values.push([parseInt(params[9]), parseInt(params[1])]); + this._devices.push(params[0].replace(":", "")); + } - // keep alive timer - return true; - } + //Logger.debug("Devices: " + this._devices); + + let total = 0; + let total_speed = null; + let up_speed = null; + let down_speed = null; + + if (this._is_up2date() === 1 && !this._device_state_changed) { + for (let i = 0; i < this._values.length; ++i) { + let _up = this._values[i][0] - this._oldvalues[i][0]; + let _down = this._values[i][1] - this._oldvalues[i][1]; + + // Avoid negetive speed in case of device going down, when device goes down, + if (_up < 0) + _up = 0; + if (_down < 0) + _down = 0; + + let _up_speed = this._speed_to_string(_up / delta); + let _down_speed = this._speed_to_string(_down / delta); + this._speeds.push({ + up: _up_speed.text + " " + _up_speed.unit, + down: _down_speed.text + " " + _down_speed.unit + }); + + total += _down + _up; + up += _up; + down += _down; + if (this.getDevice() === this._devices[i]) { + total_speed = this._speed_to_string((_up + _down) / delta); + up_speed = this._speed_to_string(_up / delta); + down_speed = this._speed_to_string(_down / delta); + } + } + if (total_speed === null) { + total_speed = this._speed_to_string(total / delta); + up_speed = this._speed_to_string(up / delta); + down_speed = this._speed_to_string(down / delta); + } + + this._sendStats(total_speed, up_speed, down_speed); + this._sendSpeeds(); + } else { + this._create_menu(); + } - /** - * NetSpeed: _load - */ - _load() { - if (this._saving === 1) { - return; + if (this._device_state_changed && this.show_ips) { + this._retrieve_ips(); + this._sendIps(); + Logger.debug("Retrieved ips"); + } + + // reset state + this._device_state_changed = false; + + // keep alive timer + return true; } - this.digits = this._settings.get_int('digits'); - this._device = this._settings.get_string('device'); - this.timer = this._settings.get_int('timer'); - this.use_bytes = this._settings.get_boolean('use-bytes'); - this.bin_prefixes = this._settings.get_boolean('bin-prefixes'); - - let show_ips = this._settings.get_boolean('show-ips'); - if (show_ips !== this.show_ips && show_ips) { - // trigger ip reload - this._trigger_ips_reload(); + + /** + * NetSpeed: _load + */ + _load() { + if (this._saving === 1) { + return; + } + this.digits = this._settings.get_int('digits'); + this._device = this._settings.get_string('device'); + this.timer = this._settings.get_int('timer'); + this.use_bytes = this._settings.get_boolean('use-bytes'); + this.bin_prefixes = this._settings.get_boolean('bin-prefixes'); + + let show_ips = this._settings.get_boolean('show-ips'); + if (show_ips !== this.show_ips && show_ips) { + // trigger ip reload + this._trigger_ips_reload(); + } + this.show_ips = show_ips; } - this.show_ips = show_ips; - } - /** - * NetSpeed: save - */ - save() { - this._saving = 1; // Disable Load - //this._settings.set_boolean('show-sum', this.showsum); - //this._settings.set_string('device', this._device); - this._settings.set_boolean('show-ips', this.show_ips); - this._saving = 0; // Enable Load - } - - /** - * NetSpeed: _reload - */ - _reload() { - if (this._settings !== null) { - let m_timer = this._settings.get_int('timer'); - if (m_timer !== this.timer) { - GLib.source_remove(this._timerid); - this._timerid = GLib.timeout_add(m_timer, this._update.bind(this)); - // this.timer will be updated within this._load, so no need to update it here - } - this._load(); - //this._status_icon.updateui(); - this.emit('reloaded'); + /** + * NetSpeed: save + */ + save() { + this._saving = 1; // Disable Load + //this._settings.set_boolean('show-sum', this.showsum); + //this._settings.set_string('device', this._device); + this._settings.set_boolean('show-ips', this.show_ips); + this._saving = 0; // Enable Load } - } - /** - * NetSpeed: start - */ - start() { - this._changed = this._settings.connect('changed', this._reload.bind(this)); - this._timerid = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this.timer, this._update.bind(this)); - } + /** + * NetSpeed: _reload + */ + _reload() { + if (this._settings !== null) { + let m_timer = this._settings.get_int('timer'); + if (m_timer !== this.timer) { + GLib.source_remove(this._timerid); + this._timerid = GLib.timeout_add(m_timer, this._update.bind(this)); + // this.timer will be updated within this._load, so no need to update it here + } + this._load(); + //this._status_icon.updateui(); + this.emit('reloaded'); + } + } - /** - * NetSpeed: stop + /** + * NetSpeed: start */ - stop() { - if (this._timerid && this._timerid !== 0) { - GLib.source_remove(this._timerid); - this._timerid = 0; + start() { + this._changed = this._settings.connect('changed', this._reload.bind(this)); + this._timerid = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this.timer, this._update.bind(this)); } - this._devices = null; - this._values = null; - this._olddevices = null; - this._oldvalues = null; - this._settings = null; - - this._nm_signals.forEach(sig_id => { - this._nm_client.disconnect(sig_id); - }); - - this._disconnect_all_nm_device_state_changed(); - this._nm_client = null; - //this._status_icon.destroy(); - //this._status_icon = null; - } - - getDevice() { - if (this._device === "defaultGW") { - return this._defaultGw; - } else { - return this._device; - } - } - /* - setDevice(device) { - this._device = device; - } - */ + /** + * NetSpeed: stop + */ + stop() { + if (this._timerid && this._timerid !== 0) { + GLib.source_remove(this._timerid); + this._timerid = 0; + } + this._devices = null; + this._values = null; + this._olddevices = null; + this._oldvalues = null; + this._settings = null; + + this._nm_signals.forEach(sig_id => { + this._nm_client.disconnect(sig_id); + }); - /** - * NetSpeed: _nm_device_changed - */ - _nm_device_changed(_client, _device) { - this._trigger_ips_reload(); - } + this._disconnect_all_nm_device_state_changed(); + this._nm_client = null; + //this._status_icon.destroy(); + //this._status_icon = null; + } - /** - * NetSpeed: _nm_connection_changed - */ - _nm_connection_changed(_client, _connection) { - this._trigger_ips_reload(); - } + getDevice() { + if (this._device === "defaultGW") { + return this._defaultGw; + } else { + return this._device; + } + } - /** - * NetSpeed: _trigger_ips_reload - */ - _trigger_ips_reload() { - this._device_state_changed = true; - } + /* + setDevice(device) { + this._device = device; + } + */ - /** - * NetSpeed: _retrieve_ips - * get ips v4 - */ - _retrieve_ips() { - // remove previous connects - this._disconnect_all_nm_device_state_changed(); - - for (let dev of this._devices) { - let nm_dev = this._nm_client.get_device_by_iface(dev); - let addresses = this._getAddresses(nm_dev, GLib.SYSDEF_AF_INET); - this._ips.push(addresses); - this._connect_nm_device_state_changed(nm_dev); + /** + * NetSpeed: _nm_device_changed + */ + _nm_device_changed(_client, _device) { + this._trigger_ips_reload(); } - } - /** - * NetSpeed: _retrieve_wifi_ssid - * Retrieve access point name (SSID) for wifi device interface - */ - _retrieve_wifi_ssid(iface) { - let nm_dev = this._nm_client.get_device_by_iface(iface); - if (nm_dev.get_device_type() === NM.DeviceType.WIFI) { - let active_ap = nm_dev.get_active_access_point(); - if (active_ap !== null) { - return new TextDecoder().decode(active_ap.get_ssid().toArray(), 'UTF-8'); - } + /** + * NetSpeed: _nm_connection_changed + */ + _nm_connection_changed(_client, _connection) { + this._trigger_ips_reload(); } - return null; - } - /** - * NetSpeed: _connect_nm_device_state_changed - * @param {NM.Device} nm_device: NM Device instance - */ - _connect_nm_device_state_changed(nm_device) { - if (!this._nm_devices_signals_map.has(nm_device.get_iface())) { - let signal_id = nm_device.connect('state-changed', this._nm_device_state_changed.bind(this)); - this._nm_devices_signals_map.set(nm_device.get_iface(), [nm_device, signal_id]); + /** + * NetSpeed: _trigger_ips_reload + */ + _trigger_ips_reload() { + this._device_state_changed = true; } - } - /** - * NetSpeed: _disconnect_nm_device_state_changed - * Use GObject.signal_handler_disconnect to avoid override of disconnect - * due ot introspection on NM.Device . - */ - _disconnect_all_nm_device_state_changed() { - for (let [nm_device, signal_id] of this._nm_devices_signals_map.values()) { - GObject.signal_handler_disconnect(nm_device, signal_id); + /** + * NetSpeed: _retrieve_ips + * get ips v4 + */ + _retrieve_ips() { + // remove previous connects + this._disconnect_all_nm_device_state_changed(); + + for (let dev of this._devices) { + let nm_dev = this._nm_client.get_device_by_iface(dev); + let addresses = this._getAddresses(nm_dev, GLib.SYSDEF_AF_INET); + this._ips.push(addresses); + this._connect_nm_device_state_changed(nm_dev); + } } - this._nm_devices_signals_map.clear(); - } - - /** - * NetSpeed: _nm_device_state_changed - * Handler for NM.Device 'state-changed' signal - * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceState for states - * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceStateReason for reasons - */ - _nm_device_state_changed(_nm_device, _old_state, _new_state, _reason) { - //Logger.info(`${nm_device.get_iface()} move from ${old_state} to ${new_state}: reason ${reason}`); - this._trigger_ips_reload(); - } - - /** - * NetSpeed: _getAddresses - * function from https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/examples/js/get_ips.js#L16 - * @param {NM.Device}: NetWorkManager Device - * @param {Glib.SYSDEF_AF_INET}: family - Glib.SYSDEF_AF_INET or Glib.SYSDEF_AF_INET6 - * @returns {string[]}: Array of 'address/prefix' string - */ - _getAddresses(nm_device, family) { - let ip_cfg; - if (family === GLib.SYSDEF_AF_INET) - ip_cfg = nm_device.get_ip4_config(); - else - ip_cfg = nm_device.get_ip6_config(); - - if (ip_cfg === null) { - //Logger.info(`No config for device '${nm_device.get_iface()}'`); - return []; + + /** + * NetSpeed: _retrieve_wifi_ssid + * Retrieve access point name (SSID) for wifi device interface + */ + _retrieve_wifi_ssid(iface) { + let nm_dev = this._nm_client.get_device_by_iface(iface); + if (nm_dev.get_device_type() === NM.DeviceType.WIFI) { + let active_ap = nm_dev.get_active_access_point(); + if (active_ap !== null) { + return new TextDecoder().decode(active_ap.get_ssid().toArray(), 'UTF-8'); + } + } + return null; } - let nm_addresses = ip_cfg.get_addresses(); - if (nm_addresses.length === 0) { - //Logger.info(`No IP addresses for device '${nm_device.get_iface()}'`); - return []; + /** + * NetSpeed: _connect_nm_device_state_changed + * @param {NM.Device} nm_device: NM Device instance + */ + _connect_nm_device_state_changed(nm_device) { + if (!this._nm_devices_signals_map.has(nm_device.get_iface())) { + let signal_id = nm_device.connect('state-changed', this._nm_device_state_changed.bind(this)); + this._nm_devices_signals_map.set(nm_device.get_iface(), [nm_device, signal_id]); + } } - let addresses = []; - for (let nm_address of nm_addresses) { - let addr = nm_address.get_address(); - let prefix = nm_address.get_prefix(); - addresses.push(addr + "/" + prefix); + /** + * NetSpeed: _disconnect_nm_device_state_changed + * Use GObject.signal_handler_disconnect to avoid override of disconnect + * due ot introspection on NM.Device . + */ + _disconnect_all_nm_device_state_changed() { + for (let [nm_device, signal_id] of this._nm_devices_signals_map.values()) { + GObject.signal_handler_disconnect(nm_device, signal_id); + } + this._nm_devices_signals_map.clear(); } - return addresses; - } + /** + * NetSpeed: _nm_device_state_changed + * Handler for NM.Device 'state-changed' signal + * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceState for states + * See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMDeviceStateReason for reasons + */ + _nm_device_state_changed(_nm_device, _old_state, _new_state, _reason) { + //Logger.info(`${nm_device.get_iface()} move from ${old_state} to ${new_state}: reason ${reason}`); + this._trigger_ips_reload(); + } + + /** + * NetSpeed: _getAddresses + * function from https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/examples/js/get_ips.js#L16 + * @param {NM.Device}: NetWorkManager Device + * @param {Glib.SYSDEF_AF_INET}: family - Glib.SYSDEF_AF_INET or Glib.SYSDEF_AF_INET6 + * @returns {string[]}: Array of 'address/prefix' string + */ + _getAddresses(nm_device, family) { + let ip_cfg; + if (family === GLib.SYSDEF_AF_INET) + ip_cfg = nm_device.get_ip4_config(); + else + ip_cfg = nm_device.get_ip6_config(); + + if (ip_cfg === null) { + //Logger.info(`No config for device '${nm_device.get_iface()}'`); + return []; + } + + let nm_addresses = ip_cfg.get_addresses(); + if (nm_addresses.length === 0) { + //Logger.info(`No IP addresses for device '${nm_device.get_iface()}'`); + return []; + } + + let addresses = []; + for (let nm_address of nm_addresses) { + let addr = nm_address.get_address(); + let prefix = nm_address.get_prefix(); + addresses.push(addr + "/" + prefix); + } + + return addresses; + } }); diff --git a/net_speed_layout_menu_item.js b/net_speed_layout_menu_item.js index 87f2002..f28860b 100644 --- a/net_speed_layout_menu_item.js +++ b/net_speed_layout_menu_item.js @@ -24,81 +24,81 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; * Class: NetSpeedLayoutMenuItem */ export const NetSpeedLayoutMenuItem = GObject.registerClass( - class NetSpeedLayoutMenuItem extends PopupMenu.PopupBaseMenuItem { - /** - * NetSpeedLayoutMenuItem: ctor - */ - constructor(device, icon, menu_label_size) { - super(); - this.device = device; - this._icon = icon; - this._device_title = new St.Label( - { - text: device, - style_class: "ns-menuitem" - } - ); - this._device_title.get_clutter_text().set_line_wrap(true); + class NetSpeedLayoutMenuItem extends PopupMenu.PopupBaseMenuItem { + /** + * NetSpeedLayoutMenuItem: ctor + */ + constructor(device, icon, menu_label_size) { + super(); + this.device = device; + this._icon = icon; + this._device_title = new St.Label( + { + text: device, + style_class: "ns-menuitem" + } + ); + this._device_title.get_clutter_text().set_line_wrap(true); - this._down_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - this._up_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - this._ips_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._down_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._up_label = new St.Label({ text: "", style_class: "ns-menuitem" }); + this._ips_label = new St.Label({ text: "", style_class: "ns-menuitem" }); - if (this._icon !== null) { - this.add(this._icon); - } else { - this.add(new St.Label()); - } - this.add(this._device_title); - this.add(this._down_label); - this.add(this._up_label); - this.add(this._ips_label); - this.update_ui(menu_label_size); - this.show_ip(false); + if (this._icon !== null) { + this.add(this._icon); + } else { + this.add(new St.Label()); + } + this.add(this._device_title); + this.add(this._down_label); + this.add(this._up_label); + this.add(this._ips_label); + this.update_ui(menu_label_size); + this.show_ip(false); - //log(`${getMethods(this)}`); - } + //log(`${getMethods(this)}`); + } - /** - * NetSpeedLayoutMenuItem: update_ui - * update settings - */ - update_ui(menu_label_size) { - this._down_label.set_width(menu_label_size); - this._up_label.set_width(menu_label_size); - this._device_title.set_width(menu_label_size); - this._ips_label.set_width(menu_label_size); - } + /** + * NetSpeedLayoutMenuItem: update_ui + * update settings + */ + update_ui(menu_label_size) { + this._down_label.set_width(menu_label_size); + this._up_label.set_width(menu_label_size); + this._device_title.set_width(menu_label_size); + this._ips_label.set_width(menu_label_size); + } - /** - * NetSpeedLayoutMenuItem: update_speeds - * update speeds - */ - update_speeds(speed) { - this._down_label.set_text(speed.down); - this._up_label.set_text(speed.up); - } + /** + * NetSpeedLayoutMenuItem: update_speeds + * update speeds + */ + update_speeds(speed) { + this._down_label.set_text(speed.down); + this._up_label.set_text(speed.up); + } - /** - * NetSpeedLayoutMenuItem: show_ip - * @param {boolean} value - */ - show_ip(value) { - if (value) { - this._ips_label.show(); - } - else { - this._ips_label.hide(); - } - } + /** + * NetSpeedLayoutMenuItem: show_ip + * @param {boolean} value + */ + show_ip(value) { + if (value) { + this._ips_label.show(); + } + else { + this._ips_label.hide(); + } + } - /** - * NetSpeedLayoutMenuItem: update_ips - * update ips - * @param {string[]} ips: IPs addresses array - */ - update_ips(ips) { - this._ips_label.set_text(ips.join("\n")); - } + /** + * NetSpeedLayoutMenuItem: update_ips + * update ips + * @param {string[]} ips: IPs addresses array + */ + update_ips(ips) { + this._ips_label.set_text(ips.join("\n")); + } - }); + }); diff --git a/net_speed_status_icon.js b/net_speed_status_icon.js index 2d097b6..9864ae0 100644 --- a/net_speed_status_icon.js +++ b/net_speed_status_icon.js @@ -34,317 +34,317 @@ import { Logger } from './lib.js'; * status icon, texts for speeds, the drop-down menu */ export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu.Button { - /** - * NetSpeedStatusIcon: _init - * Constructor - */ - constructor(extension, net_speed) { - super(0.0); - this._extension = extension; - this._settings = extension.getSettings() - this._net_speed = net_speed; - - // extension button - this._box = new St.BoxLayout(); - this.add_actor(this._box); - this.connect('button-release-event', this._toggle_showsum.bind(this)); - - // download - this._download_box = new St.BoxLayout(); - this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._download_box.add_actor(this._down); - this._download_box.add_actor(this._downunit); - this._download_box.add_actor(this._downicon); - - // upload - this._upload_box = new St.BoxLayout(); - this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._upload_box.add_actor(this._up); - this._upload_box.add_actor(this._upunit); - this._upload_box.add_actor(this._upicon); - - // sum - this._sum_box = new St.BoxLayout(); - this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); - this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._sum_box.add_actor(this._sum); - this._sum_box.add_actor(this._sumunit); - - // metrics box - this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); - this._metrics_box.add_actor(this._download_box); - this._metrics_box.add_actor(this._upload_box); - this._metrics_box.add_actor(this._sum_box); - this._box.add_actor(this._metrics_box); - - // interface icon - this._icon_box = new St.BoxLayout(); - this._icon = this._getIcon(this._net_speed.get_device_type(this._net_speed.getDevice())); - this._icon_box.add_actor(this._icon); - this._box.add_actor(this._icon_box); - - // Add pref luncher - this._pref = new St.Button({ child: this._getIcon("pref") }); - this._pref.connect("clicked", () => { - Util.spawn(["gnome-extensions", "prefs", this._extension.metadata.uuid]); - }); - - this._menu_title = new NetSpeedLayoutMenuItem(_("Device"), this._pref, this._settings.get_int('menu-label-size')); - this._menu_title.connect("activate", this._change_device.bind(this, "")); - this._menu_title.update_speeds({ up: _("Up"), down: _("Down") }); - this._menu_title.update_ips([_("IP")]); - this._menu_title.show_ip(this._settings.get_boolean('show-ips')); - this.menu.addMenuItem(this._menu_title); - this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this._layouts = []; - this.updateui(); - - this._connectSignals(); - - - // connect settings for position in panel - this._placement_changed_id = this._settings.connect('changed::placement', this._positionInPanelChanged.bind(this)); - this._placement_index_changed_id = this._settings.connect('changed::placement-index', this._positionInPanelChanged.bind(this)); - } - - /** - * NetSpeedStatusIcon :_change_device - */ - _change_device(param1, param2, device) { - this._settings.set_string('device', device); - //this._net_speed.setDevice(device); - this.updateui(); - //this._net_speed.save(); - } - - /** - * NetSpeedStatusIcon: _toggle_showsum - */ - _toggle_showsum(actor, event) { - let button = event.get_button(); - if (button === 2) { // middle - this._settings.set_boolean('show-sum', !this._settings.get_boolean('show-sum')); - this.updateui(); + /** + * NetSpeedStatusIcon: _init + * Constructor + */ + constructor(extension, net_speed) { + super(0.0); + this._extension = extension; + this._settings = extension.getSettings() + this._net_speed = net_speed; + + // extension button + this._box = new St.BoxLayout(); + this.add_actor(this._box); + this.connect('button-release-event', this._toggle_showsum.bind(this)); + + // download + this._download_box = new St.BoxLayout(); + this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); + this._download_box.add_actor(this._down); + this._download_box.add_actor(this._downunit); + this._download_box.add_actor(this._downicon); + + // upload + this._upload_box = new St.BoxLayout(); + this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); + this._upload_box.add_actor(this._up); + this._upload_box.add_actor(this._upunit); + this._upload_box.add_actor(this._upicon); + + // sum + this._sum_box = new St.BoxLayout(); + this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); + this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); + this._sum_box.add_actor(this._sum); + this._sum_box.add_actor(this._sumunit); + + // metrics box + this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); + this._metrics_box.add_actor(this._download_box); + this._metrics_box.add_actor(this._upload_box); + this._metrics_box.add_actor(this._sum_box); + this._box.add_actor(this._metrics_box); + + // interface icon + this._icon_box = new St.BoxLayout(); + this._icon = this._getIcon(this._net_speed.get_device_type(this._net_speed.getDevice())); + this._icon_box.add_actor(this._icon); + this._box.add_actor(this._icon_box); + + // Add pref luncher + this._pref = new St.Button({ child: this._getIcon("pref") }); + this._pref.connect("clicked", () => { + Util.spawn(["gnome-extensions", "prefs", this._extension.metadata.uuid]); + }); + + this._menu_title = new NetSpeedLayoutMenuItem(_("Device"), this._pref, this._settings.get_int('menu-label-size')); + this._menu_title.connect("activate", this._change_device.bind(this, "")); + this._menu_title.update_speeds({ up: _("Up"), down: _("Down") }); + this._menu_title.update_ips([_("IP")]); + this._menu_title.show_ip(this._settings.get_boolean('show-ips')); + this.menu.addMenuItem(this._menu_title); + this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + this._layouts = []; + this.updateui(); + + this._connectSignals(); + + + // connect settings for position in panel + this._placement_changed_id = this._settings.connect('changed::placement', this._positionInPanelChanged.bind(this)); + this._placement_index_changed_id = this._settings.connect('changed::placement-index', this._positionInPanelChanged.bind(this)); } - } - - /** - * NetSpeedStatusIcon: updateui - * update ui according to settings - */ - updateui() { - // Set the size of labels - this._sum.set_width(this._settings.get_int('label-size')); - this._sumunit.set_width(this._settings.get_int('unit-label-size')); - this._up.set_width(this._settings.get_int('label-size')); - this._upunit.set_width(this._settings.get_int('unit-label-size')); - this._down.set_width(this._settings.get_int('label-size')); - this._downunit.set_width(this._settings.get_int('unit-label-size')); - - // Show up + down or sum - if (this._settings.get_boolean('show-sum') === false) { - this._sum.hide(); - this._sumunit.hide(); - this._upicon.show(); - this._up.show(); - this._upunit.show(); - this._downicon.show(); - this._down.show(); - this._downunit.show(); - this.set_vertical_alignment(this._settings.get_boolean('vert-align')); - } else { - this._sum.show(); - this._sumunit.show(); - this._upicon.hide(); - this._up.hide(); - this._upunit.hide(); - this._downicon.hide(); - this._down.hide(); - this._downunit.hide(); - // ignore vertical alignment with sum - this.set_vertical_alignment(false); + + /** + * NetSpeedStatusIcon :_change_device + */ + _change_device(param1, param2, device) { + this._settings.set_string('device', device); + //this._net_speed.setDevice(device); + this.updateui(); + //this._net_speed.save(); } - // Change the type of Icon - this._icon.destroy(); - const device = this._net_speed.getDevice(); - - Logger.debug("Device -> " + device); - - this._icon = this._getIcon(this._net_speed.get_device_type(device)); - this._icon_box.add_actor(this._icon); - // Show icon or not - if (this._settings.get_boolean('icon-display')) - this._icon.show(); - else - this._icon.hide(); - // Update Menu sizes - this._menu_title.update_ui(this._settings.get_int('menu-label-size')); - - const show_ips = this._settings.get_boolean('show-ips'); - this._menu_title.show_ip(show_ips); - for (let layout of this._layouts) { - layout.update_ui(this._settings.get_int('menu-label-size')); - layout.show_ip(show_ips); + /** + * NetSpeedStatusIcon: _toggle_showsum + */ + _toggle_showsum(actor, event) { + let button = event.get_button(); + if (button === 2) { // middle + this._settings.set_boolean('show-sum', !this._settings.get_boolean('show-sum')); + this.updateui(); + } } - } - - _connectSignals() { - this._net_speed.connect('reloaded', () => this.updateui()); - this._net_speed.connect('global-stats-changed', this._onGlobalStatsChanged.bind(this)); - this._net_speed.connect('speeds-changed', this._onSpeedsChanged.bind(this)); - this._net_speed.connect('ips-changed', this._onIPsChanged.bind(this)); - this._net_speed.connect('menu-changed', this._onCreateMenu.bind(this)); - } - - /** - * NetSpeedStatusIcon: _getIcon - * Utility function to create icon from name - */ - _getIcon(name, size) { - if (arguments.length === 1) - size = 16; - let iconname = ""; - switch (name) { - case "none": - iconname = "network-transmit-receive-symbolic"; - break; - case "ethernet": - iconname = "network-wired-symbolic"; - break; - case "wifi": - iconname = "network-wireless-signal-excellent-symbolic"; - break; - case "bt": - iconname = "bluetooth-active-symbolic"; - break; - case "olpcmesh": - iconname = "network-wired-symbolic"; - break; - case "wimax": - iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi - break; - case "modem": - iconname = "gnome-modem"; // Hope works! - break; - case "up": - iconname = "go-up-symbolic"; - break; - case "down": - iconname = "go-down-symbolic"; - break; - case "pref": - iconname = "emblem-system-symbolic"; - break; - default: - iconname = "network-transmit-receive-symbolic"; + + /** + * NetSpeedStatusIcon: updateui + * update ui according to settings + */ + updateui() { + // Set the size of labels + this._sum.set_width(this._settings.get_int('label-size')); + this._sumunit.set_width(this._settings.get_int('unit-label-size')); + this._up.set_width(this._settings.get_int('label-size')); + this._upunit.set_width(this._settings.get_int('unit-label-size')); + this._down.set_width(this._settings.get_int('label-size')); + this._downunit.set_width(this._settings.get_int('unit-label-size')); + + // Show up + down or sum + if (this._settings.get_boolean('show-sum') === false) { + this._sum.hide(); + this._sumunit.hide(); + this._upicon.show(); + this._up.show(); + this._upunit.show(); + this._downicon.show(); + this._down.show(); + this._downunit.show(); + this.set_vertical_alignment(this._settings.get_boolean('vert-align')); + } else { + this._sum.show(); + this._sumunit.show(); + this._upicon.hide(); + this._up.hide(); + this._upunit.hide(); + this._downicon.hide(); + this._down.hide(); + this._downunit.hide(); + // ignore vertical alignment with sum + this.set_vertical_alignment(false); + } + + // Change the type of Icon + this._icon.destroy(); + const device = this._net_speed.getDevice(); + + Logger.debug("Device -> " + device); + + this._icon = this._getIcon(this._net_speed.get_device_type(device)); + this._icon_box.add_actor(this._icon); + // Show icon or not + if (this._settings.get_boolean('icon-display')) + this._icon.show(); + else + this._icon.hide(); + // Update Menu sizes + this._menu_title.update_ui(this._settings.get_int('menu-label-size')); + + const show_ips = this._settings.get_boolean('show-ips'); + this._menu_title.show_ip(show_ips); + for (let layout of this._layouts) { + layout.update_ui(this._settings.get_int('menu-label-size')); + layout.show_ip(show_ips); + } } - return new St.Icon({ - icon_name: iconname, - icon_size: size, - }); - } - - /** - * NetSpeedStatusIcon: _onGlobalStatsChanged(,NetSpeedGlobalStats) - * @param {*} sender - * @param {Messages.NetSpeedGlobalStatsMessage} stats - */ - _onGlobalStatsChanged(sender, stats) { - this._sum.set_text(stats.sum.text); - this._sumunit.set_text(stats.sum.unit); - - this._up.set_text(stats.up.text); - this._upunit.set_text(stats.up.unit); - - this._down.set_text(stats.down.text); - this._downunit.set_text(stats.down.unit); - } - - /** - * NetSpeedStatusIcon: create_menu - * @param {*} sender - * @param {Messages.NetSpeedMenuMessage} menu - */ - _onCreateMenu(sender, menu) { - for (let layout of this._layouts) { - layout.destroy(); + _connectSignals() { + this._net_speed.connect('reloaded', () => this.updateui()); + this._net_speed.connect('global-stats-changed', this._onGlobalStatsChanged.bind(this)); + this._net_speed.connect('speeds-changed', this._onSpeedsChanged.bind(this)); + this._net_speed.connect('ips-changed', this._onIPsChanged.bind(this)); + this._net_speed.connect('menu-changed', this._onCreateMenu.bind(this)); } - this._layouts = []; - for (let i = 0; i < menu.devices_text.length; ++i) { - let icon = this._getIcon(menu.types[i]); - let layout = new NetSpeedLayoutMenuItem(menu.devices_text[i], icon, this._settings.get_int('menu-label-size')); - layout.show_ip(this._settings.get_boolean('show-ips')); - layout.connect("activate", this._change_device.bind(this, menu.devices_text[i])); - this._layouts.push(layout); - this.menu.addMenuItem(layout); + + /** + * NetSpeedStatusIcon: _getIcon + * Utility function to create icon from name + */ + _getIcon(name, size) { + if (arguments.length === 1) + size = 16; + let iconname = ""; + switch (name) { + case "none": + iconname = "network-transmit-receive-symbolic"; + break; + case "ethernet": + iconname = "network-wired-symbolic"; + break; + case "wifi": + iconname = "network-wireless-signal-excellent-symbolic"; + break; + case "bt": + iconname = "bluetooth-active-symbolic"; + break; + case "olpcmesh": + iconname = "network-wired-symbolic"; + break; + case "wimax": + iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi + break; + case "modem": + iconname = "gnome-modem"; // Hope works! + break; + case "up": + iconname = "go-up-symbolic"; + break; + case "down": + iconname = "go-down-symbolic"; + break; + case "pref": + iconname = "emblem-system-symbolic"; + break; + default: + iconname = "network-transmit-receive-symbolic"; + } + + return new St.Icon({ + icon_name: iconname, + icon_size: size, + }); } - } - - /** - * NetSpeedStatusIcon: _onSpeedsChanged - * - * @param {*} sender - * @param {Messages.NetSpeedSpeedsMessage} speeds - */ - _onSpeedsChanged(sender, speeds) { - for (let i = 0; i < speeds.speeds.length; ++i) { - this._layouts[i].update_speeds(speeds.speeds[i]); + + /** + * NetSpeedStatusIcon: _onGlobalStatsChanged(,NetSpeedGlobalStats) + * @param {*} sender + * @param {Messages.NetSpeedGlobalStatsMessage} stats + */ + _onGlobalStatsChanged(sender, stats) { + this._sum.set_text(stats.sum.text); + this._sumunit.set_text(stats.sum.unit); + + this._up.set_text(stats.up.text); + this._upunit.set_text(stats.up.unit); + + this._down.set_text(stats.down.text); + this._downunit.set_text(stats.down.unit); } - // fix #131 by forcing a delayed redraw - GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => { - this.queue_redraw(); - return GLib.SOURCE_REMOVE; - }); - } - - /** - * NetSpeedStatusIcon: set_vertical_alignment - */ - set_vertical_alignment(tof) { - this._metrics_box.set_vertical(tof); - let align = tof ? 'vertical' : 'horizontal'; - this._down.set_style_class_name('ns-' + align + '-label'); - this._downunit.set_style_class_name('ns-' + align + '-unit-label'); - this._downicon.set_style_class_name('ns-' + align + '-icon'); - this._up.set_style_class_name('ns-' + align + '-label'); - this._upunit.set_style_class_name('ns-' + align + '-unit-label'); - this._upicon.set_style_class_name('ns-' + align + '-icon'); - } - - /** - * NetSpeedStatusIcon: _onIPsChanged - * @param {*} sender - * @param {Messages.NetSpeedIPsMessage} ips - */ - _onIPsChanged(sender, ips) { - for (let i = 0; i < ips.ips.length; ++i) { - this._layouts[i].update_ips(ips.ips[i]); + /** + * NetSpeedStatusIcon: create_menu + * @param {*} sender + * @param {Messages.NetSpeedMenuMessage} menu + */ + _onCreateMenu(sender, menu) { + for (let layout of this._layouts) { + layout.destroy(); + } + this._layouts = []; + for (let i = 0; i < menu.devices_text.length; ++i) { + let icon = this._getIcon(menu.types[i]); + let layout = new NetSpeedLayoutMenuItem(menu.devices_text[i], icon, this._settings.get_int('menu-label-size')); + layout.show_ip(this._settings.get_boolean('show-ips')); + layout.connect("activate", this._change_device.bind(this, menu.devices_text[i])); + this._layouts.push(layout); + this.menu.addMenuItem(layout); + } } - } - _positionInPanelChanged() { - this.container.get_parent().remove_actor(this.container); + /** + * NetSpeedStatusIcon: _onSpeedsChanged + * + * @param {*} sender + * @param {Messages.NetSpeedSpeedsMessage} speeds + */ + _onSpeedsChanged(sender, speeds) { + for (let i = 0; i < speeds.speeds.length; ++i) { + this._layouts[i].update_speeds(speeds.speeds[i]); + } + + // fix #131 by forcing a delayed redraw + GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => { + this.queue_redraw(); + return GLib.SOURCE_REMOVE; + }); + } - // small HACK with private boxes :) - let boxes = { - left: Main.panel._leftBox, - center: Main.panel._centerBox, - right: Main.panel._rightBox - }; + /** + * NetSpeedStatusIcon: set_vertical_alignment + */ + set_vertical_alignment(tof) { + this._metrics_box.set_vertical(tof); + let align = tof ? 'vertical' : 'horizontal'; + this._down.set_style_class_name('ns-' + align + '-label'); + this._downunit.set_style_class_name('ns-' + align + '-unit-label'); + this._downicon.set_style_class_name('ns-' + align + '-icon'); + this._up.set_style_class_name('ns-' + align + '-label'); + this._upunit.set_style_class_name('ns-' + align + '-unit-label'); + this._upicon.set_style_class_name('ns-' + align + '-icon'); + } + + /** + * NetSpeedStatusIcon: _onIPsChanged + * @param {*} sender + * @param {Messages.NetSpeedIPsMessage} ips + */ + _onIPsChanged(sender, ips) { + for (let i = 0; i < ips.ips.length; ++i) { + this._layouts[i].update_ips(ips.ips[i]); + } + } - let p = this._settings.get_string('placement'); - let i = this._settings.get_int('placement-index'); + _positionInPanelChanged() { + this.container.get_parent().remove_actor(this.container); - Logger.debug(`_positionInPanelChanged: ${p} at index ${i}`); + // small HACK with private boxes :) + let boxes = { + left: Main.panel._leftBox, + center: Main.panel._centerBox, + right: Main.panel._rightBox + }; - boxes[p].insert_child_at_index(this.container, i); - } + let p = this._settings.get_string('placement'); + let i = this._settings.get_int('placement-index'); + + Logger.debug(`_positionInPanelChanged: ${p} at index ${i}`); + + boxes[p].insert_child_at_index(this.container, i); + } }); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..cc7f939 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1135 @@ +{ + "name": "org.gnome.shell.extensions.netspeed", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "org.gnome.shell.extensions.netspeed", + "version": "1.0.0", + "license": "GPL-2.0", + "devDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", + "integrity": "sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..95dc6e6 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "org.gnome.shell.extensions.netspeed", + "version": "1.0.0", + "description": "Displays Internet Speed", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "sourceType": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/hedayaty/NetSpeed.git" + }, + "keywords": [ + "gnome", + "extension", + "network", + "speed", + "ip", + "interface" + ], + "author": "hedayaty@gmail.com", + "license": "(ISC OR GPL-3.0)", + "bugs": { + "url": "https://github.com/hedayaty/NetSpeed/issues" + }, + "homepage": "https://github.com/hedayaty/NetSpeed#readme", + "devDependencies": { + "eslint": "^8.56.0" + } +} \ No newline at end of file diff --git a/prefs.js b/prefs.js index a912ced..d8a38a9 100644 --- a/prefs.js +++ b/prefs.js @@ -24,286 +24,286 @@ import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/ import { Logger } from './lib.js'; const NetSpeedPreferences = new GObject.registerClass(class NetSpeedPreferences extends Gtk.Grid { - _get_dev_combo() { - let listStore = new Gtk.ListStore(); - listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); - - let all = listStore.append(); - listStore.set(all, [0], [_("ALL")]); - listStore.set(all, [1], ["network-workgroup-symbolic"]); - - let defaultGw = listStore.append(); - listStore.set(defaultGw, [0], [_("Default Gateway")]); - listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); - - let nmc = NM.Client.new(null); - let devices = nmc.get_devices() || []; - this._devices = []; - - for (let dev of devices) { - let iconname; - switch (dev.device_type) { - case NM.DeviceType.ETHERNET: - iconname = "network-wired-symbolic"; - break; - case NM.DeviceType.WIFI: - iconname = "network-wireless-signal-excellent-symbolic"; - break; - case NM.DeviceType.BT: - iconname = "bluetooth-active-symbolic"; - break; - case NM.DeviceType.OLPC_MESH: - iconname = "network-wired-symbolic"; - break; - case NM.DeviceType.WIMAX: - iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi - break; - case NM.DeviceType.MODEM: - iconname = "network-transmit-receive-symbolic"; - break; - default: - continue; - } - this._devices.push(dev.interface); - let iter = listStore.append(); - listStore.set(iter, [0], [dev.interface]); - listStore.set(iter, [1], [iconname]); - } + _get_dev_combo() { + let listStore = new Gtk.ListStore(); + listStore.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]); + + let all = listStore.append(); + listStore.set(all, [0], [_("ALL")]); + listStore.set(all, [1], ["network-workgroup-symbolic"]); + + let defaultGw = listStore.append(); + listStore.set(defaultGw, [0], [_("Default Gateway")]); + listStore.set(defaultGw, [1], ["network-workgroup-symbolic"]); + + let nmc = NM.Client.new(null); + let devices = nmc.get_devices() || []; + this._devices = []; + + for (let dev of devices) { + let iconname; + switch (dev.device_type) { + case NM.DeviceType.ETHERNET: + iconname = "network-wired-symbolic"; + break; + case NM.DeviceType.WIFI: + iconname = "network-wireless-signal-excellent-symbolic"; + break; + case NM.DeviceType.BT: + iconname = "bluetooth-active-symbolic"; + break; + case NM.DeviceType.OLPC_MESH: + iconname = "network-wired-symbolic"; + break; + case NM.DeviceType.WIMAX: + iconname = "network-wirelss-signal-excellent-symbolic"; // Same for wifi + break; + case NM.DeviceType.MODEM: + iconname = "network-transmit-receive-symbolic"; + break; + default: + continue; + } + this._devices.push(dev.interface); + let iter = listStore.append(); + listStore.set(iter, [0], [dev.interface]); + listStore.set(iter, [1], [iconname]); + } - let combo = new Gtk.ComboBox({ model: listStore }); - let rendererPixbuf = new Gtk.CellRendererPixbuf(); - let rendererText = new Gtk.CellRendererText(); - - // Pack the renderers into the combobox in the order we want to see - combo.pack_start(rendererPixbuf, false); - combo.pack_start(rendererText, false); - - // Set the renderers to use the information from our listStore - combo.add_attribute(rendererText, "text", 0); - combo.add_attribute(rendererPixbuf, "icon_name", 1); - return combo; - } - - _pick_changement() { - let active = -1; - switch (this._settings.get_string('placement')) { - case 'right': - active = 0; - break; - case 'center': - active = 1; - break; - case 'left': - active = 2; - break; - } - this.placement.set_active(active); - } + let combo = new Gtk.ComboBox({ model: listStore }); + let rendererPixbuf = new Gtk.CellRendererPixbuf(); + let rendererText = new Gtk.CellRendererText(); - _change_placement() { - let active = this.placement.get_active(); - Logger.debug("_change_placement: active=" + active); + // Pack the renderers into the combobox in the order we want to see + combo.pack_start(rendererPixbuf, false); + combo.pack_start(rendererText, false); - if (active === -1) { - return; + // Set the renderers to use the information from our listStore + combo.add_attribute(rendererText, "text", 0); + combo.add_attribute(rendererPixbuf, "icon_name", 1); + return combo; } - switch (active) { - case 0: - this._settings.set_string('placement', 'right'); - Logger.debug("placement <- right"); - break; - case 1: - this._settings.set_string('placement', 'center'); - Logger.debug("placement <- center"); - break; - case 2: - this._settings.set_string('placement', 'left'); - Logger.debug("placement <- left"); - break; + + _pick_changement() { + let active = -1; + switch (this._settings.get_string('placement')) { + case 'right': + active = 0; + break; + case 'center': + active = 1; + break; + case 'left': + active = 2; + break; + } + this.placement.set_active(active); } - } - _dpi_changed() { - let factor = this._settings.get_int('hi-dpi-factor'); - if (factor !== this._factor) { - this._change_factor(); + _change_placement() { + let active = this.placement.get_active(); + Logger.debug("_change_placement: active=" + active); + + if (active === -1) { + return; + } + switch (active) { + case 0: + this._settings.set_string('placement', 'right'); + Logger.debug("placement <- right"); + break; + case 1: + this._settings.set_string('placement', 'center'); + Logger.debug("placement <- center"); + break; + case 2: + this._settings.set_string('placement', 'left'); + Logger.debug("placement <- left"); + break; + } } - } - _put_dev() { - let active = this.dev.get_active(); - if (active === -1) { - return; + _dpi_changed() { + let factor = this._settings.get_int('hi-dpi-factor'); + if (factor !== this._factor) { + this._change_factor(); + } } - switch (active) { - case 0: - this._settings.set_string('device', "all"); - break; - case 1: - this._settings.set_string('device', "defaultGW"); - break; - default: - this._settings.set_string('device', this._devices[active - 2]); + + _put_dev() { + let active = this.dev.get_active(); + if (active === -1) { + return; + } + switch (active) { + case 0: + this._settings.set_string('device', "all"); + break; + case 1: + this._settings.set_string('device', "defaultGW"); + break; + default: + this._settings.set_string('device', this._devices[active - 2]); + } + + Logger.debug("device <- " + this._settings.get_string('device')); } - Logger.debug("device <- " + this._settings.get_string('device')); - } - - _pick_dev() { - let activeDev = this._settings.get_string('device'); - this._device = activeDev; - let active = 0; - if (activeDev === "all") { - active = 0; - } else if (activeDev === "defaultGW") { - active = 1; - } else { - for (let i = 0; i < this._devices.length; ++i) { - if (this._devices[i] === activeDev) { - active = i + 2; + _pick_dev() { + let activeDev = this._settings.get_string('device'); + this._device = activeDev; + let active = 0; + if (activeDev === "all") { + active = 0; + } else if (activeDev === "defaultGW") { + active = 1; + } else { + for (let i = 0; i < this._devices.length; ++i) { + if (this._devices[i] === activeDev) { + active = i + 2; + } + } } - } + this.dev.set_active(active); } - this.dev.set_active(active); - } - _change_factor() { - let old_factor = this._factor; - let factor = this._settings.get_int('hi-dpi-factor'); - this._factor = factor; + _change_factor() { + let old_factor = this._factor; + let factor = this._settings.get_int('hi-dpi-factor'); + this._factor = factor; - this._label_adjustment.upper = 100 * factor; - this._label_adjustment.step_increment = factor; - this._settings.set_int('label-size', this._settings.get_int('label-size') * factor / old_factor); + this._label_adjustment.upper = 100 * factor; + this._label_adjustment.step_increment = factor; + this._settings.set_int('label-size', this._settings.get_int('label-size') * factor / old_factor); - this._unit_label_adjustment.upper = 100 * factor; - this._unit_label_adjustment.step_increment = factor; - this._settings.set_int('unit-label-size', this._settings.get_int('unit-label-size') * factor / old_factor); + this._unit_label_adjustment.upper = 100 * factor; + this._unit_label_adjustment.step_increment = factor; + this._settings.set_int('unit-label-size', this._settings.get_int('unit-label-size') * factor / old_factor); - this._menu_label_adjustment.upper = 100 * factor; - this._menu_label_adjustment.step_increment = factor; - this._settings.set_int('menu-label-size', this._settings.get_int('menu-label-size') * factor / old_factor); - } + this._menu_label_adjustment.upper = 100 * factor; + this._menu_label_adjustment.step_increment = factor; + this._settings.set_int('menu-label-size', this._settings.get_int('menu-label-size') * factor / old_factor); + } - constructor(extension) { - super({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); - - this._settings = extension.getSettings(); + constructor(extension) { + super({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true }); - this._factor = this._settings.get_int('hi-dpi-factor'); - - // Header: device selection - this.attach(new Gtk.Label({ label: _("Device to monitor") }), 2, 1, 1, 1); - this.dev = this._get_dev_combo(); - this.attach(this.dev, 3, 1, 1, 1); + this._settings = extension.getSettings(); - // Separator - let separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL, valign: Gtk.Align.CENTER }); - separator.set_vexpand(false); - this.attach(separator, 1, 2, 4, 1); + this._factor = this._settings.get_int('hi-dpi-factor'); - // Title - this.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1); + // Header: device selection + this.attach(new Gtk.Label({ label: _("Device to monitor") }), 2, 1, 1, 1); + this.dev = this._get_dev_combo(); + this.attach(this.dev, 3, 1, 1, 1); - // Display options + // Separator + let separator = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL, valign: Gtk.Align.CENTER }); + separator.set_vexpand(false); + this.attach(separator, 1, 2, 4, 1); - this.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); - this.timer = Gtk.SpinButton.new_with_range(100, 10000, 100); - this.attach(this.timer, 2, 4, 1, 1); + // Title + this.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1); - this.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); - this.digits = Gtk.SpinButton.new_with_range(3, 10, 1); - this.attach(this.digits, 2, 5, 1, 1); + // Display options - this.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); - this.label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.attach(this.label_size, 2, 6, 1, 1); + this.attach(new Gtk.Label({ label: _("Timer (milliseconds)") }), 1, 4, 1, 1); + this.timer = Gtk.SpinButton.new_with_range(100, 10000, 100); + this.attach(this.timer, 2, 4, 1, 1); - this.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); - this.unit_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.attach(this.unit_label_size, 2, 7, 1, 1); + this.attach(new Gtk.Label({ label: _("Digits") }), 1, 5, 1, 1); + this.digits = Gtk.SpinButton.new_with_range(3, 10, 1); + this.attach(this.digits, 2, 5, 1, 1); - this.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); - this.menu_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); - this.attach(this.menu_label_size, 2, 8, 1, 1); + this.attach(new Gtk.Label({ label: _("Label Size") }), 1, 6, 1, 1); + this.label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.label_size, 2, 6, 1, 1); - this.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 9, 1, 1); - this.hi_dpi_factor = Gtk.SpinButton.new_with_range(1, 100, 1); - this.attach(this.hi_dpi_factor, 2, 9, 1, 1); + this.attach(new Gtk.Label({ label: _("Unit Label Size") }), 1, 7, 1, 1); + this.unit_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.unit_label_size, 2, 7, 1, 1); - this.attach(new Gtk.Label({ label: _("Placement") }), 1, 10, 1, 1); - this.placement = new Gtk.ComboBoxText(); - this.placement.append_text(_("Right")); - this.placement.append_text(_("Center")); - this.placement.append_text(_("Left")); - this.placement.set_active(0); - this.attach(this.placement, 2, 10, 1, 1); + this.attach(new Gtk.Label({ label: _("Menu Label Size") }), 1, 8, 1, 1); + this.menu_label_size = Gtk.SpinButton.new_with_range(1, 100 * this._factor, this._factor); + this.attach(this.menu_label_size, 2, 8, 1, 1); - this.attach(new Gtk.Label({ label: _("Placement Index") }), 1, 11, 1, 1); - this.placement_index = Gtk.SpinButton.new_with_range(-1, 20, 1); - this.attach(this.placement_index, 2, 11, 1, 1); + this.attach(new Gtk.Label({ label: _("HiDPI factor") }), 1, 9, 1, 1); + this.hi_dpi_factor = Gtk.SpinButton.new_with_range(1, 100, 1); + this.attach(this.hi_dpi_factor, 2, 9, 1, 1); + this.attach(new Gtk.Label({ label: _("Placement") }), 1, 10, 1, 1); + this.placement = new Gtk.ComboBoxText(); + this.placement.append_text(_("Right")); + this.placement.append_text(_("Center")); + this.placement.append_text(_("Left")); + this.placement.set_active(0); + this.attach(this.placement, 2, 10, 1, 1); - // Extension Settings + this.attach(new Gtk.Label({ label: _("Placement Index") }), 1, 11, 1, 1); + this.placement_index = Gtk.SpinButton.new_with_range(-1, 20, 1); + this.attach(this.placement_index, 2, 11, 1, 1); - this.attach(new Gtk.Label({ label: _("Show sum(UP+Down)") }), 3, 4, 1, 1); - this.sum = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(this.sum, 4, 4, 1, 1); - this.attach(new Gtk.Label({ label: _("Show the Icon") }), 3, 5, 1, 1); - this.icon = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(this.icon, 4, 5, 1, 1); + // Extension Settings - this.attach(new Gtk.Label({ label: _("Use multiples of byte") }), 3, 6, 1, 1); - this.use_bytes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(this.use_bytes, 4, 6, 1, 1); + this.attach(new Gtk.Label({ label: _("Show sum(UP+Down)") }), 3, 4, 1, 1); + this.sum = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.sum, 4, 4, 1, 1); - this.attach(new Gtk.Label({ label: _("Use binary prefixes") }), 3, 7, 1, 1); - this.bin_prefixes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(this.bin_prefixes, 4, 7, 1, 1); + this.attach(new Gtk.Label({ label: _("Show the Icon") }), 3, 5, 1, 1); + this.icon = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.icon, 4, 5, 1, 1); - this.attach(new Gtk.Label({ label: _("Align vertically") }), 3, 8, 1, 1); - this.vert_align = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(this.vert_align, 4, 8, 1, 1); + this.attach(new Gtk.Label({ label: _("Use multiples of byte") }), 3, 6, 1, 1); + this.use_bytes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.use_bytes, 4, 6, 1, 1); - this.show_ip = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); - this.attach(new Gtk.Label({ label: _("Show IPs") }), 3, 9, 1, 1); - this.attach(this.show_ip, 4, 9, 1, 1); - this.show_ip.show(); + this.attach(new Gtk.Label({ label: _("Use binary prefixes") }), 3, 7, 1, 1); + this.bin_prefixes = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.bin_prefixes, 4, 7, 1, 1); + this.attach(new Gtk.Label({ label: _("Align vertically") }), 3, 8, 1, 1); + this.vert_align = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(this.vert_align, 4, 8, 1, 1); - // Initialize values - this._pick_dev(); - this.dev.connect('changed', this._put_dev.bind(this)); + this.show_ip = new Gtk.Switch({ halign: Gtk.Align.START, valign: Gtk.Align.CENTER }); + this.attach(new Gtk.Label({ label: _("Show IPs") }), 3, 9, 1, 1); + this.attach(this.show_ip, 4, 9, 1, 1); + this.show_ip.show(); - this._settings.bind('show-sum', this.sum, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('icon-display', this.icon, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('timer', this.timer, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('digits', this.digits, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('label-size', this.label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('unit-label-size', this.unit_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('menu-label-size', this.menu_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('use-bytes', this.use_bytes, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('bin-prefixes', this.bin_prefixes, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('vert-align', this.vert_align, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('hi-dpi-factor', this.hi_dpi_factor, 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('show-ips', this.show_ip, 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind_writable('show-ips', this.show_ip, 'visible', false); - this._settings.connect('changed', this._dpi_changed.bind(this)); - this._dpi_changed(); + // Initialize values + this._pick_dev(); + this.dev.connect('changed', this._put_dev.bind(this)); - this._pick_changement(); - this.placement.connect('changed', this._change_placement.bind(this)); + this._settings.bind('show-sum', this.sum, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('icon-display', this.icon, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('timer', this.timer, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('digits', this.digits, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('label-size', this.label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('unit-label-size', this.unit_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('menu-label-size', this.menu_label_size, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('use-bytes', this.use_bytes, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('bin-prefixes', this.bin_prefixes, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('vert-align', this.vert_align, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hi-dpi-factor', this.hi_dpi_factor, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-ips', this.show_ip, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind_writable('show-ips', this.show_ip, 'visible', false); - this._settings.bind('placement-index', this.placement_index, 'value', Gio.SettingsBindFlags.DEFAULT); + this._settings.connect('changed', this._dpi_changed.bind(this)); + this._dpi_changed(); - } + this._pick_changement(); + this.placement.connect('changed', this._change_placement.bind(this)); + + this._settings.bind('placement-index', this.placement_index, 'value', Gio.SettingsBindFlags.DEFAULT); + + } }); export default class extends ExtensionPreferences { - getPreferencesWidget() { - return new NetSpeedPreferences(this); - } -} \ No newline at end of file + getPreferencesWidget() { + return new NetSpeedPreferences(this); + } +} From 3011386d2cf21893cdcf393efe287626fa7062e4 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sat, 18 May 2024 18:34:39 +0200 Subject: [PATCH 19/25] Gnome 46 --- metadata.json | 6 +++--- net_speed_layout_menu_item.js | 12 ++++++------ net_speed_status_icon.js | 34 +++++++++++++++++----------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/metadata.json b/metadata.json index 2a953ba..91418dd 100644 --- a/metadata.json +++ b/metadata.json @@ -4,11 +4,11 @@ "description": "Displays Internet Speed", "original-author": "hedayaty@gmail.com", "shell-version": [ - "45" + "46" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "settings-schema": "org.gnome.shell.extensions.netspeed", "gettext-domain": "netspeed", - "version": 38 -} \ No newline at end of file + "version": 39 +} diff --git a/net_speed_layout_menu_item.js b/net_speed_layout_menu_item.js index f28860b..84ec475 100644 --- a/net_speed_layout_menu_item.js +++ b/net_speed_layout_menu_item.js @@ -45,14 +45,14 @@ export const NetSpeedLayoutMenuItem = GObject.registerClass( this._ips_label = new St.Label({ text: "", style_class: "ns-menuitem" }); if (this._icon !== null) { - this.add(this._icon); + this.add_child(this._icon); } else { - this.add(new St.Label()); + this.add_child(new St.Label()); } - this.add(this._device_title); - this.add(this._down_label); - this.add(this._up_label); - this.add(this._ips_label); + this.add_child(this._device_title); + this.add_child(this._down_label); + this.add_child(this._up_label); + this.add_child(this._ips_label); this.update_ui(menu_label_size); this.show_ip(false); diff --git a/net_speed_status_icon.js b/net_speed_status_icon.js index 9864ae0..ce41ce6 100644 --- a/net_speed_status_icon.js +++ b/net_speed_status_icon.js @@ -46,7 +46,7 @@ export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu. // extension button this._box = new St.BoxLayout(); - this.add_actor(this._box); + this.add_child(this._box); this.connect('button-release-event', this._toggle_showsum.bind(this)); // download @@ -54,38 +54,38 @@ export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu. this._down = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); this._downunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); this._downicon = new St.Label({ text: "⬇", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._download_box.add_actor(this._down); - this._download_box.add_actor(this._downunit); - this._download_box.add_actor(this._downicon); + this._download_box.add_child(this._down); + this._download_box.add_child(this._downunit); + this._download_box.add_child(this._downicon); // upload this._upload_box = new St.BoxLayout(); this._up = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); this._upunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); this._upicon = new St.Label({ text: "⬆", style_class: 'ns-horizontal-icon', y_align: Clutter.ActorAlign.CENTER }); - this._upload_box.add_actor(this._up); - this._upload_box.add_actor(this._upunit); - this._upload_box.add_actor(this._upicon); + this._upload_box.add_child(this._up); + this._upload_box.add_child(this._upunit); + this._upload_box.add_child(this._upicon); // sum this._sum_box = new St.BoxLayout(); this._sum = new St.Label({ text: "---", style_class: 'ns-horizontal-label', y_align: Clutter.ActorAlign.CENTER }); this._sumunit = new St.Label({ text: "", style_class: 'ns-horizontal-unit-label', y_align: Clutter.ActorAlign.CENTER }); - this._sum_box.add_actor(this._sum); - this._sum_box.add_actor(this._sumunit); + this._sum_box.add_child(this._sum); + this._sum_box.add_child(this._sumunit); // metrics box this._metrics_box = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER }); - this._metrics_box.add_actor(this._download_box); - this._metrics_box.add_actor(this._upload_box); - this._metrics_box.add_actor(this._sum_box); - this._box.add_actor(this._metrics_box); + this._metrics_box.add_child(this._download_box); + this._metrics_box.add_child(this._upload_box); + this._metrics_box.add_child(this._sum_box); + this._box.add_child(this._metrics_box); // interface icon this._icon_box = new St.BoxLayout(); this._icon = this._getIcon(this._net_speed.get_device_type(this._net_speed.getDevice())); - this._icon_box.add_actor(this._icon); - this._box.add_actor(this._icon_box); + this._icon_box.add_child(this._icon); + this._box.add_child(this._icon_box); // Add pref luncher this._pref = new St.Button({ child: this._getIcon("pref") }); @@ -176,7 +176,7 @@ export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu. Logger.debug("Device -> " + device); this._icon = this._getIcon(this._net_speed.get_device_type(device)); - this._icon_box.add_actor(this._icon); + this._icon_box.add_child(this._icon); // Show icon or not if (this._settings.get_boolean('icon-display')) this._icon.show(); @@ -330,7 +330,7 @@ export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu. } _positionInPanelChanged() { - this.container.get_parent().remove_actor(this.container); + this.container.get_parent().remove_child(this.container); // small HACK with private boxes :) let boxes = { From 3ed7c692083db5ee1963292910950e68c8a9dc5b Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:33:22 +0100 Subject: [PATCH 20/25] fix: update po --- po/ca.po | 30 +++++++++++++++--------------- po/de.po | 30 +++++++++++++++--------------- po/en_CA.po | 30 +++++++++++++++--------------- po/es_ES.po | 30 +++++++++++++++--------------- po/fa.po | 30 +++++++++++++++--------------- po/fr.po | 30 +++++++++++++++--------------- po/it.po | 30 +++++++++++++++--------------- po/netspeed.pot | 30 +++++++++++++++--------------- po/nl_NL.po | 30 +++++++++++++++--------------- po/pt_BR.po | 30 +++++++++++++++--------------- po/ru.po | 30 +++++++++++++++--------------- po/tr.po | 30 +++++++++++++++--------------- po/zh_CN.po | 30 +++++++++++++++--------------- po/zh_TW.po | 30 +++++++++++++++--------------- 14 files changed, 210 insertions(+), 210 deletions(-) diff --git a/po/ca.po b/po/ca.po index aae47fc..bd20c39 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2019-07-28 13:37+0200\n" "Last-Translator: Jordi Mas i Hernandez \n" "Language-Team: \n" @@ -101,60 +101,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/de.po b/po/de.po index 7dc1fba..0bffd14 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2013-11-13 20:39+0100\n" "Last-Translator: Jonatan Zeidler \n" "Language-Team: GERMAN \n" @@ -104,60 +104,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/en_CA.po b/po/en_CA.po index 7228a0d..adac3c7 100644 --- a/po/en_CA.po +++ b/po/en_CA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: English\n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 8a4736f..e192345 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Netspeed Gnome-Shell Extension\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2016-10-12 20:53+0200\n" "Last-Translator: Javier Junquera \n" "Language-Team: Español; Castellano <>\n" @@ -104,60 +104,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/fa.po b/po/fa.po index 5a40e5c..c8ce968 100644 --- a/po/fa.po +++ b/po/fa.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2014-05-25 19:38-0700\n" "Last-Translator: Amir Hedayaty \n" "Language-Team: Persian\n" @@ -101,59 +101,59 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 msgid "b/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/fr.po b/po/fr.po index 0579ea9..e740fe3 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2014-05-25 19:36-0700\n" "Last-Translator: Lucien Aubert \n" "Language-Team: French\n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/it.po b/po/it.po index d0882fd..9805a11 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2017-04-17 15:58+0200\n" "Last-Translator: l3nn4rt \n" "Language-Team: Italian\n" @@ -103,60 +103,60 @@ msgstr "Allinea verticalmente" msgid "Show IPs" msgstr "Mostra indirizzi IP" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/netspeed.pot b/po/netspeed.pot index cc5ba65..281424f 100644 --- a/po/netspeed.pot +++ b/po/netspeed.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -101,59 +101,59 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 msgid "b/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/nl_NL.po b/po/nl_NL.po index b5069fb..a1c5e64 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2021-09-13 19:16+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" @@ -103,59 +103,59 @@ msgstr "Verticaal uitlijnen" msgid "Show IPs" msgstr "IP-adressen tonen" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "kiB/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "MiB/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "GiB/s" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 msgid "b/s" msgstr "b/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "kib/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "Mib/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "Gib/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "kB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "kb/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "Mb/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "Gb/s" diff --git a/po/pt_BR.po b/po/pt_BR.po index bc05853..dce7ef3 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2016-02-04 17:44-0300\n" "Last-Translator: Fábio Nogueira \n" "Language-Team: \n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/ru.po b/po/ru.po index 24a0065..d4eb4d0 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2019-04-23 11:19+0500\n" "Last-Translator: Руслан Нигматьянов \n" "Language-Team: Russian\n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "Б/с" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "Б/с" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "МБ/с" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "ГБ/с" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/tr.po b/po/tr.po index fe5692b..73208b5 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: netspeed\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2019-03-21 09:18+0300\n" "Last-Translator: Serdar Sağlam \n" "Language-Team: Türkçe \n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 5ff51b2..c620bc7 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index 6e8b6e6..3b8d6aa 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 00:34+0100\n" +"POT-Creation-Date: 2025-02-01 19:30+0100\n" "PO-Revision-Date: 2016-02-20 20:55+0800\n" "Last-Translator: Dingzhong Chen \n" "Language-Team: \n" @@ -103,60 +103,60 @@ msgstr "" msgid "Show IPs" msgstr "" -#: net_speed.js:151 net_speed.js:155 net_speed.js:159 +#: net_speed.js:146 net_speed.js:150 net_speed.js:154 msgid "B/s" msgstr "B/s" -#: net_speed.js:151 +#: net_speed.js:146 msgid "kiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "MiB/s" msgstr "" -#: net_speed.js:151 +#: net_speed.js:146 msgid "GiB/s" msgstr "" -#: net_speed.js:152 net_speed.js:156 +#: net_speed.js:147 net_speed.js:151 #, fuzzy msgid "b/s" msgstr "B/s" -#: net_speed.js:152 +#: net_speed.js:147 msgid "kib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Mib/s" msgstr "" -#: net_speed.js:152 +#: net_speed.js:147 msgid "Gib/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "kB/s" msgstr "" -#: net_speed.js:155 +#: net_speed.js:150 msgid "MB/s" msgstr "MB/s" -#: net_speed.js:155 +#: net_speed.js:150 msgid "GB/s" msgstr "GB/s" -#: net_speed.js:156 +#: net_speed.js:151 msgid "kb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Mb/s" msgstr "" -#: net_speed.js:156 +#: net_speed.js:151 msgid "Gb/s" msgstr "" From fc3bb2f7ca857a6df0635c121b9c36e4efb7d4f6 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:33:42 +0100 Subject: [PATCH 21/25] style: code formatting --- extension.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/extension.js b/extension.js index ae31db1..874f2d3 100644 --- a/extension.js +++ b/extension.js @@ -23,8 +23,6 @@ import { Logger } from './lib.js'; import { NetSpeed } from './net_speed.js'; - - export default class extends Extension { enable() { From fe117c4888b614e8a9854e39ac0c4fb329ad7fe8 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:34:02 +0100 Subject: [PATCH 22/25] feat: Gnome 47 --- metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 91418dd..0910887 100644 --- a/metadata.json +++ b/metadata.json @@ -4,11 +4,11 @@ "description": "Displays Internet Speed", "original-author": "hedayaty@gmail.com", "shell-version": [ - "46" + "47" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "settings-schema": "org.gnome.shell.extensions.netspeed", "gettext-domain": "netspeed", - "version": 39 + "version": 41 } From db80d54ed22b7a4be816bc22f08a3478e85971a1 Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:22:20 +0200 Subject: [PATCH 23/25] Add Gnome 45 and 46 in supported Gnome Shell versions --- metadata.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 0910887..ab2eb79 100644 --- a/metadata.json +++ b/metadata.json @@ -4,11 +4,13 @@ "description": "Displays Internet Speed", "original-author": "hedayaty@gmail.com", "shell-version": [ + "45", + "46", "47" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "settings-schema": "org.gnome.shell.extensions.netspeed", "gettext-domain": "netspeed", - "version": 41 + "version": 42 } From 7e25ab948b6115c9ccbb1b2363e493ba2ceb25ce Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Fri, 16 May 2025 00:06:02 +0200 Subject: [PATCH 24/25] fixes --- lib.js | 4 ++-- prefs.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib.js b/lib.js index ceecc97..eb744ac 100644 --- a/lib.js +++ b/lib.js @@ -24,7 +24,7 @@ const DEBUG = false; export class Logger { static _formatMessage(message, file, func, line) { - return `[${this.extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`; + return `[${Logger._extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`; } static _makeMessage(message) { @@ -46,7 +46,7 @@ export class Logger { if (Logger._domain) return; - this.extension = extension; + Logger._extension = extension; const { name: domain } = extension.metadata; Logger._domain = domain.replaceAll(' ', '-'); diff --git a/prefs.js b/prefs.js index d8a38a9..cf202f4 100644 --- a/prefs.js +++ b/prefs.js @@ -172,16 +172,16 @@ const NetSpeedPreferences = new GObject.registerClass(class NetSpeedPreferences let factor = this._settings.get_int('hi-dpi-factor'); this._factor = factor; - this._label_adjustment.upper = 100 * factor; - this._label_adjustment.step_increment = factor; + this.label_size.upper = 100 * factor; + this.label_size.step_increment = factor; this._settings.set_int('label-size', this._settings.get_int('label-size') * factor / old_factor); - this._unit_label_adjustment.upper = 100 * factor; - this._unit_label_adjustment.step_increment = factor; + this.unit_label_size.upper = 100 * factor; + this.unit_label_size.step_increment = factor; this._settings.set_int('unit-label-size', this._settings.get_int('unit-label-size') * factor / old_factor); - this._menu_label_adjustment.upper = 100 * factor; - this._menu_label_adjustment.step_increment = factor; + this.menu_label_size.upper = 100 * factor; + this.menu_label_size.step_increment = factor; this._settings.set_int('menu-label-size', this._settings.get_int('menu-label-size') * factor / old_factor); } From 801b4aa626b71195305245fa7f67e093de17d93c Mon Sep 17 00:00:00 2001 From: c84c <616846+c84c@users.noreply.github.com> Date: Fri, 16 May 2025 00:06:24 +0200 Subject: [PATCH 25/25] Add Gnome 48 --- metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index ab2eb79..cbc3b3f 100644 --- a/metadata.json +++ b/metadata.json @@ -6,11 +6,12 @@ "shell-version": [ "45", "46", - "47" + "47", + "48" ], "url": "https://github.com/hedayaty/NetSpeed", "uuid": "netspeed@hedayaty.gmail.com", "settings-schema": "org.gnome.shell.extensions.netspeed", "gettext-domain": "netspeed", - "version": 42 + "version": 43 }