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

pdfarranger forgets file name to save when closing window #744

Closed
lonnic opened this issue Oct 11, 2022 · 18 comments
Closed

pdfarranger forgets file name to save when closing window #744

lonnic opened this issue Oct 11, 2022 · 18 comments
Labels
bug flatpak not our bug A bug that impacts PDF Arranger but is not in our code. This is probably a bug that we can't fix.
Milestone

Comments

@lonnic
Copy link

lonnic commented Oct 11, 2022

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. open a file pdf
  2. erase one or more pages
  3. close pdfarranger
  4. See error: pdfarranger forgets the name of the file ad uses xdg-desktop-portal-kde when the default file manager is thunar. Even if I use CTRL+S to save the file pdfarranger needs to insert again the same file name.

Expected behavior

the previous version was ok

@jeromerobert
Copy link
Member

Please provide OS, GTK and PDF Arranger versions.

@lonnic
Copy link
Author

lonnic commented Oct 12, 2022

slackware, kernel 5.15.19
GTK version: 1.2.10 (into slackware)
pdfarranger 1.9.1 FLATPAK VERSION ...
in about: I read:
It uses libqpdf 11.1.1, pikepdf 6.2.0, GTK 3.24.34 and Python 3.9.9.

@jeromerobert
Copy link
Member

It could be related to #704 but I'm currently not able to reproduce it.

By the way, why are you talking about xdg-desktop-portal-kde and thunar ? How is that related to PDF Arranger ?

Could you provide screenshots of your save dialog ?

@lonnic
Copy link
Author

lonnic commented Oct 14, 2022

Screenshot_2022-10-14_06-12-07
Screenshot_2022-10-14_06-12-23
Screenshot_2022-10-14_06-12-35
Screenshot_2022-10-14_06-12-46
Screenshot_2022-10-14_06-13-12

Screenshot_2022-10-14_06-13-30

@lonnic
Copy link
Author

lonnic commented Oct 14, 2022

If iI close pdf arranger, it asks again the name of the original file ...
same situation if i use CTRL+S

@jeromerobert
Copy link
Member

Ok so this because #704 and because Gtk.FileChooserNative.set_filename does not work with KDE. This must be fixed in GTK or KDE but this is beyond what I can do. We have 2 reasonable possibilities:

@oscfdezdz @dreua any opinion ?

@jeromerobert jeromerobert added not our bug A bug that impacts PDF Arranger but is not in our code. This is probably a bug that we can't fix. bug and removed need more info labels Oct 14, 2022
@kbengs
Copy link
Member

kbengs commented Oct 14, 2022

In Windows FileChooserNative works much faster so imo we should not remove it from Windows at least.

@dreua
Copy link
Member

dreua commented Oct 14, 2022

Is this affecting all KDE or do we only know of this case with slackware?

@lonnic lonnic changed the title pdfarranger looses file name to save when closing window pdfarranger forgets file name to save when closing window Oct 14, 2022
@kbengs
Copy link
Member

kbengs commented Oct 14, 2022

I see this issue on Kubuntu 22.04 with the flatpak version. Pdfarranger installed with pip works fine.

@dreua
Copy link
Member

dreua commented Oct 14, 2022

Thanks for checking, so that's probably a Flatpak issue that should be fixed by someone. Not sure if we should add a workaround in PDF Arranger for such stuff but we could check whether we are flatpak or not. I could probably also add a patch to the Flatpak build.

@dreua dreua added the flatpak label Oct 14, 2022
@dreua
Copy link
Member

dreua commented Oct 22, 2022

I updated the Flatpak to Gnome 43, could you check whether that changes anything? If no, it would be nice if someone could report that as Flatpak bug. I'll try to patch our flatpak back to FileChooserDialog once that is done.

@kbengs
Copy link
Member

kbengs commented Oct 23, 2022

I am not sure where to find the flatpak? The version on flathub is updated 24 september. I tried to reinstall it but it did not change anything.

@lonnic
Copy link
Author

lonnic commented Nov 5, 2022

at the moment I switched back to flatpak pdfarranger previous working version 1.8.2

flatpak update --commit=baa9335d72777702b0484932a23ac1278f2f589387b46108181c21878efae74e com.github.jeromerobert.pdfarranger

meanwhile I will update this thread when latest flatpak update will work correcty...

kbengs added a commit to kbengs/pdfarranger that referenced this issue Nov 25, 2022
set_filename() followed by set_current_folder() seems to be the cause
Fix pdfarranger#744
@siodor
Copy link

siodor commented Nov 28, 2022

I can confirm that the same behaviour happens when I open a PDF, drag another one in to add it to the original document and then pdfarranger also forgets the path.

