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

32 lines
916 B
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"
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;
confirmDialog.open();
}
}
2020-11-06 14:20:52 +00:00
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()
}
}