[gnome-control-center] mouse: Don't destroy the touchpad tab



commit cf8465c250434b17561e05e18c7c39aebc5058c9
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 16 13:12:11 2011 +0000

    mouse: Don't destroy the touchpad tab
    
    We might actually need it when a touchpad appears.

 panels/mouse/gnome-mouse-properties.c  |   54 +++++++++++++++----------------
 panels/mouse/gnome-mouse-properties.ui |    2 +-
 2 files changed, 27 insertions(+), 29 deletions(-)
---
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index 3d5dfa2..5dc7d90 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -285,35 +285,33 @@ setup_dialog (GtkBuilder *dialog)
 
 	/* Trackpad page */
 	if (touchpad_is_present () == FALSE)
-		gtk_notebook_remove_page (GTK_NOTEBOOK (WID ("prefs_widget")), -1);
-	else {
-		g_settings_bind (touchpad_settings, "disable-while-typing",
-				 WID ("disable_w_typing_toggle"), "active",
-				 G_SETTINGS_BIND_DEFAULT);
-		g_settings_bind (touchpad_settings, "tap-to-click",
-				 WID ("tap_to_click_toggle"), "active",
-				 G_SETTINGS_BIND_DEFAULT);
-		g_settings_bind (touchpad_settings, "horiz-scroll-enabled",
-				 WID ("horiz_scroll_toggle"), "active",
-				 G_SETTINGS_BIND_DEFAULT);
-		g_settings_bind (touchpad_settings, "motion-acceleration",
-				 gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_accel_scale"))), "value",
-				 G_SETTINGS_BIND_DEFAULT);
-		g_settings_bind (touchpad_settings, "motion-threshold",
-				 gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_sensitivity_scale"))), "value",
-				 G_SETTINGS_BIND_DEFAULT);
-
-		g_signal_connect (WID ("scroll_disabled_radio"), "toggled",
-				  G_CALLBACK (scrollmethod_changed_event), dialog);
-		g_signal_connect (WID ("scroll_edge_radio"), "toggled",
-				  G_CALLBACK (scrollmethod_changed_event), dialog);
-		g_signal_connect (WID ("scroll_twofinger_radio"), "toggled",
-				  G_CALLBACK (scrollmethod_changed_event), dialog);
-
-		synaptics_check_capabilities (dialog);
-		setup_scrollmethod_radios (dialog);
-	}
+		gtk_widget_hide (WID ("touchpad_vbox"));
+
+	g_settings_bind (touchpad_settings, "disable-while-typing",
+			 WID ("disable_w_typing_toggle"), "active",
+			 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (touchpad_settings, "tap-to-click",
+			 WID ("tap_to_click_toggle"), "active",
+			 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (touchpad_settings, "horiz-scroll-enabled",
+			 WID ("horiz_scroll_toggle"), "active",
+			 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (touchpad_settings, "motion-acceleration",
+			 gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_accel_scale"))), "value",
+			 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (touchpad_settings, "motion-threshold",
+			 gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_sensitivity_scale"))), "value",
+			 G_SETTINGS_BIND_DEFAULT);
+
+	g_signal_connect (WID ("scroll_disabled_radio"), "toggled",
+			  G_CALLBACK (scrollmethod_changed_event), dialog);
+	g_signal_connect (WID ("scroll_edge_radio"), "toggled",
+			  G_CALLBACK (scrollmethod_changed_event), dialog);
+	g_signal_connect (WID ("scroll_twofinger_radio"), "toggled",
+			  G_CALLBACK (scrollmethod_changed_event), dialog);
 
+	synaptics_check_capabilities (dialog);
+	setup_scrollmethod_radios (dialog);
 }
 
 /* Construct the dialog */
diff --git a/panels/mouse/gnome-mouse-properties.ui b/panels/mouse/gnome-mouse-properties.ui
index d9bff13..c3c47b9 100644
--- a/panels/mouse/gnome-mouse-properties.ui
+++ b/panels/mouse/gnome-mouse-properties.ui
@@ -701,7 +701,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox3">
+              <object class="GtkVBox" id="touchpad_vbox">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="border_width">12</property>



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