[gnome-initial-setup] language: Rebuild all pages when a new locale is selected
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] language: Rebuild all pages when a new locale is selected
- Date: Tue, 21 Aug 2012 19:37:41 +0000 (UTC)
commit 868968e5fdbade0b4346d278e0e0e5ae65ec60fd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Aug 21 15:06:24 2012 -0400
language: Rebuild all pages when a new locale is selected
gnome-initial-setup/gnome-initial-setup.c | 14 ++++++++++++++
gnome-initial-setup/gnome-initial-setup.h | 1 +
.../pages/language/gis-language-page.c | 1 +
3 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index a0c8802..415c33a 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -73,6 +73,12 @@ prepare_main_window (SetupData *setup)
g_signal_connect (setup->assistant, "prepare",
G_CALLBACK (prepare_cb), setup);
+}
+
+static gboolean
+rebuild_pages (SetupData *setup)
+{
+ gis_assistant_destroy_all_pages (setup->assistant);
gis_prepare_language_page (setup);
gis_prepare_eula_pages (setup);
@@ -81,6 +87,8 @@ prepare_main_window (SetupData *setup)
gis_prepare_location_page (setup);
gis_prepare_online_page (setup);
gis_prepare_summary_page (setup);
+
+ return FALSE;
}
GKeyFile *
@@ -119,6 +127,11 @@ gis_get_user_permissions (SetupData *setup,
*password = setup->user_password;
}
+void
+gis_locale_changed (SetupData *setup)
+{
+ g_idle_add ((GSourceFunc) rebuild_pages, setup);
+}
static GType
get_assistant_type (void)
@@ -189,6 +202,7 @@ startup_cb (GApplication *app,
load_overrides (setup);
prepare_main_window (setup);
+ rebuild_pages (setup);
}
int
diff --git a/gnome-initial-setup/gnome-initial-setup.h b/gnome-initial-setup/gnome-initial-setup.h
index e0c341e..254f59e 100644
--- a/gnome-initial-setup/gnome-initial-setup.h
+++ b/gnome-initial-setup/gnome-initial-setup.h
@@ -17,6 +17,7 @@ typedef struct _SetupData SetupData;
GtkWindow *gis_get_main_window (SetupData *setup);
GKeyFile *gis_get_overrides (SetupData *setup);
GisAssistant * gis_get_assistant (SetupData *setup);
+void gis_locale_changed (SetupData *setup);
void gis_set_user_permissions (SetupData *setup,
ActUser *user,
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c b/gnome-initial-setup/pages/language/gis-language-page.c
index dad80f9..0be14d1 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -42,6 +42,7 @@ set_language (LanguageData *data,
gchar *current_locale_id = cc_common_language_get_current_language ();
if (g_strcmp0 (current_locale_id, locale_id) != 0) {
setlocale (LC_MESSAGES, locale_id);
+ gis_locale_changed (data->setup);
}
g_free (current_locale_id);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]