status-desktop/ui/app/AppLayouts/Profile/Sections/NetworkRadioSelector.qml

41 lines
1.2 KiB
QML
Raw Normal View History

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"
RowLayout {
2020-11-23 20:41:57 +00:00
property string network: ""
property string networkName: ""
2020-11-23 19:14:48 +00:00
property string newNetwork: ""
ConfirmationDialog {
id: confirmDialog
title: qsTr("Warning!")
confirmationText: qsTr("The account will be logged out. When you unlock it again, the selected network will be used")
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
}
width: parent.width
StyledText {
text: networkName == "" ? Utils.getNetworkName(network) : networkName
2020-11-23 19:14:48 +00:00
font.pixelSize: 15
}
StatusRadioButton {
id: radioProd
Layout.alignment: Qt.AlignRight
ButtonGroup.group: networkSettings
rightPadding: 0
2020-12-06 22:15:51 +00:00
checked: profileModel.network.current === network
2020-11-23 19:14:48 +00:00
onClicked: {
2020-12-06 22:15:51 +00:00
if (profileModel.network.current === network) return;
2020-11-23 20:41:57 +00:00
newNetwork = network;
2020-11-23 19:14:48 +00:00
confirmDialog.open();
}
}
}