2023-12-21 18:03:44 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
|
|
|
Popup {
|
2023-12-26 23:31:55 +00:00
|
|
|
property bool closable: true
|
2023-12-21 18:03:44 +00:00
|
|
|
property bool inProgress: false
|
|
|
|
property string status: ""
|
|
|
|
|
|
|
|
id: modal
|
|
|
|
anchors.centerIn: parent
|
|
|
|
modal: true
|
|
|
|
focus: true
|
|
|
|
width: column.width + 60
|
|
|
|
height: column.height + 60
|
2023-12-26 23:31:55 +00:00
|
|
|
closePolicy: closable ? Popup.CloseOnEscape : Popup.NoAutoClose
|
2023-12-21 18:03:44 +00:00
|
|
|
onClosed: inProgress = false
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column
|
|
|
|
anchors.centerIn: parent
|
|
|
|
spacing: 10
|
|
|
|
Label {
|
|
|
|
text: status
|
|
|
|
width: 300
|
|
|
|
wrapMode: Label.WordWrap
|
|
|
|
horizontalAlignment: Label.AlignHCenter
|
|
|
|
}
|
|
|
|
BusyIndicator {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
visible: inProgress
|
|
|
|
running: inProgress
|
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: qsTr("Close")
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-12-26 23:31:55 +00:00
|
|
|
visible: closable && !inProgress
|
2023-12-21 18:03:44 +00:00
|
|
|
onClicked: modal.close()
|
|
|
|
focus: true
|
|
|
|
Keys.onReturnPressed: {
|
2023-12-26 23:31:55 +00:00
|
|
|
if (closable && !inProgress)
|
2023-12-21 18:03:44 +00:00
|
|
|
modal.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enter: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 0.0
|
|
|
|
to: 1.0
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit: Transition {
|
|
|
|
NumberAnimation {
|
|
|
|
property: "opacity"
|
|
|
|
from: 1.0
|
|
|
|
to: 0.0
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|