[gnome-initial-setup] keyboard: Write out the settings when leaving the page



commit 7bfd8ff32418639e730cde0b4b2aca4da1b11885
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri May 17 16:42:16 2013 +0200

    keyboard: Write out the settings when leaving the page
    
    Otherwise if users just click next without editing the default input
    sources list they'll end up with an empty setting.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700535

 .../pages/keyboard/gis-keyboard-page.c             |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index 345c0fc..4187bdd 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -112,12 +112,23 @@ gis_keyboard_page_finalize (GObject *object)
 
 static void localed_proxy_ready (GObject *source, GAsyncResult *res, gpointer data);
 static void setup_input_section (GisKeyboardPage *self);
+static void update_input (GisKeyboardPage *self);
+
+static void
+next_page_cb (GisAssistant *assistant,
+              GisPage      *which_page,
+              GisPage      *this_page)
+{
+        if (which_page == this_page)
+                update_input (GIS_KEYBOARD_PAGE (this_page));
+}
 
 static void
 gis_keyboard_page_constructed (GObject *object)
 {
         GisKeyboardPage *self = GIS_KEYBOARD_PAGE (object);
         GisKeyboardPagePrivate *priv = self->priv;
+        GisAssistant *assistant = gis_driver_get_assistant (GIS_PAGE (self)->driver);
 
         G_OBJECT_CLASS (gis_keyboard_page_parent_class)->constructed (object);
 
@@ -137,6 +148,8 @@ gis_keyboard_page_constructed (GObject *object)
                                   (GAsyncReadyCallback) localed_proxy_ready,
                                   self);
 
+        g_signal_connect (assistant, "next-page", G_CALLBACK (next_page_cb), self);
+
         gis_page_set_complete (GIS_PAGE (self), TRUE);
         gtk_widget_show (GTK_WIDGET (self));
 }


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