[gnome-initial-setup/shell/4765: 13/362] language: make Enter always switch to next page
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/shell/4765: 13/362] language: make Enter always switch to next page
- Date: Thu, 19 Mar 2015 01:22:09 +0000 (UTC)
commit 41d852047e56ac7d70bdba1830f90342f3075116
Author: Cosimo Cecchi <cosimo endlessm com>
Date: Fri Apr 18 12:08:47 2014 -0700
language: make Enter always switch to next page
In particular, also when the selected language is already the default.
.../pages/language/cc-language-chooser.c | 18 ++++++++++++++++
.../pages/language/gis-language-page.c | 22 +++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/gnome-initial-setup/pages/language/cc-language-chooser.c
b/gnome-initial-setup/pages/language/cc-language-chooser.c
index 2dea0dc..9fa0c81 100644
--- a/gnome-initial-setup/pages/language/cc-language-chooser.c
+++ b/gnome-initial-setup/pages/language/cc-language-chooser.c
@@ -54,6 +54,13 @@ enum {
static GParamSpec *obj_props[PROP_LAST];
+enum {
+ LANGUAGE_ACTIVATED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
struct _CcLanguageChooserPrivate
{
GtkWidget *no_results;
@@ -397,6 +404,8 @@ child_activated (EggListBox *box,
widget = get_language_widget (child);
set_locale_id (chooser, widget->locale_id);
+
+ g_signal_emit (chooser, signals[LANGUAGE_ACTIVATED], 0, widget->locale_id);
}
typedef struct {
@@ -572,6 +581,15 @@ cc_language_chooser_class_init (CcLanguageChooserClass *klass)
g_param_spec_string ("showing-extra", "", "", "",
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ signals[LANGUAGE_ACTIVATED] =
+ g_signal_new ("language-activated",
+ CC_TYPE_LANGUAGE_CHOOSER,
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c
b/gnome-initial-setup/pages/language/gis-language-page.c
index 701a437..89fcfda 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -158,9 +158,7 @@ set_language (GisLanguagePage *page)
}
static void
-language_changed (CcLanguageChooser *chooser,
- GParamSpec *pspec,
- GisLanguagePage *page)
+set_language_and_change_page (GisLanguagePage *page)
{
GisLanguagePagePrivate *priv = gis_language_page_get_instance_private (page);
GisDriver *driver;
@@ -180,6 +178,22 @@ language_changed (CcLanguageChooser *chooser,
}
static void
+language_activated (CcLanguageChooser *chooser,
+ gchar *language,
+ GisLanguagePage *page)
+{
+ set_language_and_change_page (page);
+}
+
+static void
+language_changed (CcLanguageChooser *chooser,
+ GParamSpec *pspec,
+ GisLanguagePage *page)
+{
+ set_language_and_change_page (page);
+}
+
+static void
ensure_localed_proxy (GisLanguagePage *page)
{
GisLanguagePagePrivate *priv = gis_language_page_get_instance_private (page);
@@ -230,6 +244,8 @@ gis_language_page_constructed (GObject *object)
/* Now connect to language chooser changes */
g_signal_connect (priv->language_chooser, "notify::language",
G_CALLBACK (language_changed), page);
+ g_signal_connect (priv->language_chooser, "language-activated",
+ G_CALLBACK (language_activated), page);
/* If we're in new user mode then we're manipulating system settings */
if (gis_driver_get_mode (driver) == GIS_DRIVER_MODE_NEW_USER)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]