1
0
mirror of https://github.com/nomic-ai/gpt4all.git synced 2025-04-30 04:34:15 +00:00
gpt4all/gpt4all-chat/qml/MyFileDialog.qml
AT db443f2090
Support attaching an Excel spreadsheet to a chat message ()
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>
2024-10-01 21:17:49 -04:00

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();
}
}