[gnome-initial-setup] keyboard: Prevent going forward before the localed proxy is ready
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] keyboard: Prevent going forward before the localed proxy is ready
- Date: Thu, 30 Oct 2014 18:01:39 +0000 (UTC)
commit 539f1bafb3f4c722cb1793f1a5dc71014a458a1e
Author: Rui Matos <tiagomatos gmail com>
Date: Thu Oct 30 14:56:54 2014 +0100
keyboard: Prevent going forward before the localed proxy is ready
Otherwise we would crash on set_localed_input() and we really don't
want to move forward before we have a chance to pre-select the system
layout which we'll get from localed in the next patch.
.../pages/keyboard/gis-keyboard-page.c | 26 ++++++++++++-------
1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index d3af107..3a856b5 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -90,6 +90,9 @@ set_localed_input (GisKeyboardPage *self)
GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
const gchar *layout, *variant;
+ if (!priv->localed)
+ return;
+
cc_input_chooser_get_layout (CC_INPUT_CHOOSER (priv->input_chooser), &layout, &variant);
g_dbus_proxy_call (priv->localed,
@@ -149,6 +152,17 @@ gis_keyboard_page_apply (GisPage *page,
}
static void
+update_page_complete (GisKeyboardPage *self)
+{
+ GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
+ gboolean complete;
+
+ complete = (priv->localed != NULL &&
+ cc_input_chooser_get_input_id (CC_INPUT_CHOOSER (priv->input_chooser)) != NULL);
+ gis_page_set_complete (GIS_PAGE (self), complete);
+}
+
+static void
localed_proxy_ready (GObject *source,
GAsyncResult *res,
gpointer data)
@@ -168,6 +182,8 @@ localed_proxy_ready (GObject *source,
}
priv->localed = proxy;
+
+ update_page_complete (self);
}
static void
@@ -178,16 +194,6 @@ input_confirmed (CcInputChooser *chooser,
}
static void
-update_page_complete (GisKeyboardPage *self)
-{
- GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
- gboolean complete;
-
- complete = cc_input_chooser_get_input_id (CC_INPUT_CHOOSER (priv->input_chooser)) != NULL;
- gis_page_set_complete (GIS_PAGE (self), complete);
-}
-
-static void
input_changed (CcInputChooser *chooser,
GisKeyboardPage *self)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]