[gnome-settings-daemon] wacom: Add ineffective code to print the changed stylus



commit 6110368d33aff36bec87b95a4ccab64e4fa69b55
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 14 18:42:24 2011 +0000

    wacom: Add ineffective code to print the changed stylus

 plugins/wacom/list-wacom.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index d696894..0cad95b 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -43,6 +43,29 @@ get_loc (GSettings *settings)
 	return ret;
 }
 
+static void
+last_stylus_changed (GsdWacomDevice  *device,
+		     GParamSpec      *pspec,
+		     gpointer         user_data)
+{
+	GsdWacomStylus *stylus;
+	char *loc;
+
+	g_object_get (device, "last-stylus", &stylus, NULL);
+
+	g_print ("Stylus changed for device '%s'\n",
+		 gsd_wacom_device_get_name (device));
+
+	g_print ("\t*** Stylus: '%s'\n",
+		 gsd_wacom_stylus_get_name (stylus));
+
+	loc = get_loc (gsd_wacom_stylus_get_settings (stylus));
+	g_print ("\t\tSettings: %s\n", loc);
+	g_free (loc);
+
+	g_print ("\t\tIcon name: %s\n", gsd_wacom_stylus_get_icon_name (stylus));
+}
+
 #define BOOL_AS_STR(x) (x ? "yes" : "no")
 
 static void
@@ -57,6 +80,9 @@ list_devices (GList *devices)
 
 		device = l->data;
 
+		g_signal_connect (G_OBJECT (device), "notify::last-stylus",
+				  G_CALLBACK (last_stylus_changed), NULL);
+
 		g_print ("Device '%s' (type: %s)\n",
 			 gsd_wacom_device_get_name (device),
 			 gsd_wacom_device_type_to_string (gsd_wacom_device_get_device_type (device)));



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