2021-04-09 20:59:05 +00:00
|
|
|
/*
|
2021-12-22 23:29:00 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
2021-04-09 20:59:05 +00:00
|
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
2021-09-28 22:55:51 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 Tobias Fella <fella@posteo.de>
|
2021-04-09 20:59:05 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2023-10-19 17:46:54 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
|
2021-04-09 20:59:05 +00:00
|
|
|
import QtQuick 2.1
|
2026-02-12 04:19:36 +00:00
|
|
|
import org.kde.plasma.networkmanagement.cellular as Cellular
|
2021-04-09 20:59:05 +00:00
|
|
|
|
|
|
|
|
QtObject {
|
2026-02-12 04:19:36 +00:00
|
|
|
property Cellular.CellularModemList _modemList: Cellular.CellularModemList {}
|
2022-11-11 16:21:12 +00:00
|
|
|
|
2026-02-12 04:19:36 +00:00
|
|
|
readonly property string icon: "network-mobile-" + Math.floor((_modemList.primaryModem ? _modemList.primaryModem.signalStrength : 0) / 20) * 20
|
2021-04-09 20:59:05 +00:00
|
|
|
|
2026-02-12 04:19:36 +00:00
|
|
|
readonly property string label: {
|
|
|
|
|
if (!_modemList.primaryModem) return "";
|
|
|
|
|
if (_modemList.primaryModem.simLocked) return i18n("SIM Locked");
|
|
|
|
|
return _modemList.primaryModem.operatorName;
|
|
|
|
|
}
|
2021-04-09 20:59:05 +00:00
|
|
|
|
2026-02-12 04:19:36 +00:00
|
|
|
readonly property bool showIndicator: _modemList.modemAvailable
|
|
|
|
|
}
|