Open AlessandroW opened 5 years ago
Can someone add some information why it is not possible? If it is not too difficult maybe I could implement it.
@andreasb242 Could you answer this?
Xournal++ used first the standard ZLib API, not the GLib wrapper, and they don't support URLs, Gnome 2 returned the real URLs from Open Dialog, like smb://server/share/file.xoj, and this cannot be opened.
File reading / writing was completely refactored, so may this is no issue anymore. May also Gnome 3 handle this different.
Maybe only add the remote supported flag to the Open Dialog, and everything works, probably nobody has tried this since years ;-)
XojOpenDlg.cpp
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), true);
Here is the question, what is returned now? Theoretically there should always be a local path, e.g. if I mount an FTP, it ismounted local at: /run/user/<my-user-id, e.g. 1000>/gvfs/ftp:host=192.168.1.2,port=123
and this is a local mounted path, so if we can get this Path from Filechooser, it should work without changes of the file loading / writing, because we don't use GTK file API.
The way to go is using GIO for this as mentioned in the documentation. Unfortunately the libraries required for the new fileformat are C libraries and therefore incapable of using GIO.
Only one solution comes to mind but this is really ugly: We could use GIO to download remote files to a local directory and then open the file with the normal routines. For saving we could also use this abstraction.
For a Java Application I did simple a hack, and resolve a mountpoint, then you have a local path, and it's working. This should also be possible for this case.
There's a workaround I use on Ubuntu with several other Linux programs that also appears to work with Xournal++.
If you are always mounting the same network drive, you can create a symlink in an easy-to-access location (i.e. your desktop or home folder) that points to the drive's FUSE mount point.
networkdrive -> /run/user/<uid>/gvfs/smb-share:server=<server>,share=<share name>/
After that, you can open remote files using this path without an issue. Saving also works.
Thanks, I created a symlink like you suggested:
google-drive -> /run/user/<uid>/gvfs/google-drive:host=gmail.com,user=<user-name>/
Things I noticed:
So yes, the workaround does work. But the missing filenames and the long loading time makes it unusable. Did you experience similar issues?
But the missing filenames and the long loading time makes it unusable. Did you experience similar issues?
I'm using Samba. The filenames show up normally for me. It does take a bit longer to open folders, but not long enough to be a big deal (definitely not ten seconds longer).
Evidently this doesn't work as well for Google Drive.
I have the same behavior in gnome as @AlessandroW reports with the mentioned symbolic link workaround.
This could be fixed already in v.1.1.0-dev
I'm mounting drives on my server over ssh
and trying to load files from that. @Febbe how do you mean this is possible in v1.1.0-dev? Is there work to do on this or has it already been done?
I'm very confused about there is a limitation on opening remote files. We already depend on gio
anyways, so we should be able to leverage gio's features to read/write files.
@LittleHuba: We could use GIO to download remote files to a local directory and then open the file with the normal routines. For saving we could also use this abstraction.
I'm not too familiar with gio, but a quick look at the API suggests that there's no need for workaround. We could make the file chooser return a URI and then call g_file_new_for_uri()
, which supports file://
, smb://
, ftp://
, ssh://
, etc. URIs. There may be some slight caveats when authentication is required, but this should work out of the box for common use cases.
@WillNilges: how do you mean this is possible in v1.1.0-dev? Is there work to do on this or has it already been done?
I think @Febbe means that it is possible to implement but that no one has implemented it yet.
Any news on this? I'm using the 1.0.20 Flatpak version, and I can't open or save at remote goggle-drive directories mounted via gnome "online-accounts"'s package.
The subfolder gvfs
in /run/user/1001/
simply doesn't appear in Xournal++.
Thanks, Felipo
@Technius Ah, I see. Well, I'm taking my last final in about two days. After that, maybe I'll take a crack at it if nobody else has.
Any news on this? I'm using the 1.0.20 Flatpak version, and I can't open or save at remote goggle-drive directories mounted via gnome "online-accounts"'s package.
The subfolder
gvfs
in/run/user/1001/
simply doesn't appear in Xournal++.
This is a bug with our flatpak, please submit an issue here: https://github.com/flathub/com.github.xournalpp.xournalpp
Can you try running
flatpak override --talk-name='org.gtk.vfs.*' com.github.xournalpp.xournalpp
@Technius Ah, I see. Well, I'm taking my last final in about two days. After that, maybe I'll take a crack at it if nobody else has.
Actually, it worked when using the stable PPA version (the snap also didn't worked). Thanks @WillNilges and @Technius.
This is a bug with our flatpak, please submit an issue here: https://github.com/flathub/com.github.xournalpp.xournalpp
@Technius I didn't knew that. Thanks and sorry for the mistake.
By the way, the suggested command flatpak override --talk-name='org.gtk.vfs.*' com.github.xournalpp.xournalpp
didn't worked.
@WillNilges Reading and writing files from a mounted device should work with v.1.1.0~dev without a problem.
Currently we don't support URI files with another scheme than file://
and honestly I don't see much benefit in supporting them.
Nearly every other scheme can only be used to read only. And they are suspect of change which is a bad choice for example for a PDF background.
I see, I'll test this out tonight and see if it can do what I think it can. If so, then when will this feature get merged? Because this would be LIT to have.
I see, I'll test this out tonight and see if it can do what I think it can. If so, then when will this feature get merged? Because this would be LIT to have.
You could try mounting the remote folder using gvfs first (e.g. through your file manager). It should then be accessible in Xournal++ through the file chooser (in Nautilus, it's under Other Locations > Network
). I tried this with a PDF on a server I have and I can annotate/load it successfully.
If this works correctly, I think we can just close this issue.
Affects versions :
Describe the bug Cannot open remote files.
To Reproduce
Expected behavior Usual workflow.
Screenshots of Problem