cpw.qulogic.gtk3: fbe77efc: Replace GtkOptionMenu with GtkComboBox i...

qulogic at pidgin.im qulogic at pidgin.im
Fri Apr 10 03:36:14 EDT 2009


-----------------------------------------------------------------
Revision: fbe77efc06ba98af604ef878b97fd55924daa018
Ancestor: c32e5afffcda0d82fe8b69752ae91ce3dc3bcc61
Author: qulogic at pidgin.im
Date: 2009-04-09T04:21:12
Branch: im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/fbe77efc06ba98af604ef878b97fd55924daa018

Modified files:
        pidgin/plugins/gestures/gestures.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/plugins/gestures/gestures.c	8d5d2c94b0c78ab3aeb4ad7167729490e070283e
+++ pidgin/plugins/gestures/gestures.c	abce256058f38e4a1228c8ae91caabc4c790671d
@@ -149,7 +149,16 @@ new_conv_cb(PurpleConversation *conv)
 }
 
 #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)
 {
 	int button = (int)data;
@@ -157,6 +166,7 @@ mouse_button_menu_cb(GtkMenuItem *item, 
 	gstroke_set_mouse_button(button + 2);
 }
 #endif
+#endif
 
 static void
 toggle_draw_cb(GtkToggleButton *toggle, gpointer data)
@@ -224,8 +234,10 @@ get_config_frame(PurplePlugin *plugin)
 	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,7 +247,20 @@ get_config_frame(PurplePlugin *plugin)
 	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 @@ get_config_frame(PurplePlugin *plugin)
 	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"));


More information about the Commits mailing list