2022-10-26 19:57:41 +03:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-10-12 20:46:17 +03:00
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme as StudioTheme
|
2023-03-02 13:21:40 +01:00
|
|
|
import ContentLibraryBackend
|
2022-10-12 20:46:17 +03:00
|
|
|
|
2023-04-18 14:09:48 +03:00
|
|
|
StudioControls.Dialog {
|
2022-10-12 20:46:17 +03:00
|
|
|
id: root
|
|
|
|
|
|
2024-03-21 12:47:09 +02:00
|
|
|
property var targetBundleItem
|
|
|
|
|
property var targetBundleModel
|
2024-04-25 11:59:01 +03:00
|
|
|
property string targetBundleLabel // "effect" or "material"
|
2024-03-21 12:47:09 +02:00
|
|
|
|
|
|
|
|
title: qsTr("Bundle %1 might be in use").arg(root.targetBundleLabel)
|
2022-10-12 20:46:17 +03:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
closePolicy: Popup.CloseOnEscape
|
|
|
|
|
implicitWidth: 300
|
|
|
|
|
modal: true
|
|
|
|
|
|
2024-03-21 12:47:09 +02:00
|
|
|
onOpened: warningText.forceActiveFocus()
|
2022-10-12 20:46:17 +03:00
|
|
|
|
|
|
|
|
contentItem: Column {
|
|
|
|
|
spacing: 20
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
|
|
Text {
|
2024-03-21 12:47:09 +02:00
|
|
|
id: warningText
|
2022-10-12 20:46:17 +03:00
|
|
|
|
2024-03-21 12:47:09 +02:00
|
|
|
text: qsTr("If the %1 you are removing is in use, it might cause the project to malfunction.\n\nAre you sure you want to remove it?")
|
|
|
|
|
.arg(root.targetBundleLabel)
|
2022-10-12 20:46:17 +03:00
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
leftPadding: 10
|
|
|
|
|
rightPadding: 10
|
|
|
|
|
|
|
|
|
|
Keys.onEnterPressed: btnRemove.onClicked()
|
|
|
|
|
Keys.onReturnPressed: btnRemove.onClicked()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
Button {
|
|
|
|
|
id: btnRemove
|
|
|
|
|
|
|
|
|
|
text: qsTr("Remove")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
2024-03-21 12:47:09 +02:00
|
|
|
root.targetBundleModel.removeFromProject(root.targetBundleItem)
|
2022-10-12 20:46:17 +03:00
|
|
|
root.accept()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
onClicked: root.reject()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|