status-desktop/ui/app/AppLayouts/Profile/controls/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 utils 1.0
2020-11-06 14:20:52 +00:00
import "../../../../shared"
import "../../../../shared/popups"
2020-11-06 14:20:52 +00:00
import "../../../../shared/status"
// TODO: replace with StatusQ component
StatusRadioButtonRow {
2020-11-06 14:20:52 +00:00
property string fleetName: ""
property string newFleet: ""
text: fleetName
buttonGroup: fleetSettings
checked: profileModel.fleets.fleet === text
onRadioCheckedChanged: {
if (checked) {
if (profileModel.fleets.fleet === fleetName) return;
newFleet = fleetName;
2021-06-04 17:38:25 +00:00
openPopup(confirmDialogComponent)
}
}
2021-06-04 17:38:25 +00:00
Component {
id: confirmDialogComponent
ConfirmationDialog {
//% "Warning!"
header.title: qsTrId("close-app-title")
2021-06-04 17:38:25 +00:00
//% "Change fleet to %1"
confirmationText: qsTrId("change-fleet-to--1").arg(newFleet)
onConfirmButtonClicked: profileModel.fleets.setFleet(newFleet)
onClosed: {
profileModel.fleets.triggerFleetChange()
destroy();
}
}
2020-11-06 14:20:52 +00:00
}
}