2022-11-23 11:49:45 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2023-01-04 08:52:22 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-10-07 19:49:52 +03:00
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
2022-11-23 11:49:45 +02:00
|
|
|
import HelperWidgets as HelperWidgets
|
2022-10-07 19:49:52 +03:00
|
|
|
import StudioTheme as StudioTheme
|
2023-03-07 16:51:02 +01:00
|
|
|
import AssetsLibraryBackend
|
2022-10-07 19:49:52 +03:00
|
|
|
|
|
|
|
|
Dialog {
|
2022-11-23 11:49:45 +02:00
|
|
|
id: root
|
2022-10-07 19:49:52 +03:00
|
|
|
|
|
|
|
|
title: qsTr("Folder Not Empty")
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
closePolicy: Popup.CloseOnEscape
|
|
|
|
|
implicitWidth: 300
|
|
|
|
|
modal: true
|
|
|
|
|
|
2022-11-23 11:49:45 +02:00
|
|
|
required property string dirName
|
|
|
|
|
required property var dirIndex
|
|
|
|
|
|
2022-10-07 19:49:52 +03:00
|
|
|
contentItem: Column {
|
|
|
|
|
spacing: 20
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
id: folderNotEmpty
|
|
|
|
|
|
2022-11-23 11:49:45 +02:00
|
|
|
text: qsTr("Folder \"%1\" is not empty. Delete it anyway?").arg(root.dirName)
|
2022-10-07 19:49:52 +03:00
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
wrapMode: Text.WordWrap
|
2022-11-23 11:49:45 +02:00
|
|
|
width: root.width
|
2022-10-07 19:49:52 +03:00
|
|
|
leftPadding: 10
|
|
|
|
|
rightPadding: 10
|
|
|
|
|
|
|
|
|
|
Keys.onEnterPressed: btnDelete.onClicked()
|
|
|
|
|
Keys.onReturnPressed: btnDelete.onClicked()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
text: qsTr("If the folder has assets in use, deleting it might cause the project to not work correctly.")
|
|
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
wrapMode: Text.WordWrap
|
2022-11-23 11:49:45 +02:00
|
|
|
width: root.width
|
2022-10-07 19:49:52 +03:00
|
|
|
leftPadding: 10
|
|
|
|
|
rightPadding: 10
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
anchors.right: parent.right
|
2022-11-23 11:49:45 +02:00
|
|
|
HelperWidgets.Button {
|
2022-10-07 19:49:52 +03:00
|
|
|
id: btnDelete
|
|
|
|
|
|
|
|
|
|
text: qsTr("Delete")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
2023-03-07 16:51:02 +01:00
|
|
|
AssetsLibraryBackend.assetsModel.deleteFolderRecursively(root.dirIndex)
|
2022-11-23 11:49:45 +02:00
|
|
|
root.accept()
|
2022-10-07 19:49:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-23 11:49:45 +02:00
|
|
|
HelperWidgets.Button {
|
2022-10-07 19:49:52 +03:00
|
|
|
text: qsTr("Cancel")
|
2022-11-23 11:49:45 +02:00
|
|
|
onClicked: root.reject()
|
2022-10-07 19:49:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onOpened: folderNotEmpty.forceActiveFocus()
|
|
|
|
|
}
|