Commit 7f9379cb authored by Michael Natterer's avatar Michael Natterer 😴

Issue #1297 - Unhide the items hidden in the Advanced drop-down file...

...export dialogs

Remove the "Advanced" expander and have all options in plain sight.

Issue #701: Add a "Save color profile" toggle and always honor it.
parent a35b243f
......@@ -318,7 +318,8 @@ save_image (GFile *file,
gimp_file_get_utf8_name (file));
#ifdef TIFFTAG_ICCPROFILE
profile = gimp_image_get_color_profile (orig_image);
if (tsvals->save_profile)
profile = gimp_image_get_effective_color_profile (orig_image);
#endif
drawable_type = gimp_drawable_type (layer);
......@@ -1008,7 +1009,7 @@ save_dialog (TiffSaveVals *tsvals,
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "sv_alpha"));
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-alpha"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
has_alpha && tsvals->save_transp_pixels);
gtk_widget_set_sensitive (toggle, has_alpha);
......@@ -1023,34 +1024,45 @@ save_dialog (TiffSaveVals *tsvals,
G_CALLBACK (comment_entry_callback),
image_comment);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "sv_exif"));
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-exif"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
tsvals->save_exif);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&tsvals->save_exif);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "sv_xmp"));
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-xmp"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
tsvals->save_xmp);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&tsvals->save_xmp);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "sv_iptc"));
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-iptc"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
tsvals->save_iptc);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&tsvals->save_iptc);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "sv_thumbnail"));
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-thumbnail"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
tsvals->save_thumbnail);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&tsvals->save_thumbnail);
toggle = GTK_WIDGET (gtk_builder_get_object (builder, "save-color-profile"));
#ifdef TIFFTAG_ICCPROFILE
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
tsvals->save_profile);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&tsvals->save_profile);
#else
gtk_widget_hide (toggle);
#endif
gtk_widget_show (dialog);
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
......
......@@ -32,6 +32,7 @@ typedef struct
gboolean save_xmp;
gboolean save_iptc;
gboolean save_thumbnail;
gboolean save_profile;
} TiffSaveVals;
......
......@@ -89,7 +89,8 @@ static TiffSaveVals tsvals =
FALSE, /* save exif */
FALSE, /* save xmp */
FALSE, /* save iptc */
TRUE /* save thumbnail */
TRUE, /* save thumbnail */
TRUE /* save profile */
};
static gchar *image_comment = NULL;
......@@ -366,6 +367,7 @@ run (const gchar *name,
tsvals.save_xmp = (metadata_flags & GIMP_METADATA_SAVE_XMP) != 0;
tsvals.save_iptc = (metadata_flags & GIMP_METADATA_SAVE_IPTC) != 0;
tsvals.save_thumbnail = (metadata_flags & GIMP_METADATA_SAVE_THUMBNAIL) != 0;
tsvals.save_profile = gimp_export_color_profile ();
parasite = gimp_image_get_parasite (orig_image, "gimp-comment");
if (parasite)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkVBox" id="tiff_export_vbox">
<requires lib="gtk+" version="3.0"/>
<object class="GtkBox" id="tiff_export_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">11</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
......@@ -12,17 +15,11 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<object class="GtkBox" id="radio_button_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="radio_button_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
</object>
</child>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
</object>
</child>
</object>
......@@ -34,210 +31,111 @@
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator3">
<object class="GtkCheckButton" id="save-alpha">
<property name="label" translatable="yes">Save color values from transparent pixels</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox7">
<object class="GtkCheckButton" id="save-exif">
<property name="label" translatable="yes">Save Exif data</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="sv_alpha">
<property name="label" translatable="yes">Save color values from transparent pixels</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator2">
<object class="GtkCheckButton" id="save-xmp">
<property name="label" translatable="yes">Save XMP data</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<object class="GtkCheckButton" id="save-iptc">
<property name="label" translatable="yes">Save IPTC data</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="commentfield">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="commentlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Comment&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">4</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator1">
<object class="GtkCheckButton" id="save-thumbnail">
<property name="label" translatable="yes">Save thumbnail</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">5</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="expander1">
<object class="GtkCheckButton" id="save-color-profile">
<property name="label" translatable="yes">Save color profile</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkHBox" id="hbox2">
<object class="GtkEntry" id="commentfield">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="sv_exif">
<property name="label" translatable="yes">save Exif data</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="sv_xmp">
<property name="label" translatable="yes">save XMP data</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="sv_iptc">
<property name="label" translatable="yes">save IPTC data</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="sv_thumbnail">
<property name="label" translatable="yes">save thumbnail</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="can_focus">True</property>
<property name="margin_left">6</property>
<property name="invisible_char"></property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="adv_label">
<object class="GtkLabel" id="commentlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Advanced</property>
<property name="label" translatable="yes">&lt;b&gt;Comment&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
......@@ -245,7 +143,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">6</property>
<property name="position">11</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment