Index: eel-preferences-glade.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-preferences-glade.c,v
retrieving revision 1.5
diff -u -r1.5 eel-preferences-glade.c
--- eel-preferences-glade.c	22 Jul 2003 23:20:30 -0000	1.5
+++ eel-preferences-glade.c	26 Nov 2005 11:54:46 -0000
@@ -25,7 +25,7 @@
 #include "eel-preferences-glade.h"
 
 #include <glib.h>
-#include <gtk/gtkoptionmenu.h>
+#include <gtk/gtkcombobox.h>
 #include <gtk/gtktogglebutton.h>
 
 #include "eel-preferences.h"
@@ -39,27 +39,27 @@
 /* helper */
 
 static void
-eel_preferences_glade_option_menu_update (GtkOptionMenu *option_menu,
+eel_preferences_glade_combo_box_update (GtkComboBox *combo_box,
 					  gpointer value,
 					  GCallback change_callback)
 {
 	GHashTable *map;
-	int history;
+	int active;
 	gpointer key;
 
-	map = (GHashTable *) g_object_get_data (G_OBJECT (option_menu),
+	map = (GHashTable *) g_object_get_data (G_OBJECT (combo_box),
 						EEL_PREFERENCES_GLADE_DATA_MAP);
-	history = GPOINTER_TO_INT (g_hash_table_lookup (map, value));
+	active = GPOINTER_TO_INT (g_hash_table_lookup (map, value));
 
-	if (history == -1) {
+	if (active == -1) {
 		return;
 	}
 
-	key = g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_KEY);
+	key = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY);
 
-	g_signal_handlers_block_by_func (option_menu, change_callback, key);
-	gtk_option_menu_set_history (option_menu, history);
-	g_signal_handlers_unblock_by_func (option_menu, change_callback, key);
+	g_signal_handlers_block_by_func (combo_box, change_callback, key);
+	gtk_combo_box_set_active (combo_box, active);
+	g_signal_handlers_unblock_by_func (combo_box, change_callback, key);
 }
 
 static void
@@ -152,22 +152,21 @@
 			       G_CALLBACK (eel_preferences_glade_bool_toggled),
 			       g_strdup (key), (GClosureNotify) g_free, 0);
 }
-
-/* string enum (OptionMenu) preference */
+/* string enum (ComboBox) preference */
 
 static void
-eel_preferences_glade_string_enum_option_menu_changed (GtkOptionMenu *option_menu,
+eel_preferences_glade_string_enum_combo_box_changed (GtkComboBox *combo_box,
 						       char *key)
 {
-	int history;
+	int active;
 	char **values;
 	int i;
 
-	history = gtk_option_menu_get_history (option_menu);
-	values = g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_VALUE);
+	active = gtk_combo_box_get_active  (combo_box);
+	values = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE);
 
 	i = 0;
-	while (i < history && values[i] != NULL) {
+	while (i < active && values[i] != NULL) {
 		i++;
 	}
 
@@ -179,26 +178,26 @@
 }
 
 static void
