changeset 5767:c97d9ca044a7

[gaim-migrate @ 6192] The mouse gestures plugin now saves its visualization prefs. Yay new prefs system! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 05 Jun 2003 23:12:28 +0000
parents 97a19b574342
children 9c367309b33c
files plugins/gestures/gestures.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/gestures/gestures.c	Thu Jun 05 22:47:30 2003 +0000
+++ b/plugins/gestures/gestures.c	Thu Jun 05 23:12:28 2003 +0000
@@ -21,6 +21,7 @@
 #include "config.h"
 
 #include "gaim.h"
+#include "prefs.h"
 #include "gstroke.h"
 #include "gtkconv.h"
 #include "gtkplugin.h"
@@ -147,7 +148,15 @@
 static void
 toggle_draw_cb(GtkToggleButton *toggle, gpointer data)
 {
-	gstroke_set_draw_strokes(!gstroke_draw_strokes());
+	gaim_prefs_set_bool("/plugins/gtk/X11/gestures/visual",
+		gtk_toggle_button_get_active(toggle));
+}
+
+static void
+visual_pref_cb(const char *name, GaimPrefType type, gpointer value,
+			   gpointer data)
+{
+	gstroke_set_draw_strokes((gboolean)value);
 }
 
 static gboolean
@@ -234,7 +243,7 @@
 	toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display"));
 	gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
-								 gstroke_draw_strokes());
+			gaim_prefs_get_bool("/plugins/gtk/X11/gestures/visual"));
 	g_signal_connect(G_OBJECT(toggle), "toggled",
 					 G_CALLBACK(toggle_draw_cb), NULL);
 
@@ -284,6 +293,13 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
+	gaim_prefs_add_none("/plugins/gtk");
+	gaim_prefs_add_none("/plugins/gtk/X11");
+	gaim_prefs_add_none("/plugins/gtk/X11/gestures");
+	gaim_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE);
+
+	gaim_prefs_connect_callback("/plugins/gtk/X11/gestures/visual",
+								visual_pref_cb, NULL);
 }
 
 GAIM_INIT_PLUGIN(gestures, __init_plugin, info);