[gnome-control-center] mouse: Show mouse section only if mouse is present
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] mouse: Show mouse section only if mouse is present
- Date: Mon, 20 Aug 2012 18:21:32 +0000 (UTC)
commit 278c89fdce5e5351192652079386c29d806128f4
Author: Ondrej Holy <oholy redhat com>
Date: Mon Aug 20 14:50:44 2012 +0200
mouse: Show mouse section only if mouse is present
https://bugzilla.gnome.org/show_bug.cgi?id=677206
panels/mouse/gnome-mouse-properties.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index 508ce93..b2dcc0e 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -158,7 +158,7 @@ static void
setup_dialog (GtkBuilder *dialog)
{
GtkRadioButton *radio;
- gboolean touchpad_present;
+ gboolean touchpad_present, mouse_present;
/* Orientation radio buttons */
radio = GTK_RADIO_BUTTON (WID ("left_handed_radio"));
@@ -175,7 +175,10 @@ setup_dialog (GtkBuilder *dialog)
gtk_range_get_adjustment (GTK_RANGE (WID ("double_click_scale"))), "value",
G_SETTINGS_BIND_DEFAULT);
- /* speed */
+ /* Mouse section */
+ mouse_present = mouse_is_present ();
+ gtk_widget_set_visible (WID ("mouse_vbox"), mouse_present);
+
g_signal_connect (WID ("pointer_speed_scale"), "value-changed",
G_CALLBACK (pointer_speed_scale_event), dialog);
@@ -254,6 +257,9 @@ device_changed (GdkDeviceManager *device_manager,
setup_scrollmethod_radios (dialog);
changing_scroll = FALSE;
}
+
+ present = mouse_is_present ();
+ gtk_widget_set_visible (WID ("mouse_vbox"), present);
}
GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]