-eel_preferences_glade_string_enum_option_menu_update (GtkOptionMenu *option_menu)
+eel_preferences_glade_string_enum_combo_box_update (GtkComboBox *combo_box)
 {
 	char *value;
 
-	value = eel_preferences_get (g_object_get_data (G_OBJECT (option_menu),
+	value = eel_preferences_get (g_object_get_data (G_OBJECT (combo_box),
 							EEL_PREFERENCES_GLADE_DATA_KEY));
 
-	eel_preferences_glade_option_menu_update (option_menu, value,
-						  G_CALLBACK (eel_preferences_glade_string_enum_option_menu_changed));
+	eel_preferences_glade_combo_box_update (combo_box, value,
+						  G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed));
 
 	g_free (value);
 }
 
 void
-eel_preferences_glade_connect_string_enum_option_menu (GladeXML *dialog,
+eel_preferences_glade_connect_string_enum_combo_box (GladeXML *dialog,
 						       const char *component,
 						       const char *key,
 						       const char **values)
 {
-	GtkWidget *option_menu;
+	GtkWidget *combo_box;
 	GHashTable *map;
 	int i;
 
@@ -207,7 +206,7 @@
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
 	
-	option_menu = glade_xml_get_widget (dialog, component);
+	combo_box = glade_xml_get_widget (dialog, component);
 
 	map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
 
@@ -215,67 +214,68 @@
 		g_hash_table_insert (map, g_strdup (values[i]), GINT_TO_POINTER (i));
 	}
 
-	g_object_set_data_full (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_MAP, map,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP, map,
 				(GDestroyNotify) g_hash_table_destroy);
-	g_object_set_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_VALUE, values);
-	g_object_set_data_full (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_KEY,
+	g_object_set_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE, values);
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY,
 				g_strdup (key), (GDestroyNotify) g_free);
 
 	eel_preferences_add_callback_while_alive (key,
-				 		  (EelPreferencesCallback) eel_preferences_glade_string_enum_option_menu_update,
-						  option_menu, G_OBJECT (option_menu));
+				 		  (EelPreferencesCallback) eel_preferences_glade_string_enum_combo_box_update,
+						  combo_box, G_OBJECT (combo_box));
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (option_menu));
+		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
-	g_signal_connect (G_OBJECT (option_menu), "changed",
-			  G_CALLBACK (eel_preferences_glade_string_enum_option_menu_changed),
-			  g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_KEY));
+	g_signal_connect (G_OBJECT (combo_box), "changed",
+			  G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed),
+			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY));
 
-	eel_preferences_glade_string_enum_option_menu_update (GTK_OPTION_MENU (option_menu));
+	eel_preferences_glade_string_enum_combo_box_update (GTK_COMBO_BOX (combo_box));
 }
 
 void
-eel_preferences_glade_connect_string_enum_option_menu_slave (GladeXML *dialog,
+eel_preferences_glade_connect_string_enum_combo_box_slave (GladeXML *dialog,
 							     const char *component,
 							     const char *key)
 {
-	GtkWidget *option_menu;
+	GtkWidget *combo_box;
 
 	g_return_if_fail (dialog != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 	
-	option_menu = glade_xml_get_widget (dialog, component);
+	combo_box = glade_xml_get_widget (dialog, component);
 
-	g_assert (g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_MAP) != NULL);
+	g_assert (g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP) != NULL);
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (option_menu));
+		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
-	g_signal_connect_data (G_OBJECT (option_menu), "changed",
-			       G_CALLBACK (eel_preferences_glade_string_enum_option_menu_changed),
+	g_signal_connect_data (G_OBJECT (combo_box), "changed",
+			       G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed),
 			       g_strdup (key), (GClosureNotify) g_free, 0);
 }
 
+
 /* int enum preference */
 
 static void
