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.
This commit is contained in:
Michael Natterer 2010-06-11 09:53:08 +02:00
parent e827e7f1bf
commit 56994869cd
1 changed files with 21 additions and 0 deletions

View File

@ -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;
}