[gimp] libgimpwidgets: register descriptions for the GdkInputMode enum
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: register descriptions for the GdkInputMode enum
- Date: Fri, 11 Jun 2010 07:54:43 +0000 (UTC)
commit 56994869cd04dd49d2c569ff5611425343f69fad
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 11 09:53:08 2010 +0200
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 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libgimpwidgets/gimpwidgets-private.c b/libgimpwidgets/gimpwidgets-private.c
index ca70ff6..26ba4d0 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]