From 56994869cd04dd49d2c569ff5611425343f69fad Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 11 Jun 2010 09:53:08 +0200 Subject: [PATCH] libgimpwidgets: register descriptions for the GdkInputMode enum so the combo box in the input dialog shows proper labels and translations instead of GDK_MODE_FOO. --- libgimpwidgets/gimpwidgets-private.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libgimpwidgets/gimpwidgets-private.c b/libgimpwidgets/gimpwidgets-private.c index ca70ff6b2f..26ba4d07ea 100644 --- a/libgimpwidgets/gimpwidgets-private.c +++ b/libgimpwidgets/gimpwidgets-private.c @@ -30,6 +30,8 @@ #include "gimpstock.h" #include "gimpwidgets-private.h" +#include "libgimp/libgimp-intl.h" + #include "gimp-wilber-pixbufs.h" @@ -39,6 +41,23 @@ GimpGetColorFunc _gimp_get_background_func = NULL; GimpEnsureModulesFunc _gimp_ensure_modules_func = NULL; +static void +gimp_widgets_init_foreign_enums (void) +{ + static const GimpEnumDesc input_mode_descs[] = + { + { GDK_MODE_DISABLED, NC_("input-mode", "Disabled"), NULL }, + { GDK_MODE_SCREEN, NC_("input-mode", "Screen"), NULL }, + { GDK_MODE_WINDOW, NC_("input-mode", "Window"), NULL }, + { 0, NULL, NULL } + }; + + gimp_type_set_translation_domain (GDK_TYPE_INPUT_MODE, + GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (GDK_TYPE_INPUT_MODE, "input-mode"); + gimp_enum_set_value_descriptions (GDK_TYPE_INPUT_MODE, input_mode_descs); +} + void gimp_widgets_init (GimpHelpFunc standard_help_func, GimpGetColorFunc get_foreground_func, @@ -82,5 +101,7 @@ gimp_widgets_init (GimpHelpFunc standard_help_func, g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); + gimp_widgets_init_foreign_enums (); + gimp_widgets_initialized = TRUE; }