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

44 lines
1010 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 utils 1.0
import shared.popups 1.0
import shared.controls 1.0
2020-11-06 14:20:52 +00:00
RadioButtonSelector {
id: root
property var advancedStore
2020-11-06 14:20:52 +00:00
property string fleetName: ""
property string newFleet: ""
title: fleetName
checked: root.advancedStore.fleet === root.fleetName
onCheckedChanged: {
if (checked) {
if (root.advancedStore.fleet === root.fleetName)
return
root.newFleet = root.fleetName;
Global.openPopup(confirmDialogComponent)
}
}
2021-06-04 17:38:25 +00:00
Component {
id: confirmDialogComponent
ConfirmationDialog {
headerSettings.title: qsTr("Warning!")
confirmationText: qsTr("Change fleet to %1").arg(root.newFleet)
onConfirmButtonClicked: {
root.advancedStore.setFleet(root.newFleet)
}
2021-06-04 17:38:25 +00:00
onClosed: {
destroy();
}
}
2020-11-06 14:20:52 +00:00
}
}