2020-11-23 19:14:48 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
|
|
|
|
2021-03-19 10:25:29 +00:00
|
|
|
StatusRadioButtonRow {
|
2020-11-23 20:41:57 +00:00
|
|
|
property string network: ""
|
2021-01-08 22:10:31 +00:00
|
|
|
property string networkName: ""
|
2020-11-23 19:14:48 +00:00
|
|
|
property string newNetwork: ""
|
2021-03-19 10:25:29 +00:00
|
|
|
id: radioProd
|
|
|
|
text: networkName == "" ? Utils.getNetworkName(network) : networkName
|
|
|
|
buttonGroup: networkSettings
|
|
|
|
checked: profileModel.network.current === network
|
|
|
|
onRadioCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
if (profileModel.network.current === network) return;
|
|
|
|
newNetwork = network;
|
|
|
|
confirmDialog.open();
|
|
|
|
}
|
|
|
|
}
|
2020-11-23 19:14:48 +00:00
|
|
|
|
|
|
|
ConfirmationDialog {
|
|
|
|
id: confirmDialog
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Warning!"
|
|
|
|
title: qsTrId("close-app-title")
|
|
|
|
//% "The account will be logged out. When you unlock it again, the selected network will be used"
|
|
|
|
confirmationText: qsTrId("logout-app-content")
|
2020-11-23 19:14:48 +00:00
|
|
|
onConfirmButtonClicked: {
|
2020-12-06 22:15:51 +00:00
|
|
|
profileModel.network.current = newNetwork;
|
2020-11-23 19:14:48 +00:00
|
|
|
}
|
2020-12-06 22:15:51 +00:00
|
|
|
onClosed: profileModel.network.triggerNetworkChange()
|
2020-11-23 19:14:48 +00:00
|
|
|
}
|
|
|
|
}
|