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 QtQuickDesignerTheme
|
|
|
|
|
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
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
title: qsTr("Bundle material might be in use")
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
closePolicy: Popup.CloseOnEscape
|
|
|
|
|
implicitWidth: 300
|
|
|
|
|
modal: true
|
|
|
|
|
|
|
|
|
|
property var targetBundleMaterial
|
|
|
|
|
|
|
|
|
|
contentItem: Column {
|
|
|
|
|
spacing: 20
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
id: folderNotEmpty
|
|
|
|
|
|
|
|
|
|
text: qsTr("If the material you are removing is in use, it might cause the project to malfunction.\n\nAre you sure you want to remove the material?")
|
|
|
|
|
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: {
|
2023-03-02 13:21:40 +01:00
|
|
|
ContentLibraryBackend.materialsModel.removeFromProject(root.targetBundleMaterial)
|
2022-10-12 20:46:17 +03:00
|
|
|
root.accept()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
onClicked: root.reject()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onOpened: folderNotEmpty.forceActiveFocus()
|
|
|
|
|
}
|