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

41 lines
1.1 KiB
QML
Raw Normal View History

2020-11-06 14:20:52 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../../../../imports"
import "../../../../shared"
import "../../../../shared/status"
RowLayout {
property string fleetName: ""
property string newFleet: ""
ConfirmationDialog {
id: confirmDialog
2021-02-18 16:36:05 +00:00
//% "Warning!"
title: qsTrId("close-app-title")
//% "Change fleet to %1"
confirmationText: qsTrId("change-fleet-to--1").arg(newFleet)
2020-11-06 14:20:52 +00:00
onConfirmButtonClicked: profileModel.fleets.setFleet(newFleet)
onClosed: profileModel.fleets.triggerFleetChange()
}
width: parent.width
StyledText {
text: fleetName
font.pixelSize: 15
}
StatusRadioButton {
id: radioProd
Layout.alignment: Qt.AlignRight
ButtonGroup.group: fleetSettings
rightPadding: 0
checked: profileModel.fleets.fleet === fleetName
onClicked: {
if (profileModel.fleets.fleet === fleetName) return;
newFleet = fleetName;
confirmDialog.open();
}
}
}