-eel_preferences_glade_int_enum_changed (GtkOptionMenu *option_menu,
+eel_preferences_glade_int_enum_changed (GtkComboBox *combo_box,
 					char *key)
 {
-	int history;
+	int active;
 	GSList *value_list;
 	int i;
 
-	history = gtk_option_menu_get_history (option_menu);
-	value_list = (GSList *) g_object_get_data (G_OBJECT (option_menu),
+	active = gtk_combo_box_get_active (combo_box);
+	value_list = (GSList *) g_object_get_data (G_OBJECT (combo_box),
 						   EEL_PREFERENCES_GLADE_DATA_VALUE);
 
 	i = 0;
-	while (i < history && value_list->next != NULL) {
+	while (i < active && value_list->next != NULL) {
 		i++;
 		value_list = value_list->next;
 	}
@@ -288,14 +288,14 @@
 }
 
 static void
-eel_preferences_glade_int_enum_update (GtkOptionMenu *option_menu)
+eel_preferences_glade_int_enum_update (GtkComboBox *combo_box)
 {
 	int value;
 
-	value = eel_preferences_get_integer (g_object_get_data (G_OBJECT (option_menu),
+	value = eel_preferences_get_integer (g_object_get_data (G_OBJECT (combo_box),
 								EEL_PREFERENCES_GLADE_DATA_KEY));
 
-	eel_preferences_glade_option_menu_update (option_menu, GINT_TO_POINTER (value),
+	eel_preferences_glade_combo_box_update (combo_box, GINT_TO_POINTER (value),
 						  G_CALLBACK (eel_preferences_glade_int_enum_changed));
 }
 
@@ -308,7 +308,7 @@
 	GHashTable *map;
 	int i;
 	int value;
-	GtkOptionMenu *option_menu;
+	GtkComboBox *combo_box;
 	GSList *value_list;
 
 	g_return_if_fail (dialog != NULL);
@@ -316,7 +316,7 @@
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
 	
-	option_menu = GTK_OPTION_MENU (glade_xml_get_widget (dialog, component));
+	combo_box = GTK_COMBO_BOX (glade_xml_get_widget (dialog, component));
 
 	map = g_hash_table_new (g_direct_hash, g_direct_equal);
 	value_list = NULL;
@@ -327,26 +327,26 @@
 		g_hash_table_insert (map, GINT_TO_POINTER (value), GINT_TO_POINTER (i));
 	}
 
-	g_object_set_data_full (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_MAP, map,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP, map,
 				(GDestroyNotify) g_hash_table_destroy);
-	g_object_set_data_full (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_VALUE, value_list,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE, value_list,
 				(GDestroyNotify) g_slist_free);
-	g_object_set_data_full (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_KEY,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY,
 				g_strdup (key), (GDestroyNotify) g_free);
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (option_menu));
+		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
-	g_signal_connect (G_OBJECT (option_menu), "changed",
+	g_signal_connect (G_OBJECT (combo_box), "changed",
 			  G_CALLBACK (eel_preferences_glade_int_enum_changed),
-			  g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_KEY));
+			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY));
 
 	eel_preferences_add_callback_while_alive (key,
 				 		  (EelPreferencesCallback) eel_preferences_glade_int_enum_update,
-						  option_menu, G_OBJECT (option_menu));
+						  combo_box, G_OBJECT (combo_box));
 
-	eel_preferences_glade_int_enum_update (option_menu);
+	eel_preferences_glade_int_enum_update (combo_box);
 }
 
 /* String Enum (RadioButton) preference */
@@ -449,25 +449,25 @@
 /* list enum preference */
 
 static void
