fadden / CiderPress2

Tool for working with Apple II and vintage Mac disk images and file archives.
https://ciderpress2.com/
Apache License 2.0
50 stars 7 forks source link

Add "overwrite all" #19

Closed fadden closed 5 months ago

fadden commented 5 months ago

(prompted by fatdog in Slack)

When an operation is asked to overwrite an existing file, the application will ask the user if it should do so. The dialog is currently just a generic yes/no/cancel MessageBox:

image

The original CiderPress had a fancier dialog that allowed "yes to all" and "no to all" as options, and showed some file attributes:

image

Being able to select the behavior for all future conflicts is useful when operating on a large number of files. The CLI doesn't really need this, because the command-line flags let you choose between overwrite none / overwrite all / interactive, but the GUI does.

The progress callback code was designed to handle this, but we need a custom dialog rather than a generic MessageBox. We may also want to add file sizes and dates to the CallbackFacts object, so we can present additional information.

The original CP's dialog also had the option of renaming the file. This outcome isn't currently implemented in the worker library code.

The Win10 Explorer conflict message looks like this:

image

Instead of asking a yes/no question, it lets you click on "copy and replace" or "don't copy", and has a checkbox to apply the decision to all conflicts. This might be better, since it lets you click on a verb instead of answering a question.

Update: displaying the information for the original file is a little weird, mostly because of forked files, but also because of compressed data in archives where the uncompressed size isn't stored (.BNY, possibly .gz). It's also a little tricky around AppleSingle/AppleDouble, where you need to choose between displaying the information for the wrapper vs. the wrapped content; note this comes up for MacZip as well as files on the host. Comparing the length of the original file to the length of an existing .as file is meaningless, because the .as has both forks and a file header. If we're exporting rather than extracting, there is no meaningful source length.

fadden commented 5 months ago

https://github.com/fadden/CiderPress2/releases/tag/v1.0.2-dev3