[gnome-control-center] region: trigger the layout chooser dialog response on 'row-activated' signal
- From: Sergey V. Udaltsov <svu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: trigger the layout chooser dialog response on 'row-activated' signal
- Date: Mon, 13 Jun 2011 20:12:39 +0000 (UTC)
commit 22f7c182bd6c2fc3380c8b59226b5aa94156e989
Author: Rui Matos <tiagomatos gmail com>
Date: Sun Jun 12 22:45:05 2011 +0100
region: trigger the layout chooser dialog response on 'row-activated' signal
Allows the user to choose a new layout by double clicking or hitting enter.
https://bugzilla.gnome.org/show_bug.cgi?id=652409
panels/region/gnome-region-panel-xkbltadd.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-xkbltadd.c b/panels/region/gnome-region-panel-xkbltadd.c
index c2a3dc4..15fe02b 100644
--- a/panels/region/gnome-region-panel-xkbltadd.c
+++ b/panels/region/gnome-region-panel-xkbltadd.c
@@ -301,6 +301,19 @@ xkb_layout_chooser_selection_changed (GtkTreeSelection * selection,
gtk_widget_set_sensitive (preview_button, anything_selected);
}
+static void
+xkb_layout_chooser_row_activated (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ GtkBuilder *chooser_dialog)
+{
+ GtkWidget *add_button = CWID ("btnOk");
+ GtkWidget *dialog = CWID ("xkb_layout_chooser");
+
+ if (gtk_widget_is_sensitive (add_button))
+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+}
+
static gboolean
xkb_filter_layouts (GtkTreeModel * model,
GtkTreeIter * iter, gpointer data)
@@ -401,6 +414,9 @@ xkb_layout_choose (GtkBuilder * dialog)
xkb_layout_chooser_selection_changed (selection, chooser_dialog);
+ g_signal_connect (G_OBJECT (xkb_filtered_layouts_list), "row-activated",
+ G_CALLBACK (xkb_layout_chooser_row_activated), chooser_dialog);
+
filtered_model =
GTK_TREE_MODEL_FILTER (gtk_builder_get_object
(chooser_dialog,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]