Index: gedit/dialogs/gedit-open-location-dialog.c
===================================================================
--- gedit/dialogs/gedit-open-location-dialog.c	(revision 6616)
+++ gedit/dialogs/gedit-open-location-dialog.c	(working copy)
@@ -38,7 +38,7 @@
 
 #include "gedit-open-location-dialog.h"
 #include "gedit-history-entry.h"
-#include "gedit-encodings-option-menu.h"
+#include "gedit-encodings-combo-box.h"
 #include "gedit-utils.h"
 #include "gedit-help.h"
 
@@ -188,7 +188,7 @@
 	gtk_label_set_mnemonic_widget (GTK_LABEL (location_label),
 				       dlg->priv->uri_entry);
 
-	dlg->priv->encoding_menu = gedit_encodings_option_menu_new (FALSE);
+	dlg->priv->encoding_menu = gedit_encodings_combo_box_new (FALSE);
 
 	gtk_label_set_mnemonic_widget (GTK_LABEL (encoding_label),
 				       dlg->priv->encoding_menu);
@@ -250,6 +250,6 @@
 {
 	g_return_val_if_fail (GEDIT_IS_OPEN_LOCATION_DIALOG (dlg), NULL);
 	
-	return gedit_encodings_option_menu_get_selected_encoding (
-				GEDIT_ENCODINGS_OPTION_MENU (dlg->priv->encoding_menu));
+	return gedit_encodings_combo_box_get_selected_encoding (
+				GEDIT_ENCODINGS_COMBO_BOX (dlg->priv->encoding_menu));
 }
Index: gedit/gedit-file-chooser-dialog.c
===================================================================
--- gedit/gedit-file-chooser-dialog.c	(revision 6616)
+++ gedit/gedit-file-chooser-dialog.c	(working copy)
@@ -41,7 +41,7 @@
 #include <gtk/gtk.h>
 
 #include "gedit-file-chooser-dialog.h"
-#include "gedit-encodings-option-menu.h"
+#include "gedit-encodings-combo-box.h"
 #include "gedit-language-manager.h"
 #include "gedit-prefs-manager-app.h"
 #include "gedit-debug.h"
@@ -76,7 +76,7 @@
 	hbox = gtk_hbox_new (FALSE, 6);
 
 	label = gtk_label_new_with_mnemonic (_("C_haracter Coding:"));
-	menu = gedit_encodings_option_menu_new (
+	menu = gedit_encodings_combo_box_new (
 		gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE);
 
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu);
@@ -271,8 +271,8 @@
 			  NULL);
 
 	if (encoding != NULL)
-		gedit_encodings_option_menu_set_selected_encoding (
-				GEDIT_ENCODINGS_OPTION_MENU (GEDIT_FILE_CHOOSER_DIALOG (result)->priv->option_menu),
+		gedit_encodings_combo_box_set_selected_encoding (
+				GEDIT_ENCODINGS_COMBO_BOX (GEDIT_FILE_CHOOSER_DIALOG (result)->priv->option_menu),
 				encoding);
 
 	active_filter = gedit_prefs_manager_get_active_file_filter ();
@@ -370,10 +370,10 @@
 					const GeditEncoding    *encoding)
 {
 	g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog));
-	g_return_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (dialog->priv->option_menu));
+	g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (dialog->priv->option_menu));
 
-	gedit_encodings_option_menu_set_selected_encoding (
-				GEDIT_ENCODINGS_OPTION_MENU (dialog->priv->option_menu),
+	gedit_encodings_combo_box_set_selected_encoding (
+				GEDIT_ENCODINGS_COMBO_BOX (dialog->priv->option_menu),
 				encoding);
 }
 
@@ -381,10 +381,10 @@
 gedit_file_chooser_dialog_get_encoding (GeditFileChooserDialog *dialog)
 {
 	g_return_val_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog), NULL);
-	g_return_val_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (dialog->priv->option_menu), NULL);
+	g_return_val_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (dialog->priv->option_menu), NULL);
 	g_return_val_if_fail ((gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_OPEN ||
 			       gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE), NULL);
 
-	return gedit_encodings_option_menu_get_selected_encoding (
-				GEDIT_ENCODINGS_OPTION_MENU (dialog->priv->option_menu));
+	return gedit_encodings_combo_box_get_selected_encoding (
+				GEDIT_ENCODINGS_COMBO_BOX (dialog->priv->option_menu));
 }
