libgimpwidgets: make using GimpColorProfileComboBox easier

If the passed dialog is a GimpColorProfileChooserDialog, handle its
"response" signal automatically and also destroy it when the combo box
is destroyed (before we leaked all dialogs). Remove the same callback
from all places using GimpColorProfileComboBox.
This commit is contained in:
Michael Natterer
2014-04-04 17:09:54 +02:00
parent 40d42d113e
commit 661317f74c
4 changed files with 47 additions and 76 deletions

View File

@ -259,26 +259,6 @@ cdisplay_proof_convert_buffer (GimpColorDisplay *display,
}
}
static void
cdisplay_proof_file_chooser_dialog_response (GtkFileChooser *dialog,
gint response,
GimpColorProfileComboBox *combo)
{
if (response == GTK_RESPONSE_ACCEPT)
{
gchar *filename = gtk_file_chooser_get_filename (dialog);
if (filename)
{
gimp_color_profile_combo_box_set_active (combo, filename, NULL);
g_free (filename);
}
}
gtk_widget_hide (GTK_WIDGET (dialog));
}
static void
cdisplay_proof_profile_changed (GtkWidget *combo,
CdisplayProof *proof)
@ -314,10 +294,6 @@ cdisplay_proof_configure (GimpColorDisplay *display)
combo = gimp_color_profile_combo_box_new (dialog, history);
g_free (history);
g_signal_connect (dialog, "response",
G_CALLBACK (cdisplay_proof_file_chooser_dialog_response),
combo);
g_signal_connect (combo, "changed",
G_CALLBACK (cdisplay_proof_profile_changed),
proof);