mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-04-30 04:34:15 +00:00
Signed-off-by: Adam Treat <treat.adam@gmail.com> Signed-off-by: Jared Van Bortel <jared@nomic.ai> Co-authored-by: Jared Van Bortel <jared@nomic.ai>
20 lines
566 B
QML
20 lines
566 B
QML
import QtCore
|
|
import QtQuick
|
|
import QtQuick.Dialogs
|
|
|
|
FileDialog {
|
|
id: fileDialog
|
|
title: qsTr("Please choose a file")
|
|
property var acceptedConnection: null
|
|
|
|
function openFileDialog(currentFolder, onAccepted) {
|
|
fileDialog.currentFolder = currentFolder;
|
|
if (acceptedConnection !== null) {
|
|
fileDialog.accepted.disconnect(acceptedConnection);
|
|
}
|
|
acceptedConnection = function() { onAccepted(fileDialog.selectedFile); };
|
|
fileDialog.accepted.connect(acceptedConnection);
|
|
fileDialog.open();
|
|
}
|
|
}
|