# HG changeset patch # User Elliott Sales de Andrade # Date 1239250872 0 # Node ID d1f097ee50304abd301fa0af8908dd71ebf680bc # Parent 547399434ca4b022024fd7d99ae0dc98907b65b4 Replace GtkOptionMenu with GtkComboBox in the gestures plugin for GTK+ 2.4 and up. But that code's commented out, so this is totally untested. diff -r 547399434ca4 -r d1f097ee5030 pidgin/plugins/gestures/gestures.c --- a/pidgin/plugins/gestures/gestures.c Thu Apr 09 04:18:50 2009 +0000 +++ b/pidgin/plugins/gestures/gestures.c Thu Apr 09 04:21:12 2009 +0000 @@ -149,6 +149,15 @@ } #if 0 +#if GTK_CHECK_VERSION(2,4,0) +static void +mouse_button_menu_cb(GtkComboBox *opt, gpointer data) +{ + int button = gtk_combo_box_get_active(opt); + + gstroke_set_mouse_button(button + 2); +} +#else static void mouse_button_menu_cb(GtkMenuItem *item, gpointer data) { @@ -157,6 +166,7 @@ gstroke_set_mouse_button(button + 2); } #endif +#endif static void toggle_draw_cb(GtkToggleButton *toggle, gpointer data) @@ -224,8 +234,10 @@ GtkWidget *toggle; #if 0 GtkWidget *opt; +#if GTK_CHECK_VERSION(2,4,0) GtkWidget *menu, *item; #endif +#endif /* Outside container */ ret = gtk_vbox_new(FALSE, 18); @@ -235,6 +247,19 @@ vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); #if 0 +#if GTK_CHECK_VERSION(2,4,0) + /* Mouse button drop-down menu */ + opt = gtk_combo_box_new_text(); + + gtk_combo_box_append_text(_("Middle mouse button")); + gtk_combo_box_append_text(_("Right mouse button")); + g_signal_connect(G_OBJECT(opt), "changed", + G_CALLBACK(mouse_button_menu_cb), NULL); + + gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); + gtk_combo_box_set_active(GTK_COMBO_BOX(opt), + gstroke_get_mouse_button() - 2); +#else /* Mouse button drop-down menu */ menu = gtk_menu_new(); opt = gtk_option_menu_new(); @@ -254,6 +279,7 @@ gtk_option_menu_set_history(GTK_OPTION_MENU(opt), gstroke_get_mouse_button() - 2); #endif +#endif /* "Visual gesture display" checkbox */ toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display"));