pidgin/gtkprivacy.c

changeset 29742
631616e39444
parent 29741
3fbd100877f9
child 31321
1fef3832cfa2
child 32394
f883709bdba4
--- a/pidgin/gtkprivacy.c	Fri Feb 19 07:29:30 2010 +0000
+++ b/pidgin/gtkprivacy.c	Fri Feb 19 07:40:34 2010 +0000
@@ -220,11 +220,7 @@
 
 	for (i = 0; i < menu_entry_count; i++) {
 		if (menu_entries[i].num == account->perm_deny) {
-#if GTK_CHECK_VERSION(2,4,0)
 			gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i);
-#else
-			gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), i);
-#endif
 			break;
 		}
 	}
@@ -237,17 +233,10 @@
  * TODO: Setting the permit/deny setting needs to go through privacy.c
  *       Even better: the privacy API needs to not suck.
  */
-#if GTK_CHECK_VERSION(2,4,0)
 static void
 type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog)
 {
 	int new_type = menu_entries[gtk_combo_box_get_active(combo)].num;
-#else
-static void
-type_changed_cb(GtkOptionMenu *optmenu, PidginPrivacyDialog *dialog)
-{
-	int new_type = menu_entries[gtk_option_menu_get_history(optmenu)].num;
-#endif
 
 	dialog->account->perm_deny = new_type;
 	serv_set_permit_deny(purple_account_get_connection(dialog->account));
@@ -354,10 +343,7 @@
 	GtkWidget *button;
 	GtkWidget *dropdown;
 	GtkWidget *label;
-#if !GTK_CHECK_VERSION(2,4,0)
-	GtkWidget *menu;
-#endif
-	int selected = 0;
+	int selected = -1;
 	int i;
 
 	dialog = g_new0(PidginPrivacyDialog, 1);
@@ -385,7 +371,6 @@
 	dialog->account = pidgin_account_option_menu_get_selected(dropdown);
 
 	/* Add the drop-down list with the allow/block types. */
-#if GTK_CHECK_VERSION(2,4,0)
 	dialog->type_menu = gtk_combo_box_new_text();
 	gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0);
 	gtk_widget_show(dialog->type_menu);
@@ -402,27 +387,6 @@
 
 	g_signal_connect(G_OBJECT(dialog->type_menu), "changed",
 					 G_CALLBACK(type_changed_cb), dialog);
-#else
-	dialog->type_menu = gtk_option_menu_new();
-	gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0);
-	gtk_widget_show(dialog->type_menu);
-
-	/* Build the menu for that. */
-	menu = gtk_menu_new();
-
-	for (i = 0; i < menu_entry_count; i++) {
-		pidgin_new_item(menu, _(menu_entries[i].text));
-
-		if (menu_entries[i].num == dialog->account->perm_deny)
-			selected = i;
-	}
-
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(dialog->type_menu), menu);
-	gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), selected);
-
-	g_signal_connect(G_OBJECT(dialog->type_menu), "changed",
-					 G_CALLBACK(type_changed_cb), dialog);
-#endif
 
 	/* Build the treeview for the allow list. */
 	dialog->allow_widget = build_allow_list(dialog);
@@ -453,11 +417,7 @@
 	button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog);
 	dialog->close_button = button;
 
-#if GTK_CHECK_VERSION(2,4,0)
 	type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog);
-#else
-	type_changed_cb(GTK_OPTION_MENU(dialog->type_menu), dialog);
-#endif
 #if 0
 	if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) {
 		gtk_widget_show(dialog->allow_widget);

mercurial