Bug 383019 - Network Monitor plasmoid cannot show transfer rates in byte-based units anymore
Summary: Network Monitor plasmoid cannot show transfer rates in byte-based units anymore
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Monitor (show other bugs)
Version: 5.10.4
Platform: Mageia RPMs Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-01 19:38 UTC by JanKusanagi
Modified: 2019-12-21 17:14 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JanKusanagi 2017-08-01 19:38:09 UTC
Since https://cgit.kde.org/plasma-workspace.git/commit/applets/systemmonitor/net/contents/ui/net.qml?id=8da91cde831c75111c62f2bc7e2e9481f227d7a6 ( https://phabricator.kde.org/D4551 ), the Network Monitor plasmoid (org.kde.plasma.systemmonitor.net, to be precise, since there are other plasmoids with the same or similar name) shows speeds in Kbps/Mbps, instead of KiB/s as it did previously.

Could you please add an option to set that to KiB/MiB? Quite frankly, I don't know who would find bits per second units useful, but to me it's really useless.

Sure, I read the argument in the Phabricator review that ISP's advertise their services in "Megabits" and such, but I don't download 16 Mebibits images, I download 2 Mebibytes images, etc, and I really don't think I'm alone ;)

There was some debate about this in the Phabricator review, but I guess it went nowhere. Could we please have an option here? Thank you!
Comment 1 slartibart70 2017-08-06 13:14:43 UTC
I would also recommend to have a specific option available for the measurement units (bits/sec or (k)bytes/sec, ...) in the 'network monitor settings'
Comment 2 Nate Graham 2019-01-15 19:36:56 UTC
This should be configurable, yeah.
Comment 3 pditchev 2019-10-05 12:31:23 UTC
Here's the patched back to kibibytes /usr/share/plasma/plasmoids/org.kde.plasma.systemmonitor.net/contents/ui/net.qml if anyone wants to patch up to sane units themselves (just replace the file contents with the code below and restart plasmashell with `killall plasmashell && plasmashell` :
```
/*
 *   Copyright 2015 Marco Martin <mart@kde.org>
 *
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as
 *   published by the Free Software Foundation; either version 2 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 Library General Public
 *   License along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons

Applet {
    id: root

    onSourceAdded: {
        if (source.indexOf("network/interfaces/lo/") !== -1) {
            return;
        }
        var match = source.match(/^network\/interfaces\/(\w+)\/transmitter\/data$/);
        if (match) {
            var rxSource = "network/interfaces/" + match[1] + "/receiver/data";
            root.addSource(source, match[1], rxSource, match[1]);
        }
    }

    delegate: DoublePlotter {
        function formatData(data) {
            var value = data.value
            if (value > 1024) {
                return i18nc("%1 is the displayed data transfer speed in mebibytes per second", "%1 MiB/s", (value / 1024).toFixed(1));
            }
            return i18nc("%1 is the displayed data transfer speed in kibibytes per second", "%1 KiB/s", (value));
        }
    }
}
```
Comment 4 Nate Graham 2019-12-20 17:14:09 UTC
Patch: https://phabricator.kde.org/D26124
Comment 5 Nate Graham 2019-12-21 17:14:45 UTC
author	George Vogiatzis <Gvgeo@protonmail.com>	2019-12-21 10:07:06 -0700
committer	Nate Graham <nate@kde.org>	2019-12-21 10:12:47 -0700
commit	d21cb2e7a95b1dad92a13d5e7242f45e4aa9111f (patch)
tree	f079801040382a47cab99997c92905575b969acb
parent	cd6e94a776f6336a6c13811eac4db9a4fa24ba2a (diff)
Add byte display option in Network Monitor plasmoidHEADmaster
Summary:
Add the option to select between byte and bit display in Network Monitor plasmoid.
Bug: 383019

{F7826928}

Reviewers: #vdg, #plasma, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26124
Diffstat
-rw-r--r--	applets/systemmonitor/common/contents/config/main.xml	8	
		
-rw-r--r--	applets/systemmonitor/net/contents/config/config.qml	5	
		
-rw-r--r--	applets/systemmonitor/net/contents/ui/displayConfig.qml	54	
		
-rw-r--r--	applets/systemmonitor/net/contents/ui/net.qml	20