mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 09:23:24 +00:00
Merge branch 'DefaultExportTypeAlways2' into 'master'
Optionally always offer default file type when exporting (take 2) See merge request GNOME/gimp!1149
This commit is contained in:
commit
8751fca061
6 changed files with 43 additions and 8 deletions
|
@ -115,6 +115,7 @@ enum
|
|||
PROP_IMPORT_ADD_ALPHA,
|
||||
PROP_IMPORT_RAW_PLUG_IN,
|
||||
PROP_EXPORT_FILE_TYPE,
|
||||
PROP_EXPORT_FILE_TYPE_ALWAYS,
|
||||
PROP_EXPORT_COLOR_PROFILE,
|
||||
PROP_EXPORT_COMMENT,
|
||||
PROP_EXPORT_THUMBNAIL,
|
||||
|
@ -751,6 +752,13 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
|
|||
GIMP_EXPORT_FILE_PNG,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_FILE_TYPE_ALWAYS,
|
||||
"export-file-type-always",
|
||||
"Always offer default export file type",
|
||||
EXPORT_FILE_TYPE_ALWAYS_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_COLOR_PROFILE,
|
||||
"export-color-profile",
|
||||
"Export Color Profile",
|
||||
|
@ -1174,6 +1182,9 @@ gimp_core_config_set_property (GObject *object,
|
|||
case PROP_EXPORT_FILE_TYPE:
|
||||
core_config->export_file_type = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_EXPORT_FILE_TYPE_ALWAYS:
|
||||
core_config->export_file_type_always = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_EXPORT_COLOR_PROFILE:
|
||||
core_config->export_color_profile = g_value_get_boolean (value);
|
||||
break;
|
||||
|
@ -1442,6 +1453,9 @@ gimp_core_config_get_property (GObject *object,
|
|||
case PROP_EXPORT_FILE_TYPE:
|
||||
g_value_set_enum (value, core_config->export_file_type);
|
||||
break;
|
||||
case PROP_EXPORT_FILE_TYPE_ALWAYS:
|
||||
g_value_set_boolean (value, core_config->export_file_type_always);
|
||||
break;
|
||||
case PROP_EXPORT_COLOR_PROFILE:
|
||||
g_value_set_boolean (value, core_config->export_color_profile);
|
||||
break;
|
||||
|
|
|
@ -99,6 +99,7 @@ struct _GimpCoreConfig
|
|||
gboolean import_add_alpha;
|
||||
gchar *import_raw_plug_in;
|
||||
GimpExportFileType export_file_type;
|
||||
gboolean export_file_type_always;
|
||||
gboolean export_color_profile;
|
||||
gboolean export_comment;
|
||||
gboolean export_thumbnail;
|
||||
|
|
|
@ -232,6 +232,9 @@ _("Which plug-in to use for importing raw digital camera files.")
|
|||
#define EXPORT_FILE_TYPE_BLURB \
|
||||
_("Export file type used by default.")
|
||||
|
||||
#define EXPORT_FILE_TYPE_ALWAYS_BLURB \
|
||||
_("Always offer the default export file type when exporting.")
|
||||
|
||||
#define EXPORT_COLOR_PROFILE_BLURB \
|
||||
_("Export the image's color profile by default.")
|
||||
|
||||
|
|
|
@ -1604,6 +1604,15 @@ prefs_dialog_new (Gimp *gimp,
|
|||
_("Default export file t_ype:"),
|
||||
GTK_GRID (grid), 0, size_group);
|
||||
|
||||
button = prefs_check_button_add (object, "export-file-type-always",
|
||||
/* Translators: label for
|
||||
* configuration option (checkbox).
|
||||
* If selected the default export file type is always
|
||||
* offered when exporting even if the file type is known..
|
||||
*/
|
||||
_("Always offer the default file type when exporting"),
|
||||
GTK_BOX (vbox2));
|
||||
|
||||
/* Raw Image Importer */
|
||||
vbox2 = prefs_frame_new (_("Raw Image Importer"),
|
||||
GTK_CONTAINER (vbox), TRUE);
|
||||
|
|
|
@ -165,16 +165,19 @@ gimp_export_dialog_set_image (GimpExportDialog *dialog,
|
|||
* 4. Default file type set in Preferences
|
||||
*/
|
||||
|
||||
if (! image->gimp->config->export_file_type_always)
|
||||
{
|
||||
ext_file = gimp_image_get_exported_file (image);
|
||||
|
||||
if (! ext_file)
|
||||
if (ext_file == NULL)
|
||||
ext_file = gimp_image_get_imported_file (image);
|
||||
|
||||
if (! ext_file)
|
||||
if (ext_file == NULL)
|
||||
ext_file = g_object_get_data (G_OBJECT (file_dialog->gimp),
|
||||
GIMP_FILE_EXPORT_LAST_FILE_KEY);
|
||||
}
|
||||
|
||||
if (ext_file)
|
||||
if (ext_file != NULL)
|
||||
{
|
||||
g_object_ref (ext_file);
|
||||
}
|
||||
|
@ -193,7 +196,7 @@ gimp_export_dialog_set_image (GimpExportDialog *dialog,
|
|||
g_free (uri);
|
||||
}
|
||||
|
||||
if (ext_file)
|
||||
if (ext_file != NULL)
|
||||
{
|
||||
GFile *tmp_file = gimp_file_with_new_extension (name_file, ext_file);
|
||||
basename = g_path_get_basename (gimp_file_get_utf8_name (tmp_file));
|
||||
|
|
|
@ -365,6 +365,11 @@
|
|||
#
|
||||
# (export-file-type png)
|
||||
|
||||
# Always offer the default file type when exporting an image file. Possible
|
||||
# values are yes and no
|
||||
#
|
||||
# (export-file-type-always no)
|
||||
|
||||
# Export the image's color profile by default. Possible values are yes and
|
||||
# no.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue