Skip to content

Refine "File exists" warning #12565

@koppor

Description

@koppor

The current "error" dialog for renaming a file to an existing file is not good.

Improvements:

  1. Allow "Keep both" -> JabRef adds (1), (2), ... at the file name.
    • Use org.jabref.logic.util.io.FileNameUniqueness#getNonOverWritingFileName for this
    • Hover on the button "Keep both": Shows tool tip "New filename {}", with {} replaced by a filename not existing yet. Example: "Bogner (1).pdf" if "Bogner.pdf" would be generated and exist.
  2. Add button "Provide alternative file name", which triggers the functionality "Rename file to a given name" from the context menu having the proposed name in the text box
  3. Change title from "File exists" to "Target file already exists"
  4. The content of the message box is strange for a long file name. Content: "Target file name {}"
  5. Content of message box should not be editable.

Current behavior:

  1. Open pdfContentImporterTest-pdfs.bib (contained in src\test\resources\pdfs\PdfContentImporter)
  2. Remove "Tucker2007" entry, but "Keep file(s)"
  3. Select "Bogner2023RESTAPI"
  4. In the Windows Explorer, select Tucker2007.pdf. Drag it onto "Bogner2023 RESTAPI" in the main table
  5. In the "General" tab in the entry editor at the field "File", there are now two entries
  6. Select the second one
  7. Context menu (right click)
  8. Select "Rename file to defined pattern"

Image

Image

(Internal discussion: We could have an "Advanced hint" explaining all options in the dialog box, but we think this is not necessary to understand the actions taken by JabRef)

Metadata

Metadata

Assignees

No fields configured for feature.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions