[gimp/gtk3-port: 222/226] Use GTK+3 gtk_get_locale_direction() function instead of current hack.



commit f43643e38d67a939d8c290a8b7b046b853d8b80b
Author: Jehan <jehan girinstud io>
Date:   Thu Jan 16 15:50:58 2014 +1300

    Use GTK+3 gtk_get_locale_direction() function instead of current hack.
    
    This new function is available from the released dev version 3.11.4. But
    we don't want to require GTK+ master for the gtk3-port branch, so I
    leave the old hack in a GTK_CHECK_VERSION() macro, to be removed later
    when we update GTK+ required version.

 app/gui/gui.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/app/gui/gui.c b/app/gui/gui.c
index fc24ba7..8dc7298 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -201,21 +201,27 @@ gui_init (Gimp     *gimp,
 
   the_gui_gimp = gimp;
 
+  /* Normally this should have been taken care of during command line
+   * parsing as a post-parse hook of gtk_get_option_group(), using the
+   * system locales.
+   * But user config may have overriden the language, therefore we must
+   * check the widget directions again.
+   */
+#if GTK_CHECK_VERSION (3, 11, 4)
+  gtk_widget_set_default_direction (gtk_get_locale_direction ());
+  /* TODO: remove the below hack once the GTK+ required version is
+   * 3.11.4 or higher. */
+#else
   /* TRANSLATORS: there is no need to translate this in GIMP. This uses
    * "gtk20" domain as a special trick to determine language direction,
    * but xgettext extracts it anyway mistakenly into GIMP po files.
    * Leave an empty string as translation. It does not matter.
    */
   if (g_strcmp0 (dgettext ("gtk20", "default:LTR"), "default:RTL") == 0)
-    /* Normally this should have been taken care of during command line
-     * parsing as a post-parse hook of gtk_get_option_group(), using the
-     * system locales.
-     * But user config may have overriden the language, therefore we must
-     * check the widget directions again.
-     */
     gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
   else
     gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
+#endif
 
   gui_unique_init (gimp);
   gimp_language_store_parser_init ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]