diff --git a/panels/user-accounts/Makefile.am b/panels/user-accounts/Makefile.am index 3f01cf00d..583af086d 100644 --- a/panels/user-accounts/Makefile.am +++ b/panels/user-accounts/Makefile.am @@ -47,8 +47,6 @@ libuser_accounts_la_SOURCES = \ um-language-dialog.c \ um-lockbutton.h \ um-lockbutton.c \ - um-login-options.h \ - um-login-options.c \ um-password-dialog.h \ um-password-dialog.c \ um-photo-dialog.h \ diff --git a/panels/user-accounts/data/user-accounts-dialog.ui b/panels/user-accounts/data/user-accounts-dialog.ui index 02ae626b9..d1f39f388 100644 --- a/panels/user-accounts/data/user-accounts-dialog.ui +++ b/panels/user-accounts/data/user-accounts-dialog.ui @@ -47,77 +47,32 @@ True 6 - + True - True - True - 10 + vertical + 12 - + True - vertical - 12 + 12 - + True - 12 + vertical + 0 - + True - vertical - 0 + True + never + automatic + in - + True True - never - automatic - in - - - True - True - False - - + False - - 0 - - - - - True - 1 - True - - - True - False - list-add-symbolic - - - False - True - - - - - True - False - list-remove-symbolic - - - False - True - - - - - False - False - 1 - @@ -125,578 +80,444 @@ - + True - vertical - 6 + 1 + True - + True - - - True - 8 - 2 - 10 - - - False - - - Open - False - True - True - 0 - - - False - False - 0 - - - - - - - - 1 - 2 - 7 - 8 - - - - - - - - Open - True - True - True - 0 - - - False - False - 0 - - - - - 1 - 2 - 7 - 8 - - - - - - 1 - Address Book Card: - - - - - - 7 - 8 - GTK_FILL - - - - - - True - - - 1 - 2 - 5 - 6 - - - - - - True - False - False - - - True - 0 - - - - - True - True - True - none - - - True - 0 - - - - - 1 - - - - - 1 - 2 - 6 - 7 - - - - - - True - account-type-model - 0 - - - 1 - 2 - 1 - 2 - - - - - - True - 1 - Account type: - - - - - - 1 - 2 - GTK_FILL - - - - - - True - vertical - - - True - - - 0 - - - - - True - 1.2 - 700 - - - 1 - - - - - 1 - 2 - - - - - - True - 1 - Password: - - - - - - 2 - 3 - GTK_FILL - - - - - - True - - - 1 - 2 - 2 - 3 - - - - - - True - 1 - E-mail address: - - - - - - 3 - 4 - GTK_FILL - - - - - - True - - - 1 - 2 - 3 - 4 - - - - - - True - 1 - Language: - - - - - - 4 - 5 - GTK_FILL - - - - - - True - 1 - Location: - - - - - - 5 - 6 - GTK_FILL - - - - - - True - 1 - Fingerprint Login: - - - - - - 6 - 7 - GTK_FILL - - - - - - False - 1 - Restrictions: - - - - - - 7 - 8 - GTK_FILL - - - - - - True - - - True - - - 0 - - - - - 0 - 0 - - - True - avatar-default - 6 - - - - - False - False - 1 - - - - - True - True - True - none - - - True - avatar-default - 6 - - - - - False - False - 2 - - - - - GTK_FILL - - - - - - True - language-model - 1 - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - - 0 - - + False + list-add-symbolic False - 0 + True + + + + + True + False + list-remove-symbolic + + + False + True - - - 1 - - - - - - - - - True - Accounts - center - - - False - - - - - True - vertical - 6 - 12 - - - True - 6 - - - True - 0 - Automatic Login: False False - 0 - - - - - True - - - - 0 - - - - 1 - False - False 0 - - Show list of users - True - True - False - True - True - - - False - False - 1 - - - - - Show Shutdown, Suspend and Restart actions - True - True - False - True - True - - - False - False - 2 - - - - - Show password hints - True - True - False - True - True - - - False - False - 3 - - - - - True - 0 - 0 - A guest account will allow anyone to temporarily log in to this computer without a password. For security, remote logins to this account are not allowed. - - <b>When the guest user logs out, all files and data associated with the account will be deleted.</b> - True - True - - - False - False - 4 - - - - - Allow guests to log in to this computer - True - True - False - True - True - - - False - False - 5 - - - - + True + vertical + 6 - + True - 0 - 1 - 0 - 0 - + + True + 8 + 2 + 10 + + + False + + + Open + False + True + True + 0 + + + False + False + 0 + + + + + + + + 1 + 2 + 7 + 8 + + + + + + + + Open + True + True + True + 0 + + + False + False + 0 + + + + + 1 + 2 + 7 + 8 + + + + + + 1 + Address Book Card: + + + + + + 7 + 8 + GTK_FILL + + + + + + True + + + 1 + 2 + 5 + 6 + + + + + + True + False + False + + + True + 0 + + + + + True + True + True + none + + + True + 0 + + + + + 1 + + + + + 1 + 2 + 6 + 7 + + + + + + True + account-type-model + 0 + + + 1 + 2 + 1 + 2 + + + + + + True + 1 + Account type: + + + + + + 1 + 2 + GTK_FILL + + + + + + True + vertical + + + True + + + 0 + + + + + True + 1.2 + 700 + + + 1 + + + + + 1 + 2 + + + + + + True + 1 + Password: + + + + + + 2 + 3 + GTK_FILL + + + + + + True + + + 1 + 2 + 2 + 3 + + + + + + True + 1 + E-mail address: + + + + + + 3 + 4 + GTK_FILL + + + + + + True + + + 1 + 2 + 3 + 4 + + + + + + True + 1 + Language: + + + + + + 4 + 5 + GTK_FILL + + + + + + True + 1 + Location: + + + + + + 5 + 6 + GTK_FILL + + + + + + True + 1 + Fingerprint Login: + + + + + + 6 + 7 + GTK_FILL + + + + + + False + 1 + Restrictions: + + + + + + 7 + 8 + GTK_FILL + + + + + + True + + + True + + + 0 + + + + + 0 + 0 + + + True + avatar-default + 6 + + + + + False + False + 1 + + + + + True + True + True + none + + + True + avatar-default + 6 + + + + + False + False + 2 + + + + + GTK_FILL + + + + + + True + language-model + 1 + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + + 0 + + False 0 - 6 + 1 - - 2 - - - - - True - Login Options - center - - - False - - - 0 - diff --git a/panels/user-accounts/um-login-options.c b/panels/user-accounts/um-login-options.c deleted file mode 100644 index 78c2700c0..000000000 --- a/panels/user-accounts/um-login-options.c +++ /dev/null @@ -1,436 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright 2009-2010 Red Hat, Inc, - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Written by: Matthias Clasen - */ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "um-login-options.h" -#include "um-lockbutton.h" -#include "um-user-manager.h" -#include "um-user.h" - -struct _UmLoginOptions { - GtkWidget *autologin_combo; - GtkWidget *userlist_check; - GtkWidget *power_check; - GtkWidget *hints_check; - GtkWidget *guest_check; - GtkWidget *lock_button; - GPermission *permission; - - UmUserManager *manager; - - DBusGProxy *proxy; - DBusGConnection *connection; -}; - -enum { - AUTOLOGIN_NAME_COL, - AUTOLOGIN_USER_COL, - NUM_AUTOLOGIN_COLS -}; - -static gint -sort_login_users (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer data) -{ - UmUser *ua, *ub; - gint result; - - gtk_tree_model_get (model, a, AUTOLOGIN_USER_COL, &ua, -1); - gtk_tree_model_get (model, b, AUTOLOGIN_USER_COL, &ub, -1); - - if (ua == NULL) - result = -1; - else if (ub == NULL) - result = 1; - else if (um_user_get_uid (ua) == getuid ()) - result = -1; - else if (um_user_get_uid (ub) == getuid ()) - result = 1; - else - result = um_user_collate (ua, ub); - - if (ua) - g_object_unref (ua); - - if (ub) - g_object_unref (ub); - - return result; -} - -static void -user_added (UmUserManager *um, UmUser *user, UmLoginOptions *d) -{ - GtkComboBox *combo; - GtkListStore *store; - GtkTreeIter iter; - - g_debug ("adding user '%s', %d", um_user_get_user_name (user), um_user_get_automatic_login (user)); - combo = GTK_COMBO_BOX (d->autologin_combo); - store = (GtkListStore*)gtk_combo_box_get_model (combo); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - AUTOLOGIN_NAME_COL, um_user_get_display_name (user), - AUTOLOGIN_USER_COL, user, - -1); - - if (um_user_get_automatic_login (user)) { - gtk_combo_box_set_active_iter (combo, &iter); - } -} - -static void -user_removed (UmUserManager *um, UmUser *user, UmLoginOptions *d) -{ - GtkComboBox *combo; - GtkTreeModel *model; - GtkListStore *store; - GtkTreeIter iter; - UmUser *u; - - combo = GTK_COMBO_BOX (d->autologin_combo); - model = gtk_combo_box_get_model (combo); - store = (GtkListStore*)model; - - gtk_combo_box_get_active_iter (combo, &iter); - gtk_tree_model_get (model, &iter, AUTOLOGIN_USER_COL, &u, -1); - if (u != NULL) { - if (um_user_get_uid (user) == um_user_get_uid (u)) { - /* autologin user got removed, set back to Disabled */ - gtk_list_store_remove (store, &iter); - gtk_combo_box_set_active (combo, 0); - g_object_unref (u); - return; - } - g_object_unref (u); - } - if (gtk_tree_model_get_iter_first (model, &iter)) { - do { - gtk_tree_model_get (model, &iter, AUTOLOGIN_USER_COL, &u, -1); - - if (u != NULL) { - if (um_user_get_uid (user) == um_user_get_uid (u)) { - gtk_list_store_remove (store, &iter); - g_object_unref (u); - return; - } - g_object_unref (u); - } - } while (gtk_tree_model_iter_next (model, &iter)); - } -} - -static void -user_changed (UmUserManager *manager, - UmUser *user, - UmLoginOptions *d) -{ - /* FIXME */ -} - -static void -users_loaded (UmUserManager *manager, - UmLoginOptions *d) -{ - GSList *list, *l; - UmUser *user; - - list = um_user_manager_list_users (manager); - for (l = list; l; l = l->next) { - user = l->data; - user_added (manager, user, d); - } - g_slist_free (list); - - g_signal_connect (manager, "user-added", G_CALLBACK (user_added), d); - g_signal_connect (manager, "user-removed", G_CALLBACK (user_removed), d); - g_signal_connect (manager, "user-changed", G_CALLBACK (user_changed), d); -} - -static void update_login_options (GtkWidget *widget, UmLoginOptions *d); - -static void -update_boolean_from_gconf (GtkWidget *widget, - UmLoginOptions *d) -{ - gchar *cmdline; - gboolean value; - gchar *std_out; - gchar *std_err; - gint status; - GError *error; - const gchar *key; - - key = g_object_get_data (G_OBJECT (widget), "gconf-key"); - - /* GConf fail. - * gconfd does not pick up any changes in the default or mandatory - * databases at runtime. Even a SIGHUP doesn't seem to help. So we - * have to use gconftool to go get the current mandatory values. - */ - cmdline = g_strdup_printf ("gconftool-2 --direct --config-source=\"xml:readonly:/etc/gconf/gconf.xml.defaults;xml:readonly:/etc/gconf/gconf.xml.mandatory\" --get %s", key); - - error = NULL; - std_out = NULL; - std_err = NULL; - if (!g_spawn_command_line_sync (cmdline, &std_out, &std_err, &status, &error)) { - g_warning ("Failed to run '%s': %s", cmdline, error->message); - g_error_free (error); - g_free (cmdline); - g_free (std_out); - g_free (std_err); - return; - } - if (WEXITSTATUS (status) != 0) { - g_warning ("Failed to run '%s': %s", cmdline, std_err); - g_free (cmdline); - g_free (std_out); - g_free (std_err); - return; - } - - if (strlen (std_out) > 0 && std_out[strlen (std_out) - 1] == '\n') { - std_out[strlen (std_out) - 1] = 0; - } - - if (g_strcmp0 (std_out, "true") == 0) { - value = TRUE; - } - else { - value = FALSE; - } - g_signal_handlers_block_by_func (widget, update_login_options, d); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), !value); - g_signal_handlers_unblock_by_func (widget, update_login_options, d); - - g_free (cmdline); - g_free (std_out); - g_free (std_err); -} - -static void -update_login_options (GtkWidget *widget, - UmLoginOptions *d) -{ - GError *error; - gboolean active; - GConfValue *value; - const gchar *key = NULL; - gchar *value_string; - - if (widget == d->userlist_check || - widget == d->power_check) { - active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - key = g_object_get_data (G_OBJECT (widget), "gconf-key"); - } - else { - g_warning ("unhandled option in update_login_options"); - return; - } - - error = NULL; - value = gconf_value_new (GCONF_VALUE_BOOL); - gconf_value_set_bool (value, !active); - value_string = gconf_value_encode (value); - if (!dbus_g_proxy_call (d->proxy, "SetMandatoryValue", - &error, - G_TYPE_STRING, key, - G_TYPE_STRING, value_string, - G_TYPE_INVALID, - G_TYPE_INVALID)) { - g_warning ("error calling SetMandatoryValue: %s\n", error->message); - g_error_free (error); - } - g_free (value_string); - gconf_value_free (value); - update_boolean_from_gconf (widget, d); -} - -static void -update_autologin (GtkWidget *widget, - UmLoginOptions *d) -{ - GtkComboBox *combo = GTK_COMBO_BOX (widget); - GtkTreeModel *model; - GtkTreeIter iter; - UmUser *user; - gboolean enabled; - - if (!gtk_widget_is_sensitive (widget)) - return; - - model = gtk_combo_box_get_model (combo); - gtk_combo_box_get_active_iter (combo, &iter); - gtk_tree_model_get (model, &iter, AUTOLOGIN_USER_COL, &user, -1); - if (user) { - enabled = TRUE; - } - else { - enabled = FALSE; - user = um_user_manager_get_user_by_id (d->manager, getuid ()); - g_object_ref (user); - } - - um_user_set_automatic_login (user, enabled); - - g_object_unref (user); -} - -static void -on_permission_changed (GPermission *permission, - GParamSpec *spec, - gpointer data) -{ - UmLoginOptions *d = data; - gboolean authorized; - - authorized = g_permission_get_allowed (G_PERMISSION (d->permission)); - - gtk_widget_set_sensitive (d->autologin_combo, authorized); - gtk_widget_set_sensitive (d->userlist_check, authorized); - gtk_widget_set_sensitive (d->power_check, authorized); - gtk_widget_set_sensitive (d->hints_check, authorized); - gtk_widget_set_sensitive (d->guest_check, authorized); -} - -UmLoginOptions * -um_login_options_new (GtkBuilder *builder) -{ - GtkWidget *widget; - GtkWidget *box; - GtkListStore *store; - GtkTreeIter iter; - GError *error; - UmLoginOptions *um; - - /* TODO: get actual login screen options */ - - um = g_new0 (UmLoginOptions, 1); - - um->manager = um_user_manager_ref_default (); - g_signal_connect (um->manager, "users-loaded", - G_CALLBACK (users_loaded), um); - - widget = (GtkWidget *) gtk_builder_get_object (builder, "dm-automatic-login-combobox"); - um->autologin_combo = widget; - - store = gtk_list_store_new (2, G_TYPE_STRING, UM_TYPE_USER); - gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store)); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - AUTOLOGIN_NAME_COL, _("Disabled"), - AUTOLOGIN_USER_COL, NULL, - -1); - - gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); - - gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store), sort_login_users, NULL, NULL); - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, GTK_SORT_ASCENDING); - - g_signal_connect (widget, "changed", - G_CALLBACK (update_autologin), um); - - widget = (GtkWidget *) gtk_builder_get_object (builder, "dm-show-user-list-checkbutton"); - um->userlist_check = widget; - g_signal_connect (widget, "toggled", - G_CALLBACK (update_login_options), um); - g_object_set_data (G_OBJECT (widget), "gconf-key", - "/apps/gdm/simple-greeter/disable_user_list"); - update_boolean_from_gconf (widget, um); - - widget = (GtkWidget *) gtk_builder_get_object (builder, "dm-show-power-buttons-checkbutton"); - um->power_check = widget; - g_signal_connect(widget, "toggled", - G_CALLBACK (update_login_options), um); - g_object_set_data (G_OBJECT (widget), "gconf-key", - "/apps/gdm/simple-greeter/disable_restart_buttons"); - update_boolean_from_gconf (widget, um); - - widget = (GtkWidget *) gtk_builder_get_object (builder, "dm-show-password-hints-checkbutton"); - um->hints_check = widget; - g_signal_connect (widget, "toggled", - G_CALLBACK (update_login_options), um); - - widget = (GtkWidget *) gtk_builder_get_object (builder, "dm-allow-guest-login-checkbutton"); - um->guest_check = widget; - g_signal_connect (widget, "toggled", - G_CALLBACK (update_login_options), um); - - um->permission = polkit_permission_new_sync ("org.freedesktop.accounts.set-login-option", NULL, NULL, NULL); - if (um->permission != NULL) { - widget = um_lock_button_new (um->permission); - gtk_widget_show (widget); - box = (GtkWidget *)gtk_builder_get_object (builder, "lockbutton-alignment"); - gtk_container_add (GTK_CONTAINER (box), widget); - g_signal_connect (um->permission, "notify", - G_CALLBACK (on_permission_changed), um); - on_permission_changed (um->permission, NULL, um); - um->lock_button = widget; - } - - error = NULL; - um->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); - if (error != NULL) { - g_warning ("Failed to get system bus connection: %s", error->message); - g_error_free (error); - } - - um->proxy = dbus_g_proxy_new_for_name (um->connection, - "org.gnome.GConf.Defaults", - "/", - "org.gnome.GConf.Defaults"); - - if (um->proxy == NULL) { - g_warning ("Cannot connect to GConf defaults mechanism"); - } - - return um; -} - -void -um_login_options_free (UmLoginOptions *um) -{ - if (um->manager) - g_object_unref (um->manager); - if (um->proxy) - g_object_unref (um->proxy); - if (um->connection) - dbus_g_connection_unref (um->connection); - - g_free (um); -} - diff --git a/panels/user-accounts/um-login-options.h b/panels/user-accounts/um-login-options.h deleted file mode 100644 index 949e0c449..000000000 --- a/panels/user-accounts/um-login-options.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright 2009-2010 Red Hat, Inc, - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Written by: Matthias Clasen - */ - -#ifndef __UM_LOGIN_OPTIONS_H__ -#define __UM_LOGIN_OPTIONS_H__ - -G_BEGIN_DECLS - -typedef struct _UmLoginOptions UmLoginOptions; - -UmLoginOptions *um_login_options_new (GtkBuilder *builder); -void um_login_options_free (UmLoginOptions *options); - -G_END_DECLS - -#endif diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c index 8aae11599..5cc4f9759 100644 --- a/panels/user-accounts/um-user-panel.c +++ b/panels/user-accounts/um-user-panel.c @@ -51,7 +51,6 @@ #include "um-account-dialog.h" #include "um-language-dialog.h" -#include "um-login-options.h" #include "um-password-dialog.h" #include "um-photo-dialog.h" #include "um-fingerprint-dialog.h" @@ -68,7 +67,7 @@ struct _UmUserPanelPrivate { UmUserManager *um; GtkBuilder *builder; - GtkWidget *notebook; + GtkWidget *main_box; GtkWidget *lock_button; GPermission *permission; GtkWidget *language_chooser; @@ -77,7 +76,6 @@ struct _UmUserPanelPrivate { UmAccountDialog *account_dialog; UmPasswordDialog *password_dialog; UmPhotoDialog *photo_dialog; - UmLoginOptions *login_options; PolkitAuthority *authority; }; @@ -331,7 +329,7 @@ static void add_user (GtkButton *button, UmUserPanelPrivate *d) { um_account_dialog_show (d->account_dialog, - GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), (UserCreatedCallback)select_created_user, d); } @@ -347,7 +345,7 @@ delete_user_done (UmUserManager *manager, if (!g_error_matches (error, UM_USER_MANAGER_ERROR, UM_USER_MANAGER_ERROR_PERMISSION_DENIED)) { GtkWidget *dialog; - dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, @@ -407,7 +405,7 @@ delete_user (GtkButton *button, UmUserPanelPrivate *d) return; } else if (um_user_get_uid (user) == getuid ()) { - dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, @@ -416,7 +414,7 @@ delete_user (GtkButton *button, UmUserPanelPrivate *d) G_CALLBACK (gtk_widget_destroy), NULL); } else if (um_user_is_logged_in (user)) { - dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, @@ -429,7 +427,7 @@ delete_user (GtkButton *button, UmUserPanelPrivate *d) G_CALLBACK (gtk_widget_destroy), NULL); } else { - dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, @@ -645,13 +643,13 @@ finish_language_chooser (UmUserPanelPrivate *d) combo = get_widget (d, "account-language-combo"); d->language_chooser = um_language_chooser_new (); gtk_window_set_transient_for (GTK_WINDOW (d->language_chooser), - GTK_WINDOW (gtk_widget_get_toplevel (d->notebook))); + GTK_WINDOW (gtk_widget_get_toplevel (d->main_box))); g_signal_connect (d->language_chooser, "response", G_CALLBACK (language_response), d); g_signal_connect (d->language_chooser, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL); - gdk_window_set_cursor (gtk_widget_get_window (gtk_widget_get_toplevel (d->notebook)), NULL); + gdk_window_set_cursor (gtk_widget_get_window (gtk_widget_get_toplevel (d->main_box)), NULL); gtk_window_present (GTK_WINDOW (d->language_chooser)); gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE); @@ -696,7 +694,7 @@ language_changed (UmEditableCombo *combo, return; cursor = gdk_cursor_new (GDK_WATCH); - gdk_window_set_cursor (gtk_widget_get_window (gtk_widget_get_toplevel (d->notebook)), + gdk_window_set_cursor (gtk_widget_get_window (gtk_widget_get_toplevel (d->main_box)), cursor); gdk_cursor_unref (cursor); @@ -712,7 +710,7 @@ change_password (GtkButton *button, UmUserPanelPrivate *d) um_password_dialog_set_user (d->password_dialog, user); um_password_dialog_show (d->password_dialog, - GTK_WINDOW (gtk_widget_get_toplevel (d->notebook))); + GTK_WINDOW (gtk_widget_get_toplevel (d->main_box))); g_object_unref (user); } @@ -760,7 +758,7 @@ change_fingerprint (GtkButton *button, UmUserPanelPrivate *d) label = get_widget (d, "account-fingerprint-value-label"); label2 = get_widget (d, "account-fingerprint-button-label"); - fingerprint_button_clicked (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), label, label2, user); + fingerprint_button_clicked (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), label, label2, user); g_object_unref (user); } @@ -822,7 +820,7 @@ users_loaded (UmUserManager *manager, GtkWidget *dialog; if (um_user_manager_no_service (d->um)) { - dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->notebook)), + dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (d->main_box)), GTK_DIALOG_MODAL, GTK_MESSAGE_OTHER, GTK_BUTTONS_CLOSE, @@ -1233,13 +1231,12 @@ um_user_panel_init (UmUserPanel *self) } setup_main_window (d); - d->login_options = um_login_options_new (d->builder); d->account_dialog = um_account_dialog_new (); d->password_dialog = um_password_dialog_new (); button = get_widget (d, "user-icon-button"); d->photo_dialog = um_photo_dialog_new (button); - d->notebook = get_widget (d, "top-level-notebook"); - gtk_widget_reparent (d->notebook, GTK_WIDGET (self)); + d->main_box = get_widget (d, "accounts-vbox"); + gtk_widget_reparent (d->main_box, GTK_WIDGET (self)); } static void @@ -1275,10 +1272,6 @@ um_user_panel_dispose (GObject *object) gtk_widget_destroy (priv->language_chooser); priv->language_chooser = NULL; } - if (priv->login_options) { - um_login_options_free (priv->login_options); - priv->login_options = NULL; - } if (priv->authority) { g_object_unref (priv->authority); priv->authority = NULL;