[gnome-control-center] user-accounts: show restart notification when account type changed



commit afe0a6226724571f263f9f11f00897bc4458380e
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Sep 17 14:35:46 2014 +0200

    user-accounts: show restart notification when account type changed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674429

 panels/user-accounts/um-user-panel.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index a16b3b3..d995ea7 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -107,6 +107,8 @@ enum {
         NUM_USER_LIST_COLS
 };
 
+static void show_restart_notification (CcUserPanelPrivate *d, const gchar *locale);
+
 typedef struct {
         CcUserPanel *self;
         GCancellable *cancellable;
@@ -1005,8 +1007,10 @@ account_type_changed (UmEditableCombo    *combo,
         GtkTreeModel *model;
         GtkTreeIter iter;
         gint account_type;
+        gboolean self_selected;
 
         user = get_selected_user (d);
+        self_selected = act_user_get_uid (user) == geteuid ();
 
         model = um_editable_combo_get_model (combo);
         um_editable_combo_get_active_iter (combo, &iter);
@@ -1014,6 +1018,9 @@ account_type_changed (UmEditableCombo    *combo,
 
         if (account_type != act_user_get_account_type (user)) {
                 act_user_set_account_type (user, account_type);
+
+                if (self_selected)
+                        show_restart_notification (d, NULL);
         }
 
         g_object_unref (user);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]