Giter Club home page Giter Club logo

Comments (12)

giannino avatar giannino commented on June 1, 2024 1

from pdfarranger.

petaflot avatar petaflot commented on June 1, 2024 1

ctrl+s enter enter does not work for me due to window focusing paradigm and because I don't want my mouse to jump to newly opened dialogs (high risk of bad clicks).

for the risk of data loss, there's a thing called "using a temporary filename".

if you refuse to implement this, I will fork.

from pdfarranger.

jeromerobert avatar jeromerobert commented on June 1, 2024

It does not because pdfarranger is not rigorously a file modifier. The PyPDF2 import/export is not a transparent operation. If you add a PDF file to pdfarranger then save, PyPDF2 rewrite the whole file and possibly change it's structure. Most of the time we don't want the original file to be replaced because there is a high risk of data loss.

This is why the save action redirect to save as until the user has specified a file name to save to.

Here is what I suggest:

  • if a single file (or no file) was imported and not modified
    • Quietly close
  • else ask about save confirmation, and if yes
    • if the user as already manually run the save or save as action to select a different file name
      • Quietly save and close
    • else
      • Open a save as dialog

The implementation is linked to #59 because this is where I can get the modified status of the file.

from pdfarranger.

dreua avatar dreua commented on June 1, 2024

How is the risk of data loss addressed with this solution? I think it's rather serious since the exported file can be corrupted while the preview in pfarranger looks good. The user has no possibility to check the results before it's too late

from pdfarranger.

jeromerobert avatar jeromerobert commented on June 1, 2024

@dreua I did not implemented what OP asked for. A file chooser still popup at the first save, but now it default to the first imported PDF files. So before overwriting a file the user still have to confirm two times:

  • Click save in the file chooser without changing the file name
  • Confirm that he wants to overwrite

He can also blindly press ctrl+s, enter, enter which allow to get almost what OP wants.

from pdfarranger.

dreua avatar dreua commented on June 1, 2024

That sounds okay to me, thank you for the clarification!

from pdfarranger.

madduck avatar madduck commented on June 1, 2024

For me, the "save" dialog does not default to a filename, unfortunately. If it did that, I guess I could live with it (and #100 could be ignored).

Also, how do you get ctrl+s to work?

from pdfarranger.

dreua avatar dreua commented on June 1, 2024

@madduck For me the "save" dialog always defaults to a filename (pdfarranger 1.3.0 on Linux/Fedora) and ctrl+s just works. Unfortunately I can only look into your problem if there is a way for me to reproduce it.

from pdfarranger.

madduck avatar madduck commented on June 1, 2024

@petaflot it would be cool if you submitted a merge request. Also starts with a fork. ;)

from pdfarranger.

petaflot avatar petaflot commented on June 1, 2024

I'm looking at the code.

I figured "to make everyone happy, I'll add a "ctrl+alt+s shortcut". That doesn't make me happy:

WTF is this <Primary> name for ctrl? comments says "See ..." for list of keys", "Primary" is not in the list. Come on... am I supposed to try pseudo-random names to find out the correct binding?

from pdfarranger.

petaflot avatar petaflot commented on June 1, 2024

<Secondary> is obviously not recognized. Unless someone gives me a clue, I will just write a dirty hack that I will keep for myself instead of doing things properly

from pdfarranger.

petaflot avatar petaflot commented on June 1, 2024

days until I make my own distro: current_days_count -1

from pdfarranger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.