[gnome-control-center] common: gdm-languages moved to gnome-desktop as gnome-languages



commit 7221f9cd5468c7a3c422e381f069f85bc25b02a4
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Jan 23 19:25:36 2013 +0100

    common: gdm-languages moved to gnome-desktop as gnome-languages
    
    That code is useful for other core desktop modules.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692414

 configure.ac                               |    8 +-
 panels/common/Makefile.am                  |   13 +-
 panels/common/cc-common-language.c         |   51 +-
 panels/common/cc-language-chooser.c        |    1 -
 panels/common/gdm-languages.c              | 1326 ----------------------------
 panels/common/gdm-languages.h              |   44 -
 panels/common/list-languages.c             |   43 -
 panels/common/locarchive.h                 |   97 --
 panels/region/gnome-region-panel-formats.c |    6 +-
 panels/region/gnome-region-panel-input.c   |    1 -
 panels/region/gnome-region-panel-lang.c    |    1 -
 panels/region/gnome-region-panel-system.c  |   10 +-
 12 files changed, 37 insertions(+), 1564 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 79c14cd..3b0be21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@ GSD_REQUIRED_VERSION=3.7.3
 NETWORK_MANAGER_REQUIRED_VERSION=0.9.6.4
 NETWORK_MANAGER_APPLET_REQUIRED_VERSION=0.9.7
 LIBNOTIFY_REQUIRED_VERSION=0.7.3
-GNOME_DESKTOP_REQUIRED_VERSION=3.5.91
+GNOME_DESKTOP_REQUIRED_VERSION=3.7.5
 SCHEMAS_REQUIRED_VERSION=3.7.2.2
 LIBWACOM_REQUIRED_VERSION=0.7
 CLUTTER_REQUIRED_VERSION=1.11.3
@@ -280,12 +280,6 @@ case $host_os in
 esac
 AM_CONDITIONAL(BUILD_WACOM, [test x"$have_wacom" = x"yes"])
 
-# This is a hard-dependency for the region and user-accounts panels
-PKG_CHECK_MODULES(ISOCODES, iso-codes)
-
-AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
-ISO_CODES=iso-codes
-
 # Kerberos kerberos support
 AC_PATH_PROG(KRB5_CONFIG, krb5-config, no)
 if test "$KRB5_CONFIG" = "no"; then
diff --git a/panels/common/Makefile.am b/panels/common/Makefile.am
index d8abed3..e262d3b 100644
--- a/panels/common/Makefile.am
+++ b/panels/common/Makefile.am
@@ -2,14 +2,10 @@
 cappletname = common
 
 noinst_LTLIBRARIES = liblanguage.la
-noinst_PROGRAMS = list-languages
 
 AM_CPPFLAGS =						\
 	$(PANEL_CFLAGS)					\
-	$(LIBLANGUAGE_CFLAGS)				\
-	-DDATADIR=\""$(datadir)"\"			\
-	-DLIBLOCALEDIR=\""$(prefix)/lib/locale"\"       \
-	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
+	$(LIBLANGUAGE_CFLAGS)
 
 BUILT_SOURCES =			\
 	cc-common-resources.c	\
@@ -17,9 +13,6 @@ BUILT_SOURCES =			\
 
 liblanguage_la_SOURCES =		\
 	$(BUILT_SOURCES)		\
-	gdm-languages.h 		\
-	gdm-languages.c 		\
-	locarchive.h			\
 	cc-common-language.c		\
 	cc-common-language.h		\
 	cc-language-chooser.c		\
@@ -28,10 +21,6 @@ liblanguage_la_SOURCES =		\
 liblanguage_la_LIBADD = 		\
 	$(LIBLANGUAGE_LIBS)
 
-list_languages_SOURCES = list-languages.c
-list_languages_LDADD = liblanguage.la
-list_languages_CFLAGS = $(LIBLANGUAGE_CFLAGS)
-
 resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/common.gresource.xml)
 cc-common-resources.c: common.gresource.xml $(resource_files)
 	$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_common $<
diff --git a/panels/common/cc-common-language.c b/panels/common/cc-common-language.c
index 727937d..4c496da 100644
--- a/panels/common/cc-common-language.c
+++ b/panels/common/cc-common-language.c
@@ -30,9 +30,10 @@
 
 #include <fontconfig/fontconfig.h>
 
-#include "cc-common-language.h"
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-languages.h>
 
-#include "gdm-languages.h"
+#include "cc-common-language.h"
 
 static char *get_lang_for_user_object_path (const char *path);
 
@@ -112,13 +113,13 @@ iter_for_language (GtkTreeModel *model,
                 g_free (l);
         } while (gtk_tree_model_iter_next (model, iter));
 
