Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/Makefile.am,v
retrieving revision 1.35
diff -u -p -r1.35 Makefile.am
--- Makefile.am	19 Jul 2004 08:03:08 -0000	1.35
+++ Makefile.am	14 Nov 2004 21:31:17 -0000
@@ -14,14 +14,13 @@ INCLUDES =							\
 
 lib_LTLIBRARIES = libgnome-desktop-2.la
 
-noinst_PROGRAMS = test-ditem test-hint test-ditem-edit
+noinst_PROGRAMS = test-ditem test-hint test-ditem-edit test-ditem-edit-simple-dialog
 
 libgnome_desktop_2_la_SOURCES = \
 	gnome-desktop-item.c	\
 	gnome-ditem-edit.c	\
-	gnome-hint.c		\
-	gnome-desktop-i18n.c	\
-	gnome-desktop-i18n.h
+	gnome-ditem-edit-simple-dialog.c	\
+	gnome-hint.c
 
 libgnome_desktop_2_la_LIBADD = \
 	$(GNOME_DESKTOP_LIBS)
@@ -47,6 +46,12 @@ test_hint_LDADD = \
 test_ditem_edit_SOURCES = test-ditem-edit.c
 
 test_ditem_edit_LDADD =		\
+	libgnome-desktop-2.la	\
+	$(GNOME_DESKTOP_LIBS)
+
+test_ditem_edit_simple_dialog_SOURCES = test-ditem-edit-simple-dialog.c
+
+test_ditem_edit_simple_dialog_LDADD =		\
 	libgnome-desktop-2.la	\
 	$(GNOME_DESKTOP_LIBS)
 
Index: gnome-desktop-item.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-desktop-item.c,v
retrieving revision 1.138
diff -u -p -r1.138 gnome-desktop-item.c
--- gnome-desktop-item.c	14 Sep 2004 07:33:26 -0000	1.138
+++ gnome-desktop-item.c	14 Nov 2004 21:31:18 -0000
@@ -38,7 +38,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <string.h>
-#include <libgnome/gnome-i18n.h>
+#include <glib/gi18n.h>
 #include <libgnome/gnome-util.h>
 #include <libgnome/gnome-exec.h>
 #include <libgnome/gnome-url.h>
@@ -50,7 +50,6 @@
 #include <libgnomevfs/gnome-vfs-utils.h>
 
 #include <libgnome/gnome-desktop-item.h>
-#include "gnome-desktop-i18n.h"
 
 #ifdef HAVE_STARTUP_NOTIFICATION
 #define SN_API_NOT_YET_FROZEN
