2020-11-23 19:14:48 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 09:37:58 +00:00
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.controls 1.0
|
2020-11-23 19:14:48 +00:00
|
|
|
|
2021-10-27 09:37:58 +00:00
|
|
|
RadioButtonSelector {
|
|
|
|
id: root
|
|
|
|
|
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-10-27 09:37:58 +00:00
|
|
|
|
|
|
|
title: networkName == "" ? Utils.getNetworkName(network) : networkName
|
|
|
|
|
|
|
|
onCheckedChanged: {
|
2021-03-19 10:25:29 +00:00
|
|
|
if (checked) {
|
2021-10-27 09:37:58 +00:00
|
|
|
if (profileModel.network.current === root.network) return;
|
|
|
|
root.newNetwork = root.network;
|
2021-12-07 20:33:12 +00:00
|
|
|
Global.openPopup(confirmDialogComponent)
|
2021-03-19 10:25:29 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-23 19:14:48 +00:00
|
|
|
|
2021-04-13 17:49:51 +00:00
|
|
|
Component {
|
|
|
|
id: confirmDialogComponent
|
|
|
|
ConfirmationDialog {
|
|
|
|
id: confirmDialog
|
|
|
|
//% "Warning!"
|
2021-09-09 09:10:29 +00:00
|
|
|
header.title: qsTrId("close-app-title")
|
2021-04-13 17:49:51 +00:00
|
|
|
//% "The account will be logged out. When you unlock it again, the selected network will be used"
|
|
|
|
confirmationText: qsTrId("logout-app-content")
|
|
|
|
onConfirmButtonClicked: {
|
2021-10-27 09:37:58 +00:00
|
|
|
profileModel.network.current = root.newNetwork;
|
2021-04-13 17:49:51 +00:00
|
|
|
}
|
|
|
|
onClosed: {
|
|
|
|
profileModel.network.triggerNetworkChange()
|
|
|
|
destroy()
|
|
|
|
}
|
2020-11-23 19:14:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|