2023-07-30 08:49:34 -04:00
|
|
|
// 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
|
|
|
|
2023-10-08 20:01:17 -04:00
|
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-10-08 20:01:17 -04:00
|
|
|
FormCard.FormButtonDelegate {
|
2023-07-30 08:49:34 -04:00
|
|
|
id: control
|
|
|
|
|
|
|
|
property string file
|
|
|
|
|
2024-01-31 16:12:39 -05:00
|
|
|
signal accepted(string path)
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
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://", "")))
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
}
|