2023-12-08 14:58:04 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import HelperWidgets as HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme as StudioTheme
|
2024-01-26 14:55:50 +02:00
|
|
|
import EffectComposerBackend
|
2023-12-08 14:58:04 +02:00
|
|
|
|
|
|
|
|
StudioControls.Dialog {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
title: qsTr("Save Changes")
|
|
|
|
|
|
|
|
|
|
closePolicy: Popup.CloseOnEscape
|
|
|
|
|
modal: true
|
2023-12-11 15:54:35 +02:00
|
|
|
implicitWidth: 300
|
|
|
|
|
implicitHeight: 130
|
2023-12-08 14:58:04 +02:00
|
|
|
|
2023-12-11 17:36:03 +02:00
|
|
|
signal save()
|
|
|
|
|
signal discard()
|
|
|
|
|
|
2023-12-11 15:54:35 +02:00
|
|
|
contentItem: Item {
|
2023-12-08 14:58:04 +02:00
|
|
|
Text {
|
|
|
|
|
text: qsTr("Current composition has unsaved changes.")
|
|
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 15:54:35 +02:00
|
|
|
HelperWidgets.Button {
|
|
|
|
|
width: 60
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
onClicked: root.reject()
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-08 14:58:04 +02:00
|
|
|
Row {
|
|
|
|
|
anchors.right: parent.right
|
2023-12-11 15:54:35 +02:00
|
|
|
anchors.bottom: parent.bottom
|
2023-12-08 14:58:04 +02:00
|
|
|
spacing: 2
|
|
|
|
|
|
|
|
|
|
HelperWidgets.Button {
|
2023-12-11 15:54:35 +02:00
|
|
|
width: 50
|
2023-12-08 14:58:04 +02:00
|
|
|
text: qsTr("Save")
|
|
|
|
|
onClicked: {
|
2024-01-26 14:55:50 +02:00
|
|
|
let name = EffectComposerBackend.effectComposerModel.currentComposition
|
2023-12-11 17:36:03 +02:00
|
|
|
if (name !== "")
|
2024-01-26 14:55:50 +02:00
|
|
|
EffectComposerBackend.effectComposerModel.saveComposition(name)
|
2023-12-11 17:36:03 +02:00
|
|
|
|
|
|
|
|
root.save()
|
2023-12-11 15:54:35 +02:00
|
|
|
root.accept()
|
2023-12-08 14:58:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HelperWidgets.Button {
|
2023-12-11 15:54:35 +02:00
|
|
|
width: 110
|
|
|
|
|
text: qsTr("Discard Changes")
|
2023-12-11 17:36:03 +02:00
|
|
|
onClicked: {
|
|
|
|
|
root.discard()
|
|
|
|
|
root.accept()
|
|
|
|
|
}
|
2023-12-08 14:58:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|