@@ -914,16 +913,16 @@ lookup_locale (const GnomeDesktopItem *i
 static const char *
 lookup_best_locale (const GnomeDesktopItem *item, const char *key)
 {
-	const GList *list = gnome_i18n_get_language_list ("LC_MESSAGES");
-	while (list != NULL) {
-		const char *ret;
-		const char *locale = list->data;
+	const char * const *langs_pointer;
+	int                 i;
+
+	langs_pointer = g_get_language_names ();
+	for (i = 0; langs_pointer[i] != NULL; i++) {
+		const char *ret = NULL;
 
-		ret = lookup_locale (item, key, locale);
+		ret = lookup_locale (item, key, langs_pointer[i]);
 		if (ret != NULL)
 			return ret;
-
-		list = list->next;
 	}
 
 	return NULL;
@@ -2807,16 +2806,16 @@ const char *
 gnome_desktop_item_get_attr_locale (const GnomeDesktopItem *item,
 				    const char             *attr)
 {
-	const GList *list, *l;
+	const char * const *langs_pointer;
+	int                 i;
 
-	list = gnome_i18n_get_language_list ("LC_MESSAGES");
-	for (l = list; l; l = l->next) {
-		const char *locale = l->data;
+	langs_pointer = g_get_language_names ();
+	for (i = 0; langs_pointer[i] != NULL; i++) {
 		const char *value = NULL;
 
-		value = lookup_locale (item, attr, locale);
+		value = lookup_locale (item, attr, langs_pointer[i]);
 		if (value)
-			return locale;
+			return langs_pointer[i];
 	}
 
 	return NULL;
@@ -2846,14 +2845,15 @@ gnome_desktop_item_get_languages (const 
 static const char *
 get_language (void)
 {
-	const GList *list = gnome_i18n_get_language_list ("LC_MESSAGES");
-	while (list != NULL) {
-		const char *lang = list->data;
+	const char * const *langs_pointer;
+	int                 i;
+
+	langs_pointer = g_get_language_names ();
+	for (i = 0; langs_pointer[i] != NULL; i++) {
 		/* find first without encoding  */
-		if (strchr (lang, '.') == NULL) {
-			return lang; 
+		if (strchr (langs_pointer[i], '.') == NULL) {
+			return langs_pointer[i]; 
 		}
-		list = list->next;
 	}
 	return NULL;
 }
Index: gnome-ditem-edit-simple-dialog.c
===================================================================
RCS file: gnome-ditem-edit-simple-dialog.c
diff -N gnome-ditem-edit-simple-dialog.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnome-ditem-edit-simple-dialog.c	14 Nov 2004 21:31:18 -0000
@@ -0,0 +1,1099 @@
+/*
+ * gnome-ditem-edit-simple-dialog.c:
+ *
+ * Copyright (C) 2004 Vincent Untz
+ *
+ * The Gnome Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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 Library General Public
+ * License along with the Gnome Library; see the file COPYING.LIB.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *	Vincent Untz <vincent@vuntz.net>
+ */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include <libgnome/gnome-desktop-item.h>
+#include <libgnomeui/gnome-file-entry.h>
+#include <libgnomeui/gnome-icon-entry.h>
+#include "gnome-ditem-edit-simple-dialog.h"
+
+struct _GnomeDItemEditSimpleDialogPrivate
+{
+	/* we keep a ditem around, since we can never have absolutely
+	   everything in the display so we load a file, or get a ditem,
+	   sync the display and ref the ditem */
+	GnomeDesktopItem *ditem;
+
+	GnomeDesktopItem *revert_ditem;
+
+	gboolean ui_dirty; /* TRUE if something got changed, and ditem
+			    * was not yet synced */
+	guint    save_timeout;
+	char    *saving_error;
+
+	char    *location; /* file location */
+
+	GtkWidget *frame_required;
+	GtkWidget *name_entry;
+	GtkWidget *type_combo;
+	GtkWidget *command_label;
+	GtkWidget *command_entry;
+
+	GtkWidget *frame_optional;
+	GtkWidget *comment_entry;
+	GtkWidget *icon_entry;
+	GtkWidget *terminal_button;  
+
+	GtkWidget *help_button;
+	GtkWidget *revert_button;
+
+	/* the directory of the theme for the icon, see bug #119208 */
+	char *icon_theme_dir;
+};
+
+/* Time in milliseconds after which we save the file on the disk */
+#define SAVE_FREQUENCY 2000
+
+enum {
+	REVERT_BUTTON
+};
+
+enum {
+	COLUMN_TEXT,
+	COLUMN_TYPE,
+	NUMBER_COLUMNS
+};
+
+typedef struct {
+	const char           *name;
+	GnomeDesktopItemType  type;
+} ComboItem;
+
+static ComboItem type_items [] = {
+	{ N_("Application"), GNOME_DESKTOP_ITEM_TYPE_APPLICATION },
+	{ N_("File"),        GNOME_DESKTOP_ITEM_TYPE_LINK        },
+	{ N_("Directory"),   GNOME_DESKTOP_ITEM_TYPE_DIRECTORY   }
+};
+
+enum {
+	CHANGED,
+	NAME_CHANGED,
+	COMMAND_CHANGED,
+	COMMENT_CHANGED,
+	ICON_CHANGED,
+	LAST_SIGNAL
+};
+
+static GObjectClass *parent_class;
+static guint ditem_edit_signals[LAST_SIGNAL] = { 0 };
+
+#define GNOME_DITEM_EDIT_SIMPLE_DIALOG_GET_PRIVATE(o)  (GNOME_DITEM_EDIT_SIMPLE_DIALOG (o)->priv)
+
+static void gnome_ditem_edit_simple_dialog_class_init (GnomeDItemEditSimpleDialogClass *class);
+static void gnome_ditem_edit_simple_dialog_init       (GnomeDItemEditSimpleDialog      *dialog);
+static void gnome_ditem_edit_simple_dialog_destroy    (GtkObject *object);
+
+static GObject* gnome_ditem_edit_simple_dialog_constructor  (GType                  type,
+							     guint                  n_construct_properties,
+							     GObjectConstructParam *construct_params);
+
+
+static GtkWidget *label_new_with_mnemonic (const char *text);
+static void table_attach_label (GtkTable  *table,
+				GtkWidget *label,
+				int        left,
+				int        right,
+				int        top,
+				int        bottom);
+
+static void table_attach_entry (GtkTable  *table,
+				GtkWidget *entry,
+				int        left,
+				int        right,
+				int        top,
+				int        bottom);
+static void setup_combo (GtkWidget *combo_box,
+			 ComboItem *items,
+			 int        nb_items);
+
+static void type_combo_changed (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_changed (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_name_changed (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_command_changed (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_comment_changed (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_icon_changed (GnomeDItemEditSimpleDialog *dialog);
+
+static void gnome_ditem_edit_simple_dialog_sync_display (GnomeDItemEditSimpleDialog *dialog);
+static void gnome_ditem_edit_simple_dialog_sync_ditem   (GnomeDItemEditSimpleDialog *dialog);
+
+static gboolean gnome_ditem_edit_simple_dialog_save_timeout (gpointer data);
+static void response_cb (GtkDialog *dialog,
+			 gint       response_id);
+static void gnome_ditem_edit_simple_dialog_set_ditem (GnomeDItemEditSimpleDialog *dialog,
+						      const GnomeDesktopItem     *ditem);
+
+GType
+gnome_ditem_edit_simple_dialog_get_type (void)
+{
+	static GType ditem_edit_simple_dialog_type = 0;
+
+	if (!ditem_edit_simple_dialog_type) {
+		static const GTypeInfo ditem_edit_simple_dialog_info =
+		{
+			sizeof (GnomeDItemEditSimpleDialogClass),
+			NULL,		/* base_init */
+			NULL,		/* base_finalize */
+			(GClassInitFunc) gnome_ditem_edit_simple_dialog_class_init,
+			NULL,		/* class_finalize */
+			NULL,		/* class_data */
+			sizeof (GnomeDItemEditSimpleDialog),
+			0,		/* n_preallocs */
+			(GInstanceInitFunc) gnome_ditem_edit_simple_dialog_init,
+		};
+
+		ditem_edit_simple_dialog_type = g_type_register_static (
+						GTK_TYPE_DIALOG,
+						"GnomeDitemEditSimpleDialog",
+						&ditem_edit_simple_dialog_info,
+						0);
+	}
+
+	return ditem_edit_simple_dialog_type;
+}
+
+static void
+gnome_ditem_edit_simple_dialog_class_init (GnomeDItemEditSimpleDialogClass *class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+	GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
+
+	parent_class = g_type_class_peek_parent (class);
+
+	gobject_class->constructor = gnome_ditem_edit_simple_dialog_constructor;
+	gtkobject_class->destroy = gnome_ditem_edit_simple_dialog_destroy;
+
+	g_type_class_add_private (class,
+				  sizeof (GnomeDItemEditSimpleDialogPrivate));
+
+	ditem_edit_signals[CHANGED] =
+		g_signal_new ("changed",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GnomeDItemEditSimpleDialogClass,
+					       changed),
+			      NULL,
+			      NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	ditem_edit_signals[NAME_CHANGED] =
+		g_signal_new ("name_changed",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GnomeDItemEditSimpleDialogClass, 
+					       name_changed),
+			      NULL,
+			      NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	ditem_edit_signals[COMMAND_CHANGED] =
+		g_signal_new ("command_changed",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GnomeDItemEditSimpleDialogClass, 
+					       command_changed),
+			      NULL,
+			      NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	ditem_edit_signals[COMMENT_CHANGED] =
+		g_signal_new ("comment_changed",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GnomeDItemEditSimpleDialogClass, 
+					       comment_changed),
+			      NULL,
+			      NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	ditem_edit_signals[ICON_CHANGED] =
+		g_signal_new ("icon_changed",
+			      G_TYPE_FROM_CLASS (gobject_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GnomeDItemEditSimpleDialogClass, 
+					       icon_changed),
+			      NULL,
+			      NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+}
+
+static void
+gnome_ditem_edit_simple_dialog_init (GnomeDItemEditSimpleDialog *dialog)
+{
+	GnomeDItemEditSimpleDialogPrivate *priv;
+
+	priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
+					    GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG,
+					    GnomeDItemEditSimpleDialogPrivate);
+
+	dialog->priv = priv;
+
+	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+
+	priv->help_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+						   GTK_STOCK_HELP,
+						   GTK_RESPONSE_HELP);
+	//FIXME if we're creating a new .desktop file, we should have a cancel button (and not a revert one)
+	priv->revert_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+						     GTK_STOCK_REVERT_TO_SAVED,
+						     REVERT_BUTTON);
+	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
+					   REVERT_BUTTON,
+					   FALSE);
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       GTK_STOCK_CLOSE,
+			       GTK_RESPONSE_CLOSE);
+	/* FIXME: There needs to be a way to edit ALL keys/sections */
+
+	/* We do a signal connection here rather than overriding the method in
+	 * class_init because GtkDialog::response is a RUN_LAST signal. We
+	 * want *our* handler to be run *first*, regardless of whether the user
+	 * installs response handlers of his own.
+	 */
+	g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL);
+
+	priv->ditem = NULL;
+	priv->revert_ditem = NULL;
+	priv->ui_dirty = FALSE;
+	priv->save_timeout = 0;
+	priv->saving_error = NULL;
+	priv->location = NULL;
+	priv->icon_theme_dir = NULL;
+}
+
+static void
+gnome_ditem_edit_simple_dialog_destroy (GtkObject *object)
+{
+	GnomeDItemEditSimpleDialog *dialog;
+	
+	dialog = GNOME_DITEM_EDIT_SIMPLE_DIALOG (object);
+
+	/* If there was a timeout, then something changed after last save,
+	 * so we must save again now */
+	if (dialog->priv->save_timeout) {
+		g_source_remove (dialog->priv->save_timeout);
+		dialog->priv->save_timeout = 0;
+		gnome_ditem_edit_simple_dialog_save_timeout (dialog);
+	}
+	// if priv->saving_error then print error FIXME
+	// free saving_error
+
+	/* remember, destroy can be run multiple times! */
+
+	if (dialog->priv->ditem != NULL)
+		gnome_desktop_item_unref (dialog->priv->ditem);
+	dialog->priv->ditem = NULL;
+
+	if (dialog->priv->revert_ditem != NULL)
+		gnome_desktop_item_unref (dialog->priv->revert_ditem);
+	dialog->priv->revert_ditem = NULL;
+
+	if (dialog->priv->location != NULL)
+		g_free (dialog->priv->location);
+	dialog->priv->location = NULL;
+
+	if (dialog->priv->icon_theme_dir != NULL)
+		g_free (dialog->priv->icon_theme_dir);
+	dialog->priv->icon_theme_dir = NULL;
+
+	GTK_OBJECT_CLASS (parent_class)->destroy (object);  
+}
+
+static GObject *
+gnome_ditem_edit_simple_dialog_constructor (GType                  type,
+					    guint                  n_construct_properties,
+					    GObjectConstructParam *construct_params)
+{
+	GnomeDItemEditSimpleDialogPrivate *priv;
+	GnomeDItemEditSimpleDialog        *dialog;
+	GObject   *object;
+	GtkWidget *table;
+	GtkWidget *label;
+	GtkWidget *hbox;
+	GtkWidget *align;
+
+	object = parent_class->constructor (type,
+					    n_construct_properties,
+					    construct_params);
+	dialog = GNOME_DITEM_EDIT_SIMPLE_DIALOG (object);
+	priv = dialog->priv;
+
+	gtk_widget_push_composite_child ();
+
+	/* First frame (required information) */
+	priv->frame_required = gtk_frame_new (_("Required Information"));
+
+	table = gtk_table_new (3, 2, FALSE);
+	gtk_container_set_border_width (GTK_CONTAINER (table), 12);
+	gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+	gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+	gtk_container_add (GTK_CONTAINER (priv->frame_required), table);
+
+	/* Name */
+	label = label_new_with_mnemonic (_("_Name:"));
+	table_attach_label (GTK_TABLE (table), label, 0, 1, 0, 1);
+
+	priv->name_entry = gtk_entry_new ();
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->name_entry);
+	table_attach_entry (GTK_TABLE (table), priv->name_entry, 1, 2, 0, 1);
+
+	g_signal_connect_swapped (priv->name_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);		
+	g_signal_connect_swapped (priv->name_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_name_changed),
+				  dialog);
+
+	/* Type */
+	label = label_new_with_mnemonic (_("_Type:"));
+	table_attach_label (GTK_TABLE (table), label, 0, 1, 1, 2);
+
+	priv->type_combo = gtk_combo_box_new ();
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->type_combo);
+	table_attach_entry (GTK_TABLE (table), priv->type_combo, 1, 2, 1, 2);
+
+	g_signal_connect_swapped (G_OBJECT (priv->type_combo), "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);	
+	g_signal_connect_swapped (G_OBJECT (priv->type_combo), "changed",
+				  G_CALLBACK (type_combo_changed),
+				  dialog);
+
+	/* Command */
+	priv->command_label = label_new_with_mnemonic ("");
+	table_attach_label (GTK_TABLE (table), priv->command_label, 0, 1, 2, 3);
+	/* Can be called only after we defined priv->command_label */
+	setup_combo (priv->type_combo, type_items, G_N_ELEMENTS (type_items));
+
+	priv->command_entry = gnome_file_entry_new ("command", _("Browse"));
+	g_object_set (G_OBJECT (priv->command_entry), "use-filechooser", TRUE, NULL);
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), gnome_file_entry_gnome_entry (GNOME_FILE_ENTRY (priv->command_entry)));
+	table_attach_entry (GTK_TABLE (table), priv->command_entry, 1, 2, 2, 3);
+ 
+	g_signal_connect_swapped (priv->command_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);
+	g_signal_connect_swapped (priv->command_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_command_changed),
+				  dialog);
+
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+			    priv->frame_required, TRUE, TRUE, 0);
+	gtk_widget_show_all (priv->frame_required);
+
+	/* Second frame (optional information) */
+	priv->frame_optional = gtk_frame_new (_("Optional Information"));
+
+	table = gtk_table_new (2, 2, FALSE);
+	gtk_container_set_border_width (GTK_CONTAINER (table), 12);
+	gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+	gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+	gtk_container_add (GTK_CONTAINER (priv->frame_optional), table);
+
+	/* Comment */
+	label = label_new_with_mnemonic (_("Co_mment:"));
+	table_attach_label (GTK_TABLE (table), label, 0, 1, 0, 1);
+
+	priv->comment_entry = gtk_entry_new ();
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->comment_entry);
+	table_attach_entry (GTK_TABLE (table), priv->comment_entry, 1, 2, 0, 1);
+
+	g_signal_connect_swapped (priv->comment_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);
+	g_signal_connect_swapped (priv->comment_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_comment_changed),
+				  dialog);
+
+	/* Icon */
+	label = label_new_with_mnemonic (_("_Icon:"));
+	table_attach_label (GTK_TABLE (table), label, 0, 1, 1, 2);
+
+	hbox = gtk_hbox_new (FALSE, 12);
+	gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 1, 2,
+			  GTK_EXPAND | GTK_FILL, 0, 0, 0); 
+
+	priv->icon_entry = gnome_icon_entry_new ("desktop-icon", _("Browse icons"));
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->icon_entry);
+	gtk_box_pack_start (GTK_BOX (hbox), priv->icon_entry, FALSE, FALSE, 0);
+
+	g_signal_connect_swapped (priv->icon_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);
+	g_signal_connect_swapped (priv->icon_entry, "changed",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_icon_changed),
+				  dialog);
+
+	/* Terminal */
+	align = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
+	gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
+
+	priv->terminal_button = gtk_check_button_new_with_mnemonic (_("Run in t_erminal"));
+	gtk_container_add (GTK_CONTAINER (align), priv->terminal_button);
+	g_signal_connect_swapped (priv->terminal_button, "clicked",
+				  G_CALLBACK (gnome_ditem_edit_simple_dialog_changed),
+				  dialog);
+
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+			    priv->frame_optional, TRUE, TRUE, 0);
+	gtk_widget_show_all (priv->frame_optional);
+
+	gtk_widget_pop_composite_child ();
+
+	return object;
+}
+
+static GtkWidget *
+label_new_with_mnemonic (const char *text)
+{
+	GtkWidget *label;
+
+	label = gtk_label_new_with_mnemonic (text);
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+	return label;
+}
+
+static void
+table_attach_label (GtkTable  *table,
+		    GtkWidget *label,
+		    int        left,
+		    int        right,
+		    int        top,
+		    int        bottom)
+{
+	gtk_table_attach (table, label, left, right, top, bottom,
+			  GTK_FILL, GTK_FILL,
+			  0, 0);
+}
+
+static void 
+table_attach_entry (GtkTable  *table,
+		    GtkWidget *entry,
+		    int        left,
+		    int        right,
+		    int        top,
+		    int        bottom)
+{
+	gtk_table_attach (table, entry, left, right, top, bottom,
+			  GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL,
+			  0, 0);
+}
+
+static void
+setup_combo (GtkWidget *combo_box,
+	     ComboItem *items,
+	     int        nb_items)
+{
+	GtkListStore          *model;
+	GtkTreeIter            iter;
+	GtkCellRenderer       *renderer;
+	int                    i;
+
+	model = gtk_list_store_new (NUMBER_COLUMNS,
+				    G_TYPE_STRING,
+				    G_TYPE_INT);
+
+	gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box),
+				 GTK_TREE_MODEL (model));
+
+	for (i = 0; i < nb_items; i++) {
+		gtk_list_store_append (model, &iter);
+		gtk_list_store_set (model, &iter,
+				    COLUMN_TEXT, _(items [i].name),
+				    COLUMN_TYPE, items [i].type,
+				    -1);
+	}
+
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box),
+				    renderer, TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box),
+					renderer, "text", COLUMN_TEXT, NULL);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
+}
+
+static void
+type_combo_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	GtkTreeIter           iter;
+	GtkTreeModel         *model;
+	GnomeDesktopItemType  type;
+
+	if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->type_combo),
+					    &iter))
+		return;
+
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->type_combo));
+	gtk_tree_model_get (model, &iter, COLUMN_TYPE, &type, -1);
+
+	switch (type) {
+	case GNOME_DESKTOP_ITEM_TYPE_APPLICATION:
+		gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->priv->command_label),
+						  _("_Command:"));
+		break;
+	case GNOME_DESKTOP_ITEM_TYPE_LINK:
+		gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->priv->command_label),
+						  _("_URL:"));
+		break;
+	case GNOME_DESKTOP_ITEM_TYPE_DIRECTORY:
+	//FIXME filechooser should allow to select directory
+		gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->priv->command_label),
+						  _("_Directory:"));
+		break;
+	default:
+		gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->priv->command_label),
+						  _("???:"));//FIXME
+	}
+}
+
+/* 
+ * Will save after SAVE_FREQUENCY milliseconds of no changes. If something is
+ * changed, the save is postponed to another SAVE_FREQUENCY seconds. This seems
+ * to be a saner behaviour than just saving every N seconds.
+ */
+static void
+gnome_ditem_edit_simple_dialog_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	if (dialog->priv->save_timeout != 0)
+		g_source_remove (dialog->priv->save_timeout);
+
+	dialog->priv->save_timeout = g_timeout_add (SAVE_FREQUENCY,
+						    gnome_ditem_edit_simple_dialog_save_timeout,
+						    dialog);
+
+	/* We're not in sync with what's on the disk */
+	dialog->priv->ui_dirty = TRUE;
+	/* We can revert to the orignal state */
+	if (dialog->priv->revert_ditem != NULL)
+		gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
+						   REVERT_BUTTON,
+						   TRUE);
+
+	g_signal_emit (G_OBJECT (dialog), ditem_edit_signals[CHANGED], 0);
+}
+
+static void
+gnome_ditem_edit_simple_dialog_name_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	g_signal_emit (G_OBJECT (dialog), ditem_edit_signals[NAME_CHANGED], 0);
+}
+
+static void
+gnome_ditem_edit_simple_dialog_command_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	g_signal_emit (G_OBJECT (dialog), ditem_edit_signals[COMMAND_CHANGED], 0);
+}
+
+static void
+gnome_ditem_edit_simple_dialog_comment_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	g_signal_emit (G_OBJECT (dialog), ditem_edit_signals[COMMENT_CHANGED], 0);
+}
+
+static void
+gnome_ditem_edit_simple_dialog_icon_changed (GnomeDItemEditSimpleDialog *dialog)
+{
+	g_signal_emit (G_OBJECT (dialog), ditem_edit_signals[ICON_CHANGED], 0);
+}
+
+/* Conform display to ditem */
+static void
+gnome_ditem_edit_simple_dialog_sync_display (GnomeDItemEditSimpleDialog *dialog)
+{
+	GnomeDesktopItemType  type;
+	GnomeDesktopItem     *ditem;
+	const char           *buffer;
+	char                 *tmpstr;
+	GtkTreeIter           iter;
+	GtkTreeModel         *model;
+	GnomeDesktopItemType  buf_type;
+
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	ditem = dialog->priv->ditem;
+
+	if (ditem == NULL) {
+		gnome_ditem_edit_simple_dialog_clear (dialog);
+		return;
+	}
+
+	/* Name */
+	buffer = gnome_desktop_item_get_localestring (ditem,
+						      GNOME_DESKTOP_ITEM_NAME);
+	gtk_entry_set_text (GTK_ENTRY (dialog->priv->name_entry), 
+			    buffer ? buffer : "");
+
+	/* Type */
+	type = gnome_desktop_item_get_entry_type (ditem);
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->type_combo));
+
+	if (!gtk_tree_model_get_iter_first (model, &iter))
+		g_assert_not_reached ();
+	do {
+		gtk_tree_model_get (model, &iter, COLUMN_TYPE, &buf_type, -1);
+		if (type == buf_type) {
+			gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->priv->type_combo),
+						       &iter);
+			break;
+		}
+	} while (gtk_tree_model_iter_next (model, &iter));
+
+	/* if the type is not one of the simple types we show by default, then
+	 * we need to add it to the combo */
+	if (type != buf_type) {
+		//FIXME
+	}
+
+	/* Command */
+	if (type == GNOME_DESKTOP_ITEM_TYPE_LINK) {
+		buffer = gnome_desktop_item_get_string (ditem,
+							GNOME_DESKTOP_ITEM_URL);
+	} else {
+		buffer = gnome_desktop_item_get_string (ditem,
+							GNOME_DESKTOP_ITEM_EXEC);
+	}
+	gnome_file_entry_set_filename (GNOME_FILE_ENTRY (dialog->priv->command_entry),
+				       buffer ? buffer : "");
+
+	/* Comment */
+	buffer = gnome_desktop_item_get_localestring (ditem,
+						      GNOME_DESKTOP_ITEM_COMMENT);
+	gtk_entry_set_text (GTK_ENTRY (dialog->priv->comment_entry),
+			    buffer ? buffer : "");
+
+
+	/* Icon */
+	buffer = gnome_desktop_item_get_string (ditem, GNOME_DESKTOP_ITEM_ICON);
+	tmpstr = gnome_desktop_item_get_icon (ditem, NULL);
+	gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (dialog->priv->icon_entry),
+				       tmpstr);
+
+	g_free (dialog->priv->icon_theme_dir);
+	if (buffer != NULL && !g_path_is_absolute (buffer)) {
+		/* this is a themed icon, see bug #119208 */
+		dialog->priv->icon_theme_dir = g_path_get_dirname (tmpstr);
+		/* FIXME: what about theme changes when the dialog is up */
+	} else {
+		/* use the default pixmap directory as the standard
+		 * icon_theme_dir, since the standard directory is themed */
+		g_object_get (G_OBJECT (dialog->priv->icon_entry), "pixmap_subdir",
+			      &(dialog->priv->icon_theme_dir), NULL);
+	}
+
+	g_free (tmpstr);
+
+	/* Terminal */
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->terminal_button),
+				      gnome_desktop_item_get_boolean (ditem,
+								      GNOME_DESKTOP_ITEM_TERMINAL));
+
+	/* ui can't be dirty, I mean, damn we just synced it from the ditem */
+	dialog->priv->ui_dirty = FALSE;
+	if (dialog->priv->save_timeout != 0) {
+		g_source_remove (dialog->priv->save_timeout);
+		dialog->priv->save_timeout = 0;
+	}
+}
+
+static void
+gnome_ditem_edit_simple_dialog_sync_ditem (GnomeDItemEditSimpleDialog *dialog)
+{
+	GnomeDesktopItem     *ditem;
+	GtkWidget            *entry;
+	const char           *buffer;
+	const char           *C_value;
+	char                 *file;
+	GnomeDesktopItemType  type;
+	GtkTreeIter           iter;
+	GtkTreeModel         *model;
+	const char           *attr;
+
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	if (!dialog->priv->ditem) {
+		dialog->priv->ditem = gnome_desktop_item_new ();
+		/* Bad gnome_desktop_item_new() initialises the Name to "No
+		 * name". Just kill this because we'll set it ourselves. */
+		gnome_desktop_item_set_string (dialog->priv->ditem,
+					       GNOME_DESKTOP_ITEM_NAME,
+					       "");
+	}
+
+	ditem = dialog->priv->ditem;
+
+	/* Name */
+	buffer = gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry));
+	gnome_desktop_item_set_localestring (ditem, GNOME_DESKTOP_ITEM_NAME,
+					     buffer);
+	/* Make sure we set the "C" locale strings to the terms we set here.
+	 * This is so that if the user logs into another locale they get their
+	 * own description there rather then empty. It is not the C locale
+	 * however, but the user created this entry herself so it's OK */
+	C_value = gnome_desktop_item_get_string (ditem,
+						 GNOME_DESKTOP_ITEM_NAME);
+	if (C_value == NULL || C_value [0] == '\0')
+		gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_NAME,
+					       buffer);
+
+	/* Type */
+	if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->type_combo),
+					   &iter)) {
+		model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->priv->type_combo));
+		gtk_tree_model_get (model, &iter, COLUMN_TYPE, &type, -1);
+	} else {
+		type = GNOME_DESKTOP_ITEM_TYPE_NULL;
+	}
+	gnome_desktop_item_set_entry_type (ditem, type);
+
+	/* Command */
+	entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->priv->command_entry));
+	buffer = gtk_entry_get_text (GTK_ENTRY (entry));
+	/* hack really */
+	if (type == GNOME_DESKTOP_ITEM_TYPE_LINK)
+		attr = GNOME_DESKTOP_ITEM_URL;
+	else
+		attr = GNOME_DESKTOP_ITEM_EXEC;
+	gnome_desktop_item_set_string (ditem, attr, buffer);
+
+	/* Comment */
+	buffer = gtk_entry_get_text (GTK_ENTRY (dialog->priv->comment_entry));
+	gnome_desktop_item_set_localestring (ditem, GNOME_DESKTOP_ITEM_COMMENT,
+					     buffer);
+	/* See the comment when we set the name for an explanation */
+	C_value = gnome_desktop_item_get_string (ditem,
+						 GNOME_DESKTOP_ITEM_COMMENT);
+	if (C_value == NULL || C_value [0] == '\0')
+		gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_COMMENT,
+					       buffer);
+
+	/* Icon */
+	file = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (dialog->priv->icon_entry));
+	if (file != NULL && file[0] != '\0') {
+		/* if the icon_theme_dir is the same as the directory name of
+		 * this icon, then just use the basename as we've just picked
+		 * another icon from the theme.  See bug #119208 */
+		char *dn = g_path_get_dirname (file);
+		if (dialog->priv->icon_theme_dir != NULL &&
+		    strcmp (dn, dialog->priv->icon_theme_dir) == 0) {
+			char *base = g_path_get_basename (file);
+			g_free (file);
+			file = base;
+		}
+		g_free (dn);
+	}
+	gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_ICON, file);
+	g_free (file);
+			
+	/* Terminal */
+	gnome_desktop_item_set_boolean (ditem, GNOME_DESKTOP_ITEM_TERMINAL,
+					gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->terminal_button)));
+
+	dialog->priv->ui_dirty = FALSE;
+}
+
+static gboolean
+gnome_ditem_edit_simple_dialog_save_timeout (gpointer data)
+{
+	GnomeDItemEditSimpleDialog *dialog;
+	const char                 *buffer;
+	GError                     *error;
+	GtkWidget                  *entry;
+
+	dialog = GNOME_DITEM_EDIT_SIMPLE_DIALOG (data);
+
+	dialog->priv->save_timeout = 0;
+
+	if (dialog->priv->ui_dirty)
+		gnome_ditem_edit_simple_dialog_sync_ditem (GNOME_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	/* Verify that the required informations are set */
+	buffer = gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry));
+	if (buffer == NULL || buffer [0] == '\0') {
+		if (dialog->priv->saving_error != NULL)
+			g_free (dialog->priv->saving_error);
+		dialog->priv->saving_error = g_strdup (_("The name of the launcher is not set."));
+		return FALSE;
+	}
+
+	entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->priv->command_entry));
+	buffer = gtk_entry_get_text (GTK_ENTRY (entry));
+	if (buffer == NULL || buffer [0] == '\0') {
+		if (dialog->priv->saving_error != NULL)
+			g_free (dialog->priv->saving_error);
+		dialog->priv->saving_error = g_strdup (_("The URL or the command of the launcher is not set."));
+		return FALSE;
+	}
+
+	/* And now, try to save */
+	error = NULL;
+	gnome_desktop_item_save (dialog->priv->ditem,
+				 dialog->priv->location,
+				 TRUE /* force */,
+				 &error);
+	if (error != NULL) {
+		if (dialog->priv->saving_error != NULL)
+			g_free (dialog->priv->saving_error);
+		dialog->priv->saving_error = g_strdup (error->message);
+		g_clear_error (&error);
+	} else {
+		if (dialog->priv->saving_error != NULL)
+			g_free (dialog->priv->saving_error);
+		dialog->priv->saving_error = NULL;
+	}
+
+	return FALSE;
+}
+
+/* GtkDialog::response handler */
+static void
+response_cb (GtkDialog *dialog,
+	     gint       response_id)
+{
+	GnomeDesktopItem *ditem;
+
+	switch (response_id) {
+	case GTK_RESPONSE_HELP:
+		/* FIXME
+		panel_show_help (
+			gtk_window_get_screen (GTK_WINDOW (w)),
+			"user-guide.xml", "gospanel-16");
+			*/
+		break;
+	case REVERT_BUTTON:
+		ditem = GNOME_DITEM_EDIT_SIMPLE_DIALOG_GET_PRIVATE (dialog)->revert_ditem;
+		if (ditem != NULL)
+			gnome_ditem_edit_simple_dialog_set_ditem (GNOME_DITEM_EDIT_SIMPLE_DIALOG (dialog),
+								  ditem);
+		else
+			gnome_ditem_edit_simple_dialog_clear (GNOME_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+		gtk_dialog_set_response_sensitive (dialog,
+						   REVERT_BUTTON,
+						   FALSE);
+		break;
+	case GTK_RESPONSE_CLOSE:
+		gtk_widget_destroy (GTK_WIDGET (dialog));
+		break;
+	case GTK_RESPONSE_CANCEL:
+		/* We need to revert the changes */
+		gtk_dialog_response (dialog, REVERT_BUTTON);
+		gtk_widget_destroy (GTK_WIDGET (dialog));
+		break;
+	}
+}
+
+static void
+gnome_ditem_edit_simple_dialog_set_ditem (GnomeDItemEditSimpleDialog *dialog,
+					  const GnomeDesktopItem     *ditem)
+{
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+	g_return_if_fail (ditem != NULL);
+
+	if (dialog->priv->ditem)
+		gnome_desktop_item_unref (dialog->priv->ditem);
+
+	dialog->priv->ditem = gnome_desktop_item_copy (ditem);
+	dialog->priv->ui_dirty = TRUE;
+
+	gnome_ditem_edit_simple_dialog_sync_display (dialog);
+}
+
+GtkWidget *
+gnome_ditem_edit_simple_dialog_new (const gchar *title,
+				    GtkWindow   *parent)
+{
+	GtkWidget *result;
+
+	//FIXME if we don't have help information, we should hide the help button
+	result = g_object_new (GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG,
+			       "title", title,
+			       NULL);
+
+	if (parent)
+		gtk_window_set_transient_for (GTK_WINDOW (result), parent);
+
+	return result;
+}
+
+GtkWidget *
+gnome_ditem_edit_simple_dialog_new_from_uri (const gchar  *title,
+					     GtkWindow    *parent,
+					     const gchar  *uri,
+					     GError      **error)
+{
+	GtkWidget *result;
+
+	result = gnome_ditem_edit_simple_dialog_new (title, parent);
+	gnome_ditem_edit_simple_dialog_load_uri (GNOME_DITEM_EDIT_SIMPLE_DIALOG (result),
+						 uri, error);
+	if (error) {
+		gtk_widget_destroy (result);
+		result = NULL;
+	}
+
+	return result;
+}
+
+gboolean
+gnome_ditem_edit_simple_dialog_load_uri (GnomeDItemEditSimpleDialog  *dialog,
+					 const gchar                 *uri,
+					 GError                     **error)
+{
+        GnomeDesktopItem *newentry;
+
+	g_return_val_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog), FALSE);
+        g_return_val_if_fail (uri != NULL, FALSE);
+
+        newentry = gnome_desktop_item_new_from_uri (uri, 0, error);
+
+        if (!newentry)
+		return FALSE;
+
+	if (dialog->priv->ditem)
+		gnome_desktop_item_unref (dialog->priv->ditem);
+
+	dialog->priv->ditem = newentry;
+	dialog->priv->ui_dirty = TRUE;
+
+	gnome_ditem_edit_simple_dialog_sync_display (dialog);
+
+	/* This should be after gnome_ditem_edit_simple_dialog_sync_display ()
+	 * so the revert button is insensitive */
+	if (dialog->priv->revert_ditem != NULL)
+		gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
+						   REVERT_BUTTON,
+						   TRUE);
+	else
+		dialog->priv->revert_ditem = gnome_desktop_item_copy (newentry);
+
+	if (dialog->priv->location != NULL)
+		g_free (dialog->priv->location);
+	dialog->priv->location = g_strdup (uri);
+
+	return TRUE;
+}
+
+void
+gnome_ditem_edit_simple_dialog_clear (GnomeDItemEditSimpleDialog *dialog)
+{
+	GtkWidget *entry;
+
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	if (dialog->priv->ditem != NULL)
+		gnome_desktop_item_unref (dialog->priv->ditem);
+	dialog->priv->ditem = NULL;
+
+	dialog->priv->ui_dirty = TRUE;
+	if (dialog->priv->revert_ditem != NULL)
+		gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
+						   REVERT_BUTTON,
+						   TRUE);
+
+	gtk_entry_set_text (GTK_ENTRY (dialog->priv->name_entry), "");
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->type_combo), 0);
+	entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->priv->command_entry));
+	gtk_entry_set_text (GTK_ENTRY (entry), "");  
+	gtk_entry_set_text (GTK_ENTRY (dialog->priv->comment_entry),"");
+	gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (dialog->priv->icon_entry), "");
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->terminal_button), FALSE);
+}
+
+void
+gnome_ditem_edit_simple_dialog_set_editable (GnomeDItemEditSimpleDialog *dialog,
+					     gboolean                    editable)
+{
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	/* FIXME: a better way needs to be found */
+	gtk_widget_set_sensitive (dialog->priv->frame_required, editable);
+	gtk_widget_set_sensitive (dialog->priv->frame_optional, editable);
+}
+
+void
+gnome_ditem_edit_simple_dialog_set_location (GnomeDItemEditSimpleDialog *dialog,
+					     const char                 *uri)
+{
+	g_return_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog));
+
+	if (dialog->priv->location != NULL)
+		g_free (dialog->priv->location);
+	dialog->priv->location = g_strdup (uri);
+}
+
+gchar *
+gnome_ditem_edit_simple_dialog_get_name (GnomeDItemEditSimpleDialog *dialog)
+{
+	const char *name;
+
+	g_return_val_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog), NULL);
+
+	name = gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry));
+	return g_strdup (name);
+}
+
+gchar *
+gnome_ditem_edit_simple_dialog_get_command (GnomeDItemEditSimpleDialog *dialog)
+{
+	const char *command;
+	GtkWidget  *entry;
+
+	g_return_val_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog), NULL);
+
+	entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->priv->command_entry));
+	command = gtk_entry_get_text (GTK_ENTRY (entry));
+	return g_strdup (command);
+}
+
+gchar *
+gnome_ditem_edit_simple_dialog_get_comment (GnomeDItemEditSimpleDialog *dialog)
+{
+	const char *comment;
+
+	g_return_val_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog), NULL);
+
+	comment = gtk_entry_get_text (GTK_ENTRY (dialog->priv->comment_entry));
+	return g_strdup (comment);
+}
+
+gchar *
+gnome_ditem_edit_simple_dialog_get_icon (GnomeDItemEditSimpleDialog *dialog)
+{
+	g_return_val_if_fail (GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG (dialog), NULL);
+ 
+	return gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (dialog->priv->icon_entry));
+}
Index: gnome-ditem-edit-simple-dialog.h
===================================================================
RCS file: gnome-ditem-edit-simple-dialog.h
diff -N gnome-ditem-edit-simple-dialog.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnome-ditem-edit-simple-dialog.h	14 Nov 2004 21:31:18 -0000
@@ -0,0 +1,96 @@
+/*
+ * gnome-ditem-edit-simple-dialog.h:
+ *
+ * Copyright (C) 2004 Vincent Untz
+ *
+ * The Gnome Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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 Library General Public
+ * License along with the Gnome Library; see the file COPYING.LIB.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *	Vincent Untz <vincent@vuntz.net>
+ */
+
+#ifndef GNOME_DITEM_EDIT_SIMPLE_DIALOG_H
+#define GNOME_DITEM_EDIT_SIMPLE_DIALOG_H
+
+#include <gtk/gtk.h>
+#include <libgnome/gnome-desktop-item.h>
+
+G_BEGIN_DECLS
+
+#define GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG		(gnome_ditem_edit_simple_dialog_get_type ())
+#define GNOME_DITEM_EDIT_SIMPLE_DIALOG(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG, GnomeDItemEditSimpleDialog))
+#define GNOME_DITEM_EDIT_SIMPLE_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG, GnomeDItemEditSimpleDialogClass))
+#define GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG))
+#define GNOME_IS_DITEM_EDIT_SIMPLE_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG))
+#define GNOME_DITEM_EDIT_SIMPLE_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_DITEM_EDIT_SIMPLE_DIALOG, GnomeDItemEditSimpleDialogClass))
+
+typedef struct _GnomeDItemEditSimpleDialog      GnomeDItemEditSimpleDialog;
+typedef struct _GnomeDItemEditSimpleDialogClass GnomeDItemEditSimpleDialogClass;
+
+typedef struct _GnomeDItemEditSimpleDialogPrivate GnomeDItemEditSimpleDialogPrivate;
+
+struct _GnomeDItemEditSimpleDialogClass
+{
+	GtkDialogClass parent_class;
+
+	/* Any information changed */
+	void (* changed)         (GnomeDItemEditSimpleDialog *dialog);
+	/* These more specific signals are provided since they 
+	 * will likely require a display update */
+	/* The name of the item has changed. */
+	void (* name_changed)    (GnomeDItemEditSimpleDialog *dialog);
+	/* The command of the item has changed. */
+	void (* command_changed) (GnomeDItemEditSimpleDialog *dialog);
+	/* The comment of the item has changed. */
+	void (* comment_changed) (GnomeDItemEditSimpleDialog *dialog);
+	/* The icon in particular has changed. */
+	void (* icon_changed)    (GnomeDItemEditSimpleDialog *dialog);
+};
+
+struct _GnomeDItemEditSimpleDialog
+{
+	GtkDialog parent_instance;
+
+	GnomeDItemEditSimpleDialogPrivate *priv;
+};
+
+GType      gnome_ditem_edit_simple_dialog_get_type (void);
+GtkWidget *gnome_ditem_edit_simple_dialog_new      (const gchar *title,
+						    GtkWindow   *parent);
+GtkWidget *gnome_ditem_edit_simple_dialog_new_from_uri (const gchar  *title,
+							GtkWindow    *parent,
+							const gchar  *uri,
+							GError      **error);
+
+gboolean gnome_ditem_edit_simple_dialog_load_uri (GnomeDItemEditSimpleDialog  *dialog,
+						  const gchar                 *uri,
+						  GError                     **error);
+
+void gnome_ditem_edit_simple_dialog_clear (GnomeDItemEditSimpleDialog *dialog);
+void gnome_ditem_edit_simple_dialog_set_editable (GnomeDItemEditSimpleDialog *dialog,
+						  gboolean                    editable);
+void gnome_ditem_edit_simple_dialog_set_location (GnomeDItemEditSimpleDialog *dialog,
+						  const char                 *uri);
+
+/* Return an allocated string, you need to g_free it. */
+gchar *gnome_ditem_edit_simple_dialog_get_name    (GnomeDItemEditSimpleDialog *dialog);
+gchar *gnome_ditem_edit_simple_dialog_get_command (GnomeDItemEditSimpleDialog *dialog);
+gchar *gnome_ditem_edit_simple_dialog_get_comment (GnomeDItemEditSimpleDialog *dialog);
+gchar *gnome_ditem_edit_simple_dialog_get_icon    (GnomeDItemEditSimpleDialog *dialog);
+
+G_END_DECLS
+
+#endif /* GNOME_DITEM_EDIT_SIMPLE_DIALOG_H */
Index: gnome-ditem-edit.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-ditem-edit.c,v
retrieving revision 1.76
diff -u -p -r1.76 gnome-ditem-edit.c
--- gnome-ditem-edit.c	13 May 2004 09:41:37 -0000	1.76
+++ gnome-ditem-edit.c	14 Nov 2004 21:31:18 -0000
@@ -28,11 +28,10 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
 #include <libgnome/gnome-macros.h>
-#include <libgnome/gnome-i18n.h>
-#include "gnome-desktop-i18n.h"
 
 #include <libgnomeui/gnome-uidefs.h>
 #include <libgnomeui/gnome-icon-entry.h>
Index: gnome-hint.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-hint.c,v
retrieving revision 1.11
diff -u -p -r1.11 gnome-hint.c
--- gnome-hint.c	18 Feb 2004 12:50:36 -0000	1.11
+++ gnome-hint.c	14 Nov 2004 21:31:18 -0000
@@ -3,7 +3,6 @@
 #include <libgnomeui/libgnomeui.h>
 #include <libgnomeui/gnome-hint.h>
 #include <gconf/gconf-client.h>
-#include "gnome-desktop-i18n.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -203,14 +202,16 @@ gnome_hint_instance_init (GnomeHint *gno
 }
 
 /*find the language, but only look as far as gotlang*/
-static const GList *
-find_lang (const GList *langlist, const GList *gotlang, const char *lang)
+static const char *
+find_lang (const char * const *langs_pointer, const char *gotlang, const char *lang)
 {
-        while (langlist != NULL &&
-               langlist != gotlang) {
-                if (strcmp (langlist->data, lang) == 0)
-                        return langlist;
-                langlist = langlist->next;
+	int i;
+
+	for (i = 0;
+	     langs_pointer[i] != NULL && langs_pointer[i] != gotlang;
+	     i++) {
+                if (strcmp (langs_pointer[i], lang) == 0)
+                        return langs_pointer[i];
         }
         return NULL;
 }
@@ -219,12 +220,12 @@ find_lang (const GList *langlist, const 
 static char *
 get_i18n_string (xmlDocPtr doc, xmlNodePtr child, const char *name)
 {
-        const GList *langlist;
         char *current;
         xmlNodePtr cur;
-        const GList *gotlang = NULL; /*the highest language we got*/
+        const char * const *langs_pointer;
+        const char  *gotlang = NULL; /*the highest language we got*/
 
-        langlist = gnome_i18n_get_language_list("LC_ALL");
+        langs_pointer = g_get_language_names ();
 
         current = NULL;
 
@@ -246,7 +247,7 @@ get_i18n_string (xmlDocPtr doc, xmlNodeP
                                 xmlFree (current);
                         current = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
                 } else {
-                        const GList *ll = find_lang (langlist, gotlang, lang);
+                        const char *ll = find_lang (langs_pointer, gotlang, lang);
                         xmlFree (lang);
                         if (ll != NULL) {
                                 if (current != NULL)
@@ -254,7 +255,7 @@ get_i18n_string (xmlDocPtr doc, xmlNodeP
 
                                 current = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
                                 gotlang = ll;
-                                if (ll == langlist) /*we can't get any better then this*/
+                                if (ll == langs_pointer[0]) /*we can't get any better then this*/
                                         break;
                         }
                 }
