Redesign interaction of the file dialog
Closed, ResolvedPublic

Description

Currently, the file dialog tries to remember from where it is called and re-open in the last used directory. It also tries to be smart about the file type it shows by default. But because it wraps QFileDialog, there's always tension between the selected mimetype and the mimetypes used to filter the files shown. We need to figure out how the file dialog should _really_ behave on:

  • file open
  • file save as
  • file export as
  • select directory

coupled with the

  • current file format of the active image
  • the last used file format when saving as
  • the last used file format when exporting
  • the file types the user would like to see (the mimetype filter)
  • the file type the user would like to use
  • the last used location.
rempt created this task.Apr 7 2017, 8:33 AM
rempt updated the task description. (Show Details)Apr 7 2017, 8:37 AM
Deevad added a subscriber: Deevad.Apr 7 2017, 10:23 AM

Here is the bug report in 2.x series (2015) and how it was documented and solved at that time: https://bugs.kde.org/show_bug.cgi?id=342555

jospin added a subscriber: jospin.Apr 7 2017, 11:31 AM
Deevad added a comment.Apr 7 2017, 5:02 PM

The last Krita appimage I can test with better file-dialog interaction is krita-3.0.1-Alpha-4c91a18-x86_64.appimage (1 august 2016), this one has correct Save, Save-As and Export path behavior.

This is what I have now working on master/3.2. We check the following things when determining the location where the file dialog opens:

  • document's path
  • last location we exported to: not stored in config -- but stored in the window, so all images exported from that window share that path
  • last location saved/exported to (stored in config)
  • location we opened the image from
  • if all else fails, the Pictures location

This is what happens:

  • no settings stored yet
    • new file:
      • save: opens Pictures location, proposes .kra
      • save as: opens Pictures location, proposes .kra
      • export: opens Pictures location, proposes All Formats
  • opened file
    • save: opens the export settings and overwrites the file
    • save as: opens the file dialog on the location where the file was loaded, and proposes the active filename
    • export: opens the file dialog on the location where the file was loaded, and proposes the active filename
  • opened file, after export
    • save: saves over the original file
    • save as: opens the file dialog on the location where the file was loaded, and proposes the active filename
    • export: proposes the location that we last exported to, the original filename, but the extension last used when exporting

After export or save as, the default location for opening files is still the last location from where a file was opened.

  • open another image
    • save: saves over the new image
    • save as: opens the file dialog in the location the file was opened from
    • export: opens the fie dialog where we last saved/exported something to, proposes the original filename, with the mimetype we last exported to.
  • create a new image
    • save: opens a file dialog in the location where we last saved something. Proposes .kra
    • save as: opens a file dialog in the location where we last saved something. Proposes .kra
    • export: opens a file dialog in the location where we last saved something. Proposes All Filters

I'm not

rempt closed this task as Resolved.Jan 10 2018, 1:34 PM