By default, it only saves the current file filter, but it allows a child
to implement its own state. It has been implemented by GimpSaveDialog to
save the preferred compatibility mode as well.
The code refactoring allows better readability which will allow in turn
to add more complex specific features making good use of the save/export
split concept.
- add gimp_image_get,get_xcf_compat_mode()
- add a compat toggle to GimpFileDialog which is shown and sensitive
only for a save (not export), and if the image structure allows
to save an old version at all. The button also has a tooltip
which explains why it is sensitive and what it does
- add "gboolean xcf_compat" to file_save_dialog_save_image()
- in file_save_dialog_save_image(), call image_set_xcf_compat_mode(TRUE)
only around the call to file_save() and set it to FALSE after saving
- in xcf_save_invoker(), honor the image's XCF compat flag and save an
RLE-compressed XCF if possible
The above is very convoluted and doesn't pass the "xcf_compat" boolean
directly because we can't change the parameters of gimp-xcf-save, and
because the gimp-xcf-save might be called indirectly.
Current implementation had 2 issues, fixed by this commit:
1/ after the file save dialog is closed, the image would not close.
2/ if you switched the visible tab before saving the new image, it
would save and close the visible tab, instead of the expected one.
Gather save dialog uri defaults in one place. Move the small bits of
it from file_save_dialog_new() to gimp_file_dialog_set_save_image()
where the rest is.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-10-05 Michael Natterer <mitch@gimp.org>
Allow to "Open as Layers" in the empty display:
* app/widgets/gimpfiledialog.[ch]: add member
"gboolean open_as_layers". Rename gimp_file_dialog_set_image() to
gimp_file_dialog_set_save_image() and add
gimp_file_dialog_set_open_image() which sets both the image to
load layers into and the "open_as_layers" boolean.
* app/dialogs/file-open-dialog.c (file_open_dialog_response): look
at dialog->open_as_layers instead of dialog->image to decide whether
to open as layers (that's much more obvious). Enable open as layers
without existing image by creating the image if it doesn't exist.
* app/actions/file-commands.c (file_open_dialog_show): add "title"
parameter and take the uri from the image if none was passed. Use the
new gimp_file_dialog_set_open_image() instead of poking into the
dialog struct. Change callers to pass the title and not get the
uri from the image; instead always pass the image.
* app/actions/file-actions.c (file_actions_update): keep
"Open as Layers" sensitive even without image.
svn path=/trunk/; revision=27135
2008-05-08 Sven Neumann <sven@gimp.org>
* app/widgets/gimpfiledialog.[ch]: added infrastructure to
access
and set some state information of the GtkFileChooser.
* app/dialogs/file-open-dialog.c
* app/dialogs/file-save-dialog.c: don't keep the file-chooser
dialogs around. Instead keep the state attached to the Gimp
object
(one state for load, one for save dialogs). Closes bug #528811.
svn path=/trunk/; revision=25586
2007-01-20 Michael Natterer <mitch@gimp.org>
Close the display after "Save as" when invoked via the "Close
Without Saving" dialog. Fixes bug #383700.
* app/actions/actions-types.h: added enum GimpSaveMode { SAVE,
SAVE_AS, SAVE_A_COPY, SAVE_AND_CLOSE }.
* app/actions/file-actions.c: changed the 4 save actions into
GimpEnumActions with above enum as values.
* app/actions/file-commands.[ch]: merged the save callbacks into
one and pass a "close_after_saving" boolean to
file_save_dialog_show().
* app/widgets/gimpfiledialog.[ch]: added "gboolean
close_after_saving" parameter to gimp_file_dialog_set_image() and
to the GimpFileDialog struct.
* app/dialogs/file-save-dialog.c: if the file was saved
successfully and close_after_saving is TRUE, close the display if
the image has not become dirty again in the meantime.
svn path=/trunk/; revision=21743
2006-04-05 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-types.h
* app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure
and made a GObject derived from GimpProcedure (instead of having
a pointer to a GimpProcedure). Added image_types and file_magic
utility functions taken from plug-ins.[ch]. Still lives in the
same crappy files because I am undecided where to put it...
* app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed
switch() statement and always call the internal marshaller because
GimpProcedure::execute() is properly overridden by
GimpPlugInProcedure now.
* app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic
utilities added to GimpPlugInProcedure.
* app/actions/file-commands.c
* app/actions/plug-in-actions.[ch]
* app/actions/plug-in-commands.[ch]
* app/core/gimp-gui.[ch]
* app/core/gimp.[ch]
* app/core/gimpimage.[ch]
* app/dialogs/file-open-dialog.c
* app/dialogs/file-save-dialog.c
* app/dialogs/print-size-dialog.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/file/file-utils.[ch]
* app/gui/gui-vtable.c
* app/menus/plug-in-menus.[ch]
* app/plug-in/plug-in-def.[ch]
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-rc.c
* app/plug-in/plug-in-run.c
* app/plug-in/plug-in.c
* app/plug-in/plug-ins-query.c
* app/widgets/gimpactiongroup.[ch]
* app/widgets/gimpdnd-xds.c
* app/widgets/gimpfiledialog.[ch]
* app/widgets/gimpfileprocview.[ch]
* app/widgets/gimppluginaction.[ch]
* app/xcf/xcf.c
* tools/pdbgen/pdb/fileops.pdb
* tools/pdbgen/pdb/plug_in.pdb: changed addordingly.
* app/pdb/fileops_cmds.c
* app/pdb/plug_in_cmds.c: regenerated.
2005-12-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.[ch]: set the new
"do-overwrite-confirmation" property on GtkFileChooser. Removed
gimp_file_overwrite_dialog().
* app/dialogs/file-save-dialog.c (file_save_dialog_check_uri):
removed broken code which tried to figure if a file exists.
Fixes bug #309729.
* app/widgets/gimpdnd-xds.c: added gimp_file_overwrite_dialog()
here as private utility function.
2005-09-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpprogressbox.c
* plug-ins/script-fu/script-fu-interface.c: made progress bars HIG
compliant (with italic label below).
* app/widgets/gimpfiledialog.[ch]: use a GimpProgressBox intead of
implementing the progress bar again.
2005-03-25 Sven Neumann <sven@gimp.org>
* app/dialogs/file-save-dialog.c
* app/widgets/gimpfiledialog.[ch]: moved overwrite confirmation
dialog to app/widgets.
* app/widgets/gimpdnd-xds.c: set "Untitled.xcf" as default name
for untitled images; ask for confirmation before overwriting a
local file.
2005-01-13 Michael Natterer <mitch@gimp.org>
Made the file open and save dialogs use the last used folder
instead of defaulting to current directory. Fixes bug #162385.
* app/widgets/gimpfiledialog.[ch] (gimp_file_dialog_set_uri):
removed this function because it had no functionality except
creating usability problems.
* app/actions/file-commands.c: use gtk_file_chooser_set_uri()
instead but *only* if we already have an uri from an alread open
image or the document hinstory.
* app/widgets/gimpfiledialog.c (gimp_file_dialog_set_image): set
the file chooser's uri only if we have an uri from the image
itself. Leave the current folder untouched otherwise and just set
the current name (e.g. "Untitled").
* app/dialogs/file-save-dialog.c (file_save_dialog_save_image): on
successful save, remember the used uri by attaching it to the
"gimp" instance.
(file_save_dialog_new): set the last saved uri's folder on the
newly created file save dialog.
2004-11-16 Sven Neumann <sven@gimp.org>
* app/actions/file-commands.c
* app/dialogs/file-save-dialog.c
* app/file/file-save.[ch]
* app/widgets/gimpfiledialog.[ch]: combined "set_uri_and_proc" and
"set_image_clean" parameters into a single "save_a_copy"
parameter. When saving a copy, attach the used URI to the image and
let the "Save a Copy" file chooser default to the last used value.
2004-08-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.[ch]
(gimp_file_dialog_set_sensitive): new function which works on all
widgets in the dialog except the cancel button.
Remember if the active progress is cancelable and added two
booleans "busy" and "canceled". Added GtkDialog::response()
implementation which, if the dialog is busy, cancels the active
progress and sets the dialog's "canceled" state.
Moved the progress bar right above the action area so it is next
to the cancel button and in the same place for both open and save
dialogs.
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c: use the new API to make image loading
and saving cancelable again.
* app/widgets/gimpthumbbox.c: use the same stuff to make
thumbnailing cancelable. Increased the minimum height a bit so it
doesn't resize when the progress bars are shown.
2004-08-10 Michael Natterer <mitch@gimp.org>
Redid the whole internal progress stuff: don't pass around
progress_callback and progress_data; instead, provide a
pointer to a GimpProgressInterface which can be implemented
by a variety of backends.
Addresses (but not yet fixes) bugs #6010, #97266 and #135185.
* app/display/Makefile.am
* app/display/gimpprogress.[ch]: removed the old progress hack.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpprogress.[ch]: implement GimpProgressInterface.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpprogressdialog.[ch]: the standalone progress
dialog as widget implementing GimpProgressInterface.
* app/display/gimpdisplay.c
* app/display/gimpstatusbar.[ch]
* app/widgets/gimpfiledialog.[ch]
* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
implementation to these classes.
* app/core/gimp-gui.[ch]
* app/gui/gui-vtable.c: replaced the old progress vtable entries
by two new to create and destroy a GimpProgressDialog in case
no other progress is available.
* app/pdb/procedural_db.[ch]
* app/plug-in/plug-in-run.[ch]
* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
all plug-ins.
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-ins.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-progress.c: handle the case there the
plug-in was crated with a progress as well as the case where it
wasn't.
* app/app_procs.c
* app/batch.c
* app/xcf/xcf.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/widgets/gimphelp.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimpfontselect.c
* app/widgets/gimpgradientselect.c
* app/widgets/gimppaletteselect.c
* app/widgets/gimppatternselect.c: changed accordingly.
* app/core/gimpimagefile.[ch]
* app/display/gimpdisplayshell-dnd.c
* app/gui/file-open-dialog.c
* app/gui/file-open-location-dialog.c
* app/gui/file-save-dialog.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
related functions. Embed the progress in the file dialog where
possible.
* app/core/gimpdrawable-blend.[ch]
* app/core/gimpdrawable-transform.[ch]
* app/core/gimpimage-convert.[ch]
* app/core/gimpimage-flip.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-rotate.[ch]
* app/core/gimpimage-scale.[ch]
* app/core/gimpitem-linked.[ch]
* app/core/gimpitem.[ch]
* app/core/gimpchannel.c
* app/core/gimpdrawable.c
* app/core/gimplayer.c
* app/core/gimpselection.c
* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.
* app/tools/gimpblendtool.c
* app/tools/gimptransformtool.c
* app/gui/convert-dialog.c
* app/actions/documents-commands.c
* app/actions/file-commands.c
* app/actions/image-commands.c
* app/actions/layers-commands.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* tools/pdbgen/pdb/convert.pdb
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.
* app/pdb/*_cmds.c: regenerated.
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).
* app/actions/file-commands.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.[ch]: changed accordingly.
* plug-ins/common/bz2.c
* plug-ins/common/gz.c: don't register "xcf.gz" and "xcf.bz2"
extension. It's redundant and breaks the code that sets the
extension from the selected file-type.
* plug-ins/common/dicom.c: register a shorter menu label.
* plug-ins/common/gbr.c
* plug-ins/common/gih.c
* plug-ins/common/pat.c
* plug-ins/common/url.c: register stock icons.
2004-03-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.[ch] (gimp_file_dialog_set_uri):
new function which configures the dialog to load an image.
* app/gui/file-open-dialog.c: use it. Don't use file-dialog-utils
any more and allow setting the uri of an already visible file open
dialog.
* app/gui/file-dialog-utils.c: took the file open menu entries out
of that insane logic that makes the menus insensitive while any
file dialog is open.
2004-03-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.[ch] (gimp_file_dialog_set_image):
new function which configures the dialog to save an image.
* app/gui/file-save-dialog.c: use it.
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c: removed useless #inlcudes.
2004-02-27 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpfiledialog.[ch]: new widget swallowing most
of file-dialog-utils.[ch]'s functionality.
* app/widgets/widgets-types.h: added "gpointer callback_data" to
GimpItemFactorySetupFunc so the setup_funcs can create items in
the same context as the item factory's default items.
* app/widgets/gimpmenufactory.c (gimp_menu_factory_menu_new):
pass "callback_data" to setup_func().
* app/gui/file-open-menu.[ch]
* app/gui/file-save-menu.[ch]: use the passed callback_data
when creating the menus and attach the file_proc to the
menu items using g_object_set_data().
* app/gui/file-commands.[ch]: merged separate file type callbacks
for open and save dialogs into one callback which simply
calls gimp_file_dialog_set_file_proc().
* app/gui/file-dialog-utils.[ch]: removed file_dialog_new()
and file_dialog_set_proc().
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.[ch]: use the new widget and removed
global variables except the dialog pointer itself.
* app/gui/image-menu.[ch]
* app/gui/tool-options-menu.[ch]
* app/gui/toolbox-menu.[ch]: changed accordingly.