eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot TODO dic/dic.cpp dic/dic.h game/freegame.... [cppdic]


From: eliot-dev
Subject: [Eliot-dev] eliot TODO dic/dic.cpp dic/dic.h game/freegame.... [cppdic]
Date: Sat, 15 Dec 2007 20:32:35 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Branch:         cppdic
Changes by:     Olivier Teulière <ipkiss>      07/12/15 20:32:35

Modified files:
        .              : TODO 
        dic            : dic.cpp dic.h 
        game           : freegame.cpp game.cpp training.cpp 
        po             : eliot.pot fr.po 
        utils          : ncurses.cpp 
        wxwin          : mainframe.cc 

Log message:
         - Validate the letters entered by the user, in case they are not in 
the dictionary
         - Translation update
         - TODO little update

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/TODO?cvsroot=eliot&only_with_tag=cppdic&r1=1.6.2.1&r2=1.6.2.2
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/dic.cpp?cvsroot=eliot&only_with_tag=cppdic&r1=1.1.2.12&r2=1.1.2.13
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/dic.h?cvsroot=eliot&only_with_tag=cppdic&r1=1.13.2.9&r2=1.13.2.10
http://cvs.savannah.gnu.org/viewcvs/eliot/game/freegame.cpp?cvsroot=eliot&only_with_tag=cppdic&r1=1.18.2.3&r2=1.18.2.4
http://cvs.savannah.gnu.org/viewcvs/eliot/game/game.cpp?cvsroot=eliot&only_with_tag=cppdic&r1=1.31.2.7&r2=1.31.2.8
http://cvs.savannah.gnu.org/viewcvs/eliot/game/training.cpp?cvsroot=eliot&only_with_tag=cppdic&r1=1.17.2.1&r2=1.17.2.2
http://cvs.savannah.gnu.org/viewcvs/eliot/po/eliot.pot?cvsroot=eliot&only_with_tag=cppdic&r1=1.6.6.3&r2=1.6.6.4
http://cvs.savannah.gnu.org/viewcvs/eliot/po/fr.po?cvsroot=eliot&only_with_tag=cppdic&r1=1.6.6.3&r2=1.6.6.4
http://cvs.savannah.gnu.org/viewcvs/eliot/utils/ncurses.cpp?cvsroot=eliot&only_with_tag=cppdic&r1=1.22.2.6&r2=1.22.2.7
http://cvs.savannah.gnu.org/viewcvs/eliot/wxwin/mainframe.cc?cvsroot=eliot&only_with_tag=cppdic&r1=1.21.2.6&r2=1.21.2.7

Patches:
Index: TODO
===================================================================
RCS file: /cvsroot/eliot/eliot/TODO,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -b -r1.6.2.1 -r1.6.2.2
--- TODO        11 Dec 2007 14:07:14 -0000      1.6.2.1
+++ TODO        15 Dec 2007 20:32:33 -0000      1.6.2.2
@@ -1,17 +1,13 @@
 
-* ====================
-* TODO Current version
-* ====================
+* ==================
+* Next Eliot version
+* ==================
 
+ - Improve error handling (use exceptions more)
  - Correct game save/load functions: Advanced format
    file saving for freegames and duplicate need a serious
    rewrite. We need to specify a file format that can handle
    all the information contained in a multiplayer game.
-
-* ==================
-* Next Eliot version
-* ==================
-
  - rack shuffling
  - new wxWidgets or QT interface
    - support of the different modes

Index: dic/dic.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/Attic/dic.cpp,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -b -r1.1.2.12 -r1.1.2.13
--- dic/dic.cpp 13 Dec 2007 12:11:06 -0000      1.1.2.12
+++ dic/dic.cpp 15 Dec 2007 20:32:33 -0000      1.1.2.13
@@ -27,6 +27,7 @@
 #include "config.h"
 
 #include <fstream>
+#include <algorithm>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -98,6 +99,11 @@
 
     initializeTiles();
 
+    // Concatenate the uppercase and lowercase letters
+    wstring lower = m_header->getLetters();
+    std::transform(lower.begin(), lower.end(), lower.begin(), towlower);
+    m_allLetters = m_header->getLetters() + lower;
+
     m_dic = this;
 }
 
@@ -145,6 +151,14 @@
 }
 
 
