[gimp] app: add a dest profile details view to the profile assign/convert dialog
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: add a dest profile details view to the profile assign/convert dialog
- Date: Wed, 26 Aug 2015 10:37:11 +0000 (UTC)
commit a66d867da906e82bcc44a9b41ea3177b3da26ceb
Author: Michael Natterer <mitch gimp org>
Date: Wed Aug 26 12:35:55 2015 +0200
app: add a dest profile details view to the profile assign/convert dialog
app/dialogs/color-profile-dialog.c | 60 +++++++++++++++++++++++++++++++++++-
1 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/app/dialogs/color-profile-dialog.c b/app/dialogs/color-profile-dialog.c
index 9ea6a3c..748ffdf 100644
--- a/app/dialogs/color-profile-dialog.c
+++ b/app/dialogs/color-profile-dialog.c
@@ -56,6 +56,7 @@ typedef struct
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *combo;
+ GtkWidget *dest_view;
GimpImage *image;
GimpProgress *progress;
@@ -76,6 +77,8 @@ static GtkWidget * color_profile_combo_box_new (ProfileDialog *dialog);
static void color_profile_dialog_response (GtkWidget *widget,
gint response_id,
ProfileDialog *dialog);
+static void color_profile_dest_changed (GtkWidget *combo,
+ ProfileDialog *dialog);
static void color_profile_dialog_free (ProfileDialog *dialog);
@@ -125,6 +128,8 @@ color_profile_dialog_new (GimpImage *image,
{
ProfileDialog *dialog;
GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *expander;
GtkWidget *label;
GimpColorProfile *src_profile;
@@ -222,10 +227,28 @@ color_profile_dialog_new (GimpImage *image,
gtk_box_pack_start (GTK_BOX (dialog->main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_container_add (GTK_CONTAINER (frame), vbox);
+ gtk_widget_show (vbox);
+
dialog->combo = color_profile_combo_box_new (dialog);
- gtk_container_add (GTK_CONTAINER (frame), dialog->combo);
+ gtk_box_pack_start (GTK_BOX (vbox), dialog->combo, FALSE, FALSE, 0);
gtk_widget_show (dialog->combo);
+ expander = gtk_expander_new_with_mnemonic (_("Profile _details"));
+ gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 0);
+ gtk_widget_show (expander);
+
+ dialog->dest_view = gimp_color_profile_view_new ();
+ gtk_container_add (GTK_CONTAINER (expander), dialog->dest_view);
+ gtk_widget_show (dialog->dest_view);
+
+ g_signal_connect (dialog->combo, "changed",
+ G_CALLBACK (color_profile_dest_changed),
+ dialog);
+
+ color_profile_dest_changed (dialog->combo, dialog);
+
if (convert)
{
GtkWidget *vbox;
@@ -426,6 +449,41 @@ color_profile_dialog_response (GtkWidget *widget,
}
static void
+color_profile_dest_changed (GtkWidget *combo,
+ ProfileDialog *dialog)
+{
+ GimpColorProfile *dest_profile = NULL;
+ GFile *file;
+ GError *error = NULL;
+
+ file = gimp_color_profile_combo_box_get_active_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo));
+
+ if (file)
+ {
+ dest_profile = gimp_color_profile_new_from_file (file, &error);
+ g_object_unref (file);
+ }
+ else
+ {
+ dest_profile = gimp_image_get_builtin_color_profile (dialog->image);
+ g_object_ref (dest_profile);
+ }
+
+ if (! dest_profile)
+ {
+ gimp_color_profile_view_set_error (GIMP_COLOR_PROFILE_VIEW (dialog->dest_view),
+ error->message);
+ g_clear_error (&error);
+ }
+ else
+ {
+ gimp_color_profile_view_set_profile (GIMP_COLOR_PROFILE_VIEW (dialog->dest_view),
+ dest_profile);
+ g_object_unref (dest_profile);
+ }
+}
+
+static void
color_profile_dialog_free (ProfileDialog *dialog)
{
g_slice_free (ProfileDialog, dialog);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]