2024-04-14 14:11:41 +02:00
|
|
|
/*
|
|
|
|
* Mirai. Copyright (C) 2024 Vyn
|
|
|
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
|
|
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Window
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
2024-05-05 15:58:56 +02:00
|
|
|
import QtQuick.Dialogs
|
2024-04-14 14:11:41 +02:00
|
|
|
import Mirai
|
|
|
|
|
|
|
|
// WIP
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: form
|
|
|
|
spacing: 6
|
2024-04-22 15:45:26 +02:00
|
|
|
signal confirmed(paths: var)
|
2024-04-14 14:11:41 +02:00
|
|
|
|
|
|
|
function reset() {
|
2024-04-22 15:45:26 +02:00
|
|
|
internal.paths = []
|
|
|
|
internal.paths = backend.files.map(file => file.path)
|
2024-04-14 14:11:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: internal
|
|
|
|
property var paths
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: internal.paths
|
|
|
|
ColumnLayout {
|
|
|
|
AppLineEdit {
|
2024-04-22 15:45:26 +02:00
|
|
|
text: modelData
|
|
|
|
onTextChanged: {
|
|
|
|
internal.paths[index] = text
|
|
|
|
}
|
2024-04-14 14:11:41 +02:00
|
|
|
}
|
2024-04-22 15:45:26 +02:00
|
|
|
}
|
|
|
|
}
|
2024-04-14 14:11:41 +02:00
|
|
|
|
2024-05-05 15:58:56 +02:00
|
|
|
FileDialog {
|
|
|
|
id: fileDialog
|
|
|
|
currentFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
|
|
|
|
onAccepted: {
|
|
|
|
console.log(selectedFile)
|
|
|
|
internal.paths = [...internal.paths, selectedFile]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-22 15:45:26 +02:00
|
|
|
AppButton {
|
2024-05-05 15:58:56 +02:00
|
|
|
text: "+ Add"
|
2024-04-22 15:45:26 +02:00
|
|
|
onClicked: {
|
2024-05-05 15:58:56 +02:00
|
|
|
fileDialog.open()
|
2024-04-14 14:11:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AppButton {
|
|
|
|
text: "Save"
|
|
|
|
onClicked: {
|
2024-04-22 15:45:26 +02:00
|
|
|
form.confirmed(internal.paths)
|
2024-04-14 14:11:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|