[gnome-control-center] user-accounts: do not show notification if not needed
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: do not show notification if not needed
- Date: Mon, 19 Jan 2015 12:13:47 +0000 (UTC)
commit 8bd1a5f18d82924ab12a73a57da6659e26bc6766
Author: Ondrej Holy <oholy redhat com>
Date: Fri Jan 16 09:11:00 2015 +0100
user-accounts: do not show notification if not needed
Restart notification is shown if there is different language in
accountsservice. However restart isn't needed if user selects original
language (after several changes), which is already used in the system.
https://bugzilla.gnome.org/show_bug.cgi?id=703392
panels/user-accounts/um-user-panel.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 63b82cb..7b005e2 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -1093,7 +1093,8 @@ language_response (GtkDialog *dialog,
{
GtkWidget *button;
ActUser *user;
- const gchar *lang, *current_language;
+ const gchar *lang, *account_language;
+ gchar *current_language;
gchar *name = NULL;
gboolean self_selected;
@@ -1103,16 +1104,19 @@ language_response (GtkDialog *dialog,
}
user = get_selected_user (d);
- current_language = act_user_get_language (user);
+ account_language = act_user_get_language (user);
self_selected = act_user_get_uid (user) == geteuid ();
lang = cc_language_chooser_get_language (GTK_WIDGET (dialog));
if (lang) {
- if (g_strcmp0 (lang, current_language) != 0) {
+ if (g_strcmp0 (lang, account_language) != 0) {
act_user_set_language (user, lang);
- if (self_selected)
+ /* Do not show the notification if the locale is already used. */
+ current_language = gnome_normalize_locale (setlocale (LC_MESSAGES, NULL));
+ if (self_selected && g_strcmp0 (lang, current_language) != 0)
show_restart_notification (d, lang);
+ g_free (current_language);
}
button = get_widget (d, "account-language-button");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]