-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Writing neighboring files #997
Comments
For creating and saving multiple files:
Feasible? Opinions? |
Interesting, but I don't think it's feasible. Usually the file chooser returns a location. As things stand, I don't think it's possible to pass much information. Such a mechanism involve the system api rather than the UI, would this mean modifying every existing file chooser? A few days ago I was seeing Gtk file chooser, I don't know if there are hooks to do this or make it possible with portals api. |
I don't know because I'm not a developer. But this will certainly involve modifying the way file choosers work. |
There's already the SaveFiles method in the FileChooser portal, the application send the list of files it want written and the portal will return the ones that got actually written. |
@Marukesu: Indeed, but does it work by also creating folders? Also, the phrasing in the documentation leads me to think that the files are saved as is, with no option to change the name. Also, is file size taken into account? Another question: What about the Firefox case? Are the relevant files of the website to save already downloaded or downloaded after saving the html file? |
no, all the paths used will be exported to the sandbox as files.
yes, it's intended. if we are dealing with auxiliary files, like all the use cases said does, allowing to change the name won't be helpful.
no. why it would, the chooser is to select a location.
i don't get it, the firefox case seem simple:
keep in mind that the portal doesn't save (or in the case of OpenFile, open) anything. it just return paths that can be used by the application, how and in what order things are written is up to the application. |
expanding in the user cases:
|
Although Inform and Metadata Cleaner are cases related to opening files/folders, I thought it was a good idea to address them separately so that #463 just focuses on the opening part, because the rest is about writing files. Note that I have not discussed these cases yet. The first part offered is just when creating a project that also writes other files (KiCad) or an app that saves multiple files (Firefox). The goal is for the user to be aware of an app's writing activity (here: that other files are being written, which ones and how much storage space they take). This obviously requires extending the portal and file choosers. |
In my case the multiple files are saved on folder, but only the first file gets the right name, the other files get hashed file name, eg.
Files are saved but are unrecognizable, except the first one that is saved. This was a month ago in Arch Linux, with xdg-desktop-portal-gtk, file chooser Gtk3, Qt6. Opening files from folder works as expected. |
Unless the user set the chooser to "open in read-only mode" (availability depends of the backend), if you open a path you can already write to it. so any case that deals with "give access to a neighbour path based in a opened path" is a #463 case solely. This issue only make sense if you are talking about "also create theses others files when creating this file".
You can show the file names sent in the SaveFiles call already, that just need implementation changes in the backends to use that information. The file size doesn't make sense at all with how the portal (or even any chooser API) works. Even if a option to send the file sizes is added, i don't think it will be used by libraries.
AFAIK, none of the more common libraries make use of the SaveFiles method, so a application will need to talk to the portal directly, or update the used library to make use of it. |
Thanks! For me, neighbor files are additional files to open (I made proposals for this which are now in the Discussions tab), and not provide access to the parent directory. But even if it would be to give access to the parent directory, in the case of Metadata Cleaner it is better to have something specific, rather than having access to the parent directory of each file (because the files can come from different locations). |
This is the equivalent of #463, but for writing files.
To be exact, it is about writing/creating folders or files after the opening or creation of a folder or file.
There are already 4 app cases listed:
site.html
) and Firefox automatically saves several files in a folder with the same name as the html file with a suffix (e.g.site_files
). The html file and its companion folder are saved in the same folder..materials
folder (folder extension) with the same name and in the same folder as an open.inform
folder. It also creates folders and files in the.inform
project folder after creating it.filename.cleaned.ext
, whereext
is the extension of the original file)..kicad_pro
,.kicad_pcb
and.kicad_sch
.Cases, said another way:
Other cases are welcome. If they are different from those mentioned, please provide a description if possible.
Addition (June 18, 2023)
Other cases :
.materials
folder if it does not exist after opening the.inform
folder.The text was updated successfully, but these errors were encountered: