Added French translation

This commit is contained in:
Pierre Pronchery 2010-11-13 23:25:45 +00:00
parent 6eb7ba6f9b
commit 7bddf14f87
14 changed files with 370 additions and 35 deletions

View File

@ -1,6 +1,6 @@
PACKAGE = XMLEditor PACKAGE = XMLEditor
VERSION = 0.0.0 VERSION = 0.0.0
SUBDIRS = src SUBDIRS = data po src
RM = rm -f RM = rm -f
LN = ln -f LN = ln -f
TAR = tar -czvf TAR = tar -czvf
@ -21,6 +21,14 @@ dist:
$(RM) -r -- $(PACKAGE)-$(VERSION) $(RM) -r -- $(PACKAGE)-$(VERSION)
$(LN) -s -- . $(PACKAGE)-$(VERSION) $(LN) -s -- . $(PACKAGE)-$(VERSION)
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \ @$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \
$(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/xmleditor.desktop \
$(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/po/Makefile \
$(PACKAGE)-$(VERSION)/po/gettext.sh \
$(PACKAGE)-$(VERSION)/po/POTFILES \
$(PACKAGE)-$(VERSION)/po/fr.po \
$(PACKAGE)-$(VERSION)/po/project.conf \
$(PACKAGE)-$(VERSION)/src/callbacks.c \ $(PACKAGE)-$(VERSION)/src/callbacks.c \
$(PACKAGE)-$(VERSION)/src/xmleditor.c \ $(PACKAGE)-$(VERSION)/src/xmleditor.c \
$(PACKAGE)-$(VERSION)/src/main.c \ $(PACKAGE)-$(VERSION)/src/main.c \
@ -31,6 +39,7 @@ dist:
$(PACKAGE)-$(VERSION)/Makefile \ $(PACKAGE)-$(VERSION)/Makefile \
$(PACKAGE)-$(VERSION)/COPYING \ $(PACKAGE)-$(VERSION)/COPYING \
$(PACKAGE)-$(VERSION)/config.h \ $(PACKAGE)-$(VERSION)/config.h \
$(PACKAGE)-$(VERSION)/config.sh \
$(PACKAGE)-$(VERSION)/project.conf $(PACKAGE)-$(VERSION)/project.conf
$(RM) -- $(PACKAGE)-$(VERSION) $(RM) -- $(PACKAGE)-$(VERSION)

5
config.sh Normal file
View File

@ -0,0 +1,5 @@
PACKAGE="XMLEditor"
VERSION="0.0.0"
PREFIX="/usr/local"
LIBDIR="${PREFIX}/lib"

21
data/Makefile Normal file
View File

@ -0,0 +1,21 @@
PREFIX = /usr/local
DESTDIR =
MKDIR = mkdir -p
INSTALL = install
RM = rm -f
all:
clean:
distclean: clean
install: all
$(MKDIR) $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -m 0644 -- xmleditor.desktop $(DESTDIR)$(PREFIX)/share/applications/xmleditor.desktop
uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/applications/xmleditor.desktop
.PHONY: all clean distclean install uninstall

4
data/project.conf Normal file
View File

@ -0,0 +1,4 @@
dist=Makefile,xmleditor.desktop
[xmleditor.desktop]
install=$(PREFIX)/share/applications

8
data/xmleditor.desktop Normal file
View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=XML editor
Comment=An XML editor
Exec=xmleditor
Icon=text-editor
Type=Application
Categories=Utility;TextEditor;GTK;
StartupNotify=true

3
po/.cvsignore Normal file
View File

@ -0,0 +1,3 @@
.cvsignore
XMLEditor.pot
fr.mo

30
po/Makefile Normal file
View File

@ -0,0 +1,30 @@
TARGETS = XMLEditor.pot fr.mo
PREFIX = /usr/local
DESTDIR =
RM = rm -f
LN = ln -f
MKDIR = mkdir -p
INSTALL = install
all: $(TARGETS)
XMLEditor.pot: POTFILES
./gettext.sh "XMLEditor.pot"
fr.mo: XMLEditor.pot fr.po
./gettext.sh "fr.mo"
clean:
$(RM) -- $(XMLEditor.pot_OBJS) $(fr.mo_OBJS)
distclean: clean
$(RM) -- $(TARGETS)
install: all
./gettext.sh -p "$(DESTDIR)$(PREFIX)" install "fr.mo"
uninstall:
./gettext.sh -p "$(DESTDIR)$(PREFIX)" uninstall "fr.mo"
.PHONY: all clean distclean install uninstall

2
po/POTFILES Normal file
View File

@ -0,0 +1,2 @@
../src/main.c
../src/xmleditor.c

125
po/fr.po Normal file
View File

@ -0,0 +1,125 @@
# $Id$
# Copyright (c) 2010 Pierre Pronchery <khorben@defora.org>
# This file is distributed under the same license as the XMLEditor package.
# Pierre Pronchery <khorben@defora.org>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: XMLEditor 0.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-11-14 00:19+0100\n"
"PO-Revision-Date: 2010-11-14 00:20+0100\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../src/main.c:43
msgid "Usage: xmleditor [file]\n"
msgstr "Usage: xmleditor [fichier]\n"
#: ../src/xmleditor.c:75
msgid "_New"
msgstr ""
#: ../src/xmleditor.c:77
msgid "_Open"
msgstr ""
#: ../src/xmleditor.c:80
msgid "_Save"
msgstr ""
#: ../src/xmleditor.c:82
msgid "_Save as..."
msgstr ""
#: ../src/xmleditor.c:85
msgid "_Close"
msgstr ""
#: ../src/xmleditor.c:92
msgid "_Preferences"
msgstr ""
#: ../src/xmleditor.c:99
msgid "_Expand all"
msgstr ""
#: ../src/xmleditor.c:101
msgid "_Collapse all"
msgstr ""
#: ../src/xmleditor.c:108
msgid "_About"
msgstr ""
#: ../src/xmleditor.c:119
msgid "_File"
msgstr ""
#: ../src/xmleditor.c:120
msgid "_Edit"
msgstr ""
#: ../src/xmleditor.c:121
msgid "_View"
msgstr ""
#: ../src/xmleditor.c:122
msgid "_Help"
msgstr ""
#: ../src/xmleditor.c:129
msgid "New"
msgstr ""
#: ../src/xmleditor.c:130
msgid "Open"
msgstr ""
#: ../src/xmleditor.c:132
msgid "Save"
msgstr ""
#: ../src/xmleditor.c:133
msgid "Save as"
msgstr ""
#: ../src/xmleditor.c:137
msgid "Preferences"
msgstr ""
#: ../src/xmleditor.c:195
msgid "Name"
msgstr ""
#: ../src/xmleditor.c:216
msgid "XML editor - "
msgstr ""
#: ../src/xmleditor.c:217
msgid "(Untitled)"
msgstr ""
#: ../src/xmleditor.c:277 ../src/xmleditor.c:282
msgid "Error"
msgstr ""
#: ../src/xmleditor.c:370
msgid "Open file..."
msgstr ""
#: ../src/xmleditor.c:426 ../src/xmleditor.c:431
msgid "Warning"
msgstr ""
#: ../src/xmleditor.c:430
msgid "This file already exists. Overwrite?"
msgstr ""
#: ../src/xmleditor.c:449
msgid "Save as..."
msgstr ""

100
po/gettext.sh Executable file
View File

@ -0,0 +1,100 @@
#!/bin/sh
#$Id$
#variables
. "../config.sh"
DEBUG="_debug"
INSTALL="install -m 0644"
LOCALEDIR="$PREFIX/share/locale"
MKDIR="mkdir -p"
MSGFMT="msgfmt"
MSGINIT="msginit"
MSGMERGE="msgmerge"
RM="rm -f"
POTFILES="POTFILES"
XGETTEXT="xgettext --force-po"
#functions
#usage
_usage()
{
echo "Usage: ./gettext.sh <target>" 1>&2
echo " ./gettext.sh -p <prefix> install <target>" 1>&2
echo " ./gettext.sh -p <prefix> uninstall <target>" 1>&2
return 1
}
#debug
_debug()
{
echo $@
$@
}
#gettext_mo
_gettext_mo()
{
package="$1"
lang="$2"
if [ -f "$lang.po" ]; then
$DEBUG $MSGMERGE -U "$lang.po" "$package.pot" || return 1
else
$DEBUG $MSGINIT -l "$lang" -o "$lang.po" -i "$package.pot" \
|| return 1
fi
$DEBUG $MSGFMT -c -v -o "$lang.mo" "$lang.po" || return 1
}
#gettext_pot
_gettext_pot()
{
package="$1"
$DEBUG $XGETTEXT -d "$package" -o "$package.pot" --keyword="_" \
--keyword="N_" -f "$POTFILES" || return 1
}
#main
if [ $# -eq 4 -a "$1" = "-p" ]; then
PREFIX="$2"
LOCALEDIR="$PREFIX/share/locale"
lang="${4%%.mo}"
if [ "$3" = "install" ]; then
$DEBUG $MKDIR "$LOCALEDIR/$lang/LC_MESSAGES" || exit 2
$DEBUG $INSTALL "$4" \
"$LOCALEDIR/$lang/LC_MESSAGES/$PACKAGE.mo" \
|| exit 2
exit 0
elif [ "$3" = "uninstall" ]; then
$DEBUG $RM "$LOCALEDIR/$lang/LC_MESSAGES/$PACKAGE.mo" \
|| exit 2
exit 0
else
echo "gettext.sh: $3: Unknown operation" 1>&2
fi
fi
if [ $# -ne 1 ]; then
_usage
exit $?
fi
case "$1" in
*.mo)
_gettext_mo "$PACKAGE" "${1%%.mo}" || exit 2
;;
*.pot)
_gettext_pot "${1%%.pot}" || exit 2
;;
*)
exit 2
;;
esac
exit 0

13
po/project.conf Normal file
View File

@ -0,0 +1,13 @@
targets=XMLEditor.pot,fr.mo
dist=Makefile,gettext.sh,POTFILES,fr.po
[XMLEditor.pot]
type=script
script=./gettext.sh
depends=POTFILES
[fr.mo]
type=script
script=./gettext.sh
install=
depends=XMLEditor.pot,fr.po

View File

@ -1,6 +1,6 @@
package=XMLEditor package=XMLEditor
version=0.0.0 version=0.0.0
config=h config=h,sh
subdirs=src subdirs=data,po,src
dist=Makefile,COPYING,config.h dist=Makefile,COPYING,config.h,config.sh

View File

@ -17,21 +17,30 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <locale.h>
#include <libintl.h>
#include "xmleditor.h" #include "xmleditor.h"
#include "../config.h" #include "../config.h"
#define _(string) gettext(string)
/* constants */ /* constants */
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
#ifndef DATADIR
# define DATADIR PREFIX "/share"
#endif
#ifndef LOCALEDIR
# define LOCALEDIR DATADIR "/locale"
#endif
/* functions */ /* functions */
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: xmleditor [file]\n", stderr); fputs(_("Usage: xmleditor [file]\n"), stderr);
return 1; return 1;
} }
@ -42,6 +51,9 @@ int main(int argc, char * argv[])
int o; int o;
XMLEditor * xmleditor; XMLEditor * xmleditor;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
gtk_init(&argc, &argv); gtk_init(&argc, &argv);
while((o = getopt(argc, argv, "")) != -1) while((o = getopt(argc, argv, "")) != -1)
switch(o) switch(o)

