Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions framework/interactive/internal/interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,19 @@ io::paths_t Interactive::selectOpeningFilesSync(const std::string& title, const

return paths;
#else
NOT_SUPPORTED;
return io::paths_t{ selectOpeningFileSync(title, dir, filter, options) };
UriQuery q = makeSelectFileQuery(FileDialogMode::OpenFiles, title, dir, filter, options);

RetVal<Val> rv = openSync(q);
if (!rv.ret) {
return io::paths_t();
}

io::paths_t paths;
for (const Val& val : rv.val.toList()) {
paths.push_back(QUrl::fromUserInput(val.toQString()).toLocalFile());
}

return paths;
#endif
}

Expand Down
8 changes: 6 additions & 2 deletions framework/interactive/qml/Muse/Interactive/FileDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ QtPlatform.FileDialog {

onAccepted: {
if (root.fileMode === FileDialog.OpenFiles) {
const selectedUrls = root.fileUrls || []
root.ret = { "errcode": 0, "value": selectedUrls }
let selectedFiles = []
const selectedUrls = root.files || []
for (let i = 0; i < selectedUrls.length; ++i) {
selectedFiles.push(selectedUrls[i].toString())
}
root.ret = { "errcode": 0, "value": selectedFiles }
} else if (root.fileMode === FileDialog.SaveFile) {
root.ret = { "errcode": 0, "value": root.appendSuffixIfNeeded(root.currentFile.toString()) }
} else {
Expand Down