Index: gedit/gedit-io-error-message-area.c
===================================================================
--- gedit/gedit-io-error-message-area.c	(revision 6616)
+++ gedit/gedit-io-error-message-area.c	(working copy)
@@ -48,7 +48,7 @@
 #include "gedit-io-error-message-area.h"
 #include "gedit-message-area.h"
 #include "gedit-prefs-manager.h"
-#include <gedit/gedit-encodings-option-menu.h>
+#include <gedit/gedit-encodings-combo-box.h>
 
 #define MAX_URI_IN_DIALOG_LENGTH 50
 
@@ -453,7 +453,7 @@
 }
 
 static void
-create_option_menu (GtkWidget *message_area, GtkWidget *vbox)
+create_combo_box (GtkWidget *message_area, GtkWidget *vbox)
 {
 	GtkWidget *hbox;
 	GtkWidget *label;
@@ -467,7 +467,7 @@
 	label = gtk_label_new_with_mnemonic (label_markup);
 	g_free (label_markup);
 	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-	menu = gedit_encodings_option_menu_new (TRUE);
+	menu = gedit_encodings_combo_box_new (TRUE);
 	g_object_set_data (G_OBJECT (message_area), 
 			   "gedit-message-area-encoding-menu", 
 			   menu);
@@ -551,7 +551,7 @@
 		gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
 	}
 
-	create_option_menu (message_area, vbox);
+	create_combo_box (message_area, vbox);
 	
 	gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (message_area),
 					 hbox_content);
@@ -690,8 +690,8 @@
 				  "gedit-message-area-encoding-menu");	
 	g_return_val_if_fail (menu, NULL);
 	
-	return gedit_encodings_option_menu_get_selected_encoding
-					(GEDIT_ENCODINGS_OPTION_MENU (menu));
+	return gedit_encodings_combo_box_get_selected_encoding
+					(GEDIT_ENCODINGS_COMBO_BOX (menu));
 }
 
 GtkWidget *
