[gnome-control-center] media: actually bind the 'autorun-never' key to the checkbox widget



commit 8e19a1093047ba244e12361e3a11884810676cbf
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Apr 18 11:28:37 2011 -0400

    media: actually bind the 'autorun-never' key to the checkbox widget
    
    The 'Never prompt or start programs on media insertion' checkbox was not
    wired properly with the relevant settings key.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648108

 panels/media/cc-media-panel.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/panels/media/cc-media-panel.c b/panels/media/cc-media-panel.c
index 8c3cc3a..96be39c 100644
--- a/panels/media/cc-media-panel.c
+++ b/panels/media/cc-media-panel.c
@@ -238,13 +238,6 @@ autorun_set_preferences (CcMediaPanel *self,
 }
 
 static void
-update_media_sensitivity (CcMediaPanel *self)
-{
-  gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "media_handling_vbox")),
-                            ! g_settings_get_boolean (self->priv->preferences, PREF_MEDIA_AUTORUN_NEVER));
-}
-
-static void
 custom_item_activated_cb (GtkAppChooserButton *button,
                           const gchar *item,
                           gpointer user_data)
@@ -556,7 +549,17 @@ media_panel_setup (CcMediaPanel *self)
                     G_CALLBACK (on_extra_options_button_clicked),
                     self);
 
-  update_media_sensitivity (self);
+  g_settings_bind (self->priv->preferences,
+                   PREF_MEDIA_AUTORUN_NEVER,
+                   gtk_builder_get_object (self->priv->builder, "media_autorun_never_checkbutton"),
+                   "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
+  g_settings_bind (self->priv->preferences,
+                   PREF_MEDIA_AUTORUN_NEVER,
+                   GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "media_handling_vbox")),
+                   "sensitive",
+                   G_SETTINGS_BIND_INVERT_BOOLEAN);
 }
 
 static void



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