status-desktop/ui/app/AppLayouts/Profile/controls/FleetRadioSelector.qml
Patryk Osmaczko 35a2dd5244 [Popups]: added destroy() function in all popups by default
Also switched StatusModal to derive from StatusDialog instead
of Popup type

Closes #10149
2023-06-02 14:28:39 +03:00

44 lines
1010 B
QML

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
RadioButtonSelector {
id: root
property var advancedStore
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)
}
}
Component {
id: confirmDialogComponent
ConfirmationDialog {
headerSettings.title: qsTr("Warning!")
confirmationText: qsTr("Change fleet to %1").arg(root.newFleet)
onConfirmButtonClicked: {
root.advancedStore.setFleet(root.newFleet)
}
onClosed: {
destroy();
}
}
}
}