+bool Dictionary::validateLetters(const wstring &iLetters,
+                                 const wstring &iAccepted) const
+{
+    return iLetters.empty()
+        || iLetters.find_first_not_of(m_allLetters + iAccepted) == 
string::npos;
+}
+
+
 const dic_elt_t Dictionary::getNext(const dic_elt_t &e) const
 {
      if (!isLast(e))

Index: dic/dic.h
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/dic.h,v
retrieving revision 1.13.2.9
retrieving revision 1.13.2.10
diff -u -b -r1.13.2.9 -r1.13.2.10
--- dic/dic.h   13 Dec 2007 12:11:06 -0000      1.13.2.9
+++ dic/dic.h   15 Dec 2007 20:32:33 -0000      1.13.2.10
@@ -79,6 +79,14 @@
     /** Give access to the dictionary header */
     const Header& getHeader() const { return *m_header; }
 
+    /**
+     * Check whether all the given letters are present in the dictionary,
+     * or are one of the other accepted letters.
+     * Return true if this is the case, false otherwise
+     */
+    bool validateLetters(const wstring &iLetters,
+                         const wstring &iAccepted = L"") const;
+
     /** Return a vector containing one of each possible tile */
     const vector<Tile>& getAllTiles() const { return m_tilesVect; }
 
@@ -220,6 +228,9 @@
     Header *m_header;
     uint32_t *m_dawg;
 
+    /** Letters of the dictionary, both in uppercase and lowercase */
+    wstring m_allLetters;
+
     /// Vector of available tiles
     vector<Tile> m_tilesVect;
 

Index: game/freegame.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/freegame.cpp,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -u -b -r1.18.2.3 -r1.18.2.4
--- game/freegame.cpp   14 Dec 2007 18:12:32 -0000      1.18.2.3
+++ game/freegame.cpp   15 Dec 2007 20:32:34 -0000      1.18.2.4
@@ -194,6 +194,9 @@
     if (m_finished)
         return 3;
 
+    if (!m_dic.validateLetters(iToChange))
+        return 4;
+
     // According to the rules in the ODS, it is allowed to pass its turn (no
     // need to change letters for that).
     // TODO: However, if all the players pass their turn, the first one has to

Index: game/game.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/game.cpp,v
retrieving revision 1.31.2.7
retrieving revision 1.31.2.8
diff -u -b -r1.31.2.7 -r1.31.2.8
--- game/game.cpp       14 Dec 2007 18:12:32 -0000      1.31.2.7
+++ game/game.cpp       15 Dec 2007 20:32:34 -0000      1.31.2.8
@@ -419,12 +419,11 @@
  */
 int Game::helperSetRackManual(int p, bool iCheck, const wstring &iLetters)
 {
-    int min, ret;
-
-    PlayedRack pld = getPlayer(p).getCurrentRack();
-    pld.reset();
+    if (!m_dic.validateLetters(iLetters, L"+"))
+        return 3;
 
-    if ((ret = pld.setManual(iLetters)) > 0)
+    PlayedRack pld;
+    if (pld.setManual(iLetters) > 0)
     {
         return 1; /* add new tests */
     }
@@ -439,6 +438,7 @@
 
     if (iCheck)
     {
+        int min;
         if (m_bag.nVowels() > 1 && m_bag.nConsonants() > 1
             && m_history.getSize() < 15)
             min = 2;

Index: game/training.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/training.cpp,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -u -b -r1.17.2.1 -r1.17.2.2
--- game/training.cpp   4 Dec 2007 16:07:25 -0000       1.17.2.1
+++ game/training.cpp   15 Dec 2007 20:32:34 -0000      1.17.2.2
@@ -59,6 +59,7 @@
     return res;
 }
 
+
 int Training::setRackManual(bool iCheck, const wstring &iLetters)
 {
     int res;
@@ -75,12 +76,14 @@
         *it = towupper(*it);
     }
     res = helperSetRackManual(p, iCheck, uLetters);
-    // 0 : ok
-    // 1 : not enough tiles
-    // 2 : check failed (number of voyels before round 15)
+    // 0: ok
+    // 1: not enough tiles
+    // 2: check failed (number of vowels before round 15)
+    // 3: letters not in the dictionary
     return res;
 }
 
+
 int Training::setRack(set_rack_mode iMode, bool iCheck, const wstring 
&iLetters)
 {
     int res = 0;
@@ -99,6 +102,7 @@
     return res;
 }
 
+
 int Training::play(const wstring &iCoord, const wstring &iWord)
 {
     /* Perform all the validity checks, and fill a round */
@@ -215,6 +219,7 @@
     m_testRound = Round();
 }
 
+
 wstring Training::getTestPlayWord() const
 {
     return m_testRound.getWord();

Index: po/eliot.pot
===================================================================
RCS file: /cvsroot/eliot/eliot/po/eliot.pot,v
retrieving revision 1.6.6.3
retrieving revision 1.6.6.4
diff -u -b -r1.6.6.3 -r1.6.6.4
--- po/eliot.pot        11 Dec 2007 14:07:14 -0000      1.6.6.3
+++ po/eliot.pot        15 Dec 2007 20:32:34 -0000      1.6.6.4
@@ -85,130 +85,130 @@
 msgid "letter | points | frequency | vowel | consonant\n"
 msgstr ""
 
-#: dic/compdic.cpp:387
+#: dic/compdic.cpp:392
 msgid "Mandatory options:"
 msgstr ""
 
-#: dic/compdic.cpp:388
+#: dic/compdic.cpp:393
 msgid "  -d, --dicname <string>  Set the dictionary name and version"
 msgstr ""
 
-#: dic/compdic.cpp:389
+#: dic/compdic.cpp:394
 msgid ""
 "  -l, --letters <string>  Path to the file containing the letters (see below)"
 msgstr ""
 
-#: dic/compdic.cpp:390
+#: dic/compdic.cpp:395
 msgid ""
 "  -i, --input <string>    Path to the uncompressed dictionary file (encoded "
 "in UTF-8)"
 msgstr ""
 
-#: dic/compdic.cpp:391
+#: dic/compdic.cpp:396
 msgid ""
 "  -o, --output <string    Path to the generated compressed dictionary file"
 msgstr ""
 
-#: dic/compdic.cpp:392
+#: dic/compdic.cpp:397
 msgid "Other options:"
 msgstr ""
 
-#: dic/compdic.cpp:393
+#: dic/compdic.cpp:398
 msgid "  -h, --help              Print this help and exit"
 msgstr ""
 
-#: dic/compdic.cpp:394
+#: dic/compdic.cpp:399
 msgid "Example:"
 msgstr ""
 
-#: dic/compdic.cpp:395
+#: dic/compdic.cpp:400
 msgid " -d 'ODS 5.0' -l letters.txt -i ods5.txt -o ods5.dawg"
 msgstr ""
 
-#: dic/compdic.cpp:397
+#: dic/compdic.cpp:402
 msgid ""
 "The file containing the letters (--letters switch) must be UTF-8 encoded."
 msgstr ""
 
-#: dic/compdic.cpp:398
+#: dic/compdic.cpp:403
 msgid ""
 "Each line corresponds to one letter, and must contain 5 fields separated "
 "with "
 msgstr ""
 
-#: dic/compdic.cpp:399
+#: dic/compdic.cpp:404
 msgid "one or more space(s)."
 msgstr ""
 
-#: dic/compdic.cpp:400
+#: dic/compdic.cpp:405
 msgid " - 1st field: the letter itself"
 msgstr ""
 
-#: dic/compdic.cpp:401
+#: dic/compdic.cpp:406
 msgid " - 2nd field: the points of the letter"
 msgstr ""
 
-#: dic/compdic.cpp:402
+#: dic/compdic.cpp:407
 msgid ""
 " - 3rd field: the frequency of the letter (how many letters of this kind in "
 "the game)"
 msgstr ""
 
-#: dic/compdic.cpp:403
+#: dic/compdic.cpp:408
 msgid ""
 " - 4th field: 1 if the letter is considered as a vowel in Scrabble game, 0 "
 "otherwise"
 msgstr ""
 
-#: dic/compdic.cpp:404
+#: dic/compdic.cpp:409
 msgid ""
 " - 5th field: 1 if the letter is considered as a consonant in Scrabble game, "
 "0 otherwise"
 msgstr ""
 
-#: dic/compdic.cpp:405
+#: dic/compdic.cpp:410
 msgid "Example for french:"
 msgstr ""
 
-#: dic/compdic.cpp:406
+#: dic/compdic.cpp:411
 msgid "A 1 9 1 0"
 msgstr ""
 
-#: dic/compdic.cpp:407
+#: dic/compdic.cpp:412
 msgid "[...]"
 msgstr ""
 
-#: dic/compdic.cpp:408
+#: dic/compdic.cpp:413
 msgid "Z 10 1 0 1"
 msgstr ""
 
-#: dic/compdic.cpp:409
+#: dic/compdic.cpp:414
 msgid "? 0 2 1 1"
 msgstr ""
 
-#: dic/compdic.cpp:479
+#: dic/compdic.cpp:484
 msgid "A mandatory option is missing"
 msgstr ""
 
-#: dic/compdic.cpp:487
+#: dic/compdic.cpp:492
 msgid "Cannot stat uncompressed dictionary "
 msgstr ""
 
-#: dic/compdic.cpp:495
+#: dic/compdic.cpp:500
 msgid "Cannot open output file "
 msgstr ""
 
-#: dic/compdic.cpp:543
+#: dic/compdic.cpp:548
 #, c-format
 msgid " Load time: %.3f s\n"
 msgstr ""
 
-#: dic/compdic.cpp:544
+#: dic/compdic.cpp:549
 #, c-format
 msgid " Compression time: %.3f s\n"
 msgstr ""
 
-#: dic/compdic.cpp:546
+#: dic/compdic.cpp:551
 #, c-format
 msgid " Maximum recursion level reached: %d\n"
 msgstr ""
@@ -485,23 +485,27 @@
 msgid "Enter the new letters:"
 msgstr ""
 
-#: utils/ncurses.cpp:810
+#: utils/ncurses.cpp:503
+msgid "Cannot take these letters from the bag"
+msgstr ""
+
+#: utils/ncurses.cpp:814
 msgid "Training mode"
 msgstr ""
 
-#: utils/ncurses.cpp:812
+#: utils/ncurses.cpp:816
 msgid "Free game mode"
 msgstr ""
 
-#: utils/ncurses.cpp:814
+#: utils/ncurses.cpp:818
 msgid "Duplicate mode"
 msgstr ""
 
-#: utils/ncurses.cpp:817
+#: utils/ncurses.cpp:821
 msgid "Joker game"
 msgstr ""
 
-#: utils/ncurses.cpp:818
+#: utils/ncurses.cpp:822
 msgid "[h for help]"
 msgstr ""
 
@@ -1125,7 +1129,7 @@
 "for a new rack."
 msgstr ""
 
-#: wxwin/mainframe.cc:955 wxwin/mainframe.cc:959 wxwin/mainframe.cc:964
+#: wxwin/mainframe.cc:955 wxwin/mainframe.cc:959 wxwin/mainframe.cc:963
 msgid "Rack validation"
 msgstr ""
 
@@ -1134,14 +1138,10 @@
 msgstr ""
 
 #: wxwin/mainframe.cc:962
-msgid "The rack must contain at least 2 consonants and 2 vowels\n"
-msgstr ""
-
-#: wxwin/mainframe.cc:963
-msgid "but the bag doesn't contain enough letters.\n"
+msgid "The rack contains invalid letters for the current dictionary"
 msgstr ""
 
-#: wxwin/mainframe.cc:967
+#: wxwin/mainframe.cc:966
 msgid "The rack has been modified manually"
 msgstr ""
 

Index: po/fr.po
===================================================================
RCS file: /cvsroot/eliot/eliot/po/fr.po,v
retrieving revision 1.6.6.3
retrieving revision 1.6.6.4
diff -u -b -r1.6.6.3 -r1.6.6.4
--- po/fr.po    11 Dec 2007 14:07:14 -0000      1.6.6.3
+++ po/fr.po    15 Dec 2007 20:32:34 -0000      1.6.6.4
@@ -29,17 +29,17 @@
 #: dic/header.cpp:497
 #, c-format
 msgid "compressed on: %s\n"
-msgstr "Compressé le : %s\n"
+msgstr "Compressé le : %s\n"
 
 #: dic/header.cpp:501
 #, c-format
 msgid "compressed on: Unknown date (old format)\n"
-msgstr "Compressé le : Date inconnue (vieux format)\n"
+msgstr "Compressé le : Date inconnue (vieux format)\n"
 
 #: dic/header.cpp:503
 #, c-format
 msgid "compressed using a binary compiled by: %s\n"
-msgstr "Compressé avec un binaire compilé par : %s\n"
+msgstr "Compressé avec un binaire compilé par : %s\n"
 
 #: dic/header.cpp:504
 #, c-format
@@ -74,157 +74,158 @@
 #: dic/header.cpp:511
 #, c-format
 msgid "nodes: %d used + %d saved\n"
-msgstr "Noeuds : %d utilisés + %d évités\n"
+msgstr "Noeuds : %d utilisés + %d évités\n"
 
 #: dic/header.cpp:512
 #, c-format
 msgid "edges: %d used + %d saved\n"
-msgstr "Arcs : %d utilisés + %d évités\n"
+msgstr "Arcs : %d utilisés + %d évités\n"
 
 #: dic/header.cpp:514
 #, c-format
 msgid "letter | points | frequency | vowel | consonant\n"
 msgstr "lettre | points | frequence | voye. | consonne\n"
 
-#: dic/compdic.cpp:387
+#: dic/compdic.cpp:392
 msgid "Mandatory options:"
 msgstr "Options obligatoires :"
 
-#: dic/compdic.cpp:388
+#: dic/compdic.cpp:393
 msgid "  -d, --dicname <string>  Set the dictionary name and version"
 msgstr "  -d, --dicname <string>  Choisir le nom et la version du dictionnaire"
 
-#: dic/compdic.cpp:389
+#: dic/compdic.cpp:394
 msgid ""
 "  -l, --letters <string>  Path to the file containing the letters (see below)"
 msgstr ""
 "  -l, --letters <string>  Chemin vers un fichier contenant les lettres (voir "
 "ci-dessous)"
 
-#: dic/compdic.cpp:390
+#: dic/compdic.cpp:395
 msgid ""
 "  -i, --input <string>    Path to the uncompressed dictionary file (encoded "
 "in UTF-8)"
 msgstr ""
 "  -i, --input <string>    Chemin vers le fichier de dictionnaire non "
-"compressé (encodé en UTF-8)"
+"compressé (encodé en UTF-8)"
 
-#: dic/compdic.cpp:391
+#: dic/compdic.cpp:396
 msgid ""
 "  -o, --output <string    Path to the generated compressed dictionary file"
 msgstr ""
-"  -o, --output <string    Chemin vers le fichier de dictionnaire compressé "
-"généré"
+"  -o, --output <string    Chemin vers le fichier de dictionnaire compressé "
+"généré"
 
-#: dic/compdic.cpp:392
+#: dic/compdic.cpp:397
 msgid "Other options:"
 msgstr "Autres options :"
 
-#: dic/compdic.cpp:393
+#: dic/compdic.cpp:398
 msgid "  -h, --help              Print this help and exit"
 msgstr "  -h, --help              Affiche cette aide et quitte"
 
-#: dic/compdic.cpp:394
+#: dic/compdic.cpp:399
 msgid "Example:"
 msgstr "Exemple :"
 
-#: dic/compdic.cpp:395
+#: dic/compdic.cpp:400
 msgid " -d 'ODS 5.0' -l letters.txt -i ods5.txt -o ods5.dawg"
 msgstr " -d 'ODS 5.0' -l lettres.txt -i ods5.txt -o ods5.dawg"
 
-#: dic/compdic.cpp:397
+#: dic/compdic.cpp:402
 msgid ""
 "The file containing the letters (--letters switch) must be UTF-8 encoded."
 msgstr ""
-"Le fichier contenant les lettres (option --letters) doit être encodé en UTF-"
-"8."
+"Le fichier contenant les lettres (option --letters) doit être encodé en "
+"UTF-8."
 
-#: dic/compdic.cpp:398
+#: dic/compdic.cpp:403
 msgid ""
 "Each line corresponds to one letter, and must contain 5 fields separated "
 "with "
 msgstr ""
-"Chaque ligne correspond à une lettre, et doit contenir 5 champs séparés par "
+"Chaque ligne correspond à une lettre, et doit contenir 5 champs séparés "
+"par "
 
-#: dic/compdic.cpp:399
+#: dic/compdic.cpp:404
 msgid "one or more space(s)."
 msgstr "un ou plusieurs espace(s)."
 
-#: dic/compdic.cpp:400
+#: dic/compdic.cpp:405
 msgid " - 1st field: the letter itself"
-msgstr " - 1er champ : la lettre elle-même"
+msgstr " - 1er champ : la lettre elle-même"
 
-#: dic/compdic.cpp:401
+#: dic/compdic.cpp:406
 msgid " - 2nd field: the points of the letter"
 msgstr " - 2e champ : les points de cette lettre"
 
-#: dic/compdic.cpp:402
+#: dic/compdic.cpp:407
 msgid ""
 " - 3rd field: the frequency of the letter (how many letters of this kind in "
 "the game)"
 msgstr ""
-" - 3e champ : la fréquance de la lettre (nombre de lettres de ce genre dans "
+" - 3e champ : la fréquance de la lettre (nombre de lettres de ce genre dans "
 "le jeu)"
 
-#: dic/compdic.cpp:403
+#: dic/compdic.cpp:408
 msgid ""
 " - 4th field: 1 if the letter is considered as a vowel in Scrabble game, 0 "
 "otherwise"
 msgstr ""
-" - 4e champ : 1 si la lettre est considérée comme une voyelle au jeu de "
+" - 4e champ : 1 si la lettre est considérée comme une voyelle au jeu de "
 "Scrabble, 0 sinon"
 
-#: dic/compdic.cpp:404
+#: dic/compdic.cpp:409
 msgid ""
 " - 5th field: 1 if the letter is considered as a consonant in Scrabble game, "
 "0 otherwise"
 msgstr ""
-" - 5e champ : 1 si la lettre est considérée comme une consonne au jeu de "
+" - 5e champ : 1 si la lettre est considérée comme une consonne au jeu de "
 "Scrabble, 0 sinon"
 
-#: dic/compdic.cpp:405
+#: dic/compdic.cpp:410
 msgid "Example for french:"
-msgstr "Exemple pour le Français :"
+msgstr "Exemple pour le Français :"
 
-#: dic/compdic.cpp:406
+#: dic/compdic.cpp:411
 msgid "A 1 9 1 0"
 msgstr "A 1 9 1 0"
 
-#: dic/compdic.cpp:407
+#: dic/compdic.cpp:412
 msgid "[...]"
 msgstr "[...]"
 
-#: dic/compdic.cpp:408
+#: dic/compdic.cpp:413
 msgid "Z 10 1 0 1"
 msgstr "Z 10 1 0 1"
 
-#: dic/compdic.cpp:409
+#: dic/compdic.cpp:414
 msgid "? 0 2 1 1"
 msgstr "? 0 2 1 1"
 
-#: dic/compdic.cpp:479
+#: dic/compdic.cpp:484
 msgid "A mandatory option is missing"
 msgstr "Une option obligatoire est manquante"
 
-#: dic/compdic.cpp:487
+#: dic/compdic.cpp:492
 msgid "Cannot stat uncompressed dictionary "
-msgstr "Impossible de trouver le dictionnaire non compressé "
+msgstr "Impossible de trouver le dictionnaire non compressé "
 
-#: dic/compdic.cpp:495
+#: dic/compdic.cpp:500
 msgid "Cannot open output file "
 msgstr "Impossible d'ouvrir le fichier d'output "
 
-#: dic/compdic.cpp:543
+#: dic/compdic.cpp:548
 #, c-format
 msgid " Load time: %.3f s\n"
 msgstr " Temps de chargement : %.3f s\n"
 
-#: dic/compdic.cpp:544
+#: dic/compdic.cpp:549
 #, c-format
 msgid " Compression time: %.3f s\n"
 msgstr " Temps de compression : %.3f s\n"
 
-#: dic/compdic.cpp:546
+#: dic/compdic.cpp:551
 #, c-format
 msgid " Maximum recursion level reached: %d\n"
 msgstr " Niveau maximum de rcursion atteint : %d\n"
@@ -247,7 +248,7 @@
 #: dic/listdic.cpp:111
 #, c-format
 msgid "  -h: print header\n"
-msgstr "  -h : affiche l'en-tête\n"
+msgstr "  -h : affiche l'en-tête\n"
 
 #: dic/listdic.cpp:112
 #, c-format
@@ -257,7 +258,7 @@
 #: dic/listdic.cpp:113
 #, c-format
 msgid "  -x: print dictionary in hex\n"
-msgstr "  -x : affiche le dictionnaire en hexadécimal\n"
+msgstr "  -x : affiche le dictionnaire en hexadécimal\n"
 
 #: dic/regexpmain.cpp:100
 #, c-format
@@ -270,11 +271,11 @@
 
 #: dic/regexpmain.cpp:136
 msgid "enter a regular expression:"
-msgstr "Entrer une expression régulière :"
+msgstr "Entrer une expression régulière :"
 
 #: dic/regexpmain.cpp:148
 msgid "result:"
-msgstr "résultat :"
+msgstr "résultat :"
 
 #: utils/ncurses.cpp:192
 msgid " Scores "
@@ -296,11 +297,11 @@
 
 #: utils/ncurses.cpp:224 utils/ncurses.cpp:227
 msgid "Search complete"
-msgstr "Recherche terminée"
+msgstr "Recherche terminée"
 
 #: utils/ncurses.cpp:239
 msgid " Search results "
-msgstr " Résultats de la recherche "
+msgstr " Résultats de la recherche "
 
 #: utils/ncurses.cpp:269
 msgid " History of the game "
@@ -316,11 +317,11 @@
 
 #: utils/ncurses.cpp:312
 msgid "[Global]"
-msgstr "[Général]"
+msgstr "[Général]"
 
 #: utils/ncurses.cpp:313
 msgid "   h, H, ?          Show/hide help box"
-msgstr "   h, H, ?          Afficher/cacher la boîte d'aide"
+msgstr "   h, H, ?          Afficher/cacher la boîte d'aide"
 
 #: utils/ncurses.cpp:314
 msgid "   y, Y             Show/hide history of the game"
@@ -334,7 +335,8 @@
 
 #: utils/ncurses.cpp:316
 msgid "   d, D             Check the existence of a word in the dictionary"
-msgstr "   d, D             Vérifier l'existence d'un mot dans le dictionnaire"
+msgstr ""
+"   d, D             Vérifier l'existence d'un mot dans le dictionnaire"
 
 #: utils/ncurses.cpp:317
 msgid "   j, J             Play a word"
@@ -354,15 +356,16 @@
 
 #: utils/ncurses.cpp:323
 msgid "[Training mode]"
-msgstr "[Mode entraînement]"
+msgstr "[Mode entraînement]"
 
 #: utils/ncurses.cpp:324
 msgid "   *                Take a random rack"
-msgstr "   *                Tirage aléatoire"
+msgstr "   *                Tirage aléatoire"
 
 #: utils/ncurses.cpp:325
 msgid "   +                Complete the current rack randomly"
-msgstr "   +                Compléter le tirage courant de manière aléatoire"
+msgstr ""
+"   +                Compléter le tirage courant de manière aléatoire"
 
 #: utils/ncurses.cpp:326
 msgid "   t, T             Set the rack manually"
@@ -374,7 +377,7 @@
 
 #: utils/ncurses.cpp:328
 msgid "   r, R             Show/hide search results"
-msgstr "   r, R             Afficher/cacher les résultats de la recherche"
+msgstr "   r, R             Afficher/cacher les résultats de la recherche"
 
 #: utils/ncurses.cpp:331
 msgid "[Duplicate mode]"
@@ -399,15 +402,15 @@
 
 #: utils/ncurses.cpp:340
 msgid "   <up>, <down>     Navigate in a box line by line"
-msgstr "   <haut>, <bas>    Naviguer dans une boîte ligne par ligne"
+msgstr "   <haut>, <bas>    Naviguer dans une boîte ligne par ligne"
 
 #: utils/ncurses.cpp:341
 msgid "   <pgup>, <pgdown> Navigate in a box page by page"
-msgstr "   <pgup>, <pgdown> Naviguer dans une boîte page par page"
+msgstr "   <pgup>, <pgdown> Naviguer dans une boîte page par page"
 
 #: utils/ncurses.cpp:342
 msgid "   Ctrl-l           Refresh the screen"
-msgstr "   Ctrl-l           Rafraîchir l'écran"
+msgstr "   Ctrl-l           Rafraîchir l'écran"
 
 #: utils/ncurses.cpp:350
 msgid " Play a word "
@@ -419,15 +422,15 @@
 #. Coordinates:
 #: utils/ncurses.cpp:351 utils/ncurses.cpp:359
 msgid "Played word:"
-msgstr "Mot joué    :"
+msgstr "Mot joué    :"
 
 #: utils/ncurses.cpp:352 utils/ncurses.cpp:360
 msgid "Coordinates:"
-msgstr "Coordonnées :"
+msgstr "Coordonnées :"
 
 #: utils/ncurses.cpp:374
 msgid "Incorrect or misplaced word"
-msgstr "Mot incorrect ou mal placé"
+msgstr "Mot incorrect ou mal placé"
 
 #: utils/ncurses.cpp:384
 msgid " Dictionary "
@@ -435,7 +438,7 @@
 
 #: utils/ncurses.cpp:385
 msgid "Enter the word to check:"
-msgstr "Entrer le mot à vérifier:"
+msgstr "Entrer le mot à vérifier:"
 
 #: utils/ncurses.cpp:394
 #, c-format
@@ -458,12 +461,12 @@
 #: utils/ncurses.cpp:417
 #, c-format
 msgid "Cannot open file %ls for writing"
-msgstr "Impossible d'ouvrir le fichier %ls en écriture"
+msgstr "Impossible d'ouvrir le fichier %ls en écriture"
 
 #: utils/ncurses.cpp:424
 #, c-format
 msgid "Game saved in %ls"
-msgstr "Partie sauvée dans %ls"
+msgstr "Partie sauvée dans %ls"
 
 #: utils/ncurses.cpp:435
 msgid " Load a game "
@@ -477,12 +480,12 @@
 #: utils/ncurses.cpp:454
 #, c-format
 msgid "Invalid saved game"
-msgstr "Partie sauvée invalide"
+msgstr "Partie sauvée invalide"
 
 #: utils/ncurses.cpp:458
 #, c-format
 msgid "Game loaded"
-msgstr "Partie chargée"
+msgstr "Partie chargée"
 
 #: utils/ncurses.cpp:473
 msgid " Pass your turn "
@@ -490,7 +493,7 @@
 
 #: utils/ncurses.cpp:474
 msgid "Enter the letters to change:"
-msgstr "Entrer les lettres à changer:"
+msgstr "Entrer les lettres à changer:"
 
 #: utils/ncurses.cpp:483
 msgid "Cannot pass the turn"
@@ -504,23 +507,27 @@
 msgid "Enter the new letters:"
 msgstr "Entrer les nouvelles lettres:"
 
-#: utils/ncurses.cpp:810
+#: utils/ncurses.cpp:503
+msgid "Cannot take these letters from the bag"
+msgstr "Impossible de retirer ces lettres du sac"
+
+#: utils/ncurses.cpp:814
 msgid "Training mode"
-msgstr "Mode entraînement"
+msgstr "Mode entraînement"
 
-#: utils/ncurses.cpp:812
+#: utils/ncurses.cpp:816
 msgid "Free game mode"
 msgstr "Mode partie libre"
 
-#: utils/ncurses.cpp:814
+#: utils/ncurses.cpp:818
 msgid "Duplicate mode"
 msgstr "Mode duplicate"
 
-#: utils/ncurses.cpp:817
+#: utils/ncurses.cpp:821
 msgid "Joker game"
 msgstr "Partie joker"
 
-#: utils/ncurses.cpp:818
+#: utils/ncurses.cpp:822
 msgid "[h for help]"
 msgstr "[h pour l'aide]"
 
@@ -567,7 +574,7 @@
 
 #: wxwin/auxframes.cc:363 wxwin/searchpanel.cc:119
 msgid "No result"
-msgstr "Pas de résultat"
+msgstr "Pas de résultat"
 
 #: wxwin/auxframes.cc:409
 msgid "Rack: "
@@ -579,7 +586,7 @@
 
 #: wxwin/auxframes.cc:557 wxwin/mainframe.cc:320
 msgid "Results"
-msgstr "Résultats"
+msgstr "Résultats"
 
 #: wxwin/confdimdlg.cc:62
 msgid "left"
@@ -587,7 +594,7 @@
 
 #: wxwin/confdimdlg.cc:63
 msgid "centered"
-msgstr "centré"
+msgstr "centré"
 
 #: wxwin/confdimdlg.cc:64
 msgid "right"
@@ -623,7 +630,7 @@
 
 #: wxwin/confdimdlg.cc:158
 msgid "Spacing of the heading characters"
-msgstr "Espacement des caractères du titre"
+msgstr "Espacement des caractères du titre"
 
 #: wxwin/confdimdlg.cc:167
 msgid "Inner dimension of the column (in mm)"
@@ -635,7 +642,7 @@
 
 #: wxwin/confdimdlg.cc:180
 msgid "Characters spacing"
-msgstr "Espacement des caractères"
+msgstr "Espacement des caractères"
 
 #: wxwin/confdimdlg.cc:231
 msgid "Title spc. top"
@@ -723,7 +730,7 @@
 
 #: wxwin/gfxresult.cc:71
 msgid "Results of the search"
-msgstr "Résultats de la recherche"
+msgstr "Résultats de la recherche"
 
 #: wxwin/mainframe.cc:204
 msgid " Rack "
@@ -731,7 +738,7 @@
 
 #: wxwin/mainframe.cc:205
 msgid " Complement "
-msgstr " Complément "
+msgstr " Complément "
 
 #: wxwin/mainframe.cc:206
 msgid " Search "
@@ -739,7 +746,7 @@
 
 #: wxwin/mainframe.cc:207
 msgid " Back "
-msgstr " Arrière "
+msgstr " Arrière "
 
 #: wxwin/mainframe.cc:208
 msgid " Play "
@@ -747,11 +754,11 @@
 
 #: wxwin/mainframe.cc:210
 msgid "Random rack"
-msgstr "Tirage aléatoire"
+msgstr "Tirage aléatoire"
 
 #: wxwin/mainframe.cc:211
 msgid "Random complement of the rack"
-msgstr "Complément aléatoire du tirage"
+msgstr "Complément aléatoire du tirage"
 
 #: wxwin/mainframe.cc:212
 msgid "Search with the current rack"
@@ -759,11 +766,11 @@
 
 #: wxwin/mainframe.cc:213
 msgid "Go back one turn"
-msgstr "Revenir un coup en arrière"
+msgstr "Revenir un coup en arrière"
 
 #: wxwin/mainframe.cc:214
 msgid "Play the selected word"
-msgstr "Jouer le mot selectionné"
+msgstr "Jouer le mot selectionné"
 
 #: wxwin/mainframe.cc:265
 msgid "&New game\tctrl+n"
@@ -771,7 +778,7 @@
 
 #: wxwin/mainframe.cc:265
 msgid "Start a new game"
-msgstr "Démarrer une nouvelle partie"
+msgstr "Démarrer une nouvelle partie"
 
 #: wxwin/mainframe.cc:266
 msgid "New &joker game\tctrl+j"
@@ -779,7 +786,7 @@
 
 #: wxwin/mainframe.cc:266
 msgid "Start a new joker game"
-msgstr "Démarrer une nouvelle partie joker"
+msgstr "Démarrer une nouvelle partie joker"
 
 #: wxwin/mainframe.cc:268
 msgid "&Load...\tctrl+l"
@@ -807,11 +814,11 @@
 
 #: wxwin/mainframe.cc:272
 msgid "Print pre&view..."
-msgstr "&Aperçu avant impression..."
+msgstr "&Aperçu avant impression..."
 
 #: wxwin/mainframe.cc:272
 msgid "Print preview of the game"
-msgstr "Aperçu avant impression de la partie"
+msgstr "Aperçu avant impression de la partie"
 
 #: wxwin/mainframe.cc:274
 msgid "Print in PostS&cript..."
@@ -863,11 +870,11 @@
 
 #: wxwin/mainframe.cc:287
 msgid "&Played letters..."
-msgstr "Lettres &jouées..."
+msgstr "Lettres &jouées..."
 
 #: wxwin/mainframe.cc:287
 msgid "Color of the letters played on the board"
-msgstr "Couleur des lettres jouées sur la grille"
+msgstr "Couleur des lettres jouées sur la grille"
 
 #: wxwin/mainframe.cc:288
 msgid "&Temporary letters..."
@@ -879,11 +886,11 @@
 
 #: wxwin/mainframe.cc:289
 msgid "B&ackground of played letters..."
-msgstr "Fo&nd des lettres jouées..."
+msgstr "Fo&nd des lettres jouées..."
 
 #: wxwin/mainframe.cc:289
 msgid "Background color of the letters played on the board"
-msgstr "Couleur de fond des lettres jouées sur la grille"
+msgstr "Couleur de fond des lettres jouées sur la grille"
 
 #: wxwin/mainframe.cc:290
 msgid "Ba&ckground of temporary letters..."
@@ -939,7 +946,7 @@
 
 #: wxwin/mainframe.cc:300
 msgid "Font for the search"
-msgstr "Police de caractères pour la recherche"
+msgstr "Police de caractères pour la recherche"
 
 #: wxwin/mainframe.cc:303 wxwin/mainframe.cc:327
 msgid "&Game"
@@ -951,11 +958,11 @@
 
 #: wxwin/mainframe.cc:304
 msgid "&Fonts"
-msgstr "P&olices de caractères"
+msgstr "P&olices de caractères"
 
 #: wxwin/mainframe.cc:304
 msgid "Configuration of the fonts"
-msgstr "Configuration des polices de caractères"
+msgstr "Configuration des polices de caractères"
 
 #: wxwin/mainframe.cc:305
 msgid "&Colors"
@@ -971,7 +978,7 @@
 
 #: wxwin/mainframe.cc:306
 msgid "Configuration of the printing parameters"
-msgstr "Configuration des paramètres d'impression"
+msgstr "Configuration des paramètres d'impression"
 
 #: wxwin/mainframe.cc:309
 msgid "&Board"
@@ -991,11 +998,11 @@
 
 #: wxwin/mainframe.cc:311
 msgid "&Check"
-msgstr "&Vérification"
+msgstr "&Vérification"
 
 #: wxwin/mainframe.cc:311
 msgid "Check a word in the dictionary"
-msgstr "Vérifier l'existence d'un mot dans le dictionnaire"
+msgstr "Vérifier l'existence d'un mot dans le dictionnaire"
 
 #: wxwin/mainframe.cc:312
 msgid "&Search"
@@ -1035,23 +1042,23 @@
 
 #: wxwin/mainframe.cc:320
 msgid "R&esults"
-msgstr "Ré&sultats"
+msgstr "Ré&sultats"
 
 #: wxwin/mainframe.cc:324
 msgid "&About..."
-msgstr "À &propos..."
+msgstr "À &propos..."
 
 #: wxwin/mainframe.cc:324 wxwin/mainframe.cc:722
 msgid "About Eliot"
-msgstr "À propos d'Eliot"
+msgstr "À propos d'Eliot"
 
 #: wxwin/mainframe.cc:328
 msgid "&Settings"
-msgstr "&Paramètres"
+msgstr "&Paramètres"
 
 #: wxwin/mainframe.cc:329
 msgid "&Windows"
-msgstr "&Fenêtres"
+msgstr "&Fenêtres"
 
 #: wxwin/mainframe.cc:330
 msgid "&Help"
@@ -1059,7 +1066,7 @@
 
 #: wxwin/mainframe.cc:354 wxwin/mainframe.cc:392
 msgid "No dictionary selected"
-msgstr "Pas de dictionnaire sélectionné"
+msgstr "Pas de dictionnaire sélectionné"
 
 #: wxwin/mainframe.cc:354 wxwin/mainframe.cc:392 wxwin/mainframe.cc:491
 #: wxwin/mainframe.cc:511 wxwin/mainframe.cc:542
@@ -1088,11 +1095,11 @@
 
 #: wxwin/mainframe.cc:471
 msgid "Cannot create "
-msgstr "Impossible de créer "
+msgstr "Impossible de créer "
 
 #: wxwin/mainframe.cc:500 wxwin/mainframe.cc:564
 msgid "Printing not done"
-msgstr "Impression non effectuée"
+msgstr "Impression non effectuée"
 
 #: wxwin/mainframe.cc:500 wxwin/mainframe.cc:528
 msgid "Printing"
@@ -1100,15 +1107,15 @@
 
 #: wxwin/mainframe.cc:523
 msgid "Print preview problem.\n"
-msgstr "Problème avec l'aperçu avant impression.\n"
+msgstr "Problème avec l'aperçu avant impression.\n"
 
 #: wxwin/mainframe.cc:524
 msgid "The printer may not be correctly initialized"
-msgstr "Il se peut que l'imprimante soit mal initialisée"
+msgstr "Il se peut que l'imprimante soit mal initialisée"
 
 #: wxwin/mainframe.cc:525
 msgid "Print preview"
-msgstr "Aperçu avant impression"
+msgstr "Aperçu avant impression"
 
 #: wxwin/mainframe.cc:546
 msgid "Print to a PostScript file"
@@ -1131,8 +1138,8 @@
 msgstr ""
 "Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le "
 "modifier selon les termes de la licence \"GNU General Public License\" "
-"publiée par la Free Software Fundation ; soit la version 2 de la Licence, "
-"soit (comme vous le préférez), n'importe quelle version ultérieure."
+"publiée par la Free Software Fundation ; soit la version 2 de la Licence, "
+"soit (comme vous le préférez), n'importe quelle version ultérieure."
 
 #: wxwin/mainframe.cc:916
 msgid "turn:"
@@ -1150,7 +1157,7 @@
 "Le sac ne contient pas assez de lettres\n"
 "pour un nouveau tirage."
 
-#: wxwin/mainframe.cc:955 wxwin/mainframe.cc:959 wxwin/mainframe.cc:964
+#: wxwin/mainframe.cc:955 wxwin/mainframe.cc:959 wxwin/mainframe.cc:963
 msgid "Rack validation"
 msgstr "Validation du tirage"
 
@@ -1159,16 +1166,13 @@
 msgstr "Le tirage doit contenir au moins 2 consonnes et 2 voyelles."
 
 #: wxwin/mainframe.cc:962
-msgid "The rack must contain at least 2 consonants and 2 vowels\n"
-msgstr "Le tirage doit contenir au moins 2 consonnes et 2 voyelles\n"
-
-#: wxwin/mainframe.cc:963
-msgid "but the bag doesn't contain enough letters.\n"
-msgstr "mais le sac ne contient plus assez de lettres.\n"
+msgid "The rack contains invalid letters for the current dictionary"
+msgstr ""
+"Le tirage contient des lettres incorrectes pour le dictionnaire courant"
 
-#: wxwin/mainframe.cc:967
+#: wxwin/mainframe.cc:966
 msgid "The rack has been modified manually"
-msgstr "Le tirage a été modifié manuellement"
+msgstr "Le tirage a été modifié manuellement"
 
 #: wxwin/searchpanel.cc:303
 msgid "Minimum length"
@@ -1180,7 +1184,7 @@
 
 #: wxwin/searchpanel.cc:368
 msgid "Cross words"
-msgstr "Mots croisés"
+msgstr "Mots croisés"
 
 #: wxwin/searchpanel.cc:369
 msgid "Plus 1"
@@ -1188,7 +1192,13 @@
 
 #: wxwin/searchpanel.cc:370
 msgid "Regular expressions"
-msgstr "Expressions régulières"
+msgstr "Expressions régulières"
+
+#~ msgid "The rack must contain at least 2 consonants and 2 vowels\n"
+#~ msgstr "Le tirage doit contenir au moins 2 consonnes et 2 voyelles\n"
+
+#~ msgid "but the bag doesn't contain enough letters.\n"
+#~ msgstr "mais le sac ne contient plus assez de lettres.\n"
 
 #~ msgid "&Configuration"
 #~ msgstr "&Configuration"
@@ -1223,7 +1233,7 @@
 
 #, fuzzy
 #~ msgid "Results..."
-#~ msgstr "Résultat"
+#~ msgstr "Résultat"
 
 #, fuzzy
 #~ msgid "Dictionnaire"
@@ -1233,7 +1243,7 @@
 #~ msgstr "Usage: eliotcurses /chemin vers/ods4.dawg\n"
 
 #~ msgid "Played word: "
-#~ msgstr "Mot joué    :"
+#~ msgstr "Mot joué    :"
 
 #~ msgid "Duplicate"
 #~ msgstr "Duplicate"

Index: utils/ncurses.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/utils/ncurses.cpp,v
retrieving revision 1.22.2.6
retrieving revision 1.22.2.7
diff -u -b -r1.22.2.6 -r1.22.2.7
--- utils/ncurses.cpp   5 Dec 2007 14:44:38 -0000       1.22.2.6
+++ utils/ncurses.cpp   15 Dec 2007 20:32:34 -0000      1.22.2.7
@@ -497,7 +497,11 @@
     wstring letters;
     if (readString(win, y + 2, x + 2, 7, letters, kJOKER))
     {
-        iGame.setRackManual(false, letters);
+        int res = iGame.setRackManual(false, letters);
+        if (res)
+        {
+            drawStatus(win, LINES - 1, 0, _("Cannot take these letters from 
the bag"));
+        }
     }
     m_state = DEFAULT;
     clearRect(win, y, x, 4, 32);

Index: wxwin/mainframe.cc
===================================================================
RCS file: /cvsroot/eliot/eliot/wxwin/mainframe.cc,v
retrieving revision 1.21.2.6
retrieving revision 1.21.2.7
diff -u -b -r1.21.2.6 -r1.21.2.7
--- wxwin/mainframe.cc  11 Dec 2007 14:07:15 -0000      1.21.2.6
+++ wxwin/mainframe.cc  15 Dec 2007 20:32:34 -0000      1.21.2.7
@@ -952,16 +952,15 @@
             break;
         case 0x01:
             msg = _("The bag doesn't contain enough letters\nfor a new rack.");
-            wxMessageBox(msg, _("Rack validation"), wxICON_INFORMATION | wxOK);
+            wxMessageBox(msg, _("Rack validation"), wxICON_ERROR | wxOK);
             return;
         case 0x02:
             msg = _("The rack must contain at least 2 consonants and 2 
vowels.");
-            wxMessageBox(msg, _("Rack validation"), wxICON_INFORMATION | wxOK);
+            wxMessageBox(msg, _("Rack validation"), wxICON_ERROR | wxOK);
             return;
         case 0x03:
-            msg = _("The rack must contain at least 2 consonants and 2 
vowels\n");
-            msg += _("but the bag doesn't contain enough letters.\n");
-            wxMessageBox(msg, _("Rack validation"), wxICON_INFORMATION | wxOK);
+            msg = _("The rack contains invalid letters for the current 
dictionary");
+            wxMessageBox(msg, _("Rack validation"), wxICON_ERROR | wxOK);
             break;
         default:
             statusbar->SetStatusText(_("The rack has been modified manually"), 
0);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]