[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] eliot game/settings.cpp po/eliot.pot po/fr.po q...
From: |
eliot-dev |
Subject: |
[Eliot-dev] eliot game/settings.cpp po/eliot.pot po/fr.po q... |
Date: |
Sun, 07 Sep 2008 21:06:18 +0000 |
CVSROOT: /cvsroot/eliot
Module name: eliot
Changes by: Olivier Teulière <ipkiss> 08/09/07 21:06:18
Modified files:
game : settings.cpp
po : eliot.pot fr.po
qt : board_widget.cpp board_widget.h main_window.cpp
player_widget.cpp player_widget.h
qt/ui : player_widget.ui
Log message:
Qt interface:
- Be more explicit if the dictionary name is missing
- Changed the colour of the joker on the board, instead of displaying
it in lower case
- Incorrect words are now refused by default
- Changed the way words are input: the case is no longer relevant,
and the coordinates are in a separate control
- Explain the problem when a word is refused
- Updated the French translation
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/game/settings.cpp?cvsroot=eliot&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/eliot/po/eliot.pot?cvsroot=eliot&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/eliot/po/fr.po?cvsroot=eliot&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/board_widget.cpp?cvsroot=eliot&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/board_widget.h?cvsroot=eliot&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/main_window.cpp?cvsroot=eliot&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/player_widget.cpp?cvsroot=eliot&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/player_widget.h?cvsroot=eliot&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/ui/player_widget.ui?cvsroot=eliot&r1=1.2&r2=1.3
Patches:
Index: game/settings.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/settings.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- game/settings.cpp 5 Sep 2008 21:31:31 -0000 1.3
+++ game/settings.cpp 7 Sep 2008 21:06:17 -0000 1.4
@@ -63,7 +63,7 @@
// If true, Eliot complains when the player does something illegal
// If false, the word is accepted (with a score of 0) and the player does
// not get a second chance
- m_boolHandler.addOption("duplicate-reject-invalid", false);
+ m_boolHandler.addOption("duplicate-reject-invalid", true);
// ============== Freegame mode options ==============
@@ -73,7 +73,7 @@
// not get a second chance.
// Trying to change letters or to pass the turn in an incorrect way will
// be rejected in any case.
- m_boolHandler.addOption("freegame-reject-invalid", false);
+ m_boolHandler.addOption("freegame-reject-invalid", true);
}
Index: po/eliot.pot
===================================================================
RCS file: /cvsroot/eliot/eliot/po/eliot.pot,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- po/eliot.pot 7 Sep 2008 13:17:40 -0000 1.13
+++ po/eliot.pot 7 Sep 2008 21:06:17 -0000 1.14
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-07 10:38+0200\n"
+"POT-Creation-Date: 2008-09-07 22:31+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
@@ -309,7 +309,7 @@
msgid " N | RACK | SOLUTION | REF | PTS | P | BONUS"
msgstr ""
-#: utils/ncurses.cpp:414 qt/history_widget.cpp:143 qt/main_window.cpp:545
+#: utils/ncurses.cpp:414 qt/history_widget.cpp:143 qt/main_window.cpp:560
msgid "(PASS)"
msgstr ""
@@ -415,7 +415,7 @@
msgid " Ctrl-l Refresh the screen"
msgstr ""
-#: utils/ncurses.cpp:486 wxwin/auxframes.cc:147 qt/main_window.cpp:628
+#: utils/ncurses.cpp:486 wxwin/auxframes.cc:147 qt/main_window.cpp:643
#: qt/ui/main_window.ui:94
msgid "Bag"
msgstr ""
@@ -481,7 +481,7 @@
msgstr ""
#: utils/ncurses.cpp:632 wxwin/mainframe.cc:275 wxwin/mainframe.cc:405
-#: wxwin/mainframe.cc:429 qt/main_window.cpp:390
+#: wxwin/mainframe.cc:429 qt/main_window.cpp:405
msgid "Load a game"
msgstr ""
@@ -495,7 +495,7 @@
msgid "Invalid saved game"
msgstr ""
-#: utils/ncurses.cpp:656 qt/main_window.cpp:404
+#: utils/ncurses.cpp:656 qt/main_window.cpp:419
#, c-format
msgid "Game loaded"
msgstr ""
@@ -797,7 +797,7 @@
msgid "&New game\tCtrl+N"
msgstr ""
-#: wxwin/mainframe.cc:272 qt/main_window.cpp:308
+#: wxwin/mainframe.cc:272 qt/main_window.cpp:323
msgid "Start a new game"
msgstr ""
@@ -817,7 +817,7 @@
msgid "&Save as...\tCtrl+S"
msgstr ""
-#: wxwin/mainframe.cc:276 qt/main_window.cpp:313
+#: wxwin/mainframe.cc:276 qt/main_window.cpp:328
msgid "Save the current game"
msgstr ""
@@ -849,7 +849,7 @@
msgid "&Quit\tCtrl+Q"
msgstr ""
-#: wxwin/mainframe.cc:284 qt/main_window.cpp:319
+#: wxwin/mainframe.cc:284 qt/main_window.cpp:334
msgid "Quit Eliot"
msgstr ""
@@ -857,7 +857,7 @@
msgid "&Dictionary...\tCtrl+D"
msgstr ""
-#: wxwin/mainframe.cc:287 wxwin/mainframe.cc:604 qt/main_window.cpp:595
+#: wxwin/mainframe.cc:287 wxwin/mainframe.cc:604 qt/main_window.cpp:610
msgid "Choose a dictionary"
msgstr ""
@@ -966,7 +966,7 @@
msgstr ""
#: wxwin/mainframe.cc:310 wxwin/mainframe.cc:334 qt/history_widget.cpp:177
-#: qt/main_window.cpp:306
+#: qt/main_window.cpp:321
msgid "&Game"
msgstr ""
@@ -1062,24 +1062,24 @@
msgid "R&esults"
msgstr ""
-#: wxwin/mainframe.cc:331 qt/main_window.cpp:344
+#: wxwin/mainframe.cc:331 qt/main_window.cpp:359
msgid "&About..."
msgstr ""
-#: wxwin/mainframe.cc:331 wxwin/mainframe.cc:733 qt/main_window.cpp:345
-#: qt/main_window.cpp:706
+#: wxwin/mainframe.cc:331 wxwin/mainframe.cc:733 qt/main_window.cpp:360
+#: qt/main_window.cpp:721
msgid "About Eliot"
msgstr ""
-#: wxwin/mainframe.cc:335 qt/main_window.cpp:323
+#: wxwin/mainframe.cc:335 qt/main_window.cpp:338
msgid "&Settings"
msgstr ""
-#: wxwin/mainframe.cc:336 qt/main_window.cpp:331
+#: wxwin/mainframe.cc:336 qt/main_window.cpp:346
msgid "&Windows"
msgstr ""
-#: wxwin/mainframe.cc:337 qt/main_window.cpp:343
+#: wxwin/mainframe.cc:337 qt/main_window.cpp:358
msgid "&Help"
msgstr ""
@@ -1096,7 +1096,7 @@
msgid "Cannot open "
msgstr ""
-#: wxwin/mainframe.cc:440 wxwin/mainframe.cc:449 qt/main_window.cpp:397
+#: wxwin/mainframe.cc:440 wxwin/mainframe.cc:449 qt/main_window.cpp:412
msgid "Error while loading the game"
msgstr ""
@@ -1216,7 +1216,7 @@
msgstr ""
#: qt/dic_tools_widget.cpp:87 qt/dic_tools_widget.cpp:92
-#: qt/ui/player_widget.ui:19 qt/ui/training_widget.ui:21
+#: qt/ui/player_widget.ui:16 qt/ui/training_widget.ui:21
msgid "Rack:"
msgstr ""
@@ -1261,7 +1261,7 @@
msgid "Player"
msgstr ""
-#: qt/main_window.cpp:109 qt/main_window.cpp:646 qt/ui/main_window.ui:40
+#: qt/main_window.cpp:109 qt/main_window.cpp:661 qt/ui/main_window.ui:40
msgid "Board"
msgstr ""
@@ -1282,185 +1282,205 @@
msgid "Free game"
msgstr ""
-#: qt/main_window.cpp:237
-msgid "%1 error"
+#: qt/main_window.cpp:233
+msgid "Dictionary: %1"
msgstr ""
-#: qt/main_window.cpp:307
+#: qt/main_window.cpp:238
+msgid "Dictionary: Unknown (old format)"
+msgstr ""
+
+#: qt/main_window.cpp:239
+msgid ""
+"The dictionary name cannot be retrieved, because you are using an old "
+"dictionary format.\n"
+"You can probably download a newer version of the dictionary on http://www."
+"nongnu.org/eliot/"
+msgstr ""
+
+#: qt/main_window.cpp:252
+msgid "Eliot - Error"
+msgstr ""
+
+#: qt/main_window.cpp:322
msgid "&New..."
msgstr ""
-#: qt/main_window.cpp:307
+#: qt/main_window.cpp:322
msgid "Ctrl+N"
msgstr ""
-#: qt/main_window.cpp:310
+#: qt/main_window.cpp:325
msgid "&Load..."
msgstr ""
-#: qt/main_window.cpp:310
+#: qt/main_window.cpp:325
msgid "Ctrl+O"
msgstr ""
-#: qt/main_window.cpp:311
+#: qt/main_window.cpp:326
msgid "Load an existing game"
msgstr ""
-#: qt/main_window.cpp:312
+#: qt/main_window.cpp:327
msgid "&Save as..."
msgstr ""
-#: qt/main_window.cpp:312
+#: qt/main_window.cpp:327
msgid "Ctrl+S"
msgstr ""
-#: qt/main_window.cpp:315
+#: qt/main_window.cpp:330
msgid "&Print..."
msgstr ""
-#: qt/main_window.cpp:315
+#: qt/main_window.cpp:330
msgid "Ctrl+P"
msgstr ""
-#: qt/main_window.cpp:316
+#: qt/main_window.cpp:331
msgid "Print the current game"
msgstr ""
-#: qt/main_window.cpp:318
+#: qt/main_window.cpp:333
msgid "&Quit"
msgstr ""
-#: qt/main_window.cpp:318
+#: qt/main_window.cpp:333
msgid "Ctrl+Q"
msgstr ""
-#: qt/main_window.cpp:324
+#: qt/main_window.cpp:339
msgid "&Choose dictionary..."
msgstr ""
-#: qt/main_window.cpp:325
+#: qt/main_window.cpp:339
+msgid "Ctrl+C"
+msgstr ""
+
+#: qt/main_window.cpp:340
msgid "Select a new dictionary"
msgstr ""
-#: qt/main_window.cpp:326
+#: qt/main_window.cpp:341
msgid "&Preferences..."
msgstr ""
-#: qt/main_window.cpp:326
+#: qt/main_window.cpp:341
msgid "Ctrl+F"
msgstr ""
-#: qt/main_window.cpp:327
+#: qt/main_window.cpp:342
msgid "Edit the preferences"
msgstr ""
-#: qt/main_window.cpp:332
+#: qt/main_window.cpp:347
msgid "&Bag"
msgstr ""
-#: qt/main_window.cpp:332
+#: qt/main_window.cpp:347
msgid "Ctrl+B"
msgstr ""
-#: qt/main_window.cpp:333 qt/ui/main_window.ui:97
+#: qt/main_window.cpp:348 qt/ui/main_window.ui:97
msgid "Show/hide the remaining tiles in the bag"
msgstr ""
-#: qt/main_window.cpp:334
+#: qt/main_window.cpp:349
msgid "&External board"
msgstr ""
-#: qt/main_window.cpp:334
+#: qt/main_window.cpp:349
msgid "Ctrl+E"
msgstr ""
-#: qt/main_window.cpp:335 qt/ui/main_window.ui:111
+#: qt/main_window.cpp:350 qt/ui/main_window.ui:111
msgid "Show/hide the external board"
msgstr ""
-#: qt/main_window.cpp:336
+#: qt/main_window.cpp:351
msgid "&History"
msgstr ""
-#: qt/main_window.cpp:336
+#: qt/main_window.cpp:351
msgid "Ctrl+H"
msgstr ""
-#: qt/main_window.cpp:337 qt/ui/main_window.ui:125
+#: qt/main_window.cpp:352 qt/ui/main_window.ui:125
msgid "Show/hide the game history"
msgstr ""
-#: qt/main_window.cpp:338
+#: qt/main_window.cpp:353
msgid "&Dictionary tools"
msgstr ""
-#: qt/main_window.cpp:338
+#: qt/main_window.cpp:353
msgid "Ctrl+D"
msgstr ""
-#: qt/main_window.cpp:339 qt/ui/main_window.ui:139
+#: qt/main_window.cpp:354 qt/ui/main_window.ui:139
msgid "Show/hide the dictionary tools"
msgstr ""
-#: qt/main_window.cpp:344
+#: qt/main_window.cpp:359
msgid "Ctrl+A"
msgstr ""
-#: qt/main_window.cpp:353 qt/main_window.cpp:386
+#: qt/main_window.cpp:368 qt/main_window.cpp:401
msgid "You have to select a dictionary first!"
msgstr ""
-#: qt/main_window.cpp:378
+#: qt/main_window.cpp:393
msgid "Game started"
msgstr ""
-#: qt/main_window.cpp:414
+#: qt/main_window.cpp:429
msgid "Save a game"
msgstr ""
-#: qt/main_window.cpp:419
+#: qt/main_window.cpp:434
msgid "Game saved"
msgstr ""
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "N."
msgstr ""
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "RACK"
msgstr ""
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "SOLUTION"
msgstr ""
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "REF"
msgstr ""
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "PTS"
msgstr ""
-#: qt/main_window.cpp:586
+#: qt/main_window.cpp:601
msgid "Stop current game?"
msgstr ""
-#: qt/main_window.cpp:587
+#: qt/main_window.cpp:602
msgid ""
"Loading a dictionary will stop the current game. Do you want to continue?"
msgstr ""
-#: qt/main_window.cpp:664 qt/ui/main_window.ui:53 qt/ui/main_window.ui:122
+#: qt/main_window.cpp:679 qt/ui/main_window.ui:53 qt/ui/main_window.ui:122
msgid "History"
msgstr ""
-#: qt/main_window.cpp:681 qt/ui/dic_tools_widget.ui:13
+#: qt/main_window.cpp:696 qt/ui/dic_tools_widget.ui:13
#: qt/ui/main_window.ui:136
msgid "Dictionary tools"
msgstr ""
-#: qt/main_window.cpp:698
+#: qt/main_window.cpp:713
msgid ""
"Copyright (C) 1999-2008 - Antoine Fraboulet & Olivier Teuliere\n"
"\n"
@@ -1503,15 +1523,82 @@
msgid "Duplicate"
msgstr ""
-#: qt/player_widget.cpp:156
-msgid "Cannot play '%1' at position '%2': incorrect or misplaced word (%3)"
+#: qt/player_widget.cpp:81
+msgid ""
+"Enter the word to play (case-insensitive).\n"
+"A joker from the rack must be written in parentheses.\n"
+"E.g.: w(o)rd or W(O)RD"
+msgstr ""
+
+#: qt/player_widget.cpp:84
+msgid ""
+"Enter the coordinates of the word.\n"
+"Specify the row before the column for horizontal words,\n"
+"and the column before the row for vertical words.\n"
+"E.g.: H4 or 4H"
+msgstr ""
+
+#: qt/player_widget.cpp:173
+msgid "Cannot play word: misplaced parentheses"
msgstr ""
-#: qt/player_widget.cpp:179
+#: qt/player_widget.cpp:194
+msgid "Cannot play '%1' at position '%2':\n"
+msgstr ""
+
+#: qt/player_widget.cpp:198
+msgid "Some letters are not valid for the current dictionary"
+msgstr ""
+
+#: qt/player_widget.cpp:201
+msgid "Invalid coordinates"
+msgstr ""
+
+#: qt/player_widget.cpp:204
+msgid "The word does not exist"
+msgstr ""
+
+#: qt/player_widget.cpp:207
+msgid "The rack doesn't contain the letters needed to play this word"
+msgstr ""
+
+#: qt/player_widget.cpp:210
+msgid "The word is part of a longer one"
+msgstr ""
+
+#: qt/player_widget.cpp:213
+msgid "The word tries to replace an existing letter"
+msgstr ""
+
+#: qt/player_widget.cpp:216
+msgid "The word is going out of the board, or an orthogonal word is not valid"
+msgstr ""
+
+#: qt/player_widget.cpp:219
+msgid "The word is already present on the board at these coordinates"
+msgstr ""
+
+#: qt/player_widget.cpp:222
+msgid "A word cannot be isolated (not connected to the placed words)"
+msgstr ""
+
+#: qt/player_widget.cpp:225
+msgid "The first word of the game must be horizontal"
+msgstr ""
+
+#: qt/player_widget.cpp:228
+msgid "The first word of the game must cover the H8 square"
+msgstr ""
+
+#: qt/player_widget.cpp:231
+msgid "Incorrect or misplaced word (%1)"
+msgstr ""
+
+#: qt/player_widget.cpp:255
msgid "Cannot pass turn (%1)"
msgstr ""
-#: qt/player_widget.cpp:181
+#: qt/player_widget.cpp:257
msgid "Cannot change letters '%1' (%2)"
msgstr ""
@@ -1575,40 +1662,59 @@
msgid "Remove player"
msgstr ""
-#: qt/ui/player_widget.ui:36
+#: qt/ui/player_widget.ui:33
msgid "Shuffle"
msgstr ""
-#: qt/ui/player_widget.ui:43
+#: qt/ui/player_widget.ui:40
msgid "Play a word:"
msgstr ""
-#: qt/ui/player_widget.ui:50 qt/ui/player_widget.ui:53
+#: qt/ui/player_widget.ui:52
msgid ""
-"To play a word, enter the word (case sensitive) and its coordinates. E.g.: "
-"WORD H4"
+"Enter the word to play (case-insensitive). A joker from the rack must be "
+"written in parentheses. E.g.: w(o)rd or W(O)RD"
msgstr ""
-#: qt/ui/player_widget.ui:63 qt/ui/training_widget.ui:62
+#: qt/ui/player_widget.ui:80
+msgid ""
+"Enter the coordinates of the word. Specify the row before the column for "
+"horizontal words, and the column before the row for vertical words. E.g.: H4 "
+"or 4H"
+msgstr ""
+
+#: qt/ui/player_widget.ui:87 qt/ui/training_widget.ui:62
msgid "Play"
msgstr ""
-#: qt/ui/player_widget.ui:70
+#: qt/ui/player_widget.ui:94
msgid "Change letters:"
msgstr ""
-#: qt/ui/player_widget.ui:77
+#: qt/ui/player_widget.ui:101
msgid "Enter the letters you want to change"
msgstr ""
-#: qt/ui/player_widget.ui:87
+#: qt/ui/player_widget.ui:111
msgid "Change"
msgstr ""
-#: qt/ui/player_widget.ui:94
+#: qt/ui/player_widget.ui:118
msgid "Pass"
msgstr ""
+#: qt/ui/player_widget.ui:125
+msgid "Ref.:"
+msgstr ""
+
+#: qt/ui/player_widget.ui:74
+msgid "Enter the coordinates of the word."
+msgstr ""
+
+#: qt/ui/player_widget.ui:47
+msgid "Enter the word to play (case-insensitive)."
+msgstr ""
+
#: qt/ui/prefs_dialog.ui:13
msgid "Preferences"
msgstr ""
Index: po/fr.po
===================================================================
RCS file: /cvsroot/eliot/eliot/po/fr.po,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- po/fr.po 7 Sep 2008 13:17:41 -0000 1.14
+++ po/fr.po 7 Sep 2008 21:06:17 -0000 1.15
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: eliot 1.7\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-07 10:38+0200\n"
+"POT-Creation-Date: 2008-09-07 22:31+0200\n"
"PO-Revision-Date: 2008-08-31 10:43+0100\n"
"Last-Translator: Olivier Teuliere <address@hidden>\n"
"Language-Team: French <address@hidden>\n"
@@ -327,7 +327,7 @@
msgid " N | RACK | SOLUTION | REF | PTS | P | BONUS"
msgstr " N | TIRAGE | SOLUTION | REF | PTS | J | BONUS"
-#: utils/ncurses.cpp:414 qt/history_widget.cpp:143 qt/main_window.cpp:545
+#: utils/ncurses.cpp:414 qt/history_widget.cpp:143 qt/main_window.cpp:560
msgid "(PASS)"
msgstr "(PASSE)"
@@ -438,7 +438,7 @@
msgid " Ctrl-l Refresh the screen"
msgstr " Ctrl-l Rafraîchir l'écran"
-#: utils/ncurses.cpp:486 wxwin/auxframes.cc:147 qt/main_window.cpp:628
+#: utils/ncurses.cpp:486 wxwin/auxframes.cc:147 qt/main_window.cpp:643
#: qt/ui/main_window.ui:94
msgid "Bag"
msgstr "Sac"
@@ -504,7 +504,7 @@
msgstr "Partie sauvée dans '%ls'"
#: utils/ncurses.cpp:632 wxwin/mainframe.cc:275 wxwin/mainframe.cc:405
-#: wxwin/mainframe.cc:429 qt/main_window.cpp:390
+#: wxwin/mainframe.cc:429 qt/main_window.cpp:405
msgid "Load a game"
msgstr "Charger une partie"
@@ -518,7 +518,7 @@
msgid "Invalid saved game"
msgstr "Partie sauvée invalide"
-#: utils/ncurses.cpp:656 qt/main_window.cpp:404
+#: utils/ncurses.cpp:656 qt/main_window.cpp:419
#, c-format
msgid "Game loaded"
msgstr "Partie chargée"
@@ -820,7 +820,7 @@
msgid "&New game\tCtrl+N"
msgstr "&Nouvelle partie\tCtrl+N"
-#: wxwin/mainframe.cc:272 qt/main_window.cpp:308
+#: wxwin/mainframe.cc:272 qt/main_window.cpp:323
msgid "Start a new game"
msgstr "Démarrer une nouvelle partie"
@@ -840,7 +840,7 @@
msgid "&Save as...\tCtrl+S"
msgstr "&Enregistrer sous...\tCtrl+S"
-#: wxwin/mainframe.cc:276 qt/main_window.cpp:313
+#: wxwin/mainframe.cc:276 qt/main_window.cpp:328
msgid "Save the current game"
msgstr "Sauvegarder la partie en cours"
@@ -872,7 +872,7 @@
msgid "&Quit\tCtrl+Q"
msgstr "&Quitter\tCtrl+Q"
-#: wxwin/mainframe.cc:284 qt/main_window.cpp:319
+#: wxwin/mainframe.cc:284 qt/main_window.cpp:334
msgid "Quit Eliot"
msgstr "Quitter Eliot"
@@ -880,7 +880,7 @@
msgid "&Dictionary...\tCtrl+D"
msgstr "&Dictionnaire...\tCtrl+D"
-#: wxwin/mainframe.cc:287 wxwin/mainframe.cc:604 qt/main_window.cpp:595
+#: wxwin/mainframe.cc:287 wxwin/mainframe.cc:604 qt/main_window.cpp:610
msgid "Choose a dictionary"
msgstr "Choisir un dictionnaire"
@@ -989,7 +989,7 @@
msgstr "Police de caractères pour la recherche"
#: wxwin/mainframe.cc:310 wxwin/mainframe.cc:334 qt/history_widget.cpp:177
-#: qt/main_window.cpp:306
+#: qt/main_window.cpp:321
msgid "&Game"
msgstr "&Partie"
@@ -1085,24 +1085,24 @@
msgid "R&esults"
msgstr "Ré&sultats"
-#: wxwin/mainframe.cc:331 qt/main_window.cpp:344
+#: wxwin/mainframe.cc:331 qt/main_window.cpp:359
msgid "&About..."
msgstr "Ã &propos..."
-#: wxwin/mainframe.cc:331 wxwin/mainframe.cc:733 qt/main_window.cpp:345
-#: qt/main_window.cpp:706
+#: wxwin/mainframe.cc:331 wxwin/mainframe.cc:733 qt/main_window.cpp:360
+#: qt/main_window.cpp:721
msgid "About Eliot"
msgstr "Ã propos d'Eliot"
-#: wxwin/mainframe.cc:335 qt/main_window.cpp:323
+#: wxwin/mainframe.cc:335 qt/main_window.cpp:338
msgid "&Settings"
msgstr "Para&mètres"
-#: wxwin/mainframe.cc:336 qt/main_window.cpp:331
+#: wxwin/mainframe.cc:336 qt/main_window.cpp:346
msgid "&Windows"
msgstr "&Fenêtres"
-#: wxwin/mainframe.cc:337 qt/main_window.cpp:343
+#: wxwin/mainframe.cc:337 qt/main_window.cpp:358
msgid "&Help"
msgstr "&Aide"
@@ -1119,7 +1119,7 @@
msgid "Cannot open "
msgstr "Impossible d'ouvrir "
-#: wxwin/mainframe.cc:440 wxwin/mainframe.cc:449 qt/main_window.cpp:397
+#: wxwin/mainframe.cc:440 wxwin/mainframe.cc:449 qt/main_window.cpp:412
msgid "Error while loading the game"
msgstr "Erreur pendant le chargement de la partie"
@@ -1246,7 +1246,7 @@
msgstr "Points"
#: qt/dic_tools_widget.cpp:87 qt/dic_tools_widget.cpp:92
-#: qt/ui/player_widget.ui:19 qt/ui/training_widget.ui:21
+#: qt/ui/player_widget.ui:16 qt/ui/training_widget.ui:21
msgid "Rack:"
msgstr "Tirage :"
@@ -1291,7 +1291,7 @@
msgid "Player"
msgstr "Joueur"
-#: qt/main_window.cpp:109 qt/main_window.cpp:646 qt/ui/main_window.ui:40
+#: qt/main_window.cpp:109 qt/main_window.cpp:661 qt/ui/main_window.ui:40
msgid "Board"
msgstr "Grille"
@@ -1313,186 +1313,210 @@
msgid "Free game"
msgstr "Partie libre"
-#: qt/main_window.cpp:237
-msgid "%1 error"
-msgstr "Erreur %1"
+#: qt/main_window.cpp:233
+msgid "Dictionary: %1"
+msgstr "Dictionnaire : %1"
+
+#: qt/main_window.cpp:238
+msgid "Dictionary: Unknown (old format)"
+msgstr "Dictionnaire : Inconnu (vieux format)"
-#: qt/main_window.cpp:307
+#: qt/main_window.cpp:239
+msgid ""
+"The dictionary name cannot be retrieved, because you are using an old "
+"dictionary format.\n"
+"You can probably download a newer version of the dictionary on http://www."
+"nongnu.org/eliot/"
+msgstr ""
+"Le nom du dictionnaire ne peut pas être récupéré, car vous utilisez un
vieux "
+"format de dictionnaire.\n"
+"Vous ouvez probablement télécharger une nouvelle version du dictionnaire
sur "
+"http://www.nongnu.org/eliot/"
+
+#: qt/main_window.cpp:252
+msgid "Eliot - Error"
+msgstr "Eliot - erreur"
+
+#: qt/main_window.cpp:322
msgid "&New..."
msgstr "&Nouvelle partie..."
-#: qt/main_window.cpp:307
+#: qt/main_window.cpp:322
msgid "Ctrl+N"
msgstr "Ctrl+N"
-#: qt/main_window.cpp:310
+#: qt/main_window.cpp:325
msgid "&Load..."
msgstr "&Charger..."
-#: qt/main_window.cpp:310
+#: qt/main_window.cpp:325
msgid "Ctrl+O"
msgstr "Ctrl-O"
-#: qt/main_window.cpp:311
+#: qt/main_window.cpp:326
msgid "Load an existing game"
msgstr "Charger une partie existante"
-#: qt/main_window.cpp:312
+#: qt/main_window.cpp:327
msgid "&Save as..."
msgstr "&Enregistrer sous..."
-#: qt/main_window.cpp:312
+#: qt/main_window.cpp:327
msgid "Ctrl+S"
msgstr "Ctrl+S"
-#: qt/main_window.cpp:315
+#: qt/main_window.cpp:330
msgid "&Print..."
msgstr "Im&primer..."
-#: qt/main_window.cpp:315
+#: qt/main_window.cpp:330
msgid "Ctrl+P"
msgstr "Ctrl+P"
-#: qt/main_window.cpp:316
+#: qt/main_window.cpp:331
msgid "Print the current game"
msgstr "Imprimer la partie en cours"
-#: qt/main_window.cpp:318
+#: qt/main_window.cpp:333
msgid "&Quit"
msgstr "&Quitter"
-#: qt/main_window.cpp:318
+#: qt/main_window.cpp:333
msgid "Ctrl+Q"
msgstr "Ctrl+Q"
-#: qt/main_window.cpp:324
+#: qt/main_window.cpp:339
msgid "&Choose dictionary..."
msgstr "Choisir un &dictionnaire..."
-#: qt/main_window.cpp:325
+#: qt/main_window.cpp:339
+msgid "Ctrl+C"
+msgstr "Ctrl+C"
+
+#: qt/main_window.cpp:340
msgid "Select a new dictionary"
msgstr "Choisir un nouveau dictionnaire"
-#: qt/main_window.cpp:326
+#: qt/main_window.cpp:341
msgid "&Preferences..."
msgstr "&Préférences..."
-#: qt/main_window.cpp:326
+#: qt/main_window.cpp:341
msgid "Ctrl+F"
msgstr "Ctrl+F"
-#: qt/main_window.cpp:327
+#: qt/main_window.cpp:342
msgid "Edit the preferences"
msgstr "Modifier les préférences"
-#: qt/main_window.cpp:332
+#: qt/main_window.cpp:347
msgid "&Bag"
msgstr "&Sac"
-#: qt/main_window.cpp:332
+#: qt/main_window.cpp:347
msgid "Ctrl+B"
msgstr "Ctrl+B"
-#: qt/main_window.cpp:333 qt/ui/main_window.ui:97
+#: qt/main_window.cpp:348 qt/ui/main_window.ui:97
msgid "Show/hide the remaining tiles in the bag"
msgstr "Afficher/cacher les lettres restantes dans le sac"
-#: qt/main_window.cpp:334
+#: qt/main_window.cpp:349
msgid "&External board"
msgstr "&Plateau de jeu externe"
-#: qt/main_window.cpp:334
+#: qt/main_window.cpp:349
msgid "Ctrl+E"
msgstr "Ctrl+E"
-#: qt/main_window.cpp:335 qt/ui/main_window.ui:111
+#: qt/main_window.cpp:350 qt/ui/main_window.ui:111
msgid "Show/hide the external board"
msgstr "Afficher/cacher le plateau de jeu externe"
-#: qt/main_window.cpp:336
+#: qt/main_window.cpp:351
msgid "&History"
msgstr "&Historique"
-#: qt/main_window.cpp:336
+#: qt/main_window.cpp:351
msgid "Ctrl+H"
msgstr "Ctrl+H"
-#: qt/main_window.cpp:337 qt/ui/main_window.ui:125
+#: qt/main_window.cpp:352 qt/ui/main_window.ui:125
msgid "Show/hide the game history"
msgstr "Afficher/cacher l'historique de la partie"
-#: qt/main_window.cpp:338
+#: qt/main_window.cpp:353
msgid "&Dictionary tools"
msgstr "Outils du &dictionnaire"
-#: qt/main_window.cpp:338
+#: qt/main_window.cpp:353
msgid "Ctrl+D"
msgstr "Ctrl+D"
-#: qt/main_window.cpp:339 qt/ui/main_window.ui:139
+#: qt/main_window.cpp:354 qt/ui/main_window.ui:139
msgid "Show/hide the dictionary tools"
msgstr "Afficher/cacher les outils de recherche dans le dictionnaire"
-#: qt/main_window.cpp:344
+#: qt/main_window.cpp:359
msgid "Ctrl+A"
msgstr "Ctrl+A"
-#: qt/main_window.cpp:353 qt/main_window.cpp:386
+#: qt/main_window.cpp:368 qt/main_window.cpp:401
msgid "You have to select a dictionary first!"
msgstr "Vous devez d'abord choisir un dictionnaire !"
-#: qt/main_window.cpp:378
+#: qt/main_window.cpp:393
msgid "Game started"
msgstr "Partie démarrée"
-#: qt/main_window.cpp:414
+#: qt/main_window.cpp:429
msgid "Save a game"
msgstr "Sauvegarder la partie"
-#: qt/main_window.cpp:419
+#: qt/main_window.cpp:434
msgid "Game saved"
msgstr "Partie enregistrée"
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "N."
msgstr "N."
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "RACK"
msgstr "TIRAGE"
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "SOLUTION"
msgstr "SOLUTION"
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "REF"
msgstr "REF"
-#: qt/main_window.cpp:453
+#: qt/main_window.cpp:468
msgid "PTS"
msgstr "PTS"
-#: qt/main_window.cpp:586
+#: qt/main_window.cpp:601
msgid "Stop current game?"
msgstr "Arrêter la partie en cours ?"
-#: qt/main_window.cpp:587
+#: qt/main_window.cpp:602
msgid ""
"Loading a dictionary will stop the current game. Do you want to continue?"
msgstr ""
"Charger un dictionnaire arrêtera la partie en cours. Voulez-vous continuer ?"
-#: qt/main_window.cpp:664 qt/ui/main_window.ui:53 qt/ui/main_window.ui:122
+#: qt/main_window.cpp:679 qt/ui/main_window.ui:53 qt/ui/main_window.ui:122
msgid "History"
msgstr "Historique"
-#: qt/main_window.cpp:681 qt/ui/dic_tools_widget.ui:13
+#: qt/main_window.cpp:696 qt/ui/dic_tools_widget.ui:13
#: qt/ui/main_window.ui:136
msgid "Dictionary tools"
msgstr "Outils du dictionnaire"
-#: qt/main_window.cpp:698
+#: qt/main_window.cpp:713
msgid ""
"Copyright (C) 1999-2008 - Antoine Fraboulet & Olivier Teuliere\n"
"\n"
@@ -1541,15 +1565,90 @@
msgid "Duplicate"
msgstr "Duplicate"
-#: qt/player_widget.cpp:156
-msgid "Cannot play '%1' at position '%2': incorrect or misplaced word (%3)"
-msgstr "Impossible de jouer '%1' en '%2' : mot incorrect ou mal placé (%3)"
+#: qt/player_widget.cpp:81
+msgid ""
+"Enter the word to play (case-insensitive).\n"
+"A joker from the rack must be written in parentheses.\n"
+"E.g.: w(o)rd or W(O)RD"
+msgstr ""
+"Entrer le mot à jouer (insensible à la casse).\n"
+"Un joker provenant du chevalet doit être écrit entre parenthèses.\n"
+"Ex. : m(o)( ou M(O)T"
+
+#: qt/player_widget.cpp:84
+msgid ""
+"Enter the coordinates of the word.\n"
+"Specify the row before the column for horizontal words,\n"
+"and the column before the row for vertical words.\n"
+"E.g.: H4 or 4H"
+msgstr ""
+"Entrer les coordonnées du mot.\n"
+"Spécifier la rangée avant la colonne pour les mots horizontaux,\n"
+"et la colonne avant la rangée pour les mots verticaux.\n"
+"Ex. : H4 ou 4H"
+
+#: qt/player_widget.cpp:173
+msgid "Cannot play word: misplaced parentheses"
+msgstr "Impossible de jouer le mot : parenthèses mal placées"
+
+#: qt/player_widget.cpp:194
+msgid "Cannot play '%1' at position '%2':\n"
+msgstr "Impossible de jouer '%1' en '%2' :\n"
-#: qt/player_widget.cpp:179
+#: qt/player_widget.cpp:198
+msgid "Some letters are not valid for the current dictionary"
+msgstr ""
+"Le tirage contient des lettres incorrectes pour le dictionnaire courant"
+
+#: qt/player_widget.cpp:201
+msgid "Invalid coordinates"
+msgstr "Coordonnées invalides"
+
+#: qt/player_widget.cpp:204
+msgid "The word does not exist"
+msgstr "Le mot n'existe pas"
+
+#: qt/player_widget.cpp:207
+msgid "The rack doesn't contain the letters needed to play this word"
+msgstr "Le chevalet ne contient pas les lettres permettant de jouer ce mot"
+
+#: qt/player_widget.cpp:210
+msgid "The word is part of a longer one"
+msgstr "Le mot fait partie d'un autre mot plus long"
+
+#: qt/player_widget.cpp:213
+msgid "The word tries to replace an existing letter"
+msgstr "Le mot remplace une lettre existante"
+
+#: qt/player_widget.cpp:216
+msgid "The word is going out of the board, or an orthogonal word is not valid"
+msgstr "Le mot sort de la grille, ou un mot orthogonal est invalide"
+
+#: qt/player_widget.cpp:219
+msgid "The word is already present on the board at these coordinates"
+msgstr "Le mot est déjà présent sur la grille à cette position"
+
+#: qt/player_widget.cpp:222
+msgid "A word cannot be isolated (not connected to the placed words)"
+msgstr "Un mot ne peut pas être isolé (non connecté aux autres mots
placés)"
+
+#: qt/player_widget.cpp:225
+msgid "The first word of the game must be horizontal"
+msgstr "Le premier mot de la partie doit être horizontal"
+
+#: qt/player_widget.cpp:228
+msgid "The first word of the game must cover the H8 square"
+msgstr "Le premier mot de la partie doit couvrir la case H8"
+
+#: qt/player_widget.cpp:231
+msgid "Incorrect or misplaced word (%1)"
+msgstr "Mot incorrect ou mal placé (%1)"
+
+#: qt/player_widget.cpp:255
msgid "Cannot pass turn (%1)"
msgstr "Impossible de passer le tour (%1)"
-#: qt/player_widget.cpp:181
+#: qt/player_widget.cpp:257
msgid "Cannot change letters '%1' (%2)"
msgstr "Impossible de changer les lettres '%1' (%2)"
@@ -1613,42 +1712,64 @@
msgid "Remove player"
msgstr "Supprimer un joueur"
-#: qt/ui/player_widget.ui:36
+#: qt/ui/player_widget.ui:33
msgid "Shuffle"
msgstr "Mélanger"
-#: qt/ui/player_widget.ui:43
+#: qt/ui/player_widget.ui:40
msgid "Play a word:"
msgstr "Jouer le mot :"
-#: qt/ui/player_widget.ui:50 qt/ui/player_widget.ui:53
+#: qt/ui/player_widget.ui:52
msgid ""
-"To play a word, enter the word (case sensitive) and its coordinates. E.g.: "
-"WORD H4"
+"Enter the word to play (case-insensitive). A joker from the rack must be "
+"written in parentheses. E.g.: w(o)rd or W(O)RD"
msgstr ""
-"Pour jouer un mot, entrer le mot (sensible à la casse) puis ses
coordonnées. "
-"Par exemple : MOT H7"
+"Entrer le mot à jouer (insensible à la casse). Un joker provenant du "
+"chevalet doit être écrit entre parenthèses. Ex. : m(o)( ou M(O)T"
-#: qt/ui/player_widget.ui:63 qt/ui/training_widget.ui:62
+#: qt/ui/player_widget.ui:80
+msgid ""
+"Enter the coordinates of the word. Specify the row before the column for "
+"horizontal words, and the column before the row for vertical words. E.g.: H4 "
+"or 4H"
+msgstr ""
+"Entrer les coordonnées du mot. Spécifier la rangée avant la colonne pour
les "
+"mots horizontaux, et la colonne avant la rangée pour les mots verticaux. "
+"Ex. : H4 ou 4H"
+
+#: qt/ui/player_widget.ui:87 qt/ui/training_widget.ui:62
msgid "Play"
msgstr "Jouer"
-#: qt/ui/player_widget.ui:70
+#: qt/ui/player_widget.ui:94
msgid "Change letters:"
msgstr "Lettres à changer :"
-#: qt/ui/player_widget.ui:77
+#: qt/ui/player_widget.ui:101
msgid "Enter the letters you want to change"
msgstr "Entrer les lettres à changer"
-#: qt/ui/player_widget.ui:87
+#: qt/ui/player_widget.ui:111
msgid "Change"
msgstr "Changer"
-#: qt/ui/player_widget.ui:94
+#: qt/ui/player_widget.ui:118
msgid "Pass"
msgstr "Passer"
+#: qt/ui/player_widget.ui:125
+msgid "Ref.:"
+msgstr "Ref. :"
+
+#: qt/ui/player_widget.ui:74
+msgid "Enter the coordinates of the word."
+msgstr "Entrer les coordonnées du mot."
+
+#: qt/ui/player_widget.ui:47
+msgid "Enter the word to play (case-insensitive)."
+msgstr "Entrer le mot à jouer (non sensible à la casse)."
+
#: qt/ui/prefs_dialog.ui:13
msgid "Preferences"
msgstr "Préférences"
@@ -1722,6 +1843,16 @@
msgid "Complement"
msgstr "Complément"
+#~ msgid "%1 error"
+#~ msgstr "Erreur %1"
+
+#~ msgid ""
+#~ "To play a word, enter the word (case sensitive) and its coordinates. E."
+#~ "g.: WORD H4"
+#~ msgstr ""
+#~ "Pour jouer un mot, entrer le mot (sensible à la casse) puis ses "
+#~ "coordonnées. Par exemple : MOT H7"
+
#~ msgid "Choose dictionary..."
#~ msgstr "Choisir un &dictionnaire..."
Index: qt/board_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/board_widget.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- qt/board_widget.cpp 6 Sep 2008 20:06:58 -0000 1.5
+++ qt/board_widget.cpp 7 Sep 2008 21:06:17 -0000 1.6
@@ -38,6 +38,8 @@
const QColor BoardWidget::W3Colour(240, 80, 94);
const QColor BoardWidget::TileColour(255, 235, 205);
const QColor BoardWidget::PreviewColour(183, 183, 123);
+const QColor BoardWidget::NormalColour(0, 0, 0);
+const QColor BoardWidget::JokerColour(255, 0, 0);
BoardWidget::BoardWidget(QWidget *parent)
@@ -114,12 +116,13 @@
{
wchar_t chr = m_game->getBoard().getTile(row, col).toChar();
if (m_game->getBoard().getCharAttr(row, col) & ATTR_JOKER)
- chr = towlower(chr);
+ painter.setPen(JokerColour);
painter.drawText((col - BOARD_MIN + 1) * squareSize,
(row - BOARD_MIN + 1) * squareSize + 1,
squareSize, squareSize,
Qt::AlignCenter,
qfw(wstring(1, chr)));
+ painter.setPen(NormalColour);
}
}
}
Index: qt/board_widget.h
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/board_widget.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- qt/board_widget.h 26 Jan 2008 16:58:46 -0000 1.3
+++ qt/board_widget.h 7 Sep 2008 21:06:17 -0000 1.4
@@ -57,6 +57,8 @@
static const QColor W3Colour;
static const QColor TileColour;
static const QColor PreviewColour;
+ static const QColor NormalColour;
+ static const QColor JokerColour;
//@}
};
Index: qt/main_window.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/main_window.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- qt/main_window.cpp 6 Sep 2008 20:06:58 -0000 1.12
+++ qt/main_window.cpp 7 Sep 2008 21:06:17 -0000 1.13
@@ -226,15 +226,30 @@
{
if (iDic == NULL)
m_dicNameLabel->setText("No dictionary");
+ else {
+ if (iDic->getHeader().getVersion() != 0)
+ {
+ QString dicName = qfw(m_dic->getHeader().getName());
+ m_dicNameLabel->setText(_q("Dictionary: %1").arg(dicName));
+ m_dicNameLabel->setToolTip("");
+ }
else
- m_dicNameLabel->setText(qfw(m_dic->getHeader().getName()));
+ {
+ m_dicNameLabel->setText(_q("Dictionary: Unknown (old format)"));
+ QString warning = _q("The dictionary name cannot be "
+ "retrieved, because you are using an old dictionary
format.\n"
+ "You can probably download a newer version of the
dictionary "
+ "on http://www.nongnu.org/eliot/");
+ m_dicNameLabel->setToolTip(warning);
+ }
+ }
}
void MainWindow::displayErrorMsg(QString iMsg, QString iContext)
{
if (iContext == "")
- iContext = _q("%1 error").arg(PACKAGE_NAME);
+ iContext = _q("Eliot - Error");
QMessageBox::warning(this, iContext, iMsg);
}
@@ -321,7 +336,7 @@
QMenu *menuSettings = new QMenu(m_ui.menubar);
m_ui.menubar->addAction(menuSettings->menuAction());
menuSettings->setTitle(_q("&Settings"));
- addMenuAction(menuSettings, _q("&Choose dictionary..."), QString(""),
+ addMenuAction(menuSettings, _q("&Choose dictionary..."), _q("Ctrl+C"),
_q("Select a new dictionary"), SLOT(onSettingsChooseDic()));
addMenuAction(menuSettings, _q("&Preferences..."), _q("Ctrl+F"),
_q("Edit the preferences"), SLOT(onSettingsPreferences()));
Index: qt/player_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/player_widget.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- qt/player_widget.cpp 26 Jan 2008 23:03:34 -0000 1.6
+++ qt/player_widget.cpp 7 Sep 2008 21:06:17 -0000 1.7
@@ -50,7 +50,7 @@
};
-/// Validator used for the "change letters" line edit
+/// Validator used for the "play word" line edit
class PlayWordValidator: public QValidator
{
public:
@@ -63,14 +63,33 @@
};
+/// Validator used for the "coords" line edit
+class CoordsValidator: public QValidator
+{
+public:
+ explicit CoordsValidator(QObject *parent);
+ virtual State validate(QString &input, int &pos) const;
+};
+
+
PlayerWidget::PlayerWidget(QWidget *parent, unsigned int iPlayerNb, Game
*iGame)
: QWidget(parent), m_game(iGame), m_player(iPlayerNb)
{
setupUi(this);
+ lineEditPlay->setFocus();
+ // These strings cannot be in the .ui file, because of the newlines
+ lineEditPlay->setToolTip(_q("Enter the word to play (case-insensitive).\n"
+ "A joker from the rack must be written in parentheses.\n"
+ "E.g.: w(o)rd or W(O)RD"));
+ lineEditCoords->setToolTip(_q("Enter the coordinates of the word.\n"
+ "Specify the row before the column for horizontal words,\n"
+ "and the column before the row for vertical words.\n"
+ "E.g.: H4 or 4H"));
if (m_game)
{
lineEditPlay->setValidator(new PlayWordValidator(this,
m_game->getDic()));
+ lineEditCoords->setValidator(new CoordsValidator(this));
// Do not allow messing with AI players
if (!m_game->getPlayer(m_player).isHuman())
@@ -104,8 +123,6 @@
void PlayerWidget::refresh()
{
- lineEditPlay->clear();
-
if (m_game == NULL)
{
lineEditRack->clear();
@@ -115,6 +132,7 @@
const PlayedRack &pld = m_game->getPlayer(m_player).getCurrentRack();
lineEditRack->setText(qfw(pld.toString(PlayedRack::RACK_EXTRA)));
lineEditPlay->clear();
+ lineEditCoords->clear();
lineEditChange->clear();
}
@@ -127,7 +145,8 @@
void PlayerWidget::on_lineEditPlay_textChanged()
{
- pushButtonPlay->setEnabled(lineEditPlay->hasAcceptableInput());
+ pushButtonPlay->setEnabled(lineEditPlay->hasAcceptableInput() &&
+ lineEditCoords->hasAcceptableInput());
}
@@ -141,20 +160,78 @@
void PlayerWidget::on_lineEditPlay_returnPressed()
{
- QStringList items = lineEditPlay->text().split(' ',
QString::SkipEmptyParts);
- ASSERT(items.size() == 2, "Bug found in the validator");
+ // Convert the jokers to lowercase
+ QString word = lineEditPlay->text().toUpper();
+ int pos;
+ while ((pos = word.indexOf('(')) != -1)
+ {
+ if (word.size() < pos + 3 || word[pos + 2] != ')' ||
+ !m_game->getDic().validateLetters(qtw(QString(word[pos + 1]))))
+ {
+ // Bug in validate()!
+ // This should never happen
+ QString msg = _q("Cannot play word: misplaced parentheses");
+ emit notifyProblem(msg);
+ break;
+ }
+ else
+ {
+ QChar chr = word[pos + 1].toLower();
+ word.remove(pos, 3);
+ word.insert(pos, chr);
+ }
+ }
- // Play the word
- int res = m_game->play(qtw(items[1]), qtw(items[0]));
+ QString coords = lineEditCoords->text();
+ int res = m_game->play(qtw(coords), qtw(word));
if (res == 0)
{
emit gameUpdated();
}
else
{
+ // Try to be as explicit as possible concerning the error
+ QString msg = _q("Cannot play '%1' at position '%2':\n")
+ .arg(lineEditPlay->text()).arg(coords);
+ switch (res)
+ {
+ case 1:
+ msg += _q("Some letters are not valid for the current
dictionary");
+ break;
+ case 2:
+ msg += _q("Invalid coordinates");
+ break;
+ case 3:
+ msg += _q("The word does not exist");
+ break;
+ case 4:
+ msg += _q("The rack doesn't contain the letters needed to play
this word");
+ break;
+ case 5:
+ msg += _q("The word is part of a longer one");
+ break;
+ case 6:
+ msg += _q("The word tries to replace an existing letter");
+ break;
+ case 7:
+ msg += _q("The word is going out of the board, or an
orthogonal word is not valid");
+ break;
+ case 8:
+ msg += _q("The word is already present on the board at these
coordinates");
+ break;
+ case 9:
+ msg += _q("A word cannot be isolated (not connected to the
placed words)");
+ break;
+ case 10:
+ msg += _q("The first word of the game must be horizontal");
+ break;
+ case 11:
+ msg += _q("The first word of the game must cover the H8
square");
+ break;
+ default:
+ msg += _q("Incorrect or misplaced word (%1)").arg(1);
+ }
// FIXME: the error is too generic
- QString msg = _q("Cannot play '%1' at position '%2': incorrect or
misplaced word (%3)")
- .arg(items[0]).arg(items[1]).arg(res);
emit notifyProblem(msg);
}
}
@@ -223,18 +300,54 @@
if (input == "")
return Intermediate;
- QStringList items = input.split(' ', QString::SkipEmptyParts);
-
+ QString copy(input);
+ // Strip parentheses
+ copy.remove('(');
+ copy.remove(')');
// The string is invalid if it contains characters not present
// in the dictionary
- if (!m_dic.validateLetters(qtw(items[0])))
+ if (!m_dic.validateLetters(qtw(copy)))
return Invalid;
- if (items.size() != 2 || items[0].size() < 2)
+ // Check the parentheses pairs
+ copy = input;
+ int pos;
+ while ((pos = copy.indexOf('(')) != -1)
+ {
+ if (copy.size() < pos + 3 || copy[pos + 2] != ')' ||
+ !m_dic.validateLetters(qtw(QString(copy[pos + 1]))))
+ {
return Intermediate;
+ }
+ else
+ {
+ copy.remove(pos, 3);
+ }
+ }
+ if (copy.indexOf(')') != -1)
+ return Intermediate;
+
+ return Acceptable;
+}
+
+
+
+CoordsValidator::CoordsValidator(QObject *parent)
+ : QValidator(parent)
+{
+}
+
+
+QValidator::State CoordsValidator::validate(QString &input, int &) const
+{
+ // Only authorize characters part of a valid coordinate
+ wstring copy = qtw(input.toUpper());
+ wstring authorized = L"ABCDEFGHIJKLMNO1234567890";
+ if (copy.find_first_not_of(authorized) != wstring::npos)
+ return Invalid;
// Check coordinates
- Coord c(qtw(items[1]));
+ Coord c(qtw(input));
if (!c.isValid())
return Intermediate;
Index: qt/player_widget.h
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/player_widget.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- qt/player_widget.h 25 Jan 2008 18:43:00 -0000 1.4
+++ qt/player_widget.h 7 Sep 2008 21:06:17 -0000 1.5
@@ -54,8 +54,10 @@
void on_pushButtonChange_clicked() { on_lineEditChange_returnPressed(); }
void on_pushButtonPass_clicked() { on_lineEditChange_returnPressed(); }
void on_lineEditPlay_textChanged();
+ void on_lineEditCoords_textChanged() { on_lineEditPlay_textChanged(); }
void on_lineEditChange_textChanged();
void on_lineEditPlay_returnPressed();
+ void on_lineEditCoords_returnPressed() { on_lineEditPlay_returnPressed(); }
void on_lineEditChange_returnPressed();
private:
Index: qt/ui/player_widget.ui
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/ui/player_widget.ui,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- qt/ui/player_widget.ui 22 Jan 2008 15:30:22 -0000 1.2
+++ qt/ui/player_widget.ui 7 Sep 2008 21:06:18 -0000 1.3
@@ -6,13 +6,10 @@
<x>0</x>
<y>0</y>
<width>460</width>
- <height>125</height>
+ <height>148</height>
</rect>
</property>
- <layout class="QGridLayout" >
- <property name="horizontalSpacing" >
- <number>-1</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
@@ -20,14 +17,14 @@
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
+ <item row="0" column="1" colspan="3" >
<widget class="QLineEdit" name="lineEditRack" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
- <item row="0" column="3" >
+ <item row="0" column="4" >
<widget class="QPushButton" name="pushButtonShuffle" >
<property name="enabled" >
<bool>false</bool>
@@ -44,13 +41,15 @@
</property>
</widget>
</item>
- <item row="1" column="1" colspan="2" >
+ <item row="1" column="1" >
<widget class="QLineEdit" name="lineEditPlay" >
<property name="toolTip" >
- <string>_("To play a word, enter the word (case sensitive) and its
coordinates. E.g.: WORD H4")</string>
+ <string>_("Enter the word to play (case-insensitive).
+A joker from the rack must be written in parentheses.
+E.g.: w(o)rd or W(O)RD")</string>
</property>
<property name="statusTip" >
- <string>_("To play a word, enter the word (case sensitive) and its
coordinates. E.g.: WORD H4")</string>
+ <string>_("Enter the word to play (case-insensitive). A joker from the
rack must be written in parentheses. E.g.: w(o)rd or W(O)RD")</string>
</property>
<property name="text" >
<string>dummy</string>
@@ -58,6 +57,31 @@
</widget>
</item>
<item row="1" column="3" >
+ <widget class="QLineEdit" name="lineEditCoords" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>45</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>_("Enter the coordinates of the word.
+Specify the row before the column for horizontal words,
+ and the column before the row for vertical words.
+E.g.: H4 or 4H")</string>
+ </property>
+ <property name="statusTip" >
+ <string>_("Enter the coordinates of the word. Specify the row before the
column for horizontal words, and the column before the row for vertical words.
E.g.: H4 or 4H")</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
<widget class="QPushButton" name="pushButtonPlay" >
<property name="text" >
<string>_("Play")</string>
@@ -81,20 +105,27 @@
</property>
</widget>
</item>
- <item row="2" column="2" >
+ <item row="2" column="2" colspan="2" >
<widget class="QPushButton" name="pushButtonChange" >
<property name="text" >
<string>_("Change")</string>
</property>
</widget>
</item>
- <item row="2" column="3" >
+ <item row="2" column="4" >
<widget class="QPushButton" name="pushButtonPass" >
<property name="text" >
<string>_("Pass")</string>
</property>
</widget>
</item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>_("Ref.:")</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Eliot-dev] eliot game/settings.cpp po/eliot.pot po/fr.po q...,
eliot-dev <=