Index: gedit/gedit-encodings-combo-box.c
===================================================================
--- gedit/gedit-encodings-combo-box.c	(revision 0)
+++ gedit/gedit-encodings-combo-box.c	(revision 0)
@@ -0,0 +1,375 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gedit-encodings-combo-box.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2003-2005 - Paolo Maggi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, 
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+/*
+ * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a 
+ * list of people on the gedit Team.  
+ * See the ChangeLog files for a list of changes. 
+ *
+ * $Id: gedit-encodings-combo-box.c 6112 2008-01-23 08:26:24Z sfre $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include <gedit/gedit-encodings-combo-box.h>
+#include <gedit/gedit-prefs-manager.h>
+#include <gedit/dialogs/gedit-encodings-dialog.h>
+
+#define ENCODING_KEY "Enconding"
+
+static void	  update_menu 		(GeditEncodingsComboBox       *combo_box);
+
+/* Properties */
+enum {
+	PROP_0,
+	PROP_SAVE_MODE
+};
+
+#define GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
+							GEDIT_TYPE_ENCODINGS_COMBO_BOX,	\
+							GeditEncodingsComboBoxPrivate))
+
+struct _GeditEncodingsComboBoxPrivate
+{
+	gint activated_item;
+
+	gboolean save_mode;
+};
+
+
+G_DEFINE_TYPE(GeditEncodingsComboBox, gedit_encodings_combo_box, GTK_TYPE_COMBO_BOX)
+
+static void
+gedit_encodings_combo_box_set_property (GObject 	*object,
+					  guint 	 prop_id,
+			    		  const GValue *value,
+					  GParamSpec	*pspec)
+{
+	GeditEncodingsComboBox *om;
+
+	g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (object));
+
+    	om = GEDIT_ENCODINGS_COMBO_BOX (object);
+
+	switch (prop_id)
+	{
+	case PROP_SAVE_MODE:
+		om->priv->save_mode = g_value_get_boolean (value);
+
+		update_menu (om);		
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+gedit_encodings_combo_box_get_property (GObject 	*object, 
+					  guint 	 prop_id,
+			    		  GValue 	*value, 
+					  GParamSpec	*pspec)
+{
+	GeditEncodingsComboBox *om;
+
+	g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (object));
+
+	om = GEDIT_ENCODINGS_COMBO_BOX (object);
+
+	switch (prop_id)
+	{	
+	case PROP_SAVE_MODE:
+		g_value_set_boolean (value, om->priv->save_mode);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+gedit_encodings_combo_box_class_init (GeditEncodingsComboBoxClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = gedit_encodings_combo_box_set_property;
+	object_class->get_property = gedit_encodings_combo_box_get_property;
+
+	g_object_class_install_property (object_class,
+					 PROP_SAVE_MODE,
+					 g_param_spec_boolean ("save-mode",
+							       ("Save Mode"),
+							       ("Save Mode"),
+							       FALSE,
+							       G_PARAM_READWRITE | 
+							       G_PARAM_CONSTRUCT |
+							       G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof(GeditEncodingsComboBoxPrivate));
+}
+
+static void
+dialog_response_cb (GtkDialog                *dialog,
+                    gint                      response_id,
+                    GeditEncodingsComboBox *menu)
+{
+	update_menu (menu);
+
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+add_or_remove (GeditEncodingsComboBox *menu, GtkTreeModel *model)
+{
+	GtkTreeIter iter;
+	gpointer p = NULL;
+
+	if ( gtk_combo_box_get_active_iter (GTK_COMBO_BOX (menu), &iter) )
+		gtk_tree_model_get (model, &iter, 1, &p, -1);
+
+	if (p != NULL)
+	{
+		GtkTreeIter t;
+		menu->priv->activated_item =
+			gtk_combo_box_get_active (GTK_COMBO_BOX (menu));
+
+		if ( gtk_tree_model_get_iter_first (model, &t) )
+			do
+			{
+				gtk_list_store_set (GTK_LIST_STORE (model), &t, 2, PANGO_STYLE_NORMAL, -1);
+			}while ( gtk_tree_model_iter_next (model, &t));
+	
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter, 2, PANGO_STYLE_ITALIC, -1);
+	}
+	else
+	{
+		GtkWidget *dialog;
+
+		GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu));
+
+		if (!GTK_WIDGET_TOPLEVEL (toplevel))
+			toplevel = NULL;
+
+		gtk_combo_box_set_active (GTK_COMBO_BOX (menu),
+								  menu->priv->activated_item);
+
+		dialog = gedit_encodings_dialog_new();
+
+		if (toplevel != NULL)
+		{
+			GtkWindowGroup *wg;
+
+			gtk_window_set_transient_for (GTK_WINDOW (dialog),
+						      GTK_WINDOW (toplevel));
+
+			wg = GTK_WINDOW (toplevel)->group;		      
+			if (wg == NULL)
+			{
+				wg = gtk_window_group_new ();
+				gtk_window_group_add_window (wg,
+							     GTK_WINDOW (toplevel));
+			}
+
+			gtk_window_group_add_window (wg,
+						     GTK_WINDOW (dialog));
+		}
+
+		gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+
+		g_signal_connect (dialog,
+				  "response",
+				  G_CALLBACK (dialog_response_cb),
+				  menu);
+		g_signal_handlers_disconnect_by_func (menu, add_or_remove, model);
+
+		gtk_widget_show (dialog);
+	}
+}
+
+static gboolean
+RowSeparatorFunc (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
+{
+	gchar *str;
+	gtk_tree_model_get (model, iter, 0, &str, -1);
+	if (str != NULL && strlen (str) !=0) return FALSE;
+	return TRUE;
+}
+
+static void
+update_menu (GeditEncodingsComboBox *menu)
+{
+	GtkListStore *store;
+	GSList	  *encodings, *list;
+	gchar     *str;
+	GtkTreeIter iter;
+	GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
+
+	const GeditEncoding *utf8_encoding;
+	const GeditEncoding *current_encoding;
+
+	store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_INT);
+
+	encodings = list = gedit_prefs_manager_get_shown_in_menu_encodings ();
+
+	utf8_encoding = gedit_encoding_get_utf8 ();
+	current_encoding = gedit_encoding_get_current ();
+
+	if (!menu->priv->save_mode)
+	{
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, _("Auto Detected"), 1, NULL, 2, PANGO_STYLE_NORMAL, -1);
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, "", 1, NULL, 2, PANGO_STYLE_NORMAL, -1);
+	}
+
+	if (current_encoding != utf8_encoding)
+		str = gedit_encoding_to_string (utf8_encoding);
+	else
+		str = g_strdup_printf (_("Current Locale (%s)"),
+				       gedit_encoding_get_charset (utf8_encoding));
+
+	gtk_list_store_append (store, &iter);
+	gtk_list_store_set (store, &iter, 0, str, 1, utf8_encoding, 2, PANGO_STYLE_NORMAL, -1);
+
+	g_free (str);
+
+	if ((utf8_encoding != current_encoding) &&
+	    (current_encoding != NULL))
+	{
+		str = g_strdup_printf (_("Current Locale (%s)"),
+				       gedit_encoding_get_charset (current_encoding));
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, str, 1, current_encoding, 2, PANGO_STYLE_NORMAL, -1);
+
+		g_free (str);
+	}
+
+	while (list != NULL)
+	{
+		const GeditEncoding *enc;
+
+		enc = (const GeditEncoding *)list->data;
+
+		if ((enc != current_encoding) &&
+		    (enc != utf8_encoding) &&
+		    (enc != NULL))
+		{
+			str = gedit_encoding_to_string (enc);
+
+			gtk_list_store_append (store, &iter);
+			gtk_list_store_set (store, &iter, 0, str, 1, enc, 2, PANGO_STYLE_NORMAL, -1);
+
+			g_free (str);
+		}
+
+		list = g_slist_next (list);
+	}
+
+	g_slist_free (encodings);
+
+	if (gedit_prefs_manager_shown_in_menu_encodings_can_set ())
+	{
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, "", 1, NULL, 2, PANGO_STYLE_NORMAL, -1);
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter, 0, _("Add or Remove..."), 1, NULL, 2, PANGO_STYLE_NORMAL, -1);
+	}
+
+	gtk_cell_layout_clear (GTK_CELL_LAYOUT (menu));
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (menu), renderer, TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (menu), renderer, "text", 0, "style", 2, NULL);
+	gtk_combo_box_set_model (GTK_COMBO_BOX (menu), GTK_TREE_MODEL (store));
+	gtk_combo_box_set_active (GTK_COMBO_BOX (menu), 0);
+	gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (menu), RowSeparatorFunc, NULL, NULL);
+	g_signal_connect (menu, "changed", G_CALLBACK (add_or_remove), store);
+	add_or_remove (menu, GTK_TREE_MODEL (store));
+}
+
+static void
+gedit_encodings_combo_box_init (GeditEncodingsComboBox *menu)
+{
+	menu->priv = GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE (menu);
+}
+
+GtkWidget *
+gedit_encodings_combo_box_new (gboolean save_mode)
+{
+	return g_object_new (GEDIT_TYPE_ENCODINGS_COMBO_BOX, 
+			     "save_mode", save_mode,
+			     NULL);
+}
+
+const GeditEncoding *
+gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu)
+{
+	GtkTreeIter iter;
+
+	g_return_val_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (menu), NULL);
+
+	if ( gtk_combo_box_get_active_iter (GTK_COMBO_BOX (menu), &iter) )
+		{
+			const GeditEncoding *ret;
+			gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (menu)), &iter, 1, &ret, -1);
+
+			return ret;
+		}
+
+	return NULL;
+}
+
+void
+gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu,
+						   const GeditEncoding      *encoding)
+{
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+	gboolean b;
+	g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (menu));
+	g_return_if_fail (GTK_IS_COMBO_BOX (menu));
+
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (menu));
+	b = gtk_tree_model_get_iter_first (model, &iter);
+	while (b)
+	{
+		const GeditEncoding *enc;
+
+		gtk_tree_model_get (model, &iter, 1, &enc, -1);
+
+		if (enc == encoding)
+		{
+			gtk_combo_box_set_active_iter (GTK_COMBO_BOX (menu), &iter);
+
+			return;
+		}
+
+		b = gtk_tree_model_iter_next (model, &iter);
+	}
+}
Index: gedit/gedit-encodings-combo-box.h
===================================================================
--- gedit/gedit-encodings-combo-box.h	(revision 0)
+++ gedit/gedit-encodings-combo-box.h	(revision 0)
@@ -0,0 +1,78 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * gedit-encodings-combo-box.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2003-2005 - Paolo Maggi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, 
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+/*
+ * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a 
+ * list of people on the gedit Team.  
+ * See the ChangeLog files for a list of changes. 
+ *
+ * $Id: gedit-encodings-option-menu.h 4429 2005-12-12 17:28:04Z pborelli $
+ */
+
+#ifndef __GEDIT_ENCODINGS_COMBO_BOX_H__
+#define __GEDIT_ENCODINGS_COMBO_BOX_H__
+
+#include <gtk/gtkoptionmenu.h>
+#include <gedit/gedit-encodings.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_ENCODINGS_COMBO_BOX             (gedit_encodings_combo_box_get_type ())
+#define GEDIT_ENCODINGS_COMBO_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBox))
+#define GEDIT_ENCODINGS_COMBO_BOX_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBoxClass))
+#define GEDIT_IS_ENCODINGS_COMBO_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX))
+#define GEDIT_IS_ENCODINGS_COMBO_BOX_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_ENCODINGS_COMBO_BOX))
+#define GEDIT_ENCODINGS_COMBO_BOX_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBoxClass))
+
+
+typedef struct _GeditEncodingsComboBox 	GeditEncodingsComboBox;
+typedef struct _GeditEncodingsComboBoxClass 	GeditEncodingsComboBoxClass;
+
+typedef struct _GeditEncodingsComboBoxPrivate	GeditEncodingsComboBoxPrivate;
+
+struct _GeditEncodingsComboBox
+{
+	GtkComboBox			 parent;
+
+	GeditEncodingsComboBoxPrivate	*priv;
+};
+
+struct _GeditEncodingsComboBoxClass
+{
+	GtkComboBoxClass		 parent_class;
+};
+
+GType		     gedit_encodings_combo_box_get_type		(void) G_GNUC_CONST;
+
+/* Constructor */
+GtkWidget 	    *gedit_encodings_combo_box_new 			(gboolean save_mode);
+
+const GeditEncoding *gedit_encodings_combo_box_get_selected_encoding	(GeditEncodingsComboBox *menu);
+void		     gedit_encodings_combo_box_set_selected_encoding	(GeditEncodingsComboBox *menu,
+									 const GeditEncoding      *encoding);
+
+G_END_DECLS
+
+#endif /* __GEDIT_ENCODINGS_COMBO_BOX_H__ */
+
+
Index: gedit/gedit-encodings-option-menu.c
===================================================================
--- gedit/gedit-encodings-option-menu.c	(revision 6616)
+++ gedit/gedit-encodings-option-menu.c	(working copy)
@@ -1,419 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gedit-encodings-option-menu.c
- * This file is part of gedit
- *
- * Copyright (C) 2003-2005 - Paolo Maggi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, 
- * Boston, MA 02111-1307, USA.
- */
- 
-/*
- * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a 
- * list of people on the gedit Team.  
- * See the ChangeLog files for a list of changes. 
- *
- * $Id$
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-
-#include <gedit/gedit-encodings-option-menu.h>
-#include <gedit/gedit-prefs-manager.h>
-#include <gedit/dialogs/gedit-encodings-dialog.h>
-
-#define ENCODING_KEY "Enconding"
-
-static void	  update_menu 		(GeditEncodingsOptionMenu       *option_menu);
-
-/* Properties */
-enum {
-	PROP_0,
-	PROP_SAVE_MODE
-};
-
-#define GEDIT_ENCODINGS_OPTION_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
-							GEDIT_TYPE_ENCODINGS_OPTION_MENU,	\
-							GeditEncodingsOptionMenuPrivate))
-
-struct _GeditEncodingsOptionMenuPrivate
-{
-	gint activated_item;
-
-	gboolean save_mode;
-};
-
-
-G_DEFINE_TYPE(GeditEncodingsOptionMenu, gedit_encodings_option_menu, GTK_TYPE_OPTION_MENU)
-
-static void
-gedit_encodings_option_menu_set_property (GObject 	*object, 
-					  guint 	 prop_id,
-			    		  const GValue *value, 
-					  GParamSpec	*pspec)
-{
-	GeditEncodingsOptionMenu *om;
-
-	g_return_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (object));
-
-    	om = GEDIT_ENCODINGS_OPTION_MENU (object);
-
-	switch (prop_id)
-	{
-	case PROP_SAVE_MODE:
-		om->priv->save_mode = g_value_get_boolean (value);
-
-		update_menu (om);		
-		break;
-	default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-		break;
-	}
-}
-
-static void
-gedit_encodings_option_menu_get_property (GObject 	*object, 
-					  guint 	 prop_id,
-			    		  GValue 	*value, 
-					  GParamSpec	*pspec)
-{
-	GeditEncodingsOptionMenu *om;
-
-	g_return_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (object));
-
-	om = GEDIT_ENCODINGS_OPTION_MENU (object);
-
-	switch (prop_id)
-	{	
-	case PROP_SAVE_MODE:
-		g_value_set_boolean (value, om->priv->save_mode);
-		break;
-	default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-		break;
-	}
-}
-
-static void
-gedit_encodings_option_menu_class_init (GeditEncodingsOptionMenuClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	object_class->set_property = gedit_encodings_option_menu_set_property;
-	object_class->get_property = gedit_encodings_option_menu_get_property;
-
-	g_object_class_install_property (object_class,
-					 PROP_SAVE_MODE,
-					 g_param_spec_boolean ("save-mode",
-							       ("Save Mode"),
-							       ("Save Mode"),
-							       FALSE,
-							       G_PARAM_READWRITE | 
-							       G_PARAM_CONSTRUCT |
-							       G_PARAM_STATIC_STRINGS));
-
-	g_type_class_add_private (object_class, sizeof(GeditEncodingsOptionMenuPrivate));
-}
-
-static void
-dialog_response_cb (GtkDialog                *dialog,
-                    gint                      response_id,
-                    GeditEncodingsOptionMenu *option_menu)
-{
-	update_menu (option_menu);
-
-	gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-static void
-add_or_remove (GtkMenuItem              *menu_item,
-	       GeditEncodingsOptionMenu *option_menu)
-{
-	if (GTK_IS_RADIO_MENU_ITEM (menu_item))
-	{
-		option_menu->priv->activated_item = 
-			gtk_option_menu_get_history (GTK_OPTION_MENU (option_menu));
-	}
-	else
-	{
-		GtkWidget *dialog;
-
-		GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (option_menu));
-	
-		if (!GTK_WIDGET_TOPLEVEL (toplevel))
-			toplevel = NULL;	
-		
-		gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu),
-					     option_menu->priv->activated_item);
-
-		dialog = gedit_encodings_dialog_new();
-
-		if (toplevel != NULL)
-		{
-			GtkWindowGroup *wg;
-
-			gtk_window_set_transient_for (GTK_WINDOW (dialog),
-						      GTK_WINDOW (toplevel));
-
-			wg = GTK_WINDOW (toplevel)->group;		      
-			if (wg == NULL)
-			{
-				wg = gtk_window_group_new ();
-				gtk_window_group_add_window (wg,
-							     GTK_WINDOW (toplevel));
-			}
-
-			gtk_window_group_add_window (wg,
-						     GTK_WINDOW (dialog));
-		}
-
-		gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-		
-		g_signal_connect (dialog,
-				  "response",
-				  G_CALLBACK (dialog_response_cb),
-				  option_menu);
-
-		gtk_widget_show (dialog);
-	}
-}
-
-static void
-update_menu (GeditEncodingsOptionMenu *option_menu)
-{
-	GtkWidget *menu;
-	GtkWidget *menu_item;
-	GSList    *group = NULL;
-	GSList	  *encodings, *list;
-	gchar     *str;
-
-	const GeditEncoding *utf8_encoding;
-	const GeditEncoding *current_encoding;
-
-	menu = gtk_menu_new ();
-
-	encodings = list = gedit_prefs_manager_get_shown_in_menu_encodings ();
-
-	utf8_encoding = gedit_encoding_get_utf8 ();
-	current_encoding = gedit_encoding_get_current ();
-
-	if (!option_menu->priv->save_mode)
-	{
-		menu_item = gtk_radio_menu_item_new_with_label (group, _("Auto Detected"));
-		group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
-
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-		gtk_widget_show (menu_item);
-
-		g_signal_connect (menu_item,
-				  "activate",
-				  G_CALLBACK (add_or_remove),
-				  option_menu);
-
-		menu_item = gtk_separator_menu_item_new ();
-
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-		gtk_widget_show (menu_item);
-	}
-
-	if (current_encoding != utf8_encoding)
-		str = gedit_encoding_to_string (utf8_encoding);
-	else
-		str = g_strdup_printf (_("Current Locale (%s)"), 
-				       gedit_encoding_get_charset (utf8_encoding));
-
-	menu_item = gtk_radio_menu_item_new_with_label (group, str);
-
-	g_signal_connect (menu_item,
-			  "activate",
-			  G_CALLBACK (add_or_remove),
-			  option_menu);
-
-	group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
-
-	g_object_set_data (G_OBJECT (menu_item), ENCODING_KEY, (gpointer)utf8_encoding);
-
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-	gtk_widget_show (menu_item);
-
-	g_free (str);
-
-	if ((utf8_encoding != current_encoding) && 
-	    (current_encoding != NULL))
-	{
-		str = g_strdup_printf (_("Current Locale (%s)"), 
-				       gedit_encoding_get_charset (current_encoding));
-
-		menu_item = gtk_radio_menu_item_new_with_label (group, str);
-
-		g_signal_connect (menu_item,
-				  "activate",
-				  G_CALLBACK (add_or_remove),
-				  option_menu);
-
-		group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
-
-		g_object_set_data (G_OBJECT (menu_item), 
-				   ENCODING_KEY, (gpointer)current_encoding);
-
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-		gtk_widget_show (menu_item);
-
-		g_free (str);
-	}
-
-	while (list != NULL)
-	{
-		const GeditEncoding *enc;
-		
-		enc = (const GeditEncoding *)list->data;
-
-		if ((enc != current_encoding) && 
-		    (enc != utf8_encoding) && 
-		    (enc != NULL))
-		{
-			str = gedit_encoding_to_string (enc);
-
-			menu_item = gtk_radio_menu_item_new_with_label (group, str);
-
-			g_signal_connect (menu_item,
-					  "activate",
-					  G_CALLBACK (add_or_remove),
-					  option_menu);
-
-			group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
-
-			g_object_set_data (G_OBJECT (menu_item), ENCODING_KEY, (gpointer)enc);
-
-			gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-			gtk_widget_show (menu_item);
-
-			g_free (str);
-		}
-		
-		list = g_slist_next (list);
-	}
-
-	g_slist_free (encodings);
-
-	if (gedit_prefs_manager_shown_in_menu_encodings_can_set ())
-	{
-		menu_item = gtk_separator_menu_item_new ();
-	      	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-		gtk_widget_show (menu_item);
-
-		menu_item = gtk_menu_item_new_with_mnemonic (_("Add or _Remove..."));
-
-		g_signal_connect (menu_item,
-				  "activate",
-				  G_CALLBACK (add_or_remove),
-				  option_menu);
-	
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
-		gtk_widget_show (menu_item);
-	}
-
-	gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
-}
-
-static void
-gedit_encodings_option_menu_init (GeditEncodingsOptionMenu *menu)
-{
-	menu->priv = GEDIT_ENCODINGS_OPTION_MENU_GET_PRIVATE (menu);
-}
-
-GtkWidget *
-gedit_encodings_option_menu_new (gboolean save_mode)
-{
-	return g_object_new (GEDIT_TYPE_ENCODINGS_OPTION_MENU, 
-			     "save_mode", save_mode,
-			     NULL);
-}
-
-const GeditEncoding *
-gedit_encodings_option_menu_get_selected_encoding (GeditEncodingsOptionMenu *menu)
-{
-	GtkWidget *active_widget;
-
-	GtkOptionMenu *option_menu;
-
-	g_return_val_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (menu), NULL);
-
-	option_menu = GTK_OPTION_MENU (menu);
-	g_return_val_if_fail (option_menu != NULL, NULL);
-	
-	if (option_menu->menu)
-    	{
-      		active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu));
-
-	      	if (active_widget != NULL)
-		{
-			const GeditEncoding *ret;
-
-			ret = (const GeditEncoding *)g_object_get_data (G_OBJECT (active_widget), 
-									ENCODING_KEY);
-
-			return ret;
-		}
-	}
-
-	return NULL;
-}
-
-void
-gedit_encodings_option_menu_set_selected_encoding (GeditEncodingsOptionMenu *menu,
-						   const GeditEncoding      *encoding)
-{
-	GtkOptionMenu *option_menu;
-	GList *list;
-	gint i;
-
-	g_return_if_fail (GEDIT_IS_ENCODINGS_OPTION_MENU (menu));
-
-	option_menu = GTK_OPTION_MENU (menu);
-	g_return_if_fail (option_menu != NULL);
-
-	list = GTK_MENU_SHELL (option_menu->menu)->children;
-	i = 0;
-	while (list != NULL)
-	{
-		GtkWidget *menu_item;
-		const GeditEncoding *enc;
-
-		menu_item = GTK_WIDGET (list->data);
-
-		enc = (const GeditEncoding *)g_object_get_data (G_OBJECT (menu_item), 
-								ENCODING_KEY);
-
-		if (enc == encoding)
-		{
-			gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
-
-			gtk_option_menu_set_history (GTK_OPTION_MENU (menu), i);
-
-			return;
-		}
-
-		++i;
-
-		list = g_list_next (list);
-	}
-}
Index: gedit/gedit-encodings-option-menu.h
===================================================================
--- gedit/gedit-encodings-option-menu.h	(revision 6616)
+++ gedit/gedit-encodings-option-menu.h	(working copy)
@@ -1,78 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gedit-encodings-option-menu.h
- * This file is part of gedit
- *
- * Copyright (C) 2003-2005 - Paolo Maggi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, 
- * Boston, MA 02111-1307, USA.
- */
- 
-/*
- * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a 
- * list of people on the gedit Team.  
- * See the ChangeLog files for a list of changes. 
- *
- * $Id$
- */
-
-#ifndef __GEDIT_ENCODINGS_OPTION_MENU_H__
-#define __GEDIT_ENCODINGS_OPTION_MENU_H__
-
-#include <gtk/gtkoptionmenu.h>
-#include <gedit/gedit-encodings.h>
-
-G_BEGIN_DECLS
-
-#define GEDIT_TYPE_ENCODINGS_OPTION_MENU             (gedit_encodings_option_menu_get_type ())
-#define GEDIT_ENCODINGS_OPTION_MENU(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_ENCODINGS_OPTION_MENU, GeditEncodingsOptionMenu))
-#define GEDIT_ENCODINGS_OPTION_MENU_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_ENCODINGS_OPTION_MENU, GeditEncodingsOptionMenuClass))
-#define GEDIT_IS_ENCODINGS_OPTION_MENU(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_ENCODINGS_OPTION_MENU))
-#define GEDIT_IS_ENCODINGS_OPTION_MENU_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_ENCODINGS_OPTION_MENU))
-#define GEDIT_ENCODINGS_OPTION_MENU_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_ENCODINGS_OPTION_MENU, GeditEncodingsOptionMenuClass))
-
-
-typedef struct _GeditEncodingsOptionMenu 	GeditEncodingsOptionMenu;
-typedef struct _GeditEncodingsOptionMenuClass 	GeditEncodingsOptionMenuClass;
-
-typedef struct _GeditEncodingsOptionMenuPrivate	GeditEncodingsOptionMenuPrivate;
-
-struct _GeditEncodingsOptionMenu
-{
-	GtkOptionMenu			 parent;
-
-	GeditEncodingsOptionMenuPrivate	*priv;
-};
-
-struct _GeditEncodingsOptionMenuClass
-{
-	GtkOptionMenuClass		 parent_class;
-};
-
-GType		     gedit_encodings_option_menu_get_type		(void) G_GNUC_CONST;
-
-/* Constructor */
-GtkWidget 	    *gedit_encodings_option_menu_new 			(gboolean save_mode);
-
-const GeditEncoding *gedit_encodings_option_menu_get_selected_encoding	(GeditEncodingsOptionMenu *menu);
-void		     gedit_encodings_option_menu_set_selected_encoding	(GeditEncodingsOptionMenu *menu,
-									 const GeditEncoding      *encoding);
-
-G_END_DECLS
-
-#endif /* __GEDIT_ENCODINGS_OPTION_MENU_H__ */
-
-
Index: gedit/Makefile.am
===================================================================
--- gedit/Makefile.am	(revision 6616)
+++ gedit/Makefile.am	(working copy)
@@ -95,7 +95,7 @@
 	gedit-debug.h			\
 	gedit-document.h 		\
 	gedit-encodings.h		\
-	gedit-encodings-option-menu.h	\
+	gedit-encodings-combo-box.h	\
 	gedit-file-chooser-dialog.h	\
 	gedit-help.h 			\
 	gedit-message-area.h		\
@@ -139,7 +139,7 @@
 	gedit-gio-document-saver.c	\
 	gedit-documents-panel.c		\
 	gedit-encodings.c		\
-	gedit-encodings-option-menu.c	\
+	gedit-encodings-combo-box.c	\
 	gedit-file-chooser-dialog.c	\
 	gedit-help.c			\
 	gedit-history-entry.c		\
