GNOME Bugzilla – Bug 141535
Save as file extension problem
Last modified: 2004-07-16 21:49:23 UTC
Win2000 GTK2.2.4 Gimp2.0.1 To reproduce: 1. Open jpeg(any will do) file 2. File -> Save as Gimp(xcf) 3. Open another jpeg(or same jpeg) 2. File -> Save as... XCF is already be selected but my filename stays as jpeg. I have to change to another extension and back to xcf to save as Gimp file. The filename should match the file type selected(xcf in this particular case). Or the "by extension" selection should be default all the time.
Simple rule is to not use the file type menu at all. I agree that it should always default to "by extension".
Created attachment 27793 [details] [review] patch against 2.0.1: file type set to automatic when file open/save as/save a copy dialog is opened This may not be terribly helpful. It works fine with 2.0.1, but the same code seems to do nothing with the current cvs, even though it uses the same widgets for the list of file types.
Don't worry about CVS HEAD, the file chooser is going to undergo further changes anyway. Your patch is not going to be accepted though, at least not w/o changes. I'd like to avoid to introduce gimp_file_dialog_set_format() and we will certainly not accept an API that takes a guint index_ as parameter for the file format. I'd suggest that we simply set the option_menu to index 0 from gimp_file_dialog_set_uri() and gimp_file_dialog_set_image(). I also don't understand why your patch activates the menu item
In this case, option_menu_set_history only selects the item superficially, and it has to be activated for the GIMP to use the selected format. My guess is that this is because it switches formats on a signal, rather than finding out which item is selected.
Created attachment 27828 [details] [review] patch against 2.0.1 with requested changes
Created attachment 27839 [details] [review] revised patch
I've attached a cleaned up version of your suggested change. Should IMHO be applied but I wouldn't mind to get a second opinion on the changed behaviour.
Looks good to me. This seems like the right thing to do. Cheers, Dave.
schumaml says that the patch doesn't work for him in win32. I am clueless on how that can be but this keeps me from applying the patch right now...
Seems to work for me now.
Committed to gimp-2-0: 2004-05-29 Sven Neumann <sven@gimp.org> * app/widgets/gimpfiledialog.[ch]: reset the file type menu to "By Extension". Based on a patch from Philip Lafleur (bug #141535). Bumping milestone to 2.2 since we need a similar change in the HEAD branch.
2004-07-16 Sven Neumann <sven@gimp.org> * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpfileprocview.[ch]: added new widget that offers a treeview on file procedures. * app/widgets/gimpfiledialog.[ch]: replaced the file type option menu with the new GimpFileProcView widget. (gimp_file_dialog_set_image): reset the file type to Automatic (fixes bug #141535).