| 145 #endif |
146 #endif |
| 146 |
147 |
| 147 static void |
148 static void |
| 148 toggle_draw_cb(GtkToggleButton *toggle, gpointer data) |
149 toggle_draw_cb(GtkToggleButton *toggle, gpointer data) |
| 149 { |
150 { |
| 150 gstroke_set_draw_strokes(!gstroke_draw_strokes()); |
151 gaim_prefs_set_bool("/plugins/gtk/X11/gestures/visual", |
| |
152 gtk_toggle_button_get_active(toggle)); |
| |
153 } |
| |
154 |
| |
155 static void |
| |
156 visual_pref_cb(const char *name, GaimPrefType type, gpointer value, |
| |
157 gpointer data) |
| |
158 { |
| |
159 gstroke_set_draw_strokes((gboolean)value); |
| 151 } |
160 } |
| 152 |
161 |
| 153 static gboolean |
162 static gboolean |
| 154 plugin_load(GaimPlugin *plugin) |
163 plugin_load(GaimPlugin *plugin) |
| 155 { |
164 { |
| 232 |
241 |
| 233 /* "Visual gesture display" checkbox */ |
242 /* "Visual gesture display" checkbox */ |
| 234 toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); |
243 toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display")); |
| 235 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
244 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
| 236 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
245 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), |
| 237 gstroke_draw_strokes()); |
246 gaim_prefs_get_bool("/plugins/gtk/X11/gestures/visual")); |
| 238 g_signal_connect(G_OBJECT(toggle), "toggled", |
247 g_signal_connect(G_OBJECT(toggle), "toggled", |
| 239 G_CALLBACK(toggle_draw_cb), NULL); |
248 G_CALLBACK(toggle_draw_cb), NULL); |
| 240 |
249 |
| 241 gtk_widget_show_all(ret); |
250 gtk_widget_show_all(ret); |
| 242 |
251 |
| 282 }; |
291 }; |
| 283 |
292 |
| 284 static void |
293 static void |
| 285 __init_plugin(GaimPlugin *plugin) |
294 __init_plugin(GaimPlugin *plugin) |
| 286 { |
295 { |
| |
296 gaim_prefs_add_none("/plugins/gtk"); |
| |
297 gaim_prefs_add_none("/plugins/gtk/X11"); |
| |
298 gaim_prefs_add_none("/plugins/gtk/X11/gestures"); |
| |
299 gaim_prefs_add_bool("/plugins/gtk/X11/gestures/visual", FALSE); |
| |
300 |
| |
301 gaim_prefs_connect_callback("/plugins/gtk/X11/gestures/visual", |
| |
302 visual_pref_cb, NULL); |
| 287 } |
303 } |
| 288 |
304 |
| 289 GAIM_INIT_PLUGIN(gestures, __init_plugin, info); |
305 GAIM_INIT_PLUGIN(gestures, __init_plugin, info); |