-        name = gdm_normalize_language_name (lang);
+        name = gnome_normalize_language_name (lang);
         if (name != NULL) {
                 if (region) {
-                        language = gdm_get_region_from_name (name, NULL);
+                        language = gnome_get_region_from_name (name, NULL);
                 }
                 else {
-                        language = gdm_get_language_from_name (name, NULL);
+                        language = gnome_get_language_from_name (name, NULL);
                 }
 
                 gtk_list_store_insert_with_values (GTK_LIST_STORE (model),
@@ -166,7 +167,7 @@ cc_common_language_has_font (const gchar *locale)
         object_set = NULL;
         font_set = NULL;
 
-        if (!gdm_parse_language_name (locale, &language_code, NULL, NULL, NULL))
+        if (!gnome_parse_language_name (locale, &language_code, NULL, NULL, NULL))
                 return FALSE;
 
         charset = FcLangGetCharSet ((FcChar8 *) language_code);
@@ -241,7 +242,7 @@ add_one_language (gpointer d)
     return FALSE;
   }
 
-  name = gdm_normalize_language_name (data->languages[data->position]);
+  name = gnome_normalize_language_name (data->languages[data->position]);
   if (g_hash_table_lookup (data->user_langs, name) != NULL) {
     g_free (name);
     goto next;
@@ -253,10 +254,10 @@ add_one_language (gpointer d)
   }
 
   if (data->regions) {
-    language = gdm_get_region_from_name (name, NULL);
+    language = gnome_get_region_from_name (name, NULL);
   }
   else {
-    language = gdm_get_language_from_name (name, NULL);
+    language = gnome_get_language_from_name (name, NULL);
   }
   if (!language) {
     g_debug ("Ignoring '%s' as a locale, because we couldn't figure the language name", name);
@@ -291,7 +292,7 @@ cc_common_language_add_available_languages (GtkListStore *store,
 
   data->store = g_object_ref (store);
   data->user_langs = g_hash_table_ref (user_langs);
-  data->languages = gdm_get_all_language_names ();
+  data->languages = gnome_get_all_language_names ();
   data->regions = regions;
   data->position = 0;
 
@@ -313,7 +314,7 @@ cc_common_language_get_current_language (void)
 
         locale = (const gchar *) setlocale (LC_MESSAGES, NULL);
         if (locale)
-                language = gdm_normalize_language_name (locale);
+                language = gnome_normalize_language_name (locale);
         else
                 language = NULL;
 
@@ -466,17 +467,17 @@ user_language_has_translations (const char *locale)
         char *name, *language_code, *territory_code;
         gboolean ret;
 
-        gdm_parse_language_name (locale,
-                                 &language_code,
-                                 &territory_code,
-                                 NULL, NULL);
+        gnome_parse_language_name (locale,
+                                   &language_code,
+                                   &territory_code,
+                                   NULL, NULL);
         name = g_strdup_printf ("%s%s%s",
                                 language_code,
                                 territory_code != NULL? "_" : "",
                                 territory_code != NULL? territory_code : "");
         g_free (language_code);
         g_free (territory_code);
-        ret = gdm_language_has_translations (name);
+        ret = gnome_language_has_translations (name);
         g_free (name);
 
         return ret;
@@ -556,9 +557,9 @@ add_other_users_language (GHashTable *ht)
                 if (lang != NULL && *lang != '\0' &&
                     cc_common_language_has_font (lang) &&
                     user_language_has_translations (lang)) {
-                        name = gdm_normalize_language_name (lang);
+                        name = gnome_normalize_language_name (lang);
                         if (!g_hash_table_lookup (ht, name)) {
-                                language = gdm_get_language_from_name (name, NULL);
+                                language = gnome_get_language_from_name (name, NULL);
                                 g_hash_table_insert (ht, name, language);
                         }
                         else {
@@ -587,9 +588,9 @@ insert_language (GHashTable *ht,
 	char *label;
 	char *key;
 
-	if (gdm_language_has_translations (long_lang))
+	if (gnome_language_has_translations (long_lang))
 		lang = long_lang;
-	else if (short_lang != NULL && gdm_language_has_translations (short_lang))
+	else if (short_lang != NULL && gnome_language_has_translations (short_lang))
 		lang = short_lang;
 	else {
 		g_warning ("%s lacks translations, why is it default?", long_lang);
@@ -662,7 +663,7 @@ cc_common_language_get_user_languages (void)
         /* Add current locale */
         name = cc_common_language_get_current_language ();
         if (g_hash_table_lookup (ht, name) == NULL) {
-                language = gdm_get_language_from_name (name, NULL);
+                language = gnome_get_language_from_name (name, NULL);
                 g_hash_table_insert (ht, name, language);
         } else {
                 g_free (name);
@@ -690,14 +691,14 @@ cc_common_language_get_initial_regions (const gchar *lang)
         g_hash_table_insert (ht, g_strdup ("zh_CN.utf8"), g_strdup (_("China")));
 #endif
 
-        gdm_parse_language_name (lang, &language, NULL, NULL, NULL);
-        langs = gdm_get_all_language_names ();
+        gnome_parse_language_name (lang, &language, NULL, NULL, NULL);
+        langs = gnome_get_all_language_names ();
         for (i = 0; langs[i]; i++) {
                 gchar *l, *s;
-                gdm_parse_language_name (langs[i], &l, NULL, NULL, NULL);
+                gnome_parse_language_name (langs[i], &l, NULL, NULL, NULL);
                 if (g_strcmp0 (language, l) == 0) {
                         if (!g_hash_table_lookup (ht, langs[i])) {
-                                s = gdm_get_region_from_name (langs[i], NULL);
+                                s = gnome_get_region_from_name (langs[i], NULL);
                                 g_hash_table_insert (ht, g_strdup (langs[i]), s);
                         }
                 }
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index 76adbe8..63161c4 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -34,7 +34,6 @@
 #include "cc-language-chooser.h"
 #include "cc-common-language.h"
 #include "cc-common-resources.h"
-#include "gdm-languages.h"
 
 gchar *
 cc_language_chooser_get_language (GtkWidget *chooser)
diff --git a/panels/region/gnome-region-panel-formats.c b/panels/region/gnome-region-panel-formats.c
index f2dd374..4bbd929 100644
--- a/panels/region/gnome-region-panel-formats.c
+++ b/panels/region/gnome-region-panel-formats.c
@@ -27,9 +27,11 @@
 #include <locale.h>
 #include <langinfo.h>
 #include <stdlib.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-languages.h>
+
 #include "cc-common-language.h"
 #include "cc-language-chooser.h"
-#include "gdm-languages.h"
 #include "gnome-region-panel-formats.h"
 
 static void
@@ -237,7 +239,7 @@ populate_regions (GtkBuilder *builder, const gchar *current_lang)
                 current_region = g_strdup (current_lang);
         }
         else if (!g_hash_table_lookup (ht, current_region)) {
-                name = gdm_get_region_from_name (current_region, NULL);
+                name = gnome_get_region_from_name (current_region, NULL);
                 g_hash_table_insert (ht, g_strdup (current_region), name);
         }
 
diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c
index 28fad59..679fe03 100644
--- a/panels/region/gnome-region-panel-input.c
+++ b/panels/region/gnome-region-panel-input.c
@@ -34,7 +34,6 @@
 #include <ibus.h>
 #endif
 
-#include "gdm-languages.h"
 #include "gnome-region-panel-input.h"
 
 #define WID(s) GTK_WIDGET(gtk_builder_get_object (builder, s))
diff --git a/panels/region/gnome-region-panel-lang.c b/panels/region/gnome-region-panel-lang.c
index dbb3761..c9499d1 100644
--- a/panels/region/gnome-region-panel-lang.c
+++ b/panels/region/gnome-region-panel-lang.c
@@ -32,7 +32,6 @@
 #include "gnome-region-panel-system.h"
 #include "cc-common-language.h"
 #include "cc-language-chooser.h"
-#include "gdm-languages.h"
 
 static GDBusProxy *proxy = NULL;
 static GDBusProxy *sm_proxy = NULL;
diff --git a/panels/region/gnome-region-panel-system.c b/panels/region/gnome-region-panel-system.c
index 6f7e994..d82aba0 100644
--- a/panels/region/gnome-region-panel-system.c
+++ b/panels/region/gnome-region-panel-system.c
@@ -30,10 +30,10 @@
 #include <glib/gi18n.h>
 
 #define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-languages.h>
 #include <libgnome-desktop/gnome-xkb-info.h>
 
 #include "cc-common-language.h"
-#include "gdm-languages.h"
 #include "gnome-region-panel-system.h"
 
 #define WID(s) GTK_WIDGET(gtk_builder_get_object (dialog, s))
@@ -106,7 +106,7 @@ locale_settings_changed (GSettings *settings,
                 region = g_strdup ((gchar*)g_object_get_data (G_OBJECT (label), "language"));
         }
 
-        display_region = gdm_get_region_from_name (region, NULL);
+        display_region = gnome_get_region_from_name (region, NULL);
         label = WID ("user_format");
         gtk_label_set_text (GTK_LABEL (label), display_region);
         g_object_set_data_full (G_OBJECT (label), "region", g_strdup (region), g_free);
@@ -122,7 +122,7 @@ system_update_language (GtkBuilder *dialog, const gchar *language)
         gchar *display_language;
         GtkWidget *label;
 
-        display_language = gdm_get_language_from_name (language, NULL);
+        display_language = gnome_get_language_from_name (language, NULL);
         label = WID ("user_display_language");
         gtk_label_set_text (GTK_LABEL (label), display_language);
         g_object_set_data_full (G_OBJECT (label), "language", g_strdup (language), g_free);
@@ -283,7 +283,7 @@ on_localed_properties_changed (GDBusProxy   *proxy,
                 }
 
                 if (messages) {
-                        name = gdm_get_language_from_name (messages, NULL);
+                        name = gnome_get_language_from_name (messages, NULL);
                         label = WID ("system_display_language");
                         gtk_label_set_text (GTK_LABEL (label), name);
                         g_free (name);
@@ -291,7 +291,7 @@ on_localed_properties_changed (GDBusProxy   *proxy,
                 }
 
                 if (time) {
-                        name = gdm_get_region_from_name (time, NULL);
+                        name = gnome_get_region_from_name (time, NULL);
                         label = WID ("system_format");
                         gtk_label_set_text (GTK_LABEL (label), name);
                         g_free (name);



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