Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support current_folder with FileChooser.OpenFile #1045

Merged
merged 6 commits into from
Jun 30, 2023

Conversation

ebassi
Copy link
Collaborator

@ebassi ebassi commented Jun 29, 2023

Closes #796

Supercedes: #874

sophie-h and others added 6 commits June 29, 2023 13:01
Now that the OpenFile method in the file chooser portal supports the
current_folder option, we should perform the same reverse lookup as the
SaveFile method, to present the location on the host when given a
location inside the document portal storage.
We've been calling complete_open_file() for both save methods since the
code was first ported to gdbus-codegen. Luckily, the signature is
currently the same on every method.
The byte arrays are expected to be terminated by a nul byte, and they
express a path in the same encoding as the file system.
Document its behaviour in the same way we document it for the SaveFile
method.
The current_folder option is passed to the OpenFile invocation.
Copy link
Member

@GeorgesStavracas GeorgesStavracas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I had a style comment on the first commit, but the line is removed in the immediate next comment, so it's all good

@matthiasclasen
Copy link
Contributor

+1 from me

@GeorgesStavracas GeorgesStavracas merged commit 7a1d098 into flatpak:main Jun 30, 2023
3 checks passed
@GeorgesStavracas GeorgesStavracas added this to the 1.18 milestone Jun 30, 2023
btzy added a commit to btzy/nativefiledialog-extended that referenced this pull request Jun 30, 2023
@Nantris
Copy link

Nantris commented Jul 1, 2023

Thank you so much to everyone who worked on this!

@ebassi ebassi deleted the open-file-current-folder branch July 9, 2023 16:55
sophie-h added a commit to sophie-h/ashpd that referenced this pull request Nov 10, 2023
sophie-h added a commit to sophie-h/ashpd that referenced this pull request Nov 11, 2023
bilelmoussaoui pushed a commit to bilelmoussaoui/ashpd that referenced this pull request Dec 19, 2023
bilelmoussaoui pushed a commit to bilelmoussaoui/ashpd that referenced this pull request Jan 6, 2024
aarongable pushed a commit to chromium/chromium that referenced this pull request Aug 14, 2024
This change adds support for opening a file dialog in the current folder
in the SelectFileDialogLinuxPortal. Support for this feature was added
in xdg-desktop-portal via flatpak/xdg-desktop-portal#1045.

Electron makes use of this feature and this allows us to remove a patch to enable this functionality.

Change-Id: I3f95bdff0c6a834f965ed3c153eb1a99902f61bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786982
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1341908}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileChooser: Add current_folder option to OpenFile
5 participants