[gnome-initial-setup] welcome-page: Start to reform
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] welcome-page: Start to reform
- Date: Fri, 13 Jul 2012 03:35:43 +0000 (UTC)
commit 569f4a913d4663fb35db06aa96f273b6b60d0ec3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jul 12 16:43:38 2012 -0400
welcome-page: Start to reform
Make it into a language selector
gnome-initial-setup/Makefile.am | 5 +-
gnome-initial-setup/gis-welcome-page.c | 241 ++++++++++++--
gnome-initial-setup/gis-welcome-page.ui | 73 ++---
gnome-initial-setup/languages/Makefile.am | 4 +-
gnome-initial-setup/languages/cc-common-language.c | 361 --------------------
gnome-initial-setup/languages/cc-common-language.h | 23 --
.../languages/cc-language-chooser.c | 343 -------------------
.../languages/cc-language-chooser.h | 38 --
gnome-initial-setup/setup.gresource.xml | 3 -
gnome-initial-setup/welcome-image.png | Bin 142308 -> 0 bytes
10 files changed, 256 insertions(+), 835 deletions(-)
---
diff --git a/gnome-initial-setup/Makefile.am b/gnome-initial-setup/Makefile.am
index 64713f0..45c39f6 100644
--- a/gnome-initial-setup/Makefile.am
+++ b/gnome-initial-setup/Makefile.am
@@ -35,7 +35,7 @@ UI_FILES = \
gis-goa-page.ui \
gis-summary-page.ui
-setup_resources.c: setup.gresource.xml $(UI_FILES) welcome-image.png
+setup_resources.c: setup.gresource.xml $(UI_FILES)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/setup.gresource.xml
BUILT_SOURCES += setup_resources.c
@@ -69,6 +69,9 @@ gnome_initial_setup_SOURCES = \
tz.c tz.h \
$(BUILT_SOURCES)
+gnome_initial_setup_LDADD = \
+ languages/liblanguage.la
+
autostartdir = $(sysconfdir)/xdg/autostart
autostart_DATA = welcome-tour.desktop
diff --git a/gnome-initial-setup/gis-welcome-page.c b/gnome-initial-setup/gis-welcome-page.c
index 66b3524..fae06c3 100644
--- a/gnome-initial-setup/gis-welcome-page.c
+++ b/gnome-initial-setup/gis-welcome-page.c
@@ -5,50 +5,243 @@
#include "config.h"
#include "gis-welcome-page.h"
+#include <locale.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
+#include "languages/cc-common-language.h"
+#include "languages/gdm-languages.h"
+
#define OBJ(type,name) ((type)gtk_builder_get_object(builder,(name)))
#define WID(name) OBJ(GtkWidget*,name)
+typedef struct _WelcomeData WelcomeData;
+
+struct _WelcomeData {
+ SetupData *setup;
+
+ GtkWidget *show_all;
+ GtkWidget *page;
+ GtkTreeModel *liststore;
+ gchar *locale_id;
+};
+
+enum {
+ COL_LOCALE_ID,
+ COL_LOCALE_NAME,
+ COL_IS_EXTRA,
+ NUM_COLS,
+};
+
+static void
+sync_language (WelcomeData *data)
+{
+ setlocale (LC_MESSAGES, data->locale_id);
+
+ /* XXX more to do */
+ g_object_set_data (G_OBJECT (data->page), "gis-page-title", _("Welcome"));
+}
+
+static gint
+sort_languages (GtkTreeModel *model,
+ GtkTreeIter *a,
+ GtkTreeIter *b,
+ gpointer data)
+{
+ char *la, *lb;
+ gboolean iea, ieb;
+ gint result;
+
+ gtk_tree_model_get (model, a,
+ COL_LOCALE_NAME, &la,
+ COL_IS_EXTRA, &iea,
+ -1);
+ gtk_tree_model_get (model, b,
+ COL_LOCALE_NAME, &lb,
+ COL_IS_EXTRA, &ieb,
+ -1);
+
+ if (iea != ieb) {
+ return ieb - iea;
+ } else {
+ result = strcmp (la, lb);
+ }
+
+ g_free (la);
+ g_free (lb);
+
+ return result;
+}
+
+static char *
+lgettext (char *locale_id,
+ char *string)
+{
+ char *orig_locale_id = setlocale (LC_MESSAGES, locale_id);
+ char *result = gettext(string);
+ setlocale (LC_MESSAGES, orig_locale_id);
+ return result;
+}
+
+static char *
+use_language (char *locale_id)
+{
+ char *use, *language;
+
+ /* Translators: the parameter here is your language's name, like
+ * "Use English", "Deutsch verwenden", etc. */
+ use = N_("Use %s");
+ use = lgettext (locale_id, use);
+
+ language = gdm_get_language_from_name (locale_id, locale_id);
+
+ return g_strdup_printf (use, language);
+}
+
+static void
+select_locale_id (GtkTreeView *treeview,
+ char *locale_id)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gboolean cont;
+
+ model = gtk_tree_view_get_model (treeview);
+ cont = gtk_tree_model_get_iter_first (model, &iter);
+ while (cont) {
+ char *iter_locale_id;
+
+ gtk_tree_model_get (model, &iter,
+ COL_LOCALE_ID, &iter_locale_id,
+ -1);
+
+ if (iter_locale_id == NULL)
+ continue;
+
+ if (g_str_equal (locale_id, iter_locale_id)) {
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection (treeview);
+ gtk_tree_selection_select_iter (selection, &iter);
+ g_free (iter_locale_id);
+ break;
+ }
+
+ g_free (iter_locale_id);
+ cont = gtk_tree_model_iter_next (model, &iter);
+ }
+}
+
+static void
+select_current_locale (GtkTreeView *treeview)
+{
+ gchar *current_language = cc_common_language_get_current_language ();
+ select_locale_id (treeview, current_language);
+ g_free (current_language);
+}
+
+static void
+add_languages (GtkListStore *liststore,
+ char **locale_ids,
+ GHashTable *initial)
+{
+ while (*locale_ids) {
+ gchar *locale_id;
+ gchar *locale_name;
+ gboolean is_extra;
+ GtkTreeIter iter;
+
+ locale_id = *locale_ids;
+
+ if (!cc_common_language_has_font (locale_id))
+ continue;
+
+ is_extra = (g_hash_table_lookup (initial, locale_id) != NULL);
+ locale_name = use_language (locale_id);
+
+ gtk_list_store_insert_with_values (liststore, &iter, -1,
+ COL_LOCALE_ID, locale_id,
+ COL_LOCALE_NAME, locale_name,
+ COL_IS_EXTRA, is_extra,
+ -1);
+
+ locale_ids ++;
+ }
+}
+
+static void
+add_all_languages (GtkListStore *liststore)
+{
+ char **locale_ids = gdm_get_all_language_names ();
+ GHashTable *initial = cc_common_language_get_initial_languages ();
+
+ add_languages (liststore, locale_ids, initial);
+}
+
+static gboolean
+language_visible (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer user_data)
+{
+ WelcomeData *data = user_data;
+ gboolean is_extra;
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->show_all)))
+ return TRUE;
+
+ gtk_tree_model_get (model, iter,
+ COL_IS_EXTRA, &is_extra,
+ -1);
+
+ return is_extra;
+}
+
void
gis_prepare_welcome_page (SetupData *setup)
{
- gchar *s;
- GKeyFile *overrides = gis_get_overrides (setup);
+ WelcomeData *data;
GisAssistant *assistant = gis_get_assistant (setup);
GtkBuilder *builder = gis_builder ("gis-welcome-page");
+ GtkListStore *liststore;
+ GtkTreeModel *filter;
+ GtkTreeView *treeview;
+
+ liststore = gtk_list_store_new (NUM_COLS,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_BOOLEAN);
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-image",
- NULL, NULL);
+ data = g_slice_new0 (WelcomeData);
+ data->setup = setup;
+ data->locale_id = cc_common_language_get_current_language ();
+ data->page = WID ("welcome-page");
+ data->show_all = WID ("language-show-all");
+ data->liststore = GTK_TREE_MODEL (liststore);
+ gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (liststore),
+ sort_languages, NULL, NULL);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (liststore),
+ GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
+ GTK_SORT_ASCENDING);
- if (s && g_file_test (s, G_FILE_TEST_EXISTS))
- gtk_image_set_from_file (GTK_IMAGE (WID ("welcome-image")), s);
+ treeview = OBJ (GtkTreeView *, "language-list");
- g_free (s);
+ filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (liststore), NULL);
+ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (filter),
+ language_visible, data, NULL);
+ gtk_tree_view_set_model (treeview, filter);
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-title",
- NULL, NULL);
- if (s)
- gtk_label_set_text (GTK_LABEL (WID ("welcome-title")), s);
- g_free (s);
+ add_all_languages (GTK_LIST_STORE (data->liststore));
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-subtitle",
- NULL, NULL);
- if (s)
- gtk_label_set_text (GTK_LABEL (WID ("welcome-subtitle")), s);
- g_free (s);
+ g_signal_connect_swapped (data->show_all, "toggled",
+ G_CALLBACK (gtk_tree_model_filter_refilter),
+ filter);
- g_key_file_unref (overrides);
+ gis_assistant_add_page (assistant, data->page);
+ gis_assistant_set_page_complete (assistant, data->page, TRUE);
- g_object_set_data (OBJ (GObject *, "welcome-page"), "gis-page-title", _("Welcome"));
- gis_assistant_add_page (assistant, WID ("welcome-page"));
- gis_assistant_set_page_complete (assistant, WID ("welcome-page"), TRUE);
+ sync_language (data);
+ select_current_locale (treeview);
g_object_unref (builder);
}
diff --git a/gnome-initial-setup/gis-welcome-page.ui b/gnome-initial-setup/gis-welcome-page.ui
index 35b561a..2f59c30 100644
--- a/gnome-initial-setup/gis-welcome-page.ui
+++ b/gnome-initial-setup/gis-welcome-page.ui
@@ -1,54 +1,49 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="3.0"/>
- <object class="GtkGrid" id="welcome-page">
+ <object class="GtkBox" id="welcome-page">
<property name="name">welcome-page</property>
<property name="visible">True</property>
- <property name="halign">center</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="welcome-title">
+ <object class="GtkScrolledWindow" id="language-scrolledwindow">
<property name="visible">True</property>
- <property name="label" translatable="yes">Welcome to GNOME 3</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
- <property name="margin-bottom">18</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="scale" value="1.2"/>
- </attributes>
+ <property name="hscrollbar-policy">never</property>
+ <property name="vscrollbar-policy">automatic</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkTreeView" id="language-list">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">fill</property>
+ <property name="valign">fill</property>
+ <property name="headers-visible">False</property>
+ <property name="search-column">2</property>
+ <property name="enable-grid-lines">horizontal</property>
+ <property name="show-expanders">False</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="language-name-column">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkCellRendererText" id="language-name" />
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
</child>
<child>
- <object class="GtkImage" id="welcome-image">
+ <object class="GtkCheckButton" id="language-show-all">
<property name="visible">True</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
- <property name="pixbuf">resource:///image/welcome-image.png</property>
+ <property name="label" translatable="yes">Show _all</property>
+ <property name="use_underline">True</property>
+ <property name="halign">fill</property>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="welcome-subtitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Let's set up some essentials.</property>
- <property name="halign">center</property>
- <property name="margin-top">18</property>
- <property name="margin-bottom">18</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
</child>
</object>
</interface>
diff --git a/gnome-initial-setup/languages/Makefile.am b/gnome-initial-setup/languages/Makefile.am
index 0aa166e..ecd313d 100644
--- a/gnome-initial-setup/languages/Makefile.am
+++ b/gnome-initial-setup/languages/Makefile.am
@@ -14,9 +14,7 @@ liblanguage_la_SOURCES = \
gdm-languages.c \
locarchive.h \
cc-common-language.c \
- cc-common-language.h \
- cc-language-chooser.c \
- cc-language-chooser.h
+ cc-common-language.h
liblanguage_la_LIBADD = \
$(INITIAL_SETUP_LIBS)
diff --git a/gnome-initial-setup/languages/cc-common-language.c b/gnome-initial-setup/languages/cc-common-language.c
index 28973a8..46c2735 100644
--- a/gnome-initial-setup/languages/cc-common-language.c
+++ b/gnome-initial-setup/languages/cc-common-language.c
@@ -34,121 +34,6 @@
#include "gdm-languages.h"
-static gint
-cc_common_language_sort_languages (GtkTreeModel *model,
- GtkTreeIter *a,
- GtkTreeIter *b,
- gpointer data)
-{
- char *ca, *cb;
- char *la, *lb;
- gboolean sa, ula;
- gboolean sb, ulb;
- gint result;
-
- gtk_tree_model_get (model, a,
- LOCALE_COL, &ca,
- DISPLAY_LOCALE_COL, &la,
- SEPARATOR_COL, &sa,
- USER_LANGUAGE, &ula,
- -1);
- gtk_tree_model_get (model, b,
- LOCALE_COL, &cb,
- DISPLAY_LOCALE_COL, &lb,
- SEPARATOR_COL, &sb,
- USER_LANGUAGE, &ulb,
- -1);
-
- /* Sort before and after separator first */
- if (sa && sb)
- return 0;
- if (sa)
- return ulb ? 1 : -1;
- if (sb)
- return ula ? -1 : 1;
-
- /* Sort user-languages first */
- if (ula != ulb) {
- if (ula)
- return -1;
- else
- return 1;
- }
-
- if (!ca)
- result = 1;
- else if (!cb)
- result = -1;
- else
- result = strcmp (la, lb);
-
- g_free (ca);
- g_free (cb);
- g_free (la);
- g_free (lb);
-
- return result;
-}
-
-static gboolean
-iter_for_language (GtkTreeModel *model,
- const gchar *lang,
- GtkTreeIter *iter,
- gboolean region)
-{
- char *l;
- char *name;
- char *language;
-
- gtk_tree_model_get_iter_first (model, iter);
- do {
- gtk_tree_model_get (model, iter, LOCALE_COL, &l, -1);
- if (g_strcmp0 (l, lang) == 0) {
- g_free (l);
- return TRUE;
- }
- g_free (l);
- } while (gtk_tree_model_iter_next (model, iter));
-
- name = gdm_normalize_language_name (lang);
- if (name != NULL) {
- if (region) {
- language = gdm_get_region_from_name (name, NULL);
- }
- else {
- language = gdm_get_language_from_name (name, NULL);
- }
-
- gtk_list_store_insert_with_values (GTK_LIST_STORE (model),
- iter,
- -1,
- LOCALE_COL, name,
- DISPLAY_LOCALE_COL, language,
- -1);
- g_free (name);
- g_free (language);
- return TRUE;
- }
-
- return FALSE;
-}
-
-gboolean
-cc_common_language_get_iter_for_language (GtkTreeModel *model,
- const gchar *lang,
- GtkTreeIter *iter)
-{
- return iter_for_language (model, lang, iter, FALSE);
-}
-
-gboolean
-cc_common_language_get_iter_for_region (GtkTreeModel *model,
- const gchar *lang,
- GtkTreeIter *iter)
-{
- return iter_for_language (model, lang, iter, TRUE);
-}
-
gboolean
cc_common_language_has_font (const gchar *locale)
{
@@ -207,110 +92,6 @@ cc_common_language_has_font (const gchar *locale)
return is_displayable;
}
-typedef struct
-{
- GtkListStore *store;
- GHashTable *user_langs;
- gchar **languages;
- gboolean regions;
- gint position;
-} AsyncLangData;
-
-static void
-async_lang_data_free (AsyncLangData *data)
-{
- g_object_unref (data->store);
- g_hash_table_unref (data->user_langs);
- g_strfreev (data->languages);
- g_free (data);
-}
-
-static gboolean
-add_one_language (gpointer d)
-{
- AsyncLangData *data = d;
- char *name;
- char *language;
- GtkTreeIter iter;
-
- if (data->languages[data->position] == NULL) {
- /* we are done */
- async_lang_data_free (data);
- return FALSE;
- }
-
- name = gdm_normalize_language_name (data->languages[data->position]);
- if (g_hash_table_lookup (data->user_langs, name) != NULL) {
- g_free (name);
- goto next;
- }
-
- if (!cc_common_language_has_font (data->languages[data->position])) {
- g_free (name);
- goto next;
- }
-
- if (data->regions) {
- language = gdm_get_region_from_name (name, NULL);
- }
- else {
- language = gdm_get_language_from_name (name, NULL);
- }
- if (!language) {
- g_debug ("Ignoring '%s' as a locale, because we couldn't figure the language name", name);
- g_free (name);
- goto next;
- }
-
- /* Add separator between initial languages and new additions */
- if (g_object_get_data (G_OBJECT (data->store), "needs-separator")) {
- GtkTreeIter iter;
-
- gtk_list_store_insert_with_values (GTK_LIST_STORE (data->store),
- &iter,
- -1,
- LOCALE_COL, NULL,
- DISPLAY_LOCALE_COL, "Don't show",
- SEPARATOR_COL, TRUE,
- USER_LANGUAGE, FALSE,
- -1);
- g_object_set_data (G_OBJECT (data->store), "needs-separator", NULL);
- }
-
- gtk_list_store_insert_with_values (data->store,
- &iter,
- -1,
- LOCALE_COL, name,
- DISPLAY_LOCALE_COL, language,
- -1);
-
- g_free (name);
- g_free (language);
-
- next:
- data->position++;
-
- return TRUE;
-}
-
-guint
-cc_common_language_add_available_languages (GtkListStore *store,
- gboolean regions,
- GHashTable *user_langs)
-{
- AsyncLangData *data;
-
- data = g_new0 (AsyncLangData, 1);
-
- data->store = g_object_ref (store);
- data->user_langs = g_hash_table_ref (user_langs);
- data->languages = gdm_get_all_language_names ();
- data->regions = regions;
- data->position = 0;
-
- return gdk_threads_add_idle (add_one_language, data);
-}
-
gchar *
cc_common_language_get_current_language (void)
{
@@ -327,110 +108,6 @@ cc_common_language_get_current_language (void)
}
static void
-languages_foreach_cb (gpointer key,
- gpointer value,
- gpointer user_data)
-{
- GtkListStore *store = (GtkListStore *) user_data;
- const char *locale = (const char *) key;
- const char *display_locale = (const char *) value;
- GtkTreeIter iter;
-
- gtk_list_store_insert_with_values (store,
- &iter,
- -1,
- LOCALE_COL, locale,
- DISPLAY_LOCALE_COL, display_locale,
- SEPARATOR_COL, FALSE,
- USER_LANGUAGE, TRUE,
- -1);
-}
-
-static gboolean
-separator_func (GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer data)
-{
- gboolean is_sep;
-
- gtk_tree_model_get (model, iter,
- SEPARATOR_COL, &is_sep,
- -1);
-
- return is_sep;
-}
-
-void
-cc_common_language_setup_list (GtkWidget *treeview,
- GHashTable *initial)
-{
- GtkCellRenderer *cell;
- GtkTreeViewColumn *column;
- GtkListStore *store;
-
- cell = gtk_cell_renderer_text_new ();
- g_object_set (cell,
- "width-chars", 40,
- "ellipsize", PANGO_ELLIPSIZE_END,
- NULL);
- column = gtk_tree_view_column_new_with_attributes (NULL, cell, "text", DISPLAY_LOCALE_COL, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
- store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
- gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
- cc_common_language_sort_languages, NULL, NULL);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
- GTK_SORT_ASCENDING);
- gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (treeview),
- separator_func,
- NULL, NULL);
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store));
-
-
- /* Add languages from the initial hashtable */
- g_hash_table_foreach (initial, (GHFunc) languages_foreach_cb, store);
-
- /* Mark the need for a separator if we had any languages added */
- if (initial != NULL &&
- g_hash_table_size (initial) > 0) {
- g_object_set_data (G_OBJECT (store), "needs-separator", GINT_TO_POINTER (TRUE));
- }
-}
-
-void
-cc_common_language_select_current_language (GtkTreeView *treeview)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean cont;
- char *lang;
-
- lang = cc_common_language_get_current_language ();
- model = gtk_tree_view_get_model (treeview);
- cont = gtk_tree_model_get_iter_first (model, &iter);
- while (cont) {
- char *locale;
-
- gtk_tree_model_get (model, &iter,
- LOCALE_COL, &locale,
- -1);
- if (locale != NULL &&
- g_str_equal (locale, lang)) {
- GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection (treeview);
- gtk_tree_selection_select_iter (selection, &iter);
- g_free (locale);
- break;
- }
- g_free (locale);
-
- cont = gtk_tree_model_iter_next (model, &iter);
- }
- g_free (lang);
-}
-
-static void
add_other_users_language (GHashTable *ht)
{
GVariant *variant;
@@ -549,41 +226,3 @@ cc_common_language_get_initial_languages (void)
return ht;
}
-
-GHashTable *
-cc_common_language_get_initial_regions (const gchar *lang)
-{
- GHashTable *ht;
- char *language;
- gchar **langs;
- gint i;
-
- ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-
-#if 0
- /* Add some common regions */
- g_hash_table_insert (ht, g_strdup ("en_US.utf8"), g_strdup (_("United States")));
- g_hash_table_insert (ht, g_strdup ("de_DE.utf8"), g_strdup (_("Germany")));
- g_hash_table_insert (ht, g_strdup ("fr_FR.utf8"), g_strdup (_("France")));
- g_hash_table_insert (ht, g_strdup ("es_ES.utf8"), g_strdup (_("Spain")));
- 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 ();
- for (i = 0; langs[i]; i++) {
- gchar *l, *s;
- gdm_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);
- g_hash_table_insert (ht, g_strdup (langs[i]), s);
- }
- }
- g_free (l);
- }
- g_strfreev (langs);
- g_free (language);
-
- return ht;
-}
diff --git a/gnome-initial-setup/languages/cc-common-language.h b/gnome-initial-setup/languages/cc-common-language.h
index 169eee4..12adc57 100644
--- a/gnome-initial-setup/languages/cc-common-language.h
+++ b/gnome-initial-setup/languages/cc-common-language.h
@@ -26,32 +26,9 @@
G_BEGIN_DECLS
-enum {
- LOCALE_COL,
- DISPLAY_LOCALE_COL,
- SEPARATOR_COL,
- USER_LANGUAGE,
- NUM_COLS
-};
-
-gboolean cc_common_language_get_iter_for_language (GtkTreeModel *model,
- const gchar *lang,
- GtkTreeIter *iter);
-gboolean cc_common_language_get_iter_for_region (GtkTreeModel *model,
- const gchar *lang,
- GtkTreeIter *iter);
-guint cc_common_language_add_available_languages (GtkListStore *store,
- gboolean regions,
- GHashTable *user_langs);
gboolean cc_common_language_has_font (const gchar *locale);
gchar *cc_common_language_get_current_language (void);
-
GHashTable *cc_common_language_get_initial_languages (void);
-GHashTable *cc_common_language_get_initial_regions (const gchar *lang);
-
-void cc_common_language_setup_list (GtkWidget *treeview,
- GHashTable *initial);
-void cc_common_language_select_current_language (GtkTreeView *treeview);
G_END_DECLS
diff --git a/gnome-initial-setup/setup.gresource.xml b/gnome-initial-setup/setup.gresource.xml
index 466a6f1..c09e697 100644
--- a/gnome-initial-setup/setup.gresource.xml
+++ b/gnome-initial-setup/setup.gresource.xml
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
- <gresource prefix="/image">
- <file preprocess="to-pixdata">welcome-image.png</file>
- </gresource>
<gresource prefix="/ui">
<file preprocess="xml-stripblanks">setup.ui</file>
<file preprocess="xml-stripblanks">gis-welcome-page.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]