Commit Graph

33 Commits

Author SHA1 Message Date
Michael Natterer 7da7bab09c app: get rid of icons in dialog buttons (use labels not stock IDs)
Nobody has them anymore, and they are deprecated in GTK+ 3.x. This
also fixes all conflicting mnemonics except those I missed, but we can
fix them now.
2017-02-12 16:18:54 +01:00
Michael Natterer eee29e6793 app: some formatting cleanup in the file dialog widgets
and remove "Gimp*" parameter from gimp_save,export_dialog_set_image(),
the dialog already knows its Gimp.
2016-01-06 14:10:36 +01:00
Michael Natterer bd9afce9e2 app: some cleanup in the new file dialog classes 2015-09-09 00:01:12 +02:00
Jehan 4441133a8b app: get_default_folder() is now a class method. 2015-09-08 23:13:03 +02:00
Jehan 829f5ec3d6 app: GimpFileDialog state saving now implemented as a class method.
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.
2015-09-02 20:05:11 +02:00
Jehan b17e1b1cfc app: split GimpFileDialog into Gimp(Open|Save|Export)Dialog subclasses.
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.
2015-09-02 20:05:01 +02:00
Michael Natterer 950f753ede Bug 736907 - Compat mode for XCF
- 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.
2014-10-20 22:54:11 +02:00
Michael Natterer 0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
Jehan 5c6c55e50a Bug 685557 - fix closing and saving a new image.
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.
2012-11-27 23:57:24 +09:00
Martin Nordholts 0971d61fc4 app: Add an 'export' mode to the file save dialog 2009-05-16 09:48:12 +02:00
Martin Nordholts 3025dac653 app: Introduce and use GimpFileChooserAction
Introduce and use GimpFileChooserAction in the core so that we can
differentiate Save from Export later.
2009-05-16 09:48:12 +02:00
Martin Nordholts a93346d0a0 app: Gather save dialog uri defaults in one place
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-05-01 12:23:46 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
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
2009-01-17 22:28:01 +00:00
Michael Natterer 321913dd6d Allow to "Open as Layers" in the empty display:
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-10-05 15:21:02 +00:00
Sven Neumann 62fdd17b23 added infrastructure to access and set some state information of the
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
2008-05-08 11:30:54 +00:00
Michael Natterer a4863593ec Close the display after "Save as" when invoked via the "Close Without
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
2007-01-20 19:38:09 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 086d0b6371 app/plug-in/plug-in-types.h renamed to GimpPlugInProcedure and made a
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.
2006-04-05 08:38:33 +00:00
Sven Neumann 905fdfcbed did a global gimage -> image substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
2006-03-28 17:08:36 +00:00
Michael Natterer e397c0ef0a set the new "do-overwrite-confirmation" property on GtkFileChooser.
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-12-28 20:02:54 +00:00
Michael Natterer 14b9312a72 app/widgets/gimpprogressbox.c made progress bars HIG compliant (with
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-09-28 21:20:05 +00:00
Sven Neumann f6cb341c3c app/dialogs/file-save-dialog.c moved overwrite confirmation dialog to
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-03-25 20:18:55 +00:00
Michael Natterer 4f97f7a5f9 Made the file open and save dialogs use the last used folder instead of
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.
2005-01-13 17:41:48 +00:00
Sven Neumann d4bf381c20 app/actions/file-commands.c app/dialogs/file-save-dialog.c
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-11-16 13:37:36 +00:00
Michael Natterer 95607cce19 new function which works on all widgets in the dialog except the cancel
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 21:20:38 +00:00
Michael Natterer 02d2b990f5 Redid the whole internal progress stuff: don't pass around
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-08-10 18:47:21 +00:00
Sven Neumann ccf8ed69e7 app/widgets/Makefile.am app/widgets/widgets-types.h added new widget that
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-07-16 21:24:39 +00:00
Michael Natterer 0e1af3ee5a app/actions/Makefile.am app/actions/file-open-actions.[ch] actions for the
2004-04-29  Michael Natterer  <mitch@gimp.org>

	* app/actions/Makefile.am
	* app/actions/file-open-actions.[ch]
	* app/actions/file-save-actions.[ch]: actions for the <Load> and
	<Save> menus...

	* menus/Makefile.am
	* menus/file-open-menu.xml
	* menus/file-save-menu.xml: ...and the menus.

	* app/gui/file-open-menu.[ch]
	* app/gui/file-save-menu.[ch]: ported to UI Manager.

	* app/widgets/gimpfiledialog.[ch]: ditto.

	* app/actions/actions.c
	* app/gui/menus.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c: changed accordingly.

	* app/widgets/gimpuimanager.c: removed debugging code which
	automatically loaded all registered menus. They are now loaded on
2004-04-29 17:47:53 +00:00
Michael Natterer 2f2301c905 derive it from GtkFileChooser instead of GtkFileSelection.
2004-04-15  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpfiledialog.[ch]: derive it from GtkFileChooser
	instead of GtkFileSelection.

	* app/gui/file-dialog-utils.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimpthumbbox.c: changed accordingly.

	* app/gui/gradients-commands.c
	* app/gui/vectors-commands.c
	* app/tools/gimpimagemaptool.c
	* app/widgets/gimperrorconsole.c
	* app/widgets/gimptexteditor.c
	* libgimpwidgets/gimpfileentry.c: use file choosers instead of
	file selectors.
2004-04-15 16:28:26 +00:00
Michael Natterer 4a199a3e48 new function which configures the dialog to load an image.
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 13:40:46 +00:00
Michael Natterer ca2f7f88de new function which configures the dialog to save an image.
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-03-01 12:27:33 +00:00
Michael Natterer 705114f02f added unused "GSList *file_procs" parameter.
2004-03-01  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpfiledialog.[ch] (gimp_file_dialog_new): added
	unused "GSList *file_procs" parameter.

	* app/gui/file-open-dialog.c: pass gimp->load_procs.
	* app/gui/file-save-dialog.c: pass gimp->save_procs.
2004-03-01 11:57:38 +00:00
Michael Natterer 527aa849cb app/widgets/Makefile.am app/widgets/widgets-types.h new widget swallowing
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.
2004-02-27 14:20:19 +00:00