mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 08:44:45 +00:00
cellularnetwork-kcm: Port to FormCard
This commit is contained in:
parent
886ef153de
commit
34877b2226
4 changed files with 617 additions and 697 deletions
|
|
@ -1,29 +1,24 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2021-2022 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.12 as Controls
|
import QtQuick.Controls as Controls
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2 as Kirigami
|
||||||
import org.kde.kcmutils
|
import org.kde.kcmutils
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1 as FormCard
|
||||||
|
|
||||||
import cellularnetworkkcm 1.0
|
import cellularnetworkkcm
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: modemPage
|
id: modemPage
|
||||||
title: i18n("Modem %1", modem.displayId)
|
|
||||||
|
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
topPadding: Kirigami.Units.gridUnit
|
|
||||||
bottomPadding: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
property Modem modem
|
property Modem modem
|
||||||
property bool showExtra: false
|
property bool showExtra: false
|
||||||
|
|
||||||
ColumnLayout {
|
title: i18n("Modem %1", modem.displayId)
|
||||||
|
|
||||||
MessagesList {
|
MessagesList {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: Kirigami.Units.smallSpacing
|
Layout.margins: Kirigami.Units.smallSpacing
|
||||||
|
|
@ -31,49 +26,27 @@ Kirigami.ScrollablePage {
|
||||||
model: kcm.messages
|
model: kcm.messages
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormCardHeader {
|
|
||||||
title: i18n("Modem Control")
|
title: i18n("Modem Control")
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.FormCard {
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
id: modemRestartButton
|
id: modemRestartButton
|
||||||
Layout.fillWidth: true
|
|
||||||
contentItem: RowLayout {
|
|
||||||
Controls.Label {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: i18n("Modem Restart")
|
|
||||||
}
|
|
||||||
Controls.Button {
|
|
||||||
text: i18n("Force Modem Restart")
|
text: i18n("Force Modem Restart")
|
||||||
onClicked: modem.reset()
|
onClicked: modem.reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormCardHeader {
|
|
||||||
title: i18n("Modem Details")
|
title: i18n("Modem Details")
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.FormCard {
|
||||||
|
FormCard.AbstractFormDelegate {
|
||||||
id: accessTechnologiesText
|
id: accessTechnologiesText
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
background: Item {}
|
background: null
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
@ -95,53 +68,53 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: imeiText
|
id: imeiText
|
||||||
text: i18n("IMEI")
|
text: i18n("IMEI")
|
||||||
description: modem.details.equipmentIdentifier
|
description: modem.details.equipmentIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: enabledText
|
id: enabledText
|
||||||
text: i18n("Enabled")
|
text: i18n("Enabled")
|
||||||
description: modem.details.isEnabled
|
description: modem.details.isEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: manufacturerText
|
id: manufacturerText
|
||||||
text: i18n("Manufacturer")
|
text: i18n("Manufacturer")
|
||||||
description: modem.details.manufacturer
|
description: modem.details.manufacturer
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: modelText
|
id: modelText
|
||||||
text: i18n("Model")
|
text: i18n("Model")
|
||||||
description: modem.details.model
|
description: modem.details.model
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: ownedNumbersText
|
id: ownedNumbersText
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
background: Item {}
|
background: null
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: i18n("Owned Numbers:")
|
text: i18n("Owned Numbers:")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: modem.details.ownNumbers
|
model: modem.details.ownNumbers
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
|
|
@ -155,109 +128,108 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: revisionText
|
id: revisionText
|
||||||
text: i18n("Revision")
|
text: i18n("Revision")
|
||||||
description: modem.details.revision
|
description: modem.details.revision
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: signalQualityText
|
id: signalQualityText
|
||||||
text: i18n("Signal Quality")
|
text: i18n("Signal Quality")
|
||||||
description: modem.details.signalQuality
|
description: modem.details.signalQuality
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: stateText
|
id: stateText
|
||||||
text: i18n("State")
|
text: i18n("State")
|
||||||
description: modem.details.state
|
description: modem.details.state
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: failureReasonText
|
id: failureReasonText
|
||||||
text: i18n("Failure Reason")
|
text: i18n("Failure Reason")
|
||||||
description: modem.details.stateFailedReason
|
description: modem.details.stateFailedReason
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: registrationStateText
|
id: registrationStateText
|
||||||
text: i18n("Registration State")
|
text: i18n("Registration State")
|
||||||
description: modem.details.registrationState
|
description: modem.details.registrationState
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: roamingText
|
id: roamingText
|
||||||
text: i18n("Roaming")
|
text: i18n("Roaming")
|
||||||
description: modem.isRoaming ? i18n("Yes") : i18n("No")
|
description: modem.isRoaming ? i18n("Yes") : i18n("No")
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: firmwareVersionText
|
id: firmwareVersionText
|
||||||
text: i18n("Firmware Version")
|
text: i18n("Firmware Version")
|
||||||
description: modem.details.firmwareVersion
|
description: modem.details.firmwareVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: interfaceNameText
|
id: interfaceNameText
|
||||||
text: i18n("Interface Name")
|
text: i18n("Interface Name")
|
||||||
description: modem.details.interfaceName
|
description: modem.details.interfaceName
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: meteredText
|
id: meteredText
|
||||||
text: i18n("Metered")
|
text: i18n("Metered")
|
||||||
description: modem.details.metered
|
description: modem.details.metered
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: activeNMConnectionText
|
id: activeNMConnectionText
|
||||||
text: i18n("Active NetworkManager Connection")
|
text: i18n("Active NetworkManager Connection")
|
||||||
description: modem.activeConnectionUni
|
description: modem.activeConnectionUni
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: deviceText
|
id: deviceText
|
||||||
text: i18n("Device")
|
text: i18n("Device")
|
||||||
description: modem.details.device
|
description: modem.details.device
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: deviceIdText
|
id: deviceIdText
|
||||||
text: i18n("Device ID")
|
text: i18n("Device ID")
|
||||||
description: modem.details.deviceIdentifier
|
description: modem.details.deviceIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: driversText
|
id: driversText
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
background: Item {}
|
background: null
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
@ -279,31 +251,29 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: pluginText
|
id: pluginText
|
||||||
text: i18n("Plugin")
|
text: i18n("Plugin")
|
||||||
description: modem.details.plugin
|
description: modem.details.plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: powerStateText
|
id: powerStateText
|
||||||
text: i18n("Power State")
|
text: i18n("Power State")
|
||||||
description: modem.details.powerState
|
description: modem.details.powerState
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: simPathText
|
id: simPathText
|
||||||
text: i18n("SIM Path")
|
text: i18n("SIM Path")
|
||||||
description: modem.details.simPath
|
description: modem.details.simPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,24 +7,16 @@ import QtQuick.Controls 2.12 as Controls
|
||||||
|
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami 2.19 as Kirigami
|
||||||
import org.kde.kcmutils
|
import org.kde.kcmutils
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||||
|
|
||||||
import cellularnetworkkcm 1.0
|
import cellularnetworkkcm 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: root
|
id: root
|
||||||
title: i18n("SIM Lock")
|
|
||||||
|
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
topPadding: Kirigami.Units.gridUnit
|
|
||||||
bottomPadding: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
property Sim sim
|
property Sim sim
|
||||||
|
|
||||||
ColumnLayout {
|
title: i18n("SIM Lock")
|
||||||
spacing: 0
|
|
||||||
width: root.width
|
|
||||||
|
|
||||||
MessagesList {
|
MessagesList {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -35,7 +27,6 @@ Kirigami.ScrollablePage {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: unlockSimPlaceholder
|
id: unlockSimPlaceholder
|
||||||
visible: sim.locked
|
visible: sim.locked
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
// HACK: prevent infinite binding loop?
|
// HACK: prevent infinite binding loop?
|
||||||
Component.onCompleted: unlockSimPlaceholder.Layout.preferredHeight = root.height
|
Component.onCompleted: unlockSimPlaceholder.Layout.preferredHeight = root.height
|
||||||
|
|
@ -78,13 +69,11 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
visible: !notLockedSimPlaceholder.visible && !unlockSimPlaceholder.visible
|
visible: !notLockedSimPlaceholder.visible && !unlockSimPlaceholder.visible
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
FormCard.FormButtonDelegate {
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormButtonDelegate {
|
|
||||||
id: disableSimLockButton
|
id: disableSimLockButton
|
||||||
text: i18n("Disable SIM Lock")
|
text: i18n("Disable SIM Lock")
|
||||||
description: i18n("Disable the SIM lock feature and remove the passcode on the SIM.")
|
description: i18n("Disable the SIM lock feature and remove the passcode on the SIM.")
|
||||||
|
|
@ -94,25 +83,23 @@ Kirigami.ScrollablePage {
|
||||||
Kirigami.Separator {
|
Kirigami.Separator {
|
||||||
Layout.leftMargin: Kirigami.Units.gridUnit
|
Layout.leftMargin: Kirigami.Units.gridUnit
|
||||||
Layout.rightMargin: Kirigami.Units.gridUnit
|
Layout.rightMargin: Kirigami.Units.gridUnit
|
||||||
Layout.fillWidth: true
|
|
||||||
opacity: (!disableSimLockButton.controlHovered && !changePinButton.controlHovered) ? 0.5 : 0
|
opacity: (!disableSimLockButton.controlHovered && !changePinButton.controlHovered) ? 0.5 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: changePinButton
|
id: changePinButton
|
||||||
text: i18n("Change PIN")
|
text: i18n("Change PIN")
|
||||||
description: i18n("Change the passcode set on the SIM.")
|
description: i18n("Change the passcode set on the SIM.")
|
||||||
onClicked: changePinDialog.open()
|
onClicked: changePinDialog.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// dialogs
|
|
||||||
|
|
||||||
|
data: [
|
||||||
RegExpValidator {
|
RegExpValidator {
|
||||||
id: pinValidator
|
id: pinValidator
|
||||||
regExp: /[0-9]+/
|
regExp: /[0-9]+/
|
||||||
}
|
},
|
||||||
|
// dialogs
|
||||||
|
|
||||||
Kirigami.Dialog {
|
Kirigami.Dialog {
|
||||||
id: unlockPinDialog
|
id: unlockPinDialog
|
||||||
|
|
@ -132,7 +119,7 @@ Kirigami.ScrollablePage {
|
||||||
validator: pinValidator
|
validator: pinValidator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
Kirigami.Dialog {
|
Kirigami.Dialog {
|
||||||
id: changePinDialog
|
id: changePinDialog
|
||||||
|
|
@ -180,7 +167,7 @@ Kirigami.ScrollablePage {
|
||||||
validator: pinValidator
|
validator: pinValidator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
Kirigami.Dialog {
|
Kirigami.Dialog {
|
||||||
id: removePinDialog
|
id: removePinDialog
|
||||||
|
|
@ -197,7 +184,7 @@ Kirigami.ScrollablePage {
|
||||||
validator: pinValidator
|
validator: pinValidator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
Kirigami.Dialog {
|
Kirigami.Dialog {
|
||||||
id: createPinDialog
|
id: createPinDialog
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.12 as Controls
|
import QtQuick.Controls as Controls
|
||||||
|
|
||||||
import org.kde.kirigami 2.12 as Kirigami
|
import org.kde.plasma.networkmanagement as PlasmaNM
|
||||||
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
|
||||||
import org.kde.kcmutils
|
import org.kde.kcmutils
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.kirigamiaddons.formcard 1 as FormCard
|
||||||
|
import org.kde.kirigamiaddons.components 1 as Components
|
||||||
|
|
||||||
import cellularnetworkkcm 1.0
|
import cellularnetworkkcm 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: simPage
|
id: simPage
|
||||||
title: i18n("SIM") + " " + displayId
|
|
||||||
|
|
||||||
property Sim sim: null
|
property Sim sim: null
|
||||||
|
|
||||||
|
|
@ -32,26 +32,17 @@ Kirigami.ScrollablePage {
|
||||||
property string simIdentifier: sim ? sim.simIdentifier : ""
|
property string simIdentifier: sim ? sim.simIdentifier : ""
|
||||||
property var simEmergencyNumbers: sim ? sim.emergencyNumbers : []
|
property var simEmergencyNumbers: sim ? sim.emergencyNumbers : []
|
||||||
|
|
||||||
leftPadding: 0
|
title: i18n("SIM") + " " + displayId
|
||||||
rightPadding: 0
|
|
||||||
topPadding: Kirigami.Units.gridUnit
|
|
||||||
bottomPadding: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
PlasmaNM.EnabledConnections {
|
data: PlasmaNM.EnabledConnections {
|
||||||
id: enabledConnections
|
id: enabledConnections
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
header: Components.Banner {
|
||||||
spacing: 0
|
width: parent.width
|
||||||
width: simPage.width
|
|
||||||
|
|
||||||
Kirigami.InlineMessage {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.margins: Kirigami.Units.gridUnit
|
|
||||||
Layout.bottomMargin: visible && !messagesList.visible ? Kirigami.Units.gridUnit : 0
|
|
||||||
visible: !simEnabled
|
visible: !simEnabled
|
||||||
type: Kirigami.MessageType.Error
|
type: Kirigami.MessageType.Error
|
||||||
text: qsTr("This SIM slot is empty, a SIM card needs to be inserted in order for it to be used.")
|
text: i18n("This SIM slot is empty, a SIM card needs to be inserted in order for it to be used.")
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesList {
|
MessagesList {
|
||||||
|
|
@ -61,13 +52,8 @@ Kirigami.ScrollablePage {
|
||||||
model: kcm.messages
|
model: kcm.messages
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormSwitchDelegate {
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormSwitchDelegate {
|
|
||||||
id: dataRoamingCheckBox
|
id: dataRoamingCheckBox
|
||||||
text: i18n("Data Roaming")
|
text: i18n("Data Roaming")
|
||||||
description: i18n("Allow your device to use networks other than your carrier.")
|
description: i18n("Allow your device to use networks other than your carrier.")
|
||||||
|
|
@ -76,9 +62,9 @@ Kirigami.ScrollablePage {
|
||||||
onCheckedChanged: sim.modem.isRoaming = checked
|
onCheckedChanged: sim.modem.isRoaming = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator { above: dataRoamingCheckBox; below: apnButton }
|
FormCard.FormDelegateSeparator { above: dataRoamingCheckBox; below: apnButton }
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: apnButton
|
id: apnButton
|
||||||
icon.name: "globe"
|
icon.name: "globe"
|
||||||
text: i18n("Modify APNs")
|
text: i18n("Modify APNs")
|
||||||
|
|
@ -87,9 +73,9 @@ Kirigami.ScrollablePage {
|
||||||
onClicked: kcm.push("ProfileList.qml", { "modem": sim.modem });
|
onClicked: kcm.push("ProfileList.qml", { "modem": sim.modem });
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator { above: apnButton; below: networksButton }
|
FormCard.FormDelegateSeparator { above: apnButton; below: networksButton }
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: networksButton
|
id: networksButton
|
||||||
icon.name: "network-mobile-available"
|
icon.name: "network-mobile-available"
|
||||||
text: i18n("Networks")
|
text: i18n("Networks")
|
||||||
|
|
@ -98,9 +84,9 @@ Kirigami.ScrollablePage {
|
||||||
onClicked: kcm.push("AvailableNetworks.qml", { "modem": sim.modem, "sim": sim });
|
onClicked: kcm.push("AvailableNetworks.qml", { "modem": sim.modem, "sim": sim });
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator { above: networksButton; below: simLockButton }
|
FormCard.FormDelegateSeparator { above: networksButton; below: simLockButton }
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: simLockButton
|
id: simLockButton
|
||||||
icon.name: "unlock"
|
icon.name: "unlock"
|
||||||
text: i18n("SIM Lock")
|
text: i18n("SIM Lock")
|
||||||
|
|
@ -109,9 +95,9 @@ Kirigami.ScrollablePage {
|
||||||
onClicked: kcm.push("SimLockPage.qml", { "sim": sim });
|
onClicked: kcm.push("SimLockPage.qml", { "sim": sim });
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator { above: simLockButton; below: modemDetailsButton }
|
FormCard.FormDelegateSeparator { above: simLockButton; below: modemDetailsButton }
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: modemDetailsButton
|
id: modemDetailsButton
|
||||||
icon.name: "network-modem"
|
icon.name: "network-modem"
|
||||||
text: i18n("Modem Details")
|
text: i18n("Modem Details")
|
||||||
|
|
@ -119,88 +105,80 @@ Kirigami.ScrollablePage {
|
||||||
onClicked: kcm.push("ModemPage.qml", { "modem": sim.modem })
|
onClicked: kcm.push("ModemPage.qml", { "modem": sim.modem })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormCardHeader {
|
|
||||||
title: i18n("SIM Details")
|
title: i18n("SIM Details")
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormCard {
|
||||||
|
FormCard.FormTextDelegate {
|
||||||
id: lockedText
|
id: lockedText
|
||||||
text: i18n("Locked")
|
text: i18n("Locked")
|
||||||
description: simLocked ? i18n("Yes") : i18n("No")
|
description: simLocked ? i18n("Yes") : i18n("No")
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: imsiText
|
id: imsiText
|
||||||
text: i18n("IMSI")
|
text: i18n("IMSI")
|
||||||
description: simImsi
|
description: simImsi
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: eidText
|
id: eidText
|
||||||
text: i18n("EID")
|
text: i18n("EID")
|
||||||
description: simEid
|
description: simEid
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: opCodeModemText
|
id: opCodeModemText
|
||||||
text: i18n("Operator Code (modem)")
|
text: i18n("Operator Code (modem)")
|
||||||
description: operatorCode
|
description: operatorCode
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: opNameModemText
|
id: opNameModemText
|
||||||
text: i18n("Operator Name (modem)")
|
text: i18n("Operator Name (modem)")
|
||||||
description: operatorName
|
description: operatorName
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: opCodeSimText
|
id: opCodeSimText
|
||||||
text: i18n("Operator Code (provided by SIM)")
|
text: i18n("Operator Code (provided by SIM)")
|
||||||
description: simOperatorIdentifier
|
description: simOperatorIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: opNameSimText
|
id: opNameSimText
|
||||||
text: i18n("Operator Name (provided by SIM)")
|
text: i18n("Operator Name (provided by SIM)")
|
||||||
description: simOperatorName
|
description: simOperatorName
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: simIdText
|
id: simIdText
|
||||||
text: i18n("SIM ID")
|
text: i18n("SIM ID")
|
||||||
description: simIdentifier
|
description: simIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator {}
|
FormCard.FormDelegateSeparator {}
|
||||||
|
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: emergencyNumbersText
|
id: emergencyNumbersText
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
background: Item {}
|
background: null
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
|
@ -226,5 +204,3 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: 2018 Martin Kacej <m.kacej@atlas.sk>
|
// SPDX-FileCopyrightText: 2018 Martin Kacej <m.kacej@atlas.sk>
|
||||||
// SPDX-FileCopyrightText: 2020 Dimitris Kardarakos <dimkard@posteo.net>
|
// SPDX-FileCopyrightText: 2020 Dimitris Kardarakos <dimkard@posteo.net>
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Devin Lin <espidev@gmail.com>
|
// SPDX-FileCopyrightText: 2021-2022 Devin Lin <espidev@gmail.com>
|
||||||
|
// SPDX-FileCopyrightText: 2023 Carl Schwan <carl@carlschwan.eu>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
|
|
@ -8,27 +9,26 @@ import QtQuick.Layouts 1.2
|
||||||
import QtQuick.Controls 2.12 as Controls
|
import QtQuick.Controls 2.12 as Controls
|
||||||
|
|
||||||
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.kcmutils as KCM
|
import org.kde.kcmutils as KCM
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1 as FormCard
|
||||||
|
|
||||||
import cellularnetworkkcm 1.0
|
import cellularnetworkkcm 1.0
|
||||||
|
|
||||||
KCM.SimpleKCM {
|
KCM.SimpleKCM {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
objectName: "mobileDataMain"
|
objectName: "mobileDataMain"
|
||||||
|
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
rightPadding: 0
|
rightPadding: 0
|
||||||
topPadding: Kirigami.Units.gridUnit
|
topPadding: 0
|
||||||
bottomPadding: Kirigami.Units.gridUnit
|
bottomPadding: 0
|
||||||
|
|
||||||
Kirigami.PlaceholderMessage {
|
Kirigami.PlaceholderMessage {
|
||||||
id: noModem
|
id: noModem
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.left: parent.left
|
width: parent.width - Kirigami.Units.gridUnit * 4
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
visible: !enabledConnections.wwanHwEnabled || !availableDevices.modemDeviceAvailable || !kcm.modemFound
|
visible: !enabledConnections.wwanHwEnabled || !availableDevices.modemDeviceAvailable || !kcm.modemFound
|
||||||
icon.name: "auth-sim-missing"
|
icon.name: "auth-sim-missing"
|
||||||
|
|
@ -63,13 +63,8 @@ KCM.SimpleKCM {
|
||||||
model: kcm.messages
|
model: kcm.messages
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormSwitchDelegate {
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormSwitchDelegate {
|
|
||||||
id: mobileDataSwitch
|
id: mobileDataSwitch
|
||||||
text: i18n("Mobile data")
|
text: i18n("Mobile data")
|
||||||
description: {
|
description: {
|
||||||
|
|
@ -109,9 +104,9 @@ KCM.SimpleKCM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormDelegateSeparator { above: mobileDataSwitch; below: dataUsageButton }
|
FormCard.FormDelegateSeparator { above: mobileDataSwitch; below: dataUsageButton }
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: dataUsageButton
|
id: dataUsageButton
|
||||||
text: i18n("Data Usage")
|
text: i18n("Data Usage")
|
||||||
description: i18n("View data usage.")
|
description: i18n("View data usage.")
|
||||||
|
|
@ -120,18 +115,14 @@ KCM.SimpleKCM {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FormCard.FormHeader {
|
||||||
|
title: i18np("SIM", "SIMs", kcm.sims.count)
|
||||||
|
visible: repeater.count > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
visible: repeater.count > 0
|
||||||
Layout.topMargin: Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
MobileForm.FormCardHeader {
|
|
||||||
title: kcm.sims.count == 1 ? i18n("SIM") : i18n("SIMs")
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
|
|
@ -140,15 +131,12 @@ KCM.SimpleKCM {
|
||||||
delegate: ColumnLayout {
|
delegate: ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
Kirigami.Separator {
|
FormCard.FormDelegateSeparator {
|
||||||
visible: model.index !== 0
|
visible: model.index !== 0
|
||||||
Layout.leftMargin: Kirigami.Units.gridUnit
|
|
||||||
Layout.rightMargin: Kirigami.Units.gridUnit
|
|
||||||
Layout.fillWidth: true
|
|
||||||
opacity: (!(model.index && repeater.itemAt(model.index - 1).controlHovered) && !simDelegate.controlHovered) ? 0.5 : 0
|
opacity: (!(model.index && repeater.itemAt(model.index - 1).controlHovered) && !simDelegate.controlHovered) ? 0.5 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileForm.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
id: simDelegate
|
id: simDelegate
|
||||||
text: i18n("SIM %1", modelData.displayId)
|
text: i18n("SIM %1", modelData.displayId)
|
||||||
description: i18n("View SIM %1 details.", modelData.displayId)
|
description: i18n("View SIM %1 details.", modelData.displayId)
|
||||||
|
|
@ -164,4 +152,3 @@ KCM.SimpleKCM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue