diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2018-11-07 16:05:32 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2018-11-10 09:24:34 +1300 |
commit | 26b07202007a4349129f3ac55fd3d83961059078 (patch) | |
tree | 69b4052224973101403ac763ef6a106afab0d3b2 /panels/user-accounts/cc-user-panel.c | |
parent | 96c2c4d62c3b43611ed3585e6fdb9f7d93950496 (diff) | |
download | gnome-control-center-26b07202007a4349129f3ac55fd3d83961059078.tar.gz |
user-accounts: Use gtk_dialog_run for CcAddUserDialog
Diffstat (limited to 'panels/user-accounts/cc-user-panel.c')
-rw-r--r-- | panels/user-accounts/cc-user-panel.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c index e736b5f67..c810ca163 100644 --- a/panels/user-accounts/cc-user-panel.c +++ b/panels/user-accounts/cc-user-panel.c @@ -102,8 +102,6 @@ struct _CcUserPanel { UmPhotoDialog *photo_dialog; gint other_accounts; - - CcAddUserDialog *account_dialog; }; CC_PANEL_REGISTER (CcUserPanel, cc_user_panel) @@ -355,31 +353,23 @@ user_changed (CcUserPanel *self, ActUser *user) } static void -select_created_user (GObject *object, - GAsyncResult *result, - gpointer user_data) +add_user (CcUserPanel *self) { - CcUserPanel *self = user_data; CcAddUserDialog *dialog; + GtkWindow *toplevel; ActUser *user; - dialog = CC_ADD_USER_DIALOG (object); - user = cc_add_user_dialog_finish (dialog, result); - gtk_widget_destroy (GTK_WIDGET (dialog)); - self->account_dialog = NULL; + dialog = cc_add_user_dialog_new (self->permission); + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))); + gtk_window_set_transient_for (GTK_WINDOW (dialog), toplevel); - if (user == NULL) - return; + gtk_dialog_run (GTK_DIALOG (dialog)); - reload_users (self, user); -} + user = cc_add_user_dialog_get_user (dialog); + if (user != NULL) + reload_users (self, user); -static void -add_user (CcUserPanel *self) -{ - self->account_dialog = cc_add_user_dialog_new (); - cc_add_user_dialog_show (self->account_dialog, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))), - self->permission, select_created_user, self); + gtk_widget_destroy (GTK_WIDGET (dialog)); } static void @@ -1399,10 +1389,6 @@ cc_user_panel_dispose (GObject *object) g_clear_object (&self->login_screen_settings); - if (self->account_dialog) { - gtk_dialog_response (GTK_DIALOG (self->account_dialog), GTK_RESPONSE_DELETE_EVENT); - self->account_dialog = NULL; - } g_clear_pointer ((GtkWidget **)&self->language_chooser, gtk_widget_destroy); g_clear_object (&self->permission); G_OBJECT_CLASS (cc_user_panel_parent_class)->dispose (object); |