[gnome-control-center/gnome-3-16] common: Dismiss dialog if the activated row was already ticked
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-16] common: Dismiss dialog if the activated row was already ticked
- Date: Tue, 7 Jul 2015 16:58:07 +0000 (UTC)
commit dc78cdafa3fcfd85396feffdde68cb45fded361e
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Jul 7 17:17:35 2015 +0200
common: Dismiss dialog if the activated row was already ticked
This makes the dialog a bit friendlier to use.
https://bugzilla.gnome.org/show_bug.cgi?id=752001
panels/common/cc-language-chooser.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index de58306..39d2fc3 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -37,6 +37,7 @@
#include <libgnome-desktop/gnome-languages.h>
typedef struct {
+ GtkWidget *done_button;
GtkWidget *no_results;
GtkListBoxRow *more_item;
GtkWidget *filter_entry;
@@ -358,7 +359,13 @@ row_activated (GtkListBox *box,
return;
}
new_locale_id = g_object_get_data (G_OBJECT (row), "locale-id");
- set_locale_id (chooser, new_locale_id);
+ if (g_strcmp0 (new_locale_id, priv->language) == 0) {
+ gtk_dialog_response (GTK_DIALOG (chooser),
+ gtk_dialog_get_response_for_widget (GTK_DIALOG (chooser),
+ priv->done_button));
+ } else {
+ set_locale_id (chooser, new_locale_id);
+ }
}
static void
@@ -397,6 +404,7 @@ cc_language_chooser_new (GtkWidget *parent)
g_object_set_data_full (G_OBJECT (chooser), "private", priv, cc_language_chooser_private_free);
g_object_set_data_full (G_OBJECT (chooser), "builder", builder, g_object_unref);
+ priv->done_button = WID ("ok-button");
priv->filter_entry = WID ("language-filter-entry");
priv->language_list = WID ("language-list");
priv->scrolledwindow = WID ("language-scrolledwindow");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]