1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/ui/Components/FormFileDelegate.qml

28 lines
629 B
QML
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
2023-09-16 17:32:38 -04:00
import QtCore
import QtQuick.Dialogs
2023-09-16 18:15:11 -04:00
import org.kde.kirigamiaddons.formcard as FormCard
FormCard.FormButtonDelegate {
id: control
property string file
2024-01-31 16:12:39 -05:00
signal accepted(string path)
icon.name: "document-open"
description: file
onClicked: dialog.open()
FileDialog {
id: dialog
2023-09-16 17:32:38 -04:00
currentFolder: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
2024-01-31 16:12:39 -05:00
onAccepted: control.accepted(decodeURIComponent(selectedFile.toString().replace("file://", "")))
}
}