GNOME Bugzilla – Bug 706309
Add a “Save As” button to the “Quit GIMP” dialog
Last modified: 2016-10-01 19:01:55 UTC
1.Open GIMP version 2.8.6
2.Open any image you want.
3.Change any thing on the image.
GIMP displays "Help, Discard Changes, Cancel" buttons in “Quit GIMP” pop up except "Save As" button.
Created attachment 252229 [details]
Save As button in "Quit GIMP" pop up
I agree this would be more user-friendly.
Created attachment 253052 [details] [review]
Patch adding a "Save" option on file-quit and file-save-all
The attached patch adds the following behavior when quitting (file-quit) or closing all views (file-close-all):
* If there are no dirty image, the behavior is same as before (just quit or close all views respectively).
* If there are any dirty image, the popup listing these images will now have a button "Save", additional to the untouched "Discard Changes" and "Cancel".
* Clicking "Save" will save over and close (without further prompting) any dirty image with an existing XCF file. And it will prompt with the usual "Save Image" dialog for any dirty image without XCF file. If there are several of such images, the "Save Image" dialogs will pop up one after another (not all at the same time), with each corresponding image pulled up in the image stack.
* 2 new actions created "file-save-all-and-quit" and "file-save-and-close-all", the first being equivalent to "file-quit", then pressing "Save"; the second to "file-close-all" then pressing "Save".
That is one hell of a patch :)
Should we really make the worst code in gimp even more complicated?
I already have a hard time understanding the old shit whenever I have
to look at it...
well it's true that this code was spreading over too many files. But then should we really postpone indefinitely all features until the code is cleaned up/refactored? I mean this basic "save" button was really missing out. I often thought about it myself. And my patch don't really make the current code *that* worst. I did not make any new function or anything. I used everything from the existing architecture (only part "a little" complicated is the usage of the dialog's response to raise "Save Window" dialogs one at a time nicely. Well the loop over all images a little too maybe).
What I can propose is to push this for now, and create another ticket for code rewrite of this part of the code. I'll try to have a look at it and propose a new architecture for the save dialog.
Also while we are at it, now that save and export are different concepts, I really think we should separate their code. Even though "for now" it may be the same looking dialog, at least separate code will allow for real divergence in the future. I realized that when a user complained on IRC the other day about the new behavior and the fact that both dialog are exactly the same! I think one part of the problem is "appearance". Users see twice the same dialog and think the save/export logics is bullshit. If we had 2 clear separate dialogs, with time we could really make them feel like completely different things. And users would say "yes that makes sense".
For instance I think we could definitely get rid of the file extension dropdown list in the save dialog, and come up with a much nicer UI for allowing to select compressed versions.
And in the export dialog, we could begin to have useful features (common to all formats) directly in this first dialog. For instance we could have a "scale before export" (so that you don't scale your main project and undo after exporting. So annoying. I believe the "Export for Web" feature of Bug 98017 must be about this?), or a "export layers separately" (I saw a third-party plugin for this but this would make so much sense in the core GIMP in the export dialog!). And so on.
All this would really make the differences between the 2 dialogs stand out, and people would realize why the change was important.
What do you think of it?
If you agree, I'll make the ticket to clean and separate the 2 features. :-)
And if I can push this one, that would be awesome too.
After discussion with Mitch on IRC, I'll try the new approach:
- "save" buttons in the list of unsaved images, so you could click them and pop the save dialog from there;
- add a column "unsaved changes from <n> minutes".
Once it got saved, the image disappears from that list automatically, and gimp auto-quits when the last image disappears -> normally this is already implemented higher logic.
*** Bug 764699 has been marked as a duplicate of this bug. ***
*** Bug 764698 has been marked as a duplicate of this bug. ***
Fixed in master:
Author: Michael Natterer <firstname.lastname@example.org>
Date: Sat Oct 1 20:55:13 2016 +0200
Bug 706309 - Add a “Save As” button to the “Quit GIMP” dialog
Add GimpCellRendererButton and use it to add a "Save" icon to each row
of dirty images. Click invokes the "edit-save" action, shift-click
invokes "edit-save-as". Also add a tooltip for the icon button.
Involves minor changes to GimpContainerTreeView to allow
GimpCellRendererButton to be added, and to allow external
"query-tooltip" handlers to run.
app/dialogs/quit-dialog.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++------
app/widgets/Makefile.am | 2 +
app/widgets/gimpcellrendererbutton.c | 143 +++++++++++++++++++++++++++++++++++++++++++
app/widgets/gimpcellrendererbutton.h | 59 ++++++++++++++++++
app/widgets/gimpcontainertreeview.c | 32 +++++++---
app/widgets/widgets-types.h | 1 +
6 files changed, 384 insertions(+), 26 deletions(-)