2020-11-06 10:20:52 -04:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-11-06 10:20:52 -04:00
|
|
|
import "../../../../shared"
|
2021-10-14 12:01:34 +02:00
|
|
|
import "../../../../shared/popups"
|
2020-11-06 10:20:52 -04:00
|
|
|
import "../../../../shared/status"
|
|
|
|
|
2021-10-06 11:16:39 +02:00
|
|
|
// TODO: replace with StatusQ component
|
2021-03-19 11:25:29 +01:00
|
|
|
StatusRadioButtonRow {
|
2020-11-06 10:20:52 -04:00
|
|
|
property string fleetName: ""
|
|
|
|
property string newFleet: ""
|
2021-03-19 11:25:29 +01:00
|
|
|
text: fleetName
|
|
|
|
buttonGroup: fleetSettings
|
|
|
|
checked: profileModel.fleets.fleet === text
|
|
|
|
onRadioCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
if (profileModel.fleets.fleet === fleetName) return;
|
|
|
|
newFleet = fleetName;
|
2021-06-04 13:38:25 -04:00
|
|
|
openPopup(confirmDialogComponent)
|
2021-03-19 11:25:29 +01:00
|
|
|
}
|
|
|
|
}
|
2021-06-04 13:38:25 -04:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: confirmDialogComponent
|
|
|
|
ConfirmationDialog {
|
|
|
|
//% "Warning!"
|
2021-09-09 11:10:29 +02:00
|
|
|
header.title: qsTrId("close-app-title")
|
2021-06-04 13:38:25 -04: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 10:20:52 -04:00
|
|
|
}
|
|
|
|
}
|
2021-03-19 11:25:29 +01:00
|
|
|
|