From 50871ba1c56ac9a939b7c23d53ae80fa9c9785c9 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 18 Oct 2007 16:10:49 +0000 Subject: [PATCH] ellipsize the profile label. If possible, use the profile description as 2007-10-18 Sven Neumann * modules/colorsel_cmyk_lcms.c: ellipsize the profile label. If possible, use the profile description as we do in other places. svn path=/trunk/; revision=23877 --- ChangeLog | 5 +++++ modules/colorsel_cmyk_lcms.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a0b3e4169..045c5805fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 Sven Neumann + + * modules/colorsel_cmyk_lcms.c: ellipsize the profile label. If + possible, use the profile description as we do in other places. + 2007-10-18 Michael Natterer * libgimpmodule/gimpmoduledb.c (gimp_module_db_module_initialize): diff --git a/modules/colorsel_cmyk_lcms.c b/modules/colorsel_cmyk_lcms.c index 53f4af0fd7..773368cf71 100644 --- a/modules/colorsel_cmyk_lcms.c +++ b/modules/colorsel_cmyk_lcms.c @@ -221,9 +221,9 @@ colorsel_cmyk_init (ColorselCmyk *module) module->name_label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (module->name_label), 0.0, 0.5); + gtk_label_set_ellipsize (GTK_LABEL (module->name_label), PANGO_ELLIPSIZE_END); gimp_label_set_attributes (GTK_LABEL (module->name_label), PANGO_ATTR_SCALE, PANGO_SCALE_SMALL, - PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC, -1); gtk_box_pack_start (GTK_BOX (module), module->name_label, FALSE, FALSE, 0); gtk_widget_show (module->name_label); @@ -403,10 +403,17 @@ colorsel_cmyk_config_changed (ColorselCmyk *module) ! (cmyk_profile = cmsOpenProfileFromFile (config->cmyk_profile, "r"))) goto out; - name = cmsTakeProductName (cmyk_profile); - if (! g_utf8_validate (name, -1, NULL)) + name = cmsTakeProductDesc (cmyk_profile); + if (name && ! g_utf8_validate (name, -1, NULL)) name = _("(invalid UTF-8 string)"); + if (! name) + { + name = cmsTakeProductName (cmyk_profile); + if (name && ! g_utf8_validate (name, -1, NULL)) + name = _("(invalid UTF-8 string)"); + } + text = g_strdup_printf (_("Profile: %s"), name); gtk_label_set_text (GTK_LABEL (module->name_label), text); g_free (text);