bardsoftware / ganttproject

Official GanttProject repository.
http://ganttproject.biz
GNU General Public License v3.0
859 stars 301 forks source link

Accidental file overwrite using "Recent Documents" #2291

Closed ZaneUJi closed 7 months ago

ZaneUJi commented 1 year ago

The version is 3.2.3230.

Here is the steps to reproduce the problem.

  1. Create a new project, save it as a.gan
  2. Create another project
  3. Press Ctrl + S or click the save icon in the toolbar to open the file name dialog
  4. Select "Recent Documents" in the left area, then select a.gan. It should look like below: image
  5. Imput a new name, i.e. change a.gan to something like aaa.gan to make sure that the recent file list is empty.
  6. Click Save button.
  7. Then you'll find that a.gan has been overwritten.

I understand that some people don't like the comfirmation dialog. But it doesn't seem right to apply the user input name to clear the file list then ignore this name and overwrit the original file.

dbarashev commented 1 year ago

Well, the problem is that "a.gan" remains selected despite that you type some other file name, and basically it behaves as if you just opened "a.gan" and modified it. It is not reasonable to ask for confirmation to overwrite an explicitly opened file.

Using "Recent documents" for changing the file name is not the right way to do because it is not clear where a new file whould be written to. So, we'll just disable Save button if something other than the existing file name is typed in the text field.