Refactoring of GimpFileDialog
@Jehan
Submitted by Jehan Link to original bug (#754452)
Description
So I thought one of the major setback for the save/export troll is that people have a hard time seeing how it makes sense since all the dialogs are the same.
I have refactored GimpFileDialog as a parent class which should not be created as such, but always by creating child classes. I have created 3 children: GimpOpenDialog, GimpSaveDialog and GimpExportDialog.
This allows us to have a much clearer code at what is common to all our file dialogs (to have a similar look) and what is specific, instead of drowning ourselves in hundreds of if/else statements for every subcase.
See branch origin/GimpFileDialog-refactoring that I just pushed.
-
Commit 3bfb605 is the base refactoring (no change of functionnality).
-
Commit 0188b30: I made the file dialog state management into a class method, allowing each child dialog to save different kind of data in a single session. As an example, the GimpSaveDialog now saves the usage of the compatibility mode (if an image has never been saved yet, it will be checked by default if we checked it in a previous save; otherwise the per-image compatibility mode is used).
-
Commit f31767b: I added a "Scale Image for Export" feature into the GimpExportDialog, allowing users to rescale their exported image (making it really obvious what is the different between save and export by the way) without touching the original. This is also the start of what people call a "Save for Web" feature, I believe. I am already thinking of various other features (crop, color space change, even any GEGL op could be set at export time).
Version: git master