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/Makefile b/Makefile
index 86bbc3a..57fa280 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,14 @@ 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
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)
@@ -42,5 +42,13 @@ enable:
disable:
gnome-extensions disable $(UUID)
-reload:
+uninstall:
+ 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
diff --git a/extension.js b/extension.js
index ddddb03..874f2d3 100644
--- a/extension.js
+++ b/extension.js
@@ -1,30 +1,49 @@
- /*
- * 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;
-
-/**
- * init
- * run when gnome-shell loads
+/*
+ * 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 .
*/
-function init() {
- return new NetSpeed.NetSpeed();
-}
+import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
+import * as Main from 'resource:///org/gnome/shell/ui/main.js';
+
+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 ae20954..ceecc97 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) {
- }
+ * A Logger class with format
+*/
+export class Logger {
- _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;
+ static _formatMessage(message, file, func, line) {
+ return `[${this.extension.metadata.uuid}:${file}:${func}:${line}] -> ${message}`;
}
- _makeLogFunction(level) {
- return message => {
- let stack = (new Error()).stack;
- let caller = stack.split('\n')[2];
+ static _makeMessage(message) {
+ /* FIXME: rretrieve logging stack
+ let stack = (new Error()).stack;
+ let caller = stack.split('\n').pop();
- // 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 + "/", "");
+ console.log(stack.split('\n'));
- 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
- });
- };
+ // 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, "", "", "");
}
- debug(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_DEBUG)(event);
- }
+ static init(extension) {
+ if (Logger._domain)
+ return;
- log(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE)(event);
- }
+ this.extension = extension;
- message(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE)(event);
+ const { name: domain } = extension.metadata;
+ Logger._domain = domain.replaceAll(' ', '-');
}
- info(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_INFO)(event);
+ static debug(message) {
+ Logger._logMessage(console.debug, message);
}
- warning(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_WARNING)(event);
+ static info(message) {
+ Logger._logMessage(console.info, message);
}
- /*
- error(event) {
- // result in a core dump
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_ERROR)(event);
+ static warn(message) {
+ Logger._logMessage(console.warn, message);
}
- */
- critical(event) {
- this._makeLogFunction(GLib.LogLevelFlags.LEVEL_CRITICAL)(event);
+ static error(message) {
+ Logger._logMessage(console.critical, message);
}
-}
-
-
-/**
- * getLogger:
- * @returns {_Logger} a new Logger instance if not exists
- */
-let _loggerInstance;
-function getLogger() {
- if (!_loggerInstance) {
- _loggerInstance = new _loggerClass();
- }
- return _loggerInstance;
-}
-
-
-/**
- * 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
- */
-
-function splitVersion(version) {
- let currentArray = version.split('.');
- let major = parseInt(currentArray[0]);
- let minor = parseInt(currentArray[1]);
- return [major, minor];
-}
-
-
-/**
- * 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);
+ static _logMessage(logFunc, message) {
+ const msg = Logger._makeMessage(message);
+ if (DEBUG) {
+ console.log(msg);
+ return;
+ }
- if (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;
+ logFunc(msg);
}
- getLogger().warning(`Show IP cannot be enabled. Gjs version: '${Config.PACKAGE_VERSION}'`);
- return false;
}
diff --git a/messages.js b/messages.js
new file mode 100644
index 0000000..d23e7ea
--- /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 { }
+);
diff --git a/metadata.json b/metadata.json
index e3488fa..0910887 100644
--- a/metadata.json
+++ b/metadata.json
@@ -1,10 +1,14 @@
{
- "_generated": "Generated by SweetTooth, do not edit",
- "description": "Displays Internet Speed",
- "name": "NetSpeed",
- "original-author": "hedayaty@gmail.com",
- "shell-version": [ "40", "41", "42", "43", "44" ],
- "url": "https://github.com/hedayaty/NetSpeed",
- "uuid": "netspeed@hedayaty.gmail.com",
- "version": 32
+ "_generated": "Generated by SweetTooth, do not edit",
+ "name": "NetSpeed",
+ "description": "Displays Internet Speed",
+ "original-author": "hedayaty@gmail.com",
+ "shell-version": [
+ "47"
+ ],
+ "url": "https://github.com/hedayaty/NetSpeed",
+ "uuid": "netspeed@hedayaty.gmail.com",
+ "settings-schema": "org.gnome.shell.extensions.netspeed",
+ "gettext-domain": "netspeed",
+ "version": 41
}
diff --git a/net_speed.js b/net_speed.js
index 848e386..6b33f77 100644
--- a/net_speed.js
+++ b/net_speed.js
@@ -15,50 +15,91 @@
* 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;
-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 {
+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,
+ ],
+ }
+ },
+}, class NetSpeed extends GObject.Object {
/**
* NetSpeed: _init
* Constructor
*/
- constructor() {
- let localeDir = Extension.dir.get_child('locale');
- if (localeDir.query_exists(null)) {
- Gettext.bindtextdomain('netspeed', localeDir.get_path());
- }
+
+ 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) {
+ 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])
+ if (this._devices[i] !== this._olddevices[i])
return 0;
}
return 1;
@@ -68,22 +109,22 @@ var NetSpeed = class NetSpeed {
* NetSpeed: get_device_type
*/
get_device_type(device) {
- let devices = this._client.get_devices() || [];
+ let devices = this._nm_client.get_devices() || [];
for (let dev of devices) {
- if (dev.interface == device) {
+ if (dev.interface === device) {
switch (dev.device_type) {
- case NetworkManager.DeviceType.ETHERNET:
+ case NM.DeviceType.ETHERNET:
return "ethernet";
- case NetworkManager.DeviceType.WIFI:
+ case NM.DeviceType.WIFI:
return "wifi";
- case NetworkManager.DeviceType.BT:
+ case NM.DeviceType.BT:
return "bt";
- case NetworkManager.DeviceType.OLPC_MESH:
+ case NM.DeviceType.OLPC_MESH:
return "olpcmesh";
- case NetworkManager.DeviceType.WIMAX:
+ case NM.DeviceType.WIMAX:
return "wimax";
- case NetworkManager.DeviceType.MODEM:
+ case NM.DeviceType.MODEM:
return "modem";
default:
return "none";
@@ -109,7 +150,7 @@ var NetSpeed = class NetSpeed {
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)
+ if (amount === 0)
return { text: "0", unit: _(this.use_bytes ? "B/s" : "b/s") };
if (m_digits < 3)
m_digits = 3;
@@ -132,49 +173,63 @@ var NetSpeed = class NetSpeed {
}
/**
- * NetSpeed: _set_labels
+ * NetSpeed: _emit_stats
*/
- _set_labels(sum, up, down) {
- this._status_icon.set_labels(sum, up, down);
+ _sendStats(sum, up, down) {
+ this.emit(
+ 'global-stats-changed',
+ new Messages.NetSpeedGlobalStatsMessage(
+ {
+ sum: sum, up: up, down: down
+ })
+ );
}
/**
* 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;
- });
+ _sendSpeeds() {
+ this.emit(
+ 'speeds-changed',
+ new Messages.NetSpeedSpeedsMessage({ speeds: this._speeds })
+ );
}
/**
* NetSpeed: _update_ips
*/
- _update_ips() {
- this._status_icon.update_ips(this._ips);
+ _sendIps() {
+ this.emit(
+ 'ips-changed',
+ new Messages.NetSpeedIPsMessage({ ips: this._ips })
+ );
}
/**
* 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}`)
+ 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,
+ })
+ );
}
/**
@@ -182,14 +237,14 @@ var NetSpeed = class NetSpeed {
*/
_updateDefaultGw() {
let flines = GLib.file_get_contents('/proc/net/route'); // Read the file
- let nlines = ByteArray.toString(flines[1]).split("\n"); // Break to lines
+ 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
+ if (params.length !== 11) // ignore empty lines
continue;
// So store up/down values
- if (params[1] == "00000000") {
+ if (params[1] === "00000000") {
this._defaultGw = params[0];
}
}
@@ -201,16 +256,16 @@ var NetSpeed = class NetSpeed {
_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 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 = 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
@@ -220,21 +275,21 @@ var NetSpeed = class NetSpeed {
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
+ 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);
+ //Logger.debug("Devices: " + this._devices);
- var total = 0;
- var total_speed = null;
- var up_speed = null;
- var down_speed = null;
+ let total = 0;
+ let total_speed = null;
+ let up_speed = null;
+ let down_speed = null;
- if (this._is_up2date() == 1 && !this._device_state_changed) {
+ 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];
@@ -255,33 +310,34 @@ var NetSpeed = class NetSpeed {
total += _down + _up;
up += _up;
down += _down;
- if (this.getDevice() == this._devices[i]) {
+ 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) {
+ 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();
+ this._sendStats(total_speed, up_speed, down_speed);
+ this._sendSpeeds();
} else {
this._create_menu();
}
if (this._device_state_changed && this.show_ips) {
this._retrieve_ips();
- this._update_ips();
+ this._sendIps();
Logger.debug("Retrieved ips");
}
// reset state
this._device_state_changed = false;
+ // keep alive timer
return true;
}
@@ -289,21 +345,21 @@ var NetSpeed = class NetSpeed {
* NetSpeed: _load
*/
_load() {
- if (this._saving == 1) {
+ if (this._saving === 1) {
return;
}
- 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.show_ips = this._setting.get_boolean('show-ips');
- this.vert_align = this._setting.get_boolean('vert-align');
+ 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;
}
/**
@@ -311,9 +367,9 @@ var NetSpeed = class NetSpeed {
*/
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._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
}
@@ -321,110 +377,76 @@ var NetSpeed = class NetSpeed {
* NetSpeed: _reload
*/
_reload() {
- if (this._setting !== null) {
- let m_timer = this._setting.get_int('timer');
+ if (this._settings !== null) {
+ let m_timer = this._settings.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));
+ 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._status_icon.updateui();
+ this.emit('reloaded');
}
}
/**
- * 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 = new Array();
- 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)));
-
- // 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._load();
-
- this._updateDefaultGw();
-
- 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);
-
-
+ * 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: disable
- * exported to disable the extension
+ * NetSpeed: stop
*/
- disable() {
- if (this._timerid != 0) {
- Mainloop.source_remove(this._timerid);
+ 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._setting = null;
+ this._settings = null;
this._nm_signals.forEach(sig_id => {
- this._client.disconnect(sig_id);
+ this._nm_client.disconnect(sig_id);
});
this._disconnect_all_nm_device_state_changed();
- this._client = null;
- this._status_icon.destroy();
- this._status_icon = null;
+ this._nm_client = null;
+ //this._status_icon.destroy();
+ //this._status_icon = null;
}
getDevice() {
- if (this._device == "defaultGW") {
+ if (this._device === "defaultGW") {
return this._defaultGw;
} else {
return this._device;
}
}
+ /*
setDevice(device) {
- this._device = device;
+ this._device = device;
}
+ */
/**
* NetSpeed: _nm_device_changed
*/
- _nm_device_changed(client, device) {
+ _nm_device_changed(_client, _device) {
this._trigger_ips_reload();
}
/**
* NetSpeed: _nm_connection_changed
*/
- _nm_connection_changed(client, connection) {
+ _nm_connection_changed(_client, _connection) {
this._trigger_ips_reload();
}
@@ -444,7 +466,7 @@ var NetSpeed = class NetSpeed {
this._disconnect_all_nm_device_state_changed();
for (let dev of this._devices) {
- let nm_dev = this._client.get_device_by_iface(dev);
+ 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);
@@ -456,11 +478,11 @@ var NetSpeed = class NetSpeed {
* 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 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 ByteArray.toString(ByteArray.fromGBytes(active_ap.get_ssid()), 'UTF-8');
+ if (active_ap !== null) {
+ return new TextDecoder().decode(active_ap.get_ssid().toArray(), 'UTF-8');
}
}
return null;
@@ -468,11 +490,11 @@ var NetSpeed = class NetSpeed {
/**
* NetSpeed: _connect_nm_device_state_changed
- * @param {NM.Device} nm_device: NetworkManager Device instance
+ * @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', 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]);
}
}
@@ -495,7 +517,7 @@ var NetSpeed = class NetSpeed {
* 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) {
+ _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();
}
@@ -509,23 +531,23 @@ var NetSpeed = class NetSpeed {
*/
_getAddresses(nm_device, family) {
let ip_cfg;
- if (family == GLib.SYSDEF_AF_INET)
+ 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) {
+ 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) {
+ 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();
@@ -535,4 +557,4 @@ var NetSpeed = class NetSpeed {
return addresses;
}
-};
+});
diff --git a/net_speed_layout_menu_item.js b/net_speed_layout_menu_item.js
index 9ccd728..84ec475 100644
--- a/net_speed_layout_menu_item.js
+++ b/net_speed_layout_menu_item.js
@@ -15,27 +15,27 @@
* 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(
+export const NetSpeedLayoutMenuItem = GObject.registerClass(
class NetSpeedLayoutMenuItem extends PopupMenu.PopupBaseMenuItem {
/**
- * NetSpeedLayoutMenuItem: _init
- * Constructor
+ * NetSpeedLayoutMenuItem: ctor
*/
- _init(device, icon, menu_label_size) {
- super._init();
+ 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"
+ text: device,
+ style_class: "ns-menuitem"
}
);
this._device_title.get_clutter_text().set_line_wrap(true);
@@ -44,15 +44,15 @@ var NetSpeedLayoutMenuItem = GObject.registerClass(
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);
+ if (this._icon !== null) {
+ 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 aece34f..ce41ce6 100644
--- a/net_speed_status_icon.js
+++ b/net_speed_status_icon.js
@@ -15,103 +15,110 @@
* along with this program. If not, see .
*/
-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;
-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 {
+export default GObject.registerClass(class NetSpeedStatusIcon extends PanelMenu.Button {
/**
* NetSpeedStatusIcon: _init
* Constructor
*/
- _init(net_speed) {
+ constructor(extension, net_speed) {
+ super(0.0);
+ this._extension = extension;
+ this._settings = extension.getSettings()
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', Lang.bind(this, this._toggle_showsum));
+ this.add_child(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);
+ 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_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._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_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 = 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_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 = new St.BoxLayout({ y_align: Clutter.ActorAlign.CENTER });
+ 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._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);
+ this._icon = this._getIcon(this._net_speed.get_device_type(this._net_speed.getDevice()));
+ this._icon_box.add_child(this._icon);
+ this._box.add_child(this._icon_box);
// Add pref luncher
- this._pref = new St.Button({ child: this._get_icon("pref") });
- this._pref.connect("clicked", function () {
- ExtensionUtils.openPrefs();
+ 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.NetSpeedLayoutMenuItem(_("Device"), this._pref, this._net_speed.menu_label_size);
- this._menu_title.connect("activate", Lang.bind(this, this._change_device, ""));
+ 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._net_speed.show_ips);
+ 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 = new Array();
+ 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._net_speed.setDevice(device);
+ this._settings.set_string('device', device);
+ //this._net_speed.setDevice(device);
this.updateui();
- this._net_speed.save();
+ //this._net_speed.save();
}
/**
@@ -119,10 +126,9 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
*/
_toggle_showsum(actor, event) {
let button = event.get_button();
- if (button == 2) { // middle
- this._net_speed.showsum = !this._net_speed.showsum;
+ if (button === 2) { // middle
+ this._settings.set_boolean('show-sum', !this._settings.get_boolean('show-sum'));
this.updateui();
- this._net_speed.save();
}
}
@@ -132,15 +138,15 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
*/
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);
+ 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._net_speed.showsum == false) {
+ if (this._settings.get_boolean('show-sum') === false) {
this._sum.hide();
this._sumunit.hide();
this._upicon.show();
@@ -149,7 +155,7 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
this._downicon.show();
this._down.show();
this._downunit.show();
- this.set_vertical_alignment(this._net_speed.vert_align);
+ this.set_vertical_alignment(this._settings.get_boolean('vert-align'));
} else {
this._sum.show();
this._sumunit.show();
@@ -169,28 +175,38 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
Logger.debug("Device -> " + device);
- this._icon = this._get_icon(this._net_speed.get_device_type(device));
- this._icon_box.add_actor(this._icon);
+ this._icon = this._getIcon(this._net_speed.get_device_type(device));
+ this._icon_box.add_child(this._icon);
// Show icon or not
- if (this._net_speed.use_icon)
+ if (this._settings.get_boolean('icon-display'))
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);
+ 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._net_speed.menu_label_size);
- layout.show_ip(this._net_speed.show_ips);
+ layout.update_ui(this._settings.get_int('menu-label-size'));
+ layout.show_ip(show_ips);
}
}
+ _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: _get_icon
+ * NetSpeedStatusIcon: _getIcon
* Utility function to create icon from name
*/
- _get_icon(name, size) {
- if (arguments.length == 1)
+ _getIcon(name, size) {
+ if (arguments.length === 1)
size = 16;
let iconname = "";
switch (name) {
@@ -235,44 +251,57 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
}
/**
- * NetSpeedStatusIcon: set_labels
+ * NetSpeedStatusIcon: _onGlobalStatsChanged(,NetSpeedGlobalStats)
+ * @param {*} sender
+ * @param {Messages.NetSpeedGlobalStatsMessage} stats
*/
- set_labels(sum, up, down) {
- this._sum.set_text(sum.text);
- this._sumunit.set_text(sum.unit);
+ _onGlobalStatsChanged(sender, stats) {
+ this._sum.set_text(stats.sum.text);
+ this._sumunit.set_text(stats.sum.unit);
- this._up.set_text(up.text);
- this._upunit.set_text(up.unit);
+ this._up.set_text(stats.up.text);
+ this._upunit.set_text(stats.up.unit);
- this._down.set_text(down.text);
- this._downunit.set_text(down.unit);
+ this._down.set_text(stats.down.text);
+ this._downunit.set_text(stats.down.unit);
}
/**
* NetSpeedStatusIcon: create_menu
+ * @param {*} sender
+ * @param {Messages.NetSpeedMenuMessage} menu
*/
- create_menu(devices, types) {
+ _onCreateMenu(sender, menu) {
for (let layout of this._layouts) {
layout.destroy();
}
- this._layouts = new Array();
- 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", Lang.bind(this, this._change_device, devices[i]));
+ 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: update_speeds
+ * NetSpeedStatusIcon: _onSpeedsChanged
+ *
+ * @param {*} sender
+ * @param {Messages.NetSpeedSpeedsMessage} speeds
*/
- update_speeds(speeds) {
- for (let i = 0; i < speeds.length; ++i) {
- this._layouts[i].update_speeds(speeds[i]);
+ _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;
+ });
}
/**
@@ -290,12 +319,32 @@ var NetSpeedStatusIcon = GObject.registerClass(class NetSpeedStatusIcon extends
}
/**
- * NetSpeedStatusIcon: update_ips
+ * NetSpeedStatusIcon: _onIPsChanged
+ * @param {*} sender
+ * @param {Messages.NetSpeedIPsMessage} ips
*/
- update_ips(ips) {
- for (let i = 0; i < ips.length; ++i) {
- this._layouts[i].update_ips(ips[i]);
+ _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_child(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/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/po/ca.po b/po/ca.po
index 81abd82..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: 2021-05-30 15:48-0700\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"
@@ -16,148 +16,160 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "Tots"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Passarel·la per defecte"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Dispositiu a fer seguiment"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Temporitzador (mil·lisegons)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Dígits"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Mida de l'etiqueta"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Mida de l'etiqueta de la unitat"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Mida de l'etiqueta del menú"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Mostra la suma (pujada + baixada)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Mostra la icona"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr "Usa múltiples de byte"
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr "Usa prefixos binaris"
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -18,149 +18,161 @@ msgstr ""
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-SourceCharset: UTF-8\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "ALLE"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr ""
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Gerät zur Überwachung"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Anzeigeinterval (Millisekunden)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Ziffern"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Anzeigegröße"
-#: prefs.js:204
+#: prefs.js:222
#, fuzzy
msgid "Unit Label Size"
msgstr "Menügröße"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Menügröße"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Als Summe anzeigen (Hoch+Runter)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Symbol anzeigen"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -17,149 +17,161 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "ALL"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr ""
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Device to monitor"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Timer (milisec)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Digits"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Label Size"
-#: prefs.js:204
+#: prefs.js:222
#, fuzzy
msgid "Unit Label Size"
msgstr "Menu Label Size"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Menu Label Size"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Show sum(UP+Down)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Show the Icon"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -19,148 +19,160 @@ msgstr ""
"X-Generator: Gtranslator 2.91.7\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "Todos"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Puerta de enlace predeterminadas"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Dispositivo a monitorizar"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Temporizados (ms)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Digitos"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Tamaño de etiqueta"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Tamaño de etiqueta de unidades"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Tamaño de etiqueta de menú"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Mostrar suma (subida+bajada)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Mostrar icono"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -16,147 +16,159 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "همه"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr ""
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "تجهیزات تحت نظارت"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "زمانسنج)بر حسب میلیثانیه("
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "تعداد رقمها"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "اندازه برچسبها"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "اندازه واحدها در منو"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "اندازه برچسبها در منو"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr "راست"
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr "چپ"
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "نمایش مجموع)دریافت و ارسال("
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "نمایش نمایه"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr "راست"
-
-#: prefs.js:268
-msgid "Left"
-msgstr "چپ"
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
msgid "b/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -17,149 +17,161 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "TOUS"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr ""
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Périphérique(s) à prendre en compte"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Rafraîchissement (milisecondes)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Chiffres"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Taille des champs"
-#: prefs.js:204
+#: prefs.js:222
#, fuzzy
msgid "Unit Label Size"
msgstr "Taille des champs du menu"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Taille des champs du menu"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Afficher la somme (reçu+envoyé)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Afficher l'icône"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -18,148 +18,160 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.1\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "Tutte"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Gateway di default"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Interfaccia da monitorare"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr "Impostazioni"
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Frequenza di aggiornamento (ms)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Numero di cifre da mostrare"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Larghezza per le cifre"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Larghezza per le unità di misura"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Larghezza per le colonne del menu"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
-msgstr ""
+msgstr "Posizione"
+
+#: prefs.js:236
+msgid "Right"
+msgstr "Destra"
-#: prefs.js:211
+#: prefs.js:237
+msgid "Center"
+msgstr "Centro"
+
+#: prefs.js:238
+msgid "Left"
+msgstr "Sinistra"
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr "Posizione Relativa"
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Mostra la velocità complessiva (upload + download)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Mostra l'icona"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr "Usa multipli del byte"
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr "Usa prefissi binari"
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr "Allinea verticalmente"
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr "Mostra indirizzi IP"
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -17,146 +17,158 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr ""
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr ""
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr ""
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
msgid "Timer (milliseconds)"
msgstr ""
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr ""
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr ""
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr ""
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr ""
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
-msgid "Show sum(UP+Down)"
+#: prefs.js:236
+msgid "Right"
msgstr ""
-#: prefs.js:212
-msgid "Show the Icon"
+#: prefs.js:237
+msgid "Center"
msgstr ""
-#: prefs.js:255
-msgid "Use multiples of byte"
+#: prefs.js:238
+msgid "Left"
msgstr ""
-#: prefs.js:256
-msgid "Use binary prefixes"
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
+msgid "Show sum(UP+Down)"
+msgstr ""
+
+#: prefs.js:253
+msgid "Show the Icon"
msgstr ""
#: prefs.js:257
-msgid "Align vertically"
+msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:267
-msgid "Right"
+#: prefs.js:261
+msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:268
-msgid "Left"
+#: prefs.js:265
+msgid "Align vertically"
msgstr ""
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
msgid "b/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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/nl.po b/po/nl_NL.po
similarity index 70%
rename from po/nl.po
rename to po/nl_NL.po
index 94ef60b..a1c5e64 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: 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"
@@ -18,146 +18,159 @@ msgstr ""
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "ALLES"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Standaard toegangspoort"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Te monitoren apparaat"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
msgid "Timer (milliseconds)"
msgstr "Tijdklok (milliseconden)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Getallen"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Labelgrootte"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Labelgrootte van eenheid"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Labelgrootte van menu"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr "HiDPI-factor"
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr "Locatie"
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr "Rechts"
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr "Links"
+
+#: prefs.js:242
+#, fuzzy
+msgid "Placement Index"
+msgstr "Locatie"
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Som tonen (OMHOOG+omlaag)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Pictogram tonen"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr "Bytevermeerdering gebruiken"
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr "Binaire voorvoegsels tonen"
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr "Verticaal uitlijnen"
-#: prefs.js:267
-msgid "Right"
-msgstr "Rechts"
-
-#: prefs.js:268
-msgid "Left"
-msgstr "Links"
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr "IP-adressen tonen"
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr "kiB/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr "MiB/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr "GiB/s"
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
msgid "b/s"
msgstr "b/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr "kib/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr "Mib/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr "Gib/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr "kB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr "kb/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr "Mb/s"
-#: net_speed.js:111
+#: net_speed.js:151
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"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index a786f2a..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: 2021-05-30 15:48-0700\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"
@@ -18,148 +18,160 @@ msgstr ""
"X-Generator: Poedit 1.8.6\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "TUDO"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Gateway padrão"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Dispositivo para monitorar"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Temporizador (miliseg)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Dígitos"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Tamanho do rótulo"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Tamanho do rótulo de unidade"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Tamanho do rótulo do menu"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Exibir somatório (UP+Down)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Exibir o ícone"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -14,152 +14,164 @@ 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:32
msgid "ALL"
msgstr "Все"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Шлюз по умолчанию"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "Интерфейс отображения"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Интервал обновления (милисек)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Цифр"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Длина текста"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Длина единиц измерения"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Длина заголовка меню"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Показывать общую сумму передачи"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Показывать иконку"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "Б/с"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "Б/с"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "МБ/с"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "ГБ/с"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -18,148 +18,160 @@ msgstr ""
"X-Generator: Poedit 2.2.1\n"
"X-Poedit-SourceCharset: UTF-8\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "Tümü"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "Öntanımlı Ağ Geçidi"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "İzlenecek Aygıt"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "Zaman (millisaniye)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "Basamak"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "Etiket Boyutu"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "Birim Etiketi Boyutu"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "Menü Etiket Boyutu"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "Toplamı Göster (Yükleme+İndirme)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "Simgeyi Göster"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -18,148 +18,160 @@ msgstr ""
"X-Generator: Poedit 1.8.7\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "全部"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "默认网关"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "监控的设备"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "定时(毫秒)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "位数"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "标签大小"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "单位标签大小"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "菜单标签大小"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "显示总和(上传+下载)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "显示图标"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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..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: 2021-05-30 15:48-0700\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"
@@ -18,148 +18,160 @@ msgstr ""
"X-Generator: Poedit 1.8.7\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: prefs.js:61
+#: prefs.js:32
msgid "ALL"
msgstr "全部"
-#: prefs.js:65
+#: prefs.js:36
msgid "Default Gateway"
msgstr "默認網關"
-#: prefs.js:200
+#: prefs.js:196
msgid "Device to monitor"
msgstr "監控的設備"
-#: prefs.js:201
+#: prefs.js:206
+msgid "Settings"
+msgstr ""
+
+#: prefs.js:210
#, fuzzy
msgid "Timer (milliseconds)"
msgstr "定時(毫秒)"
-#: prefs.js:202
+#: prefs.js:214
msgid "Digits"
msgstr "位數"
-#: prefs.js:203
+#: prefs.js:218
msgid "Label Size"
msgstr "標籤大小"
-#: prefs.js:204
+#: prefs.js:222
msgid "Unit Label Size"
msgstr "單位標籤大小"
-#: prefs.js:205
+#: prefs.js:226
msgid "Menu Label Size"
msgstr "菜單標籤大小"
-#: prefs.js:206
+#: prefs.js:230
msgid "HiDPI factor"
msgstr ""
-#: prefs.js:207
+#: prefs.js:234
msgid "Placement"
msgstr ""
-#: prefs.js:211
+#: prefs.js:236
+msgid "Right"
+msgstr ""
+
+#: prefs.js:237
+msgid "Center"
+msgstr ""
+
+#: prefs.js:238
+msgid "Left"
+msgstr ""
+
+#: prefs.js:242
+msgid "Placement Index"
+msgstr ""
+
+#: prefs.js:249
msgid "Show sum(UP+Down)"
msgstr "顯示總和(上傳+下載)"
-#: prefs.js:212
+#: prefs.js:253
msgid "Show the Icon"
msgstr "顯示圖標"
-#: prefs.js:255
+#: prefs.js:257
msgid "Use multiples of byte"
msgstr ""
-#: prefs.js:256
+#: prefs.js:261
msgid "Use binary prefixes"
msgstr ""
-#: prefs.js:257
+#: prefs.js:265
msgid "Align vertically"
msgstr ""
-#: prefs.js:267
-msgid "Right"
-msgstr ""
-
-#: prefs.js:268
-msgid "Left"
-msgstr ""
-
-#: prefs.js:271
+#: prefs.js:270
msgid "Show IPs"
msgstr ""
-#: net_speed.js:106 net_speed.js:110 net_speed.js:114
+#: net_speed.js:146 net_speed.js:150 net_speed.js:154
msgid "B/s"
msgstr "B/s"
-#: net_speed.js:106
+#: net_speed.js:146
msgid "kiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "MiB/s"
msgstr ""
-#: net_speed.js:106
+#: net_speed.js:146
msgid "GiB/s"
msgstr ""
-#: net_speed.js:107 net_speed.js:111
+#: net_speed.js:147 net_speed.js:151
#, fuzzy
msgid "b/s"
msgstr "B/s"
-#: net_speed.js:107
+#: net_speed.js:147
msgid "kib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Mib/s"
msgstr ""
-#: net_speed.js:107
+#: net_speed.js:147
msgid "Gib/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "kB/s"
msgstr ""
-#: net_speed.js:110
+#: net_speed.js:150
msgid "MB/s"
msgstr "MB/s"
-#: net_speed.js:110
+#: net_speed.js:150
msgid "GB/s"
msgstr "GB/s"
-#: net_speed.js:111
+#: net_speed.js:151
msgid "kb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
msgid "Mb/s"
msgstr ""
-#: net_speed.js:111
+#: net_speed.js:151
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/prefs.js b/prefs.js
index 74330aa..d8a38a9 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1,72 +1,43 @@
- /*
- * 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;
-
-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 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 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());
- }
-
- if (!Lib.canShowIPs()){
- // Force to false at startup
- // FIXME: hide Schema key
- Schema.set_boolean('show-ips', false);
- }
-}
-
-const App = class NetSpeed_App {
+/*
+ * 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';
+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]);
+ 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,80 +66,100 @@ 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() {
+ let active = -1;
+ switch (this._settings.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() {
let active = this.placement.get_active();
Logger.debug("_change_placement: active=" + active);
- if (active == -1) {
+ if (active === -1) {
return;
}
switch (active) {
case 0:
- Schema.set_string('placement', 'right')
- Logger.debug("placement <- right")
+ this._settings.set_string('placement', 'right');
+ Logger.debug("placement <- right");
break;
case 1:
- Schema.set_string('placement', 'left')
- Logger.debug("placement <- left")
+ this._settings.set_string('placement', 'center');
+ Logger.debug("placement <- center");
+ break;
+ case 2:
+ this._settings.set_string('placement', 'left');
+ Logger.debug("placement <- left");
break;
}
}
_dpi_changed() {
- let factor = Schema.get_int('hi-dpi-factor');
- if (factor != this._factor) {
+ let factor = this._settings.get_int('hi-dpi-factor');
+ if (factor !== this._factor) {
this._change_factor();
}
}
+ _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'));
+ }
+
_pick_dev() {
- let activeDev = Schema.get_string('device');
+ let activeDev = this._settings.get_string('device');
this._device = activeDev;
let active = 0;
- if (activeDev == "all") {
+ if (activeDev === "all") {
active = 0;
- } else if (activeDev == "defaultGW") {
+ } else if (activeDev === "defaultGW") {
active = 1;
} else {
for (let i = 0; i < this._devices.length; ++i) {
- if (this._devices[i] == activeDev) {
+ if (this._devices[i] === activeDev) {
active = i + 2;
}
}
@@ -178,146 +169,141 @@ const App = class NetSpeed_App {
_change_factor() {
let old_factor = this._factor;
- let factor = Schema.get_int('hi-dpi-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;
- Schema.set_int('label-size', Schema.get_int('label-size') * factor / old_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;
- Schema.set_int('unit-label-size', Schema.get_int('unit-label-size') * factor / old_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;
- Schema.set_int('menu-label-size', Schema.get_int('menu-label-size') * factor / old_factor);
+ this._settings.set_int('menu-label-size', this._settings.get_int('menu-label-size') * factor / old_factor);
}
- 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();
+ constructor(extension) {
+ super({ row_spacing: 10, column_spacing: 20, column_homogeneous: false, row_homogeneous: true });
+
+ this._settings = extension.getSettings();
+
+ 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.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.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.attach(separator, 1, 2, 4, 1);
+
+ // Title
+ this.attach(new Gtk.Label({ label: `${_("Settings")}`, use_markup: true }), 2, 3, 2, 1);
+
+ // Display options
+
+ 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: _("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: _("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: _("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: _("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: _("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);
- this.show_ip = new Gtk.CheckButton({ label: _("Show IPs") });
-
- 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);
- this.main.attach(this.timer, 2, 4, 1, 1);
- this.main.attach(this.digits, 2, 5, 1, 1);
- this.main.attach(this.label_size, 2, 6, 1, 1);
- this.main.attach(this.unit_label_size, 2, 7, 1, 1);
- 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);
-
- 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);
-
- if (Lib.canShowIPs()) {
- this.main.attach(this.show_ip, 1, 14, 2, 1);
- this.show_ip.show();
- } else {
- this.show_ip.hide();
- }
+ 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._pick_dev();
- this._factor = Schema.get_int('hi-dpi-factor');
+ // Extension Settings
+
+ 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);
+
+ 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: _("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.dev.connect('changed', Lang.bind(this, this._put_dev));
- Schema.connect('changed', Lang.bind(this, this._dpi_changed));
+ 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.placement.connect('changed', Lang.bind(this, this._change_placement))
+ 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();
+
+
+ // Initialize values
+ this._pick_dev();
+ this.dev.connect('changed', this._put_dev.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.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);
}
-};
+});
-function buildPrefsWidget() {
- let widget = new App();
- return widget.main;
-};
+
+export default class extends ExtensionPreferences {
+ getPreferencesWidget() {
+ return new NetSpeedPreferences(this);
+ }
+}
diff --git a/schemas/org.gnome.shell.extensions.netspeed.gschema.xml b/schemas/org.gnome.shell.extensions.netspeed.gschema.xml
index 8b007eb..34d5cc0 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
@@ -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