I'm using:

  • Gentoo 2.9, up-to-date as of 27.11.2022
  • KDE Plasma Version 5.25.5
  • KDE Frameworks Version 5.99.0
  • Qt Version 5.15.5
  • Graphic Platform X11

These are the dependencies it was built with:

host /home/user # equery depgraph pdfarranger
 * Searching for pdfarranger ...

 * dependency graph for app-text/pdfarranger-1.9.1-r1
 `--  app-text/pdfarranger-1.9.1-r1  ~amd64 
   `--  app-text/poppler-22.11.0  (app-text/poppler) amd64  [introspection cairo]
   `--  dev-python/pikepdf-6.2.1  (>=dev-python/pikepdf-6.0.0) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)?]
   `--  dev-python/pycairo-1.21.0-r1  (dev-python/pycairo) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)?]
   `--  dev-python/pygobject-3.42.2  (dev-python/pygobject) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)? cairo]
   `--  dev-python/python-dateutil-2.8.2-r1  (dev-python/python-dateutil) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)?]
   `--  x11-libs/gtk+-3.24.34-r1  (x11-libs/gtk+) amd64  [introspection]
   `--  x11-libs/pango-1.50.11  (x11-libs/pango) amd64  [introspection]
   `--  dev-python/python-distutils-extra-2.47  (dev-python/python-distutils-extra) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)?]
   `--  dev-util/intltool-0.51.0-r3  (dev-util/intltool) amd64 
   `--  dev-lang/python-3.8.15_p3  (>=dev-lang/python-3.8.13) amd64 
   `--  dev-lang/python-3.9.15_p3  (>=dev-lang/python-3.9.12) amd64 
   `--  dev-lang/python-3.10.8_p3  (>=dev-lang/python-3.10.4) amd64 
   `--  dev-lang/python-3.11.0_p2  (>=dev-lang/python-3.11.0_beta4) amd64 
   `--  dev-python/setuptools-65.5.1  (>=dev-python/setuptools-65.3.0) amd64  [python_targets_python3_8(-)? python_targets_python3_9(-)? python_targets_python3_10(-)? python_targets_python3_11(-)?]
[ app-text/pdfarranger-1.9.1-r1 stats: packages (15), max depth (1) ]
host /home/user #

But I don't think that I'm using the native KDE save dialogue

This is the save dialogue when I "Save AS" from Okular:
KDE Save Dialogue

While this is what I presume is the GTK save dialogue when I do a "Save AS" in pdfarranger:
GTK Save Dialogue

Both show the same path.

@kbengs
Copy link
Member

kbengs commented Nov 29, 2022

@siodor Could you confirm that this happens only if the two pdf:s are in different folders?

@siodor
Copy link

siodor commented Nov 29, 2022

@kbengs hmm, interesting, I just noticed that pdfarranger doesn't forget the path, but instead takes the path of the drag & dropped PDF.

What I did:

  1. Open /home/user/source.pdf in pdfarranger
  2. Pulled in /home/scantoftp/scanned.pdf from KDE Dolphin file browser
  3. Checked path when doing "Save As" and it took the path of /home/scantoftp/

Is this the intended behaviour? Could it be changed to remember the path of the source PDF because in my mind someone would want to just add additional page to a source document and save it again as it was.

@dreua
Copy link
Member

dreua commented Nov 30, 2022

Could someone please report this against the Flatpak Runtime (Gnome 43)? I'm not using KDE and don't like reporting bugs that I haven't seen with my own eyes.

I'll try to Revert-Patch #704 in the Flapak Build as a reward, once it is properly reported ;)

@kbengs
Copy link
Member

kbengs commented Nov 30, 2022

Could` it be changed to remember the path of the source PDF because in my mind someone would want to just add additional page to a source document and save it again as it was.

The open PR would change it so that "save as" always goes to "first imported file" or, if it has been saved, to the last saved file.

@dreua the problem seems to be fixed by 4cb5459 I am not sure it is a bug.

kbengs added a commit to kbengs/pdfarranger that referenced this issue Dec 3, 2022
set_filename() followed by set_current_folder() seems to be the cause
Fix pdfarranger#744
kbengs added a commit to kbengs/pdfarranger that referenced this issue Dec 5, 2022
set_filename() followed by set_current_folder() seems to be the cause
Fix pdfarranger#744
petaflot pushed a commit to petaflot/pdfarranger that referenced this issue Dec 9, 2022
set_filename() followed by set_current_folder() seems to be the cause
Fix pdfarranger#744
@jeromerobert jeromerobert added this to the 1.10 milestone Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug flatpak not our bug A bug that impacts PDF Arranger but is not in our code. This is probably a bug that we can't fix.
Projects
None yet
Development

No branches or pull requests

5 participants