View File

@ -21,12 +21,15 @@ static char const _license[] =
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <libintl.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <System/Parser.h> #include <System/Parser.h>
#include <Desktop.h> #include <Desktop.h>
#include "callbacks.h" #include "callbacks.h"
#include "xmleditor.h" #include "xmleditor.h"
#include "../config.h" #include "../config.h"
#define _(string) gettext(string)
#define N_(string) (string)
/* XMLEditor */ /* XMLEditor */
@ -69,40 +72,40 @@ static DesktopAccel _xmleditor_accel[] =
#ifndef EMBEDDED #ifndef EMBEDDED
static DesktopMenu _xmleditor_menu_file[] = static DesktopMenu _xmleditor_menu_file[] =
{ {
{ "_New", G_CALLBACK(on_file_new), GTK_STOCK_NEW, GDK_CONTROL_MASK, { N_("_New"), G_CALLBACK(on_file_new), GTK_STOCK_NEW, GDK_CONTROL_MASK,
GDK_n }, GDK_n },
{ "_Open", G_CALLBACK(on_file_open), GTK_STOCK_OPEN, GDK_CONTROL_MASK, { N_("_Open"), G_CALLBACK(on_file_open), GTK_STOCK_OPEN,
GDK_o }, GDK_CONTROL_MASK, GDK_o },
{ "", NULL, NULL, 0, 0 }, { "", NULL, NULL, 0, 0 },
{ "_Save", G_CALLBACK(on_file_save), GTK_STOCK_SAVE, GDK_CONTROL_MASK, { N_("_Save"), G_CALLBACK(on_file_save), GTK_STOCK_SAVE,
GDK_s }, GDK_CONTROL_MASK, GDK_s },
{ "_Save as...", G_CALLBACK(on_file_save_as), GTK_STOCK_SAVE_AS, { N_("_Save as..."), G_CALLBACK(on_file_save_as), GTK_STOCK_SAVE_AS,
GDK_CONTROL_MASK | GDK_SHIFT_MASK, GDK_S }, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GDK_S },
{ "", NULL, NULL, 0, 0 }, { "", NULL, NULL, 0, 0 },
{ "_Close", G_CALLBACK(on_file_close), GTK_STOCK_CLOSE, { N_("_Close"), G_CALLBACK(on_file_close), GTK_STOCK_CLOSE,
GDK_CONTROL_MASK, GDK_w }, GDK_CONTROL_MASK, GDK_w },
{ NULL, NULL, NULL, 0, 0 } { NULL, NULL, NULL, 0, 0 }
}; };
static DesktopMenu _xmleditor_menu_edit[] = static DesktopMenu _xmleditor_menu_edit[] =
{ {
{ "_Preferences", G_CALLBACK(on_edit_preferences), { N_("_Preferences"), G_CALLBACK(on_edit_preferences),
GTK_STOCK_PREFERENCES, GDK_CONTROL_MASK, GDK_p }, GTK_STOCK_PREFERENCES, GDK_CONTROL_MASK, GDK_p },
{ NULL, NULL, NULL, 0, 0 } { NULL, NULL, NULL, 0, 0 }
}; };
static DesktopMenu _xmleditor_menu_view[] = static DesktopMenu _xmleditor_menu_view[] =
{ {
{ "_Expand all", G_CALLBACK(on_view_expand_all), NULL, 0, { N_("_Expand all"), G_CALLBACK(on_view_expand_all), NULL, 0,
GDK_asterisk }, GDK_asterisk },
{ "_Collapse all", G_CALLBACK(on_view_collapse_all), NULL, 0, { N_("_Collapse all"), G_CALLBACK(on_view_collapse_all), NULL, 0,
GDK_slash }, GDK_slash },
{ NULL, NULL, NULL, 0, 0 } { NULL, NULL, NULL, 0, 0 }
}; };
static DesktopMenu _xmleditor_menu_help[] = static DesktopMenu _xmleditor_menu_help[] =
{ {
{ "_About", G_CALLBACK(on_help_about), { N_("_About"), G_CALLBACK(on_help_about),
#if GTK_CHECK_VERSION(2, 6, 0) #if GTK_CHECK_VERSION(2, 6, 0)
GTK_STOCK_ABOUT, 0, 0 }, GTK_STOCK_ABOUT, 0, 0 },
#else #else
@ -113,25 +116,25 @@ static DesktopMenu _xmleditor_menu_help[] =
static DesktopMenubar _xmleditor_menubar[] = static DesktopMenubar _xmleditor_menubar[] =
{ {
{ "_File", _xmleditor_menu_file }, { N_("_File"), _xmleditor_menu_file },
{ "_Edit", _xmleditor_menu_edit }, { N_("_Edit"), _xmleditor_menu_edit },
{ "_View", _xmleditor_menu_view }, { N_("_View"), _xmleditor_menu_view },
{ "_Help", _xmleditor_menu_help }, { N_("_Help"), _xmleditor_menu_help },
{ NULL, NULL } { NULL, NULL }
}; };
#endif #endif
static DesktopToolbar _xmleditor_toolbar[] = static DesktopToolbar _xmleditor_toolbar[] =
{ {
{ "New", G_CALLBACK(on_new), GTK_STOCK_NEW, 0, 0, NULL }, { N_("New"), G_CALLBACK(on_new), GTK_STOCK_NEW, 0, 0, NULL },
{ "Open", G_CALLBACK(on_open), GTK_STOCK_OPEN, 0, 0, NULL }, { N_("Open"), G_CALLBACK(on_open), GTK_STOCK_OPEN, 0, 0, NULL },
{ "", NULL, NULL, 0, 0, NULL }, { "", NULL, NULL, 0, 0, NULL },
{ "Save", G_CALLBACK(on_save), GTK_STOCK_SAVE, 0, 0, NULL }, { N_("Save"), G_CALLBACK(on_save), GTK_STOCK_SAVE, 0, 0, NULL },
{ "Save as", G_CALLBACK(on_save_as), GTK_STOCK_SAVE_AS, 0, 0, { N_("Save as"), G_CALLBACK(on_save_as), GTK_STOCK_SAVE_AS, 0, 0,
NULL }, NULL },
#ifdef EMBEDDED #ifdef EMBEDDED
{ "", NULL, NULL, 0, 0, NULL }, { "", NULL, NULL, 0, 0, NULL },
{ "Preferences", G_CALLBACK(on_preferences), GTK_STOCK_PREFERENCES, { N_("Preferences"), G_CALLBACK(on_preferences), GTK_STOCK_PREFERENCES,
0, 0, NULL }, 0, 0, NULL },
#endif #endif
{ NULL, NULL, NULL, 0, 0, NULL } { NULL, NULL, NULL, 0, 0, NULL }
@ -189,7 +192,7 @@ XMLEditor * xmleditor_new(void)
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(xmleditor->view), gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(xmleditor->view),
FALSE); FALSE);
renderer = gtk_cell_renderer_text_new(); renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Name", renderer, column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer,
"text", 0, NULL); "text", 0, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(xmleditor->view), column); gtk_tree_view_append_column(GTK_TREE_VIEW(xmleditor->view), column);
gtk_container_add(GTK_CONTAINER(widget), xmleditor->view); gtk_container_add(GTK_CONTAINER(widget), xmleditor->view);
@ -210,8 +213,8 @@ static void _new_set_title(XMLEditor * xmleditor)
{ {
char buf[256]; char buf[256];
snprintf(buf, sizeof(buf), "%s%s", "XML editor - ", snprintf(buf, sizeof(buf), "%s%s", _("XML editor - "),
(xmleditor->xml == NULL) ? "(Untitled)" (xmleditor->xml == NULL) ? _("(Untitled)")
: xml_get_filename(xmleditor->xml)); : xml_get_filename(xmleditor->xml));
gtk_window_set_title(GTK_WINDOW(xmleditor->window), buf); gtk_window_set_title(GTK_WINDOW(xmleditor->window), buf);
} }
@ -271,12 +274,12 @@ int xmleditor_error(XMLEditor * xmleditor, char const * message, int ret)
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
#if GTK_CHECK_VERSION(2, 6, 0) #if GTK_CHECK_VERSION(2, 6, 0)
"Error"); _("Error"));
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
"%s", "%s",
#endif #endif
message); message);
gtk_window_set_title(GTK_WINDOW(dialog), "Error"); gtk_window_set_title(GTK_WINDOW(dialog), _("Error"));
g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK( g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(
gtk_widget_destroy), NULL); gtk_widget_destroy), NULL);
gtk_widget_show(dialog); gtk_widget_show(dialog);
@ -364,7 +367,7 @@ void xmleditor_open_dialog(XMLEditor * xmleditor)
GtkWidget * dialog; GtkWidget * dialog;
char * filename = NULL; char * filename = NULL;
dialog = gtk_file_chooser_dialog_new("Open file...", dialog = gtk_file_chooser_dialog_new(_("Open file..."),
GTK_WINDOW(xmleditor->window), GTK_WINDOW(xmleditor->window),
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@ -420,12 +423,12 @@ gboolean xmleditor_save_as(XMLEditor * xmleditor, char const * filename)
| GTK_DIALOG_DESTROY_WITH_PARENT, | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, "%s", GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, "%s",
#if GTK_CHECK_VERSION(2, 6, 0) #if GTK_CHECK_VERSION(2, 6, 0)
"Warning"); _("Warning"));
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG( gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
dialog), "%s", dialog), "%s",
#endif #endif
"File exists. Overwrite?"); _("This file already exists. Overwrite?"));
gtk_window_set_title(GTK_WINDOW(dialog), "Warning"); gtk_window_set_title(GTK_WINDOW(dialog), _("Warning"));
ret = gtk_dialog_run(GTK_DIALOG(dialog)); ret = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);
if(ret == GTK_RESPONSE_NO) if(ret == GTK_RESPONSE_NO)
@ -443,7 +446,7 @@ gboolean xmleditor_save_as_dialog(XMLEditor * xmleditor)
char * filename = NULL; char * filename = NULL;
gboolean ret; gboolean ret;
dialog = gtk_file_chooser_dialog_new("Save as...", dialog = gtk_file_chooser_dialog_new(_("Save as..."),
GTK_WINDOW(xmleditor->window), GTK_WINDOW(xmleditor->window),
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,