- Renamed the binaries: eliot is now the Qt interface, whereas wxeliot is the wxWidgets interface

- Embed the program icon into the executable on Windows: the icon is not visible in Windows explorer
 - Fixed gettext configuration on Windows. The translations now appear, but the accents still don't display correctly.
 - Fixed a few translation issues
This commit is contained in:
Olivier Teulière 2008-09-07 13:17:39 +00:00
parent 3837e548d4
commit 37359e97c0
15 changed files with 99 additions and 70 deletions

View file

@ -18,7 +18,7 @@ package-win32-zip:
mkdir -p $(WIN32_PACKAGE_DIR) mkdir -p $(WIN32_PACKAGE_DIR)
# Copy the binaries and strip them # Copy the binaries and strip them
cp $(top_builddir)/wxwin/eliot$(EXEEXT) $(top_builddir)/dic/compdic$(EXEEXT) $(top_builddir)/dic/listdic$(EXEEXT) $(top_builddir)/qt/qeliot$(EXEEXT) $(WIN32_PACKAGE_DIR) cp $(top_builddir)/wxwin/wxeliot$(EXEEXT) $(top_builddir)/dic/compdic$(EXEEXT) $(top_builddir)/dic/listdic$(EXEEXT) $(top_builddir)/qt/eliot$(EXEEXT) $(WIN32_PACKAGE_DIR)
$(STRIP) $(WIN32_PACKAGE_DIR)/* $(STRIP) $(WIN32_PACKAGE_DIR)/*
# Copy the i18n files # Copy the i18n files

View file

@ -4,7 +4,7 @@ dnl --------------------------------------------------------------
dnl configure.in for Eliot dnl configure.in for Eliot
dnl -------------------------------------------------------------- dnl --------------------------------------------------------------
AC_INIT(eliot, 1.7-cvs) AC_INIT(eliot, 1.7-cvs)
AC_CONFIG_SRCDIR(wxwin/main.cc) AC_CONFIG_SRCDIR(qt/main.cpp)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST AC_CANONICAL_HOST
@ -69,6 +69,9 @@ dnl Regexp / Listdic / Compdic build enable
AC_ARG_ENABLE([dictools],AC_HELP_STRING([--enable-dictools],[build independant dictionary tools (default enabled)])) AC_ARG_ENABLE([dictools],AC_HELP_STRING([--enable-dictools],[build independant dictionary tools (default enabled)]))
AM_CONDITIONAL([BUILD_DICTOOLS], [test "${enable_dictools}" != "no"]) AM_CONDITIONAL([BUILD_DICTOOLS], [test "${enable_dictools}" != "no"])
dnl Define WIN32_BUILD if the compiler is i586-mingw32msvc-g++
AM_CONDITIONAL([WIN32_BUILD], [test "${CXX}" = "i586-mingw32msvc-g++"])
dnl -------------------------------------------------------------- dnl --------------------------------------------------------------
dnl Checks for header files. dnl Checks for header files.
dnl -------------------------------------------------------------- dnl --------------------------------------------------------------

View file

@ -22,9 +22,6 @@ noinst_LIBRARIES = libdic.a
localedir = $(datadir)/locale localedir = $(datadir)/locale
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir) -I../intl -I$(top_srcdir)/intl $(INCICONV) AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir) -I../intl -I$(top_srcdir)/intl $(INCICONV)
libdic_a_CFLAGS=
libdic_a_YFLAGS=-d
libdic_a_LFLAGS=
libdic_a_SOURCES = \ libdic_a_SOURCES = \
dic_exception.cpp dic_exception.h \ dic_exception.cpp dic_exception.h \
header.cpp header.h \ header.cpp header.h \

View file

@ -443,15 +443,16 @@ int main(int argc, char* argv[])
// Set the message domain // Set the message domain
#ifdef WIN32 #ifdef WIN32
// Get the absolute path, as returned by GetFullPathName() // Get the absolute path, as returned by GetFullPathName()
char localeDir[MAX_PATH]; char baseDir[MAX_PATH];
GetFullPathName(argv[0], MAX_PATH, localeDir, NULL); GetFullPathName(argv[0], MAX_PATH, baseDir, NULL);
char *pos = strrchr(localeDir, L'\\'); char *pos = strrchr(baseDir, L'\\');
if (pos) if (pos)
*pos = '\0'; *pos = '\0';
const string localeDir = baseDir + string("\\locale");
#else #else
static const char *localeDir = LOCALEDIR; static const string localeDir = LOCALEDIR;
#endif #endif
bindtextdomain(PACKAGE, localeDir); bindtextdomain(PACKAGE, localeDir.c_str());
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif

View file

@ -130,15 +130,16 @@ int main(int argc, char *argv[])
// Set the message domain // Set the message domain
#ifdef WIN32 #ifdef WIN32
// Get the absolute path, as returned by GetFullPathName() // Get the absolute path, as returned by GetFullPathName()
char localeDir[MAX_PATH]; char baseDir[MAX_PATH];
GetFullPathName(argv[0], MAX_PATH, localeDir, NULL); GetFullPathName(argv[0], MAX_PATH, baseDir, NULL);
char *pos = strrchr(localeDir, L'\\'); char *pos = strrchr(baseDir, L'\\');
if (pos) if (pos)
*pos = '\0'; *pos = '\0';
const string localeDir = baseDir + string("\\locale");
#else #else
static const char *localeDir = LOCALEDIR; static const string localeDir = LOCALEDIR;
#endif #endif
bindtextdomain(PACKAGE, localeDir); bindtextdomain(PACKAGE, localeDir.c_str());
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif

View file

@ -66,15 +66,16 @@ int main(int argc, char* argv[])
// Set the message domain // Set the message domain
#ifdef WIN32 #ifdef WIN32
// Get the absolute path, as returned by GetFullPathName() // Get the absolute path, as returned by GetFullPathName()
char localeDir[MAX_PATH]; char baseDir[MAX_PATH];
GetFullPathName(argv[0], MAX_PATH, localeDir, NULL); GetFullPathName(argv[0], MAX_PATH, baseDir, NULL);
char *pos = strrchr(localeDir, L'\\'); char *pos = strrchr(baseDir, L'\\');
if (pos) if (pos)
*pos = '\0'; *pos = '\0';
const string localeDir = baseDir + string("\\locale");
#else #else
static const char *localeDir = LOCALEDIR; static const string localeDir = LOCALEDIR;
#endif #endif
bindtextdomain(PACKAGE, localeDir); bindtextdomain(PACKAGE, localeDir.c_str());
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-09-06 16:02+0200\n" "POT-Creation-Date: 2008-09-07 10:38+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -192,29 +192,29 @@ msgstr ""
msgid "? 0 2 1 1" msgid "? 0 2 1 1"
msgstr "" msgstr ""
#: dic/compdic.cpp:511 #: dic/compdic.cpp:512
msgid "A mandatory option is missing" msgid "A mandatory option is missing"
msgstr "" msgstr ""
#: dic/compdic.cpp:519 #: dic/compdic.cpp:520
msgid "Cannot stat uncompressed dictionary " msgid "Cannot stat uncompressed dictionary "
msgstr "" msgstr ""
#: dic/compdic.cpp:527 #: dic/compdic.cpp:528
msgid "Cannot open output file " msgid "Cannot open output file "
msgstr "" msgstr ""
#: dic/compdic.cpp:575
#, c-format
msgid " Load time: %.3f s\n"
msgstr ""
#: dic/compdic.cpp:576 #: dic/compdic.cpp:576
#, c-format #, c-format
msgid " Load time: %.3f s\n"
msgstr ""
#: dic/compdic.cpp:577
#, c-format
msgid " Compression time: %.3f s\n" msgid " Compression time: %.3f s\n"
msgstr "" msgstr ""
#: dic/compdic.cpp:578 #: dic/compdic.cpp:579
#, c-format #, c-format
msgid " Maximum recursion level reached: %d\n" msgid " Maximum recursion level reached: %d\n"
msgstr "" msgstr ""
@ -258,15 +258,15 @@ msgstr ""
msgid " dictionary: path to eliot dawg dictionary" msgid " dictionary: path to eliot dawg dictionary"
msgstr "" msgstr ""
#: dic/regexpmain.cpp:94 dic/regexpmain.cpp:118 #: dic/regexpmain.cpp:95 dic/regexpmain.cpp:119
msgid "Enter a regular expression:" msgid "Enter a regular expression:"
msgstr "" msgstr ""
#: dic/regexpmain.cpp:105 #: dic/regexpmain.cpp:106
msgid "result:" msgid "result:"
msgstr "" msgstr ""
#: dic/regexpmain.cpp:114 wxwin/searchpanel.cc:296 #: dic/regexpmain.cpp:115 wxwin/searchpanel.cc:296
msgid "Invalid regular expression: " msgid "Invalid regular expression: "
msgstr "" msgstr ""
@ -1455,7 +1455,8 @@ msgstr ""
msgid "History" msgid "History"
msgstr "" msgstr ""
#: qt/main_window.cpp:681 qt/ui/main_window.ui:136 #: qt/main_window.cpp:681 qt/ui/dic_tools_widget.ui:13
#: qt/ui/main_window.ui:136
msgid "Dictionary tools" msgid "Dictionary tools"
msgstr "" msgstr ""
@ -1608,6 +1609,10 @@ msgstr ""
msgid "Pass" msgid "Pass"
msgstr "" msgstr ""
#: qt/ui/prefs_dialog.ui:13
msgid "Preferences"
msgstr ""
#: qt/ui/prefs_dialog.ui:19 #: qt/ui/prefs_dialog.ui:19
msgid "Interface" msgid "Interface"
msgstr "" msgstr ""

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: eliot 1.7\n" "Project-Id-Version: eliot 1.7\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-09-06 16:02+0200\n" "POT-Creation-Date: 2008-09-07 10:38+0200\n"
"PO-Revision-Date: 2008-08-31 10:43+0100\n" "PO-Revision-Date: 2008-08-31 10:43+0100\n"
"Last-Translator: Olivier Teuliere <ipkiss@via.ecp.fr>\n" "Last-Translator: Olivier Teuliere <ipkiss@via.ecp.fr>\n"
"Language-Team: French <traduc@traduc.org>\n" "Language-Team: French <traduc@traduc.org>\n"
@ -210,29 +210,29 @@ msgstr "Z 10 1 0 1"
msgid "? 0 2 1 1" msgid "? 0 2 1 1"
msgstr "? 0 2 1 1" msgstr "? 0 2 1 1"
#: dic/compdic.cpp:511 #: dic/compdic.cpp:512
msgid "A mandatory option is missing" msgid "A mandatory option is missing"
msgstr "Une option obligatoire est manquante" msgstr "Une option obligatoire est manquante"
#: dic/compdic.cpp:519 #: dic/compdic.cpp:520
msgid "Cannot stat uncompressed dictionary " msgid "Cannot stat uncompressed dictionary "
msgstr "Impossible de trouver le dictionnaire non compressé " msgstr "Impossible de trouver le dictionnaire non compressé "
#: dic/compdic.cpp:527 #: dic/compdic.cpp:528
msgid "Cannot open output file " msgid "Cannot open output file "
msgstr "Impossible d'ouvrir le fichier d'output " msgstr "Impossible d'ouvrir le fichier d'output "
#: dic/compdic.cpp:575 #: dic/compdic.cpp:576
#, c-format #, c-format
msgid " Load time: %.3f s\n" msgid " Load time: %.3f s\n"
msgstr " Temps de chargement : %.3f s\n" msgstr " Temps de chargement : %.3f s\n"
#: dic/compdic.cpp:576 #: dic/compdic.cpp:577
#, c-format #, c-format
msgid " Compression time: %.3f s\n" msgid " Compression time: %.3f s\n"
msgstr " Temps de compression : %.3f s\n" msgstr " Temps de compression : %.3f s\n"
#: dic/compdic.cpp:578 #: dic/compdic.cpp:579
#, c-format #, c-format
msgid " Maximum recursion level reached: %d\n" msgid " Maximum recursion level reached: %d\n"
msgstr " Niveau maximum de rcursion atteint : %d\n" msgstr " Niveau maximum de rcursion atteint : %d\n"
@ -276,15 +276,15 @@ msgstr "Usage : %s dictionnaire"
msgid " dictionary: path to eliot dawg dictionary" msgid " dictionary: path to eliot dawg dictionary"
msgstr " dictionnaire : chemin vers un dictionnaire de type dawg pour Eliot" msgstr " dictionnaire : chemin vers un dictionnaire de type dawg pour Eliot"
#: dic/regexpmain.cpp:94 dic/regexpmain.cpp:118 #: dic/regexpmain.cpp:95 dic/regexpmain.cpp:119
msgid "Enter a regular expression:" msgid "Enter a regular expression:"
msgstr "Entrer une expression régulière :" msgstr "Entrer une expression régulière :"
#: dic/regexpmain.cpp:105 #: dic/regexpmain.cpp:106
msgid "result:" msgid "result:"
msgstr "résultat :" msgstr "résultat :"
#: dic/regexpmain.cpp:114 wxwin/searchpanel.cc:296 #: dic/regexpmain.cpp:115 wxwin/searchpanel.cc:296
msgid "Invalid regular expression: " msgid "Invalid regular expression: "
msgstr "Expression régulière invalide : " msgstr "Expression régulière invalide : "
@ -1379,7 +1379,7 @@ msgstr "&Préférences..."
#: qt/main_window.cpp:326 #: qt/main_window.cpp:326
msgid "Ctrl+F" msgid "Ctrl+F"
msgstr "Ctrl-F" msgstr "Ctrl+F"
#: qt/main_window.cpp:327 #: qt/main_window.cpp:327
msgid "Edit the preferences" msgid "Edit the preferences"
@ -1487,7 +1487,8 @@ msgstr ""
msgid "History" msgid "History"
msgstr "Historique" msgstr "Historique"
#: qt/main_window.cpp:681 qt/ui/main_window.ui:136 #: qt/main_window.cpp:681 qt/ui/dic_tools_widget.ui:13
#: qt/ui/main_window.ui:136
msgid "Dictionary tools" msgid "Dictionary tools"
msgstr "Outils du dictionnaire" msgstr "Outils du dictionnaire"
@ -1648,6 +1649,10 @@ msgstr "Changer"
msgid "Pass" msgid "Pass"
msgstr "Passer" msgstr "Passer"
#: qt/ui/prefs_dialog.ui:13
msgid "Preferences"
msgstr "Préférences"
#: qt/ui/prefs_dialog.ui:19 #: qt/ui/prefs_dialog.ui:19
msgid "Interface" msgid "Interface"
msgstr "Interface" msgstr "Interface"
@ -1729,9 +1734,6 @@ msgstr "Complément"
#~ msgid "New..." #~ msgid "New..."
#~ msgstr "&Nouvelle partie..." #~ msgstr "&Nouvelle partie..."
#~ msgid "Preferences..."
#~ msgstr "&Préférences..."
#~ msgid "Save" #~ msgid "Save"
#~ msgstr "Sauver" #~ msgstr "Sauver"

View file

@ -24,7 +24,7 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" @QT_CFLAGS@ -DQT4LOCALEDIR=\"@QT4LOCA
SUFFIXES=.ui.h .moc.cpp SUFFIXES=.ui.h .moc.cpp
bin_PROGRAMS = qeliot bin_PROGRAMS = eliot
RESOURCES = \ RESOURCES = \
images/eliot.xpm images/eliot.xpm
@ -37,7 +37,8 @@ EXTRA_DIST = \
ui/prefs_dialog.ui \ ui/prefs_dialog.ui \
ui/training_widget.ui \ ui/training_widget.ui \
eliot.qrc \ eliot.qrc \
$(RESOURCES) $(RESOURCES) \
images/eliot.ico
BUILT_SOURCES = \ BUILT_SOURCES = \
ui/main_window.ui.h \ ui/main_window.ui.h \
@ -59,7 +60,7 @@ BUILT_SOURCES = \
main_window.moc.cpp \ main_window.moc.cpp \
resources.cpp resources.cpp
qeliot_SOURCES = \ eliot_SOURCES = \
qtcommon.h \ qtcommon.h \
bag_widget.cpp bag_widget.h \ bag_widget.cpp bag_widget.h \
dic_tools_widget.cpp dic_tools_widget.h \ dic_tools_widget.cpp dic_tools_widget.h \
@ -73,9 +74,9 @@ qeliot_SOURCES = \
aux_window.cpp aux_window.h \ aux_window.cpp aux_window.h \
main_window.cpp main_window.h \ main_window.cpp main_window.h \
main.cpp main.cpp
qeliot_SOURCES += $(BUILT_SOURCES) eliot_SOURCES += $(BUILT_SOURCES)
qeliot_LDADD = @QT_LIBS@ ../game/libgame.a ../dic/libdic.a @LIBINTL@ eliot_LDADD = @QT_LIBS@ ../game/libgame.a ../dic/libdic.a @LIBINTL@
# Generate a cpp file from the resources # Generate a cpp file from the resources
resources.cpp: eliot.qrc $(RESOURCES) resources.cpp: eliot.qrc $(RESOURCES)
@ -97,6 +98,18 @@ resources.cpp: eliot.qrc $(RESOURCES)
sed 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@.tmp >$@ sed 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@.tmp >$@
rm -f $@.tmp rm -f $@.tmp
# Embed the icon in the win32 binary, see http://doc.trolltech.com/4.4/appicon.html
if WIN32_BUILD
BUILT_SOURCES += win32icon.rc
eliot_SOURCES += win32icon.rc
eliot_LDADD += win32icon.o
win32icon.rc: images/eliot.ico
echo "IDI_ICON1 ICON DISCARDABLE \"$(top_srcdir)/qt/images/eliot.ico\"" > $@
win32icon.o: win32icon.rc
i586-mingw32msvc-windres -o $@ -i $<
endif
endif endif

BIN
qt/images/eliot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#include <string>
#include <QApplication> #include <QApplication>
#include <QLocale> #include <QLocale>
#include <QTranslator> #include <QTranslator>
@ -28,6 +29,9 @@
# include <windows.h> # include <windows.h>
#endif #endif
using std::string;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
#ifdef HAVE_SETLOCALE #ifdef HAVE_SETLOCALE
@ -42,22 +46,23 @@ int main(int argc, char **argv)
// Set the message domain // Set the message domain
#ifdef WIN32 #ifdef WIN32
// Get the absolute path, as returned by GetFullPathName() // Get the absolute path, as returned by GetFullPathName()
char localeDir[MAX_PATH]; char baseDir[MAX_PATH];
GetFullPathName(argv[0], MAX_PATH, localeDir, NULL); GetFullPathName(argv[0], MAX_PATH, baseDir, NULL);
char *pos = strrchr(localeDir, L'\\'); char *pos = strrchr(baseDir, L'\\');
if (pos) if (pos)
*pos = '\0'; *pos = '\0';
const string localeDir = baseDir + string("\\locale");
#else #else
static const char *localeDir = LOCALEDIR; static const string localeDir = LOCALEDIR;
#endif #endif
bindtextdomain(PACKAGE, localeDir); bindtextdomain(PACKAGE, localeDir.c_str());
textdomain(PACKAGE); textdomain(PACKAGE);
// Translations for Qt's own strings // Translations for Qt's own strings
QTranslator translator; QTranslator translator;
// Set the path for the translation file // Set the path for the translation file
#ifdef WIN32 #ifdef WIN32
QString path = localeDir; QString path = QString(localeDir.c_str()) + "\\qt4";
#else #else
QString path = QString(QT4LOCALEDIR); QString path = QString(QT4LOCALEDIR);
#endif #endif

View file

@ -10,7 +10,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Form</string> <string>_("Dictionary tools")</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="QVBoxLayout" name="verticalLayout" >
<item> <item>

View file

@ -10,7 +10,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Preferences</string> <string>_("Preferences")</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<item> <item>

View file

@ -1123,15 +1123,16 @@ int main(int argc, char ** argv)
// Set the message domain // Set the message domain
#ifdef WIN32 #ifdef WIN32
// Get the absolute path, as returned by GetFullPathName() // Get the absolute path, as returned by GetFullPathName()
char localeDir[MAX_PATH]; char baseDir[MAX_PATH];
GetFullPathName(argv[0], MAX_PATH, localeDir, NULL); GetFullPathName(argv[0], MAX_PATH, baseDir, NULL);
char *pos = strrchr(localeDir, L'\\'); char *pos = strrchr(baseDir, L'\\');
if (pos) if (pos)
*pos = '\0'; *pos = '\0';
const string localeDir = baseDir + string("\\locale");
#else #else
static const char *localeDir = LOCALEDIR; static const string localeDir = LOCALEDIR;
#endif #endif
bindtextdomain(PACKAGE, localeDir); bindtextdomain(PACKAGE, localeDir.c_str());
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif

View file

@ -20,11 +20,11 @@ localedir = $(datadir)/locale
if BUILD_WXWIDGETS if BUILD_WXWIDGETS
bin_PROGRAMS = eliot bin_PROGRAMS = wxeliot
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" @WX_CPPFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/dic -I$(top_srcdir)/game AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" @WX_CPPFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/dic -I$(top_srcdir)/game
eliot_SOURCES = \ wxeliot_SOURCES = \
configdb.cc configdb.h \ configdb.cc configdb.h \
gfxboard.cc gfxboard.h \ gfxboard.cc gfxboard.h \
gfxresult.cc gfxresult.h \ gfxresult.cc gfxresult.h \
@ -36,7 +36,7 @@ eliot_SOURCES = \
mainframe.cc mainframe.h \ mainframe.cc mainframe.h \
main.cc ewx.h main.cc ewx.h
eliot_LDADD = @WX_LIBS@ ../game/libgame.a ../dic/libdic.a @LIBINTL@ wxeliot_LDADD = @WX_LIBS@ ../game/libgame.a ../dic/libdic.a @LIBINTL@
EXTRA_DIST = \ EXTRA_DIST = \
eliot.xpm \ eliot.xpm \