From: Stef Walter Date: Mon, 1 Feb 2010 03:09:52 +0000 (+0000) Subject: [gcr] Move the 'always unlock' option out of the unlock options widget. X-Git-Tag: split~283 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc81d297b3fae45de09659df971856343ccdcede;p=platform%2Fupstream%2Fgcr.git [gcr] Move the 'always unlock' option out of the unlock options widget. --- diff --git a/gcr/gcr-unlock-options-widget.c b/gcr/gcr-unlock-options-widget.c index 217598a..44afb8a 100644 --- a/gcr/gcr-unlock-options-widget.c +++ b/gcr/gcr-unlock-options-widget.c @@ -25,14 +25,12 @@ enum { PROP_0, - PROP_UNLOCK_AUTO, PROP_UNLOCK_TIMEOUT, PROP_UNLOCK_IDLE }; struct _GcrUnlockOptionsWidgetPrivate { GtkBuilder *builder; - GtkToggleButton *auto_unlock; GtkToggleButton *lock_logout; GtkToggleButton *lock_after; GtkToggleButton *lock_idle; @@ -62,13 +60,6 @@ builder_get_spin_button (GtkBuilder *builder, const gchar *name) } static void -on_auto_check_unlock_toggled (GtkToggleButton *check, GtkBuilder *builder) -{ - GtkWidget *area = GTK_WIDGET (gtk_builder_get_object (builder, "options_area")); - gtk_widget_set_sensitive (area, !gtk_toggle_button_get_active (check)); -} - -static void on_timeout_choices_toggled (GtkToggleButton *unused, GtkBuilder *builder) { GtkWidget *spin; @@ -106,10 +97,6 @@ gcr_unlock_options_widget_constructor (GType type, guint n_props, GObjectConstru gtk_container_add (GTK_CONTAINER (self), widget); gtk_widget_show (widget); - button = builder_get_toggle_button (self->pv->builder, "auto_unlock_check"); - g_signal_connect (button, "toggled", G_CALLBACK (on_auto_check_unlock_toggled), self->pv->builder); - on_auto_check_unlock_toggled (button, self->pv->builder); - button = builder_get_toggle_button (self->pv->builder, "lock_logout_choice"); g_signal_connect (button, "toggled", G_CALLBACK (on_timeout_choices_toggled), self->pv->builder); button = builder_get_toggle_button (self->pv->builder, "lock_after_choice"); @@ -163,10 +150,6 @@ gcr_unlock_options_widget_set_property (GObject *obj, guint prop_id, const GValu spin = builder_get_spin_button (self->pv->builder, "lock_minutes_spin"); switch (prop_id) { - case PROP_UNLOCK_AUTO: - button = builder_get_toggle_button (self->pv->builder, "auto_unlock_check"); - gtk_toggle_button_set_active (button, g_value_get_boolean (value)); - break; case PROP_UNLOCK_TIMEOUT: button = builder_get_toggle_button (self->pv->builder, "lock_after_choice"); seconds = g_value_get_int (value); @@ -202,40 +185,25 @@ gcr_unlock_options_widget_get_property (GObject *obj, guint prop_id, GValue *val GcrUnlockOptionsWidget *self = GCR_UNLOCK_OPTIONS_WIDGET (obj); GtkToggleButton *button; GtkSpinButton *spin; - gboolean auto_unlock; gint minutes; - button = builder_get_toggle_button (self->pv->builder, "auto_unlock_check"); - auto_unlock = gtk_toggle_button_get_active (button); - spin = builder_get_spin_button (self->pv->builder, "lock_minutes_spin"); minutes = gtk_spin_button_get_value_as_int (spin); switch (prop_id) { - case PROP_UNLOCK_AUTO: - g_value_set_boolean (value, auto_unlock); - break; case PROP_UNLOCK_TIMEOUT: - if (auto_unlock) { + button = builder_get_toggle_button (self->pv->builder, "lock_after_choice"); + if (!gtk_toggle_button_get_active (button)) g_value_set_int (value, 0); - } else { - button = builder_get_toggle_button (self->pv->builder, "lock_after_choice"); - if (!gtk_toggle_button_get_active (button)) - g_value_set_int (value, 0); - else - g_value_set_int (value, minutes * 60); - } + else + g_value_set_int (value, minutes * 60); break; case PROP_UNLOCK_IDLE: - if (auto_unlock) { + button = builder_get_toggle_button (self->pv->builder, "lock_idle_choice"); + if (!gtk_toggle_button_get_active (button)) g_value_set_int (value, 0); - } else { - button = builder_get_toggle_button (self->pv->builder, "lock_idle_choice"); - if (!gtk_toggle_button_get_active (button)) - g_value_set_int (value, 0); - else - g_value_set_int (value, minutes * 60); - } + else + g_value_set_int (value, minutes * 60); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); @@ -257,10 +225,6 @@ gcr_unlock_options_widget_class_init (GcrUnlockOptionsWidgetClass *klass) gobject_class->set_property = gcr_unlock_options_widget_set_property; gobject_class->get_property = gcr_unlock_options_widget_get_property; - g_object_class_install_property (gobject_class, PROP_UNLOCK_AUTO, - g_param_spec_boolean ("unlock-auto", "Unlock Auto", "Unlock Automatically", - FALSE, G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, PROP_UNLOCK_TIMEOUT, g_param_spec_int ("unlock-timeout", "Unlock Timeout", "Unlock Timeout", 0, G_MAXINT, 0, G_PARAM_READWRITE)); diff --git a/gcr/gcr-unlock-options-widget.ui b/gcr/gcr-unlock-options-widget.ui index cfa8a55..5ab4509 100644 --- a/gcr/gcr-unlock-options-widget.ui +++ b/gcr/gcr-unlock-options-widget.ui @@ -2,123 +2,100 @@ - + + 1 + 999 + 1 + 10 + + True - 0 - none + vertical + 6 + + + Lock this keyring when I log out. + True + True + False + True + True + + + 0 + + - + True - 3 - 12 + 6 - + True vertical 6 - - Lock this keyring when I log out. + + Lock this keyring after True True False - True True + lock_logout_choice + False 0 - + + Lock this keyring if idle for True - 6 - - - True - vertical - 6 - - - Lock this keyring after - True - True - False - True - lock_logout_choice - - - False - 0 - - - - - Lock this keyring if idle for - True - True - False - True - lock_logout_choice - - - False - 1 - - - - - False - 0 - - - - - True - True - - spin_adjustment - 1 - True - - - False - 1 - - - - - True - 0 - minutes. - - - 2 - - + True + False + True + lock_logout_choice + False 1 + + False + 0 + + + + + True + True + + spin_adjustment + 1 + True + + + False + 1 + + + + + True + 0 + minutes. + + + 2 + + + 1 + - - - Automatically unlock this keyring whenever I'm logged in. - True - True - False - True - - - - - 1 - 999 - 1 - 10