-eel_preferences_glade_list_enum_changed (GtkOptionMenu *option_menu,
+eel_preferences_glade_list_enum_changed (GtkComboBox *combo_box,
 					 char *key)
 {
 	GSList *widgets;
-	int history;
+	int active;
 	char **values;
 	int i;
 	EelStringList *list;
 
-	widgets = g_object_get_data (G_OBJECT (option_menu), EEL_PREFERENCES_GLADE_DATA_WIDGETS);
+	widgets = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_WIDGETS);
 
 	list = eel_string_list_new (TRUE);
 	for (; widgets != NULL; widgets = widgets->next) {
-		history = gtk_option_menu_get_history (GTK_OPTION_MENU (widgets->data));
-		values = g_object_get_data (G_OBJECT (option_menu),
+		active = gtk_combo_box_get_active (GTK_COMBO_BOX (widgets->data));
+		values = g_object_get_data (G_OBJECT (combo_box),
 					    EEL_PREFERENCES_GLADE_DATA_VALUE);
 
 		i = 0;
-		while (i < history && values[i] != NULL) {
+		while (i < active && values[i] != NULL) {
 			i++;
 		}
 
@@ -495,7 +495,7 @@
 	components = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_GLADE_DATA_WIDGETS);
 	for (i = 0; i < values && components != NULL; i++, components = components->next) {
 		item = eel_string_list_nth (value_list, i);
-		eel_preferences_glade_option_menu_update (GTK_OPTION_MENU (components->data), 
+		eel_preferences_glade_combo_box_update (GTK_COMBO_BOX (components->data), 
 							  item,
 							  G_CALLBACK (eel_preferences_glade_list_enum_changed));
 		g_free (item);
@@ -510,7 +510,7 @@
 					 const char *key,
 					 const char **values)
 {
-	GtkWidget *option_menu;
+	GtkWidget *combo_box;
 	GHashTable *map;
 	int i;
 	GSList *widgets;
@@ -529,43 +529,43 @@
 
 	writable = eel_preferences_key_is_writable (key);
 
-	option_menu = NULL;
+	combo_box = NULL;
 	widgets = NULL;
 	for (i = 0; components[i] != NULL; i++) {
-		option_menu = glade_xml_get_widget (dialog, components[i]);
-		widgets = g_slist_append (widgets, option_menu);
+		combo_box = glade_xml_get_widget (dialog, components[i]);
+		widgets = g_slist_append (widgets, combo_box);
 		if (i == 0) {
-			g_object_set_data_full (G_OBJECT (option_menu),
+			g_object_set_data_full (G_OBJECT (combo_box),
 						EEL_PREFERENCES_GLADE_DATA_MAP, map,
 						(GDestroyNotify) g_hash_table_destroy);
-			g_object_set_data_full (G_OBJECT (option_menu),
+			g_object_set_data_full (G_OBJECT (combo_box),
 						EEL_PREFERENCES_GLADE_DATA_WIDGETS,
 						widgets, (GDestroyNotify) g_slist_free);
 		} else {
-			g_object_set_data (G_OBJECT (option_menu),
+			g_object_set_data (G_OBJECT (combo_box),
 					   EEL_PREFERENCES_GLADE_DATA_MAP, map);
-			g_object_set_data (G_OBJECT (option_menu),
+			g_object_set_data (G_OBJECT (combo_box),
 					   EEL_PREFERENCES_GLADE_DATA_WIDGETS, widgets);
 		}
-		g_object_set_data (G_OBJECT (option_menu),
+		g_object_set_data (G_OBJECT (combo_box),
 				   EEL_PREFERENCES_GLADE_DATA_VALUE, values);
-		g_object_set_data_full (G_OBJECT (option_menu),
+		g_object_set_data_full (G_OBJECT (combo_box),
 				        EEL_PREFERENCES_GLADE_DATA_KEY, g_strdup (key),
 					(GDestroyNotify) g_free);
 
 		if (!writable) {
-			eel_preferences_glade_set_never_sensitive (option_menu);
+			eel_preferences_glade_set_never_sensitive (combo_box);
 		}
 
-		g_signal_connect (G_OBJECT (option_menu), "changed",
+		g_signal_connect (G_OBJECT (combo_box), "changed",
 			  	  G_CALLBACK (eel_preferences_glade_list_enum_changed),
-				  g_object_get_data (G_OBJECT (option_menu),
+				  g_object_get_data (G_OBJECT (combo_box),
 					  	     EEL_PREFERENCES_GLADE_DATA_KEY));
 	}
 
 	eel_preferences_add_callback_while_alive (key,
 						  (EelPreferencesCallback) eel_preferences_glade_list_enum_update,
-						  option_menu, G_OBJECT (option_menu));
+						  combo_box, G_OBJECT (combo_box));
 	
-	eel_preferences_glade_list_enum_update (option_menu);
+	eel_preferences_glade_list_enum_update (combo_box);
 }
Index: eel-preferences-glade.h
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-preferences-glade.h,v
retrieving revision 1.2
diff -u -r1.2 eel-preferences-glade.h
--- eel-preferences-glade.h	17 Mar 2003 15:49:34 -0000	1.2
+++ eel-preferences-glade.h	26 Nov 2005 11:54:46 -0000
@@ -35,13 +35,14 @@
 void eel_preferences_glade_connect_bool_slave			 (GladeXML    *dialog,
 								  const char  *component,
 								  const char  *key);
-void eel_preferences_glade_connect_string_enum_option_menu	 (GladeXML    *dialog,
+void eel_preferences_glade_connect_string_enum_combo_box	 (GladeXML    *dialog,
 								  const char  *component,
 								  const char  *key,
 								  const char **values);
-void eel_preferences_glade_connect_string_enum_option_menu_slave (GladeXML    *dialog,
+void eel_preferences_glade_connect_string_enum_combo_box_slave	 (GladeXML    *dialog,
 								  const char  *component,
 								  const char  *key);
+
 void eel_preferences_glade_connect_int_enum			 (GladeXML    *dialog,
 								  const char  *component,
 								  const char  *key,
