1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

* improved tile support

* misc. bugs fixes


git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@80 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
skomoroh 2006-10-07 21:13:04 +00:00
parent 76dcd2d1ae
commit e401d6a28e
11 changed files with 289 additions and 382 deletions

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Sep 21 15:56:22 2006\n" "POT-Creation-Date: Sat Oct 7 20:02:33 2006\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"
@ -576,6 +576,9 @@ msgstr ""
msgid "Congress" msgid "Congress"
msgstr "" msgstr ""
msgid "Constitution"
msgstr ""
msgid "Contradance" msgid "Contradance"
msgstr "" msgstr ""
@ -723,6 +726,9 @@ msgstr ""
msgid "Dojouji's Game Doubled" msgid "Dojouji's Game Doubled"
msgstr "" msgstr ""
msgid "Dolphin"
msgstr ""
msgid "Doorway" msgid "Doorway"
msgstr "" msgstr ""
@ -738,6 +744,9 @@ msgstr ""
msgid "Double Cockroach" msgid "Double Cockroach"
msgstr "" msgstr ""
msgid "Double Dolphin"
msgstr ""
msgid "Double Dot" msgid "Double Dot"
msgstr "" msgstr ""
@ -3132,6 +3141,9 @@ msgstr ""
msgid "Spanish Patience" msgid "Spanish Patience"
msgstr "" msgstr ""
msgid "Spanish Patience II"
msgstr ""
msgid "Sphere" msgid "Sphere"
msgstr "" msgstr ""
@ -3342,6 +3354,12 @@ msgstr ""
msgid "The Great Wall" msgid "The Great Wall"
msgstr "" msgstr ""
msgid "The Last Monarch"
msgstr ""
msgid "The Last Monarch II"
msgstr ""
msgid "The Little Corporal" msgid "The Little Corporal"
msgstr "" msgstr ""
@ -3354,9 +3372,6 @@ msgstr ""
msgid "The Wish (open)" msgid "The Wish (open)"
msgstr "" msgstr ""
msgid "The last Monarch"
msgstr ""
msgid "Theater" msgid "Theater"
msgstr "" msgstr ""
@ -3669,6 +3684,9 @@ msgstr ""
msgid "Zeus" msgid "Zeus"
msgstr "" msgstr ""
msgid "Zigzag Course"
msgstr ""
msgid "Zodiac" msgid "Zodiac"
msgstr "" msgstr ""

View file

@ -14,7 +14,7 @@ msgid ""
msgstr "" msgstr ""
"#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: Thu Sep 21 15:57:22 2006\n" "POT-Creation-Date: Sat Oct 7 20:03:30 2006\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"
@ -24,7 +24,7 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2006-09-21 15:57+0400\n" "POT-Creation-Date: 2006-10-07 20:03+0400\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"
@ -69,8 +69,8 @@ msgid "&Next number"
msgstr "" msgstr ""
#: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162 #: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162
#: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:460 #: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:478
#: pysollib/main.py:468 pysollib/tk/colorsdialog.py:122 #: pysollib/main.py:486 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
#: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155 #: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155
#: pysollib/tk/playeroptionsdialog.py:85 #: pysollib/tk/playeroptionsdialog.py:85
@ -422,31 +422,31 @@ msgid ""
"This won't come out...\n" "This won't come out...\n"
msgstr "" msgstr ""
#: pysollib/game.py:2298 #: pysollib/game.py:2291
msgid "Set bookmark" msgid "Set bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2299 #: pysollib/game.py:2292
msgid "Replace existing bookmark %d ?" msgid "Replace existing bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2321 #: pysollib/game.py:2314
msgid "Goto bookmark" msgid "Goto bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2322 #: pysollib/game.py:2315
msgid "Goto bookmark %d ?" msgid "Goto bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2353 #: pysollib/game.py:2346
msgid "Open game" msgid "Open game"
msgstr "" msgstr ""
#: pysollib/game.py:2364 pysollib/game.py:2373 pysollib/game.py:2378 #: pysollib/game.py:2357 pysollib/game.py:2366 pysollib/game.py:2371
msgid "Load game error" msgid "Load game error"
msgstr "" msgstr ""
#: pysollib/game.py:2365 #: pysollib/game.py:2358
msgid "" msgid ""
"Error while loading game.\n" "Error while loading game.\n"
"\n" "\n"
@ -454,22 +454,22 @@ msgid ""
"but this could also be a bug you might want to report." "but this could also be a bug you might want to report."
msgstr "" msgstr ""
#: pysollib/game.py:2374 #: pysollib/game.py:2367
msgid "Error while loading game" msgid "Error while loading game"
msgstr "" msgstr ""
#: pysollib/game.py:2379 #: pysollib/game.py:2372
msgid "" msgid ""
"Internal error while loading game.\n" "Internal error while loading game.\n"
"\n" "\n"
"Please report this bug." "Please report this bug."
msgstr "" msgstr ""
#: pysollib/game.py:2404 #: pysollib/game.py:2397
msgid "Save game error" msgid "Save game error"
msgstr "" msgstr ""
#: pysollib/game.py:2405 #: pysollib/game.py:2398
msgid "Error while saving game" msgid "Error while saving game"
msgstr "" msgstr ""
@ -683,7 +683,7 @@ msgstr ""
#: pysollib/games/auldlangsyne.py:158 pysollib/games/calculation.py:104 #: pysollib/games/auldlangsyne.py:158 pysollib/games/calculation.py:104
#: pysollib/games/numerica.py:90 pysollib/games/numerica.py:272 #: pysollib/games/numerica.py:90 pysollib/games/numerica.py:272
#: pysollib/games/numerica.py:639 pysollib/games/numerica.py:743 #: pysollib/games/numerica.py:639 pysollib/games/numerica.py:752
msgid "Tableau. Build regardless of rank and suit." msgid "Tableau. Build regardless of rank and suit."
msgstr "" msgstr ""
@ -710,12 +710,12 @@ msgid ""
msgstr "" msgstr ""
#: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1410 pysollib/util.py:80 #: pysollib/stack.py:1409 pysollib/util.py:80
msgid "King" msgid "King"
msgstr "" msgstr ""
#: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1409 pysollib/util.py:80 #: pysollib/stack.py:1408 pysollib/util.py:80
msgid "Queen" msgid "Queen"
msgstr "" msgstr ""
@ -744,11 +744,15 @@ msgstr ""
msgid "Balance $%d" msgid "Balance $%d"
msgstr "" msgstr ""
#: pysollib/games/klondike.py:439 #: pysollib/games/klondike.py:172 pysollib/stack.py:2115
msgid "Tableau. Build down by color."
msgstr ""
#: pysollib/games/klondike.py:441
msgid "Reserve. Only Kings are acceptable." msgid "Reserve. Only Kings are acceptable."
msgstr "" msgstr ""
#: pysollib/games/larasgame.py:163 pysollib/stack.py:1626 #: pysollib/games/larasgame.py:163 pysollib/stack.py:1625
msgid "Round %d" msgid "Round %d"
msgstr "" msgstr ""
@ -851,7 +855,7 @@ msgstr ""
#: pysollib/games/special/tarock.py:223 #: pysollib/games/special/tarock.py:223
#: pysollib/games/ultra/dashavatara.py:351 #: pysollib/games/ultra/dashavatara.py:351
#: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254 #: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254
#: pysollib/stack.py:1411 pysollib/util.py:79 #: pysollib/stack.py:1410 pysollib/util.py:79
msgid "Ace" msgid "Ace"
msgstr "" msgstr ""
@ -1231,7 +1235,7 @@ msgstr ""
msgid " Help" msgid " Help"
msgstr "" msgstr ""
#: pysollib/main.py:67 pysollib/main.py:368 #: pysollib/main.py:67 pysollib/main.py:386
msgid " installation error" msgid " installation error"
msgstr "" msgstr ""
@ -1245,17 +1249,17 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:75 pysollib/main.py:376 pysollib/tk/menubar.py:382 #: pysollib/main.py:75 pysollib/main.py:394 pysollib/tk/menubar.py:382
msgid "&Quit" msgid "&Quit"
msgstr "" msgstr ""
#: pysollib/main.py:98 #: pysollib/main.py:99
msgid "" msgid ""
"%s: %s\n" "%s: %s\n"
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:139 #: pysollib/main.py:143
msgid "" msgid ""
"Usage: %s [OPTIONS] [FILE]\n" "Usage: %s [OPTIONS] [FILE]\n"
" -g --game=GAMENAME start game GAMENAME\n" " -g --game=GAMENAME start game GAMENAME\n"
@ -1273,19 +1277,19 @@ msgid ""
" MOD - one of following: pss(default), pygame, oss, win\n" " MOD - one of following: pss(default), pygame, oss, win\n"
msgstr "" msgstr ""
#: pysollib/main.py:157 #: pysollib/main.py:161
msgid "" msgid ""
"%s: too many files\n" "%s: too many files\n"
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:161 #: pysollib/main.py:165
msgid "" msgid ""
"%s: invalid file name\n" "%s: invalid file name\n"
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:369 #: pysollib/main.py:387
msgid "" msgid ""
"\n" "\n"
"No games were found !!!\n" "No games were found !!!\n"
@ -1296,25 +1300,25 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:455 pysollib/main.py:463 #: pysollib/main.py:473 pysollib/main.py:481
msgid " installation problem" msgid " installation problem"
msgstr "" msgstr ""
#: pysollib/main.py:456 #: pysollib/main.py:474
msgid "" msgid ""
"Your Python installation is compiled without thread support.\n" "Your Python installation is compiled without thread support.\n"
"\n" "\n"
"Sounds and background music will be disabled." "Sounds and background music will be disabled."
msgstr "" msgstr ""
#: pysollib/main.py:464 #: pysollib/main.py:482
msgid "" msgid ""
"The pysolsoundserver module was not found.\n" "The pysolsoundserver module was not found.\n"
"\n" "\n"
"Sounds and background music will be disabled." "Sounds and background music will be disabled."
msgstr "" msgstr ""
#: pysollib/main.py:471 #: pysollib/main.py:489
msgid "Welcome to " msgid "Welcome to "
msgstr "" msgstr ""
@ -1582,71 +1586,71 @@ msgstr ""
msgid "USA" msgid "USA"
msgstr "" msgstr ""
#: pysollib/settings.py:54 data/glade-translations:29 #: pysollib/settings.py:55 data/glade-translations:29
msgid "Top 10" msgid "Top 10"
msgstr "" msgstr ""
#: pysollib/stack.py:1405 #: pysollib/stack.py:1404
msgid "Base card - %s." msgid "Base card - %s."
msgstr "" msgstr ""
#: pysollib/stack.py:1406 #: pysollib/stack.py:1405
msgid "Empty row cannot be filled." msgid "Empty row cannot be filled."
msgstr "" msgstr ""
#: pysollib/stack.py:1407 #: pysollib/stack.py:1406
msgid "any card" msgid "any card"
msgstr "" msgstr ""
#: pysollib/stack.py:1408 pysollib/util.py:80 #: pysollib/stack.py:1407 pysollib/util.py:80
msgid "Jack" msgid "Jack"
msgstr "" msgstr ""
#: pysollib/stack.py:1421 #: pysollib/stack.py:1420
msgid "No cards" msgid "No cards"
msgstr "" msgstr ""
#: pysollib/stack.py:1422 #: pysollib/stack.py:1421
msgid "1 card" msgid "1 card"
msgstr "" msgstr ""
#: pysollib/stack.py:1423 #: pysollib/stack.py:1422
msgid " cards" msgid " cards"
msgstr "" msgstr ""
#: pysollib/stack.py:1635 pysollib/stack.py:1637 pysollib/stack.py:1673 #: pysollib/stack.py:1634 pysollib/stack.py:1636 pysollib/stack.py:1672
msgid "Redeal" msgid "Redeal"
msgstr "" msgstr ""
#: pysollib/stack.py:1637 #: pysollib/stack.py:1636
msgid "Stop" msgid "Stop"
msgstr "" msgstr ""
#: pysollib/stack.py:1698 #: pysollib/stack.py:1697
msgid "Variable redeals." msgid "Variable redeals."
msgstr "" msgstr ""
#: pysollib/stack.py:1699 #: pysollib/stack.py:1698
msgid "Unlimited redeals." msgid "Unlimited redeals."
msgstr "" msgstr ""
#: pysollib/stack.py:1700 #: pysollib/stack.py:1699
msgid "No redeals." msgid "No redeals."
msgstr "" msgstr ""
#: pysollib/stack.py:1701 #: pysollib/stack.py:1700
msgid "One redeal." msgid "One redeal."
msgstr "" msgstr ""
#: pysollib/stack.py:1702 #: pysollib/stack.py:1701
msgid " redeals." msgid " redeals."
msgstr "" msgstr ""
#: pysollib/stack.py:1704 #: pysollib/stack.py:1703
msgid "Talon." msgid "Talon."
msgstr "" msgstr ""
#: pysollib/stack.py:1938 pysollib/stack.py:2388 #: pysollib/stack.py:1937 pysollib/stack.py:2388
msgid "Reserve. No building." msgid "Reserve. No building."
msgstr "" msgstr ""
@ -1696,10 +1700,6 @@ msgstr ""
msgid "Tableau. Build up by color." msgid "Tableau. Build up by color."
msgstr "" msgstr ""
#: pysollib/stack.py:2115
msgid "Tableau. Build down by color."
msgstr ""
#: pysollib/stack.py:2123 #: pysollib/stack.py:2123
msgid "Tableau. Build up by suit." msgid "Tableau. Build up by suit."
msgstr "" msgstr ""

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Sep 21 15:56:22 2006\n" "POT-Creation-Date: Sat Oct 7 20:02:33 2006\n"
"PO-Revision-Date: 2006-09-30 18:19+0400\n" "PO-Revision-Date: 2006-10-07 20:10+0400\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -580,6 +580,9 @@ msgstr "Конус"
msgid "Congress" msgid "Congress"
msgstr "Конгресс" msgstr "Конгресс"
msgid "Constitution"
msgstr "Конституция"
msgid "Contradance" msgid "Contradance"
msgstr "Контрданс" msgstr "Контрданс"
@ -728,6 +731,9 @@ msgstr ""
msgid "Dojouji's Game Doubled" msgid "Dojouji's Game Doubled"
msgstr "" msgstr ""
msgid "Dolphin"
msgstr "Дельфин"
msgid "Doorway" msgid "Doorway"
msgstr "Вход" msgstr "Вход"
@ -743,6 +749,9 @@ msgstr "Двойной Кенфилд"
msgid "Double Cockroach" msgid "Double Cockroach"
msgstr "Двойной таракан" msgstr "Двойной таракан"
msgid "Double Dolphin"
msgstr "Двойной Дельфин"
msgid "Double Dot" msgid "Double Dot"
msgstr "Двоеточие" msgstr "Двоеточие"
@ -3185,6 +3194,9 @@ msgstr "Промежутки и тузы"
msgid "Spanish Patience" msgid "Spanish Patience"
msgstr "Испанский пасьянс" msgstr "Испанский пасьянс"
msgid "Spanish Patience II"
msgstr "Испанский пасьянс II"
msgid "Sphere" msgid "Sphere"
msgstr "Сфера" msgstr "Сфера"
@ -3402,6 +3414,14 @@ msgstr "Сад"
msgid "The Great Wall" msgid "The Great Wall"
msgstr "Великая Стена" msgstr "Великая Стена"
#, fuzzy
msgid "The Last Monarch"
msgstr "Последний Монарх"
#, fuzzy
msgid "The Last Monarch II"
msgstr "Последний Монарх"
msgid "The Little Corporal" msgid "The Little Corporal"
msgstr "Маленький Капрал" msgstr "Маленький Капрал"
@ -3414,9 +3434,6 @@ msgstr "Желание"
msgid "The Wish (open)" msgid "The Wish (open)"
msgstr "Желание (открытое)" msgstr "Желание (открытое)"
msgid "The last Monarch"
msgstr "Последний Монарх"
msgid "Theater" msgid "Theater"
msgstr "Театр" msgstr "Театр"
@ -3745,6 +3762,9 @@ msgstr "Церлин (3 колоды)"
msgid "Zeus" msgid "Zeus"
msgstr "Зевс" msgstr "Зевс"
msgid "Zigzag Course"
msgstr ""
msgid "Zodiac" msgid "Zodiac"
msgstr "Зодиак" msgstr "Зодиак"

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Sep 21 15:57:22 2006\n" "POT-Creation-Date: Sat Oct 7 20:03:30 2006\n"
"PO-Revision-Date: 2006-10-05 16:31+0400\n" "PO-Revision-Date: 2006-10-05 16:31+0400\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
@ -54,8 +54,8 @@ msgid "&Next number"
msgstr "&Следующий номер" msgstr "&Следующий номер"
#: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162 #: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162
#: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:460 #: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:478
#: pysollib/main.py:468 pysollib/tk/colorsdialog.py:122 #: pysollib/main.py:486 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
#: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155 #: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155
#: pysollib/tk/playeroptionsdialog.py:85 #: pysollib/tk/playeroptionsdialog.py:85
@ -460,31 +460,31 @@ msgstr ""
"\n" "\n"
"Не удалось...\n" "Не удалось...\n"
#: pysollib/game.py:2298 #: pysollib/game.py:2291
msgid "Set bookmark" msgid "Set bookmark"
msgstr "Установить закладку" msgstr "Установить закладку"
#: pysollib/game.py:2299 #: pysollib/game.py:2292
msgid "Replace existing bookmark %d ?" msgid "Replace existing bookmark %d ?"
msgstr "Заменить существующую закладку %d ?" msgstr "Заменить существующую закладку %d ?"
#: pysollib/game.py:2321 #: pysollib/game.py:2314
msgid "Goto bookmark" msgid "Goto bookmark"
msgstr "Перейти к закладке" msgstr "Перейти к закладке"
#: pysollib/game.py:2322 #: pysollib/game.py:2315
msgid "Goto bookmark %d ?" msgid "Goto bookmark %d ?"
msgstr "Перейти к закладке %d ?" msgstr "Перейти к закладке %d ?"
#: pysollib/game.py:2353 #: pysollib/game.py:2346
msgid "Open game" msgid "Open game"
msgstr "Открыть игру" msgstr "Открыть игру"
#: pysollib/game.py:2364 pysollib/game.py:2373 pysollib/game.py:2378 #: pysollib/game.py:2357 pysollib/game.py:2366 pysollib/game.py:2371
msgid "Load game error" msgid "Load game error"
msgstr "Ошибка при загрузке игры" msgstr "Ошибка при загрузке игры"
#: pysollib/game.py:2365 #: pysollib/game.py:2358
msgid "" msgid ""
"Error while loading game.\n" "Error while loading game.\n"
"\n" "\n"
@ -496,11 +496,11 @@ msgstr ""
"Возможно повреждён файл,\n" "Возможно повреждён файл,\n"
"или ошибка в программе." "или ошибка в программе."
#: pysollib/game.py:2374 #: pysollib/game.py:2367
msgid "Error while loading game" msgid "Error while loading game"
msgstr "Ошибка при загрузке игры" msgstr "Ошибка при загрузке игры"
#: pysollib/game.py:2379 #: pysollib/game.py:2372
msgid "" msgid ""
"Internal error while loading game.\n" "Internal error while loading game.\n"
"\n" "\n"
@ -510,11 +510,11 @@ msgstr ""
"\n" "\n"
"Пожалуйста сообщите об этой ошибке." "Пожалуйста сообщите об этой ошибке."
#: pysollib/game.py:2404 #: pysollib/game.py:2397
msgid "Save game error" msgid "Save game error"
msgstr "Ошибка при сохранении игры" msgstr "Ошибка при сохранении игры"
#: pysollib/game.py:2405 #: pysollib/game.py:2398
msgid "Error while saving game" msgid "Error while saving game"
msgstr "Ошибка при сохранении игры" msgstr "Ошибка при сохранении игры"
@ -728,7 +728,7 @@ msgstr "Пазлы"
#: pysollib/games/auldlangsyne.py:158 pysollib/games/calculation.py:104 #: pysollib/games/auldlangsyne.py:158 pysollib/games/calculation.py:104
#: pysollib/games/numerica.py:90 pysollib/games/numerica.py:272 #: pysollib/games/numerica.py:90 pysollib/games/numerica.py:272
#: pysollib/games/numerica.py:639 pysollib/games/numerica.py:743 #: pysollib/games/numerica.py:639 pysollib/games/numerica.py:752
msgid "Tableau. Build regardless of rank and suit." msgid "Tableau. Build regardless of rank and suit."
msgstr "Игровой стол. Складывать не считаясь с мастью и достоинством." msgstr "Игровой стол. Складывать не считаясь с мастью и достоинством."
@ -759,12 +759,12 @@ msgstr ""
"4: 8 Д 3 7 В 2 6 10 Т 5 9 К" "4: 8 Д 3 7 В 2 6 10 Т 5 9 К"
#: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:528 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1410 pysollib/util.py:80 #: pysollib/stack.py:1409 pysollib/util.py:80
msgid "King" msgid "King"
msgstr "Король" msgstr "Король"
#: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224 #: pysollib/games/canfield.py:531 pysollib/games/special/tarock.py:224
#: pysollib/stack.py:1409 pysollib/util.py:80 #: pysollib/stack.py:1408 pysollib/util.py:80
msgid "Queen" msgid "Queen"
msgstr "Королева" msgstr "Королева"
@ -794,11 +794,15 @@ msgstr "Базовая ячейка. Складывать по возраста
msgid "Balance $%d" msgid "Balance $%d"
msgstr "Баланс $%d" msgstr "Баланс $%d"
#: pysollib/games/klondike.py:439 #: pysollib/games/klondike.py:172 pysollib/stack.py:2115
msgid "Tableau. Build down by color."
msgstr "Игровой стол. Складывать по убыванию в соответствии с цветом."
#: pysollib/games/klondike.py:441
msgid "Reserve. Only Kings are acceptable." msgid "Reserve. Only Kings are acceptable."
msgstr "Резерв. Только для королей." msgstr "Резерв. Только для королей."
#: pysollib/games/larasgame.py:163 pysollib/stack.py:1626 #: pysollib/games/larasgame.py:163 pysollib/stack.py:1625
msgid "Round %d" msgid "Round %d"
msgstr "Раунд %d" msgstr "Раунд %d"
@ -927,7 +931,7 @@ msgstr "Жезлы"
#: pysollib/games/special/tarock.py:223 #: pysollib/games/special/tarock.py:223
#: pysollib/games/ultra/dashavatara.py:351 #: pysollib/games/ultra/dashavatara.py:351
#: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254 #: pysollib/games/ultra/hexadeck.py:273 pysollib/games/ultra/mughal.py:254
#: pysollib/stack.py:1411 pysollib/util.py:79 #: pysollib/stack.py:1410 pysollib/util.py:79
msgid "Ace" msgid "Ace"
msgstr "Туз" msgstr "Туз"
@ -1335,7 +1339,7 @@ msgstr "Не найден файл помощи\n"
msgid " Help" msgid " Help"
msgstr " Помощь" msgstr " Помощь"
#: pysollib/main.py:67 pysollib/main.py:368 #: pysollib/main.py:67 pysollib/main.py:386
msgid " installation error" msgid " installation error"
msgstr " проблема с установкой" msgstr " проблема с установкой"
@ -1349,11 +1353,11 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:75 pysollib/main.py:376 pysollib/tk/menubar.py:382 #: pysollib/main.py:75 pysollib/main.py:394 pysollib/tk/menubar.py:382
msgid "&Quit" msgid "&Quit"
msgstr "В&ыход" msgstr "В&ыход"
#: pysollib/main.py:98 #: pysollib/main.py:99
msgid "" msgid ""
"%s: %s\n" "%s: %s\n"
"try %s --help for more information" "try %s --help for more information"
@ -1361,7 +1365,7 @@ msgstr ""
"%s: %s\n" "%s: %s\n"
"попробуйте %s --help для получения более подробной информации" "попробуйте %s --help для получения более подробной информации"
#: pysollib/main.py:139 #: pysollib/main.py:143
#, fuzzy #, fuzzy
msgid "" msgid ""
"Usage: %s [OPTIONS] [FILE]\n" "Usage: %s [OPTIONS] [FILE]\n"
@ -1390,7 +1394,7 @@ msgstr ""
"\n" "\n"
" FILE - имя файла сохранённой игры\n" " FILE - имя файла сохранённой игры\n"
#: pysollib/main.py:157 #: pysollib/main.py:161
msgid "" msgid ""
"%s: too many files\n" "%s: too many files\n"
"try %s --help for more information" "try %s --help for more information"
@ -1398,7 +1402,7 @@ msgstr ""
"\"%s: слишком много файлов\n" "\"%s: слишком много файлов\n"
"попробуйте %s --help для получения более подробной информации" "попробуйте %s --help для получения более подробной информации"
#: pysollib/main.py:161 #: pysollib/main.py:165
msgid "" msgid ""
"%s: invalid file name\n" "%s: invalid file name\n"
"try %s --help for more information" "try %s --help for more information"
@ -1406,7 +1410,7 @@ msgstr ""
"%s: неправильное имя файла\n" "%s: неправильное имя файла\n"
"попробуйте %s --help для получения более подробной информации" "попробуйте %s --help для получения более подробной информации"
#: pysollib/main.py:369 #: pysollib/main.py:387
msgid "" msgid ""
"\n" "\n"
"No games were found !!!\n" "No games were found !!!\n"
@ -1417,18 +1421,18 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:455 pysollib/main.py:463 #: pysollib/main.py:473 pysollib/main.py:481
msgid " installation problem" msgid " installation problem"
msgstr "" msgstr ""
#: pysollib/main.py:456 #: pysollib/main.py:474
msgid "" msgid ""
"Your Python installation is compiled without thread support.\n" "Your Python installation is compiled without thread support.\n"
"\n" "\n"
"Sounds and background music will be disabled." "Sounds and background music will be disabled."
msgstr "" msgstr ""
#: pysollib/main.py:464 #: pysollib/main.py:482
msgid "" msgid ""
"The pysolsoundserver module was not found.\n" "The pysolsoundserver module was not found.\n"
"\n" "\n"
@ -1438,7 +1442,7 @@ msgstr ""
"\n" "\n"
"Звук и фоновая музыка будут недоступны" "Звук и фоновая музыка будут недоступны"
#: pysollib/main.py:471 #: pysollib/main.py:489
msgid "Welcome to " msgid "Welcome to "
msgstr "Добро пожаловать в " msgstr "Добро пожаловать в "
@ -1707,71 +1711,71 @@ msgstr "Швейцария"
msgid "USA" msgid "USA"
msgstr "США" msgstr "США"
#: pysollib/settings.py:54 data/glade-translations:29 #: pysollib/settings.py:55 data/glade-translations:29
msgid "Top 10" msgid "Top 10"
msgstr "Top 10" msgstr "Top 10"
#: pysollib/stack.py:1405 #: pysollib/stack.py:1404
msgid "Base card - %s." msgid "Base card - %s."
msgstr "Базовая карта - %s." msgstr "Базовая карта - %s."
#: pysollib/stack.py:1406 #: pysollib/stack.py:1405
msgid "Empty row cannot be filled." msgid "Empty row cannot be filled."
msgstr "Пустой ряд не заполняется." msgstr "Пустой ряд не заполняется."
#: pysollib/stack.py:1407 #: pysollib/stack.py:1406
msgid "any card" msgid "any card"
msgstr "любая карта" msgstr "любая карта"
#: pysollib/stack.py:1408 pysollib/util.py:80 #: pysollib/stack.py:1407 pysollib/util.py:80
msgid "Jack" msgid "Jack"
msgstr "Валет" msgstr "Валет"
#: pysollib/stack.py:1421 #: pysollib/stack.py:1420
msgid "No cards" msgid "No cards"
msgstr "Нет карт" msgstr "Нет карт"
#: pysollib/stack.py:1422 #: pysollib/stack.py:1421
msgid "1 card" msgid "1 card"
msgstr "1 карта" msgstr "1 карта"
#: pysollib/stack.py:1423 #: pysollib/stack.py:1422
msgid " cards" msgid " cards"
msgstr " карт" msgstr " карт"
#: pysollib/stack.py:1635 pysollib/stack.py:1637 pysollib/stack.py:1673 #: pysollib/stack.py:1634 pysollib/stack.py:1636 pysollib/stack.py:1672
msgid "Redeal" msgid "Redeal"
msgstr "Сдать" msgstr "Сдать"
#: pysollib/stack.py:1637 #: pysollib/stack.py:1636
msgid "Stop" msgid "Stop"
msgstr "Стоп" msgstr "Стоп"
#: pysollib/stack.py:1698 #: pysollib/stack.py:1697
msgid "Variable redeals." msgid "Variable redeals."
msgstr "Переменное количество пересдач." msgstr "Переменное количество пересдач."
#: pysollib/stack.py:1699 #: pysollib/stack.py:1698
msgid "Unlimited redeals." msgid "Unlimited redeals."
msgstr "Неограниченное количество пересдач." msgstr "Неограниченное количество пересдач."
#: pysollib/stack.py:1700 #: pysollib/stack.py:1699
msgid "No redeals." msgid "No redeals."
msgstr "Без пересдачи." msgstr "Без пересдачи."
#: pysollib/stack.py:1701 #: pysollib/stack.py:1700
msgid "One redeal." msgid "One redeal."
msgstr "1 пересдача." msgstr "1 пересдача."
#: pysollib/stack.py:1702 #: pysollib/stack.py:1701
msgid " redeals." msgid " redeals."
msgstr " пересдачи." msgstr " пересдачи."
#: pysollib/stack.py:1704 #: pysollib/stack.py:1703
msgid "Talon." msgid "Talon."
msgstr "Колода." msgstr "Колода."
#: pysollib/stack.py:1938 pysollib/stack.py:2388 #: pysollib/stack.py:1937 pysollib/stack.py:2388
msgid "Reserve. No building." msgid "Reserve. No building."
msgstr "Резерв. Без выкладывания." msgstr "Резерв. Без выкладывания."
@ -1821,10 +1825,6 @@ msgstr "Игровой стол. Складывать в соответстви
msgid "Tableau. Build up by color." msgid "Tableau. Build up by color."
msgstr "Игровой стол. Складывать по возрастанию в соответствии с цветом." msgstr "Игровой стол. Складывать по возрастанию в соответствии с цветом."
#: pysollib/stack.py:2115
msgid "Tableau. Build down by color."
msgstr "Игровой стол. Складывать по убыванию в соответствии с цветом."
#: pysollib/stack.py:2123 #: pysollib/stack.py:2123
msgid "Tableau. Build up by suit." msgid "Tableau. Build up by suit."
msgstr "Игровой стол. Складывать по возрастанию в соответствии с мастью." msgstr "Игровой стол. Складывать по возрастанию в соответствии с мастью."

View file

@ -143,18 +143,21 @@ class BakersDozen(CastlesInSpain):
# /*********************************************************************** # /***********************************************************************
# // Spanish Patience # // Spanish Patience
# // Portuguese Solitaire
# ************************************************************************/ # ************************************************************************/
class SpanishPatience(BakersDozen): class SpanishPatience(BakersDozen):
Foundation_Class = AC_FoundationStack Foundation_Class = AC_FoundationStack
# /***********************************************************************
# // Portuguese Solitaire
# ************************************************************************/
class PortugueseSolitaire(BakersDozen): class PortugueseSolitaire(BakersDozen):
RowStack_Class = StackWrapper(RK_RowStack, base_rank=KING) RowStack_Class = StackWrapper(RK_RowStack, base_rank=KING)
def _shuffleHook(self, cards):
return cards
class SpanishPatienceII(PortugueseSolitaire):
RowStack_Class = RK_RowStack
# /*********************************************************************** # /***********************************************************************
@ -347,3 +350,5 @@ registerGame(GameInfo(369, RippleFan, "Ripple Fan",
GI.GT_BAKERS_DOZEN, 1, -1, GI.SL_MOSTLY_SKILL)) GI.GT_BAKERS_DOZEN, 1, -1, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(515, Indefatigable, "Indefatigable", registerGame(GameInfo(515, Indefatigable, "Indefatigable",
GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 1, 2, GI.SL_MOSTLY_SKILL)) GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 1, 2, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(664, SpanishPatienceII, "Spanish Patience II",
GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))

View file

@ -242,15 +242,6 @@ def pysol_init(app, args):
app.top_bg = top.cget("bg") app.top_bg = top.cget("bg")
app.top_palette = [None, None] # [fg, bg] app.top_palette = [None, None] # [fg, bg]
app.top_cursor = top.cget("cursor") app.top_cursor = top.cget("cursor")
if USE_TILE:
import settings
if opts['tile-theme']:
settings.TILE_THEME = opts['tile-theme']
from pysoltk import load_theme
try:
load_theme(app, top, settings.TILE_THEME)
except Exception, err:
print >> sys.stderr, 'ERROR: set theme:', err
# load options # load options
app.loadOptions() app.loadOptions()
@ -374,22 +365,20 @@ def pysol_init(app, args):
app.opt.fonts["default"] = None app.opt.fonts["default"] = None
if USE_TILE: # for tile if USE_TILE: # for tile
from pysoltk import load_theme
import settings
if opts['tile-theme']:
settings.TILE_THEME = opts['tile-theme']
try:
load_theme(app, top, settings.TILE_THEME)
except Exception, err:
print >> sys.stderr, 'ERROR: set theme:', err
##top.option_add('*Toolbar.relief', 'groove') ##top.option_add('*Toolbar.relief', 'groove')
##top.option_add('*Toolbar.relief', 'raised') ##top.option_add('*Toolbar.relief', 'raised')
top.option_add('*Toolbar.borderWidth', 1) ##top.option_add('*Toolbar.borderWidth', 1)
top.option_add('*Toolbar.Button.Pad', 2) ##top.option_add('*Toolbar.Button.Pad', 2)
top.option_add('*Toolbar.Button.default', 'disabled') ##top.option_add('*Toolbar.Button.default', 'disabled')
top.option_add('*Toolbar*takeFocus', 0) ##top.option_add('*Toolbar*takeFocus', 0)
#
from settings import TILE_THEME
if TILE_THEME:
if font:
top.tk.call('style', 'configure', '.', '-font', font)
else:
font = top.tk.call('style', 'lookup', TILE_THEME, '-font')
top.option_add('*font', font)
bg = top.tk.call('style', 'lookup', TILE_THEME, '-background')
top.tk_setPalette(bg)
# check games # check games
if len(app.gdb.getGamesIdSortedByName()) == 0: if len(app.gdb.getGamesIdSortedByName()) == 0:

View file

@ -23,6 +23,10 @@ TkVersion = Tkinter.TkVersion
TclError = Tkinter.TclError TclError = Tkinter.TclError
# internal
_flatten = Tkinter._flatten
class Style: class Style:
def __init__(self, master): def __init__(self, master):
self.tk = master.tk self.tk = master.tk
@ -84,7 +88,7 @@ class Style:
for k, v in cnf.items(): for k, v in cnf.items():
if v is not None: if v is not None:
if k[-1] == '_': k = k[:-1] if k[-1] == '_': k = k[:-1]
res = res + ('-'+k, v) res = res + ('-'+k, str(v))
return res return res
def configure(self, style, **kw): def configure(self, style, **kw):
@ -372,7 +376,7 @@ class Treeview(Widget, Tkinter.Listbox):
The width of the column in pixels. Default is something The width of the column in pixels. Default is something
reasonable, probably 200 or so. reasonable, probably 200 or so.
""" """
pass return self.tk.call((self._w, 'column', column) + self._options(kw))
def delete(self, items): def delete(self, items):
"""Deletes each of the items and all of their descendants. """Deletes each of the items and all of their descendants.
@ -413,7 +417,7 @@ class Treeview(Widget, Tkinter.Listbox):
-command script -command script
A script to evaluate when the heading label is pressed. A script to evaluate when the heading label is pressed.
""" """
pass return self.tk.call((self._w, 'heading', column) + self._options(kw))
def identify(self, x, y): def identify(self, x, y):
"""Returns a description of the widget component under the point given """Returns a description of the widget component under the point given
@ -458,7 +462,10 @@ class Treeview(Widget, Tkinter.Listbox):
returns the item identifier of the newly created item. See ITEM returns the item identifier of the newly created item. See ITEM
OPTIONS for the list of available options. OPTIONS for the list of available options.
""" """
pass if not parent: parent = ''
args = (self._w, 'insert', parent, index)
if id: args = args + ('-id', id)
return self.tk.call(args + self._options(kw))
def item(item, **kw): def item(item, **kw):
"""Query or modify the options for the specified item. If no -option """Query or modify the options for the specified item. If no -option

View file

@ -120,6 +120,7 @@ class MfxStatusbar:
def configLabel(self, name, **kw): def configLabel(self, name, **kw):
if kw.has_key('fg'): if kw.has_key('fg'):
kw['foreground'] = kw['fg']
del kw['fg'] del kw['fg']
label = getattr(self, name + "_label") label = getattr(self, name + "_label")
apply(label.config, (), kw) apply(label.config, (), kw)
@ -165,21 +166,21 @@ class PysolStatusbar(MfxStatusbar):
# #
l = self._createLabel("info", fill='both', expand=1) l = self._createLabel("info", fill='both', expand=1)
##l.config(text="", justify="left", anchor='w') ##l.config(text="", justify="left", anchor='w')
#~l.config(padx=8) l.config(padding=(8, 0))
class HelpStatusbar(MfxStatusbar): class HelpStatusbar(MfxStatusbar):
def __init__(self, top): def __init__(self, top):
MfxStatusbar.__init__(self, top, row=4, column=0, columnspan=3) MfxStatusbar.__init__(self, top, row=4, column=0, columnspan=3)
l = self._createLabel("info", fill='both', expand=1) l = self._createLabel("info", fill='both', expand=1)
l.config(justify="left", anchor='w') #~, padx=8) l.config(justify="left", anchor='w', padding=(8, 0))
class HtmlStatusbar(MfxStatusbar): class HtmlStatusbar(MfxStatusbar):
def __init__(self, top, row, column, columnspan): def __init__(self, top, row, column, columnspan):
MfxStatusbar.__init__(self, top, row=row, column=column, columnspan=columnspan) MfxStatusbar.__init__(self, top, row=row, column=column, columnspan=columnspan)
l = self._createLabel("url", fill='both', expand=1) l = self._createLabel("url", fill='both', expand=1)
l.config(justify="left", anchor='w') #~, padx=8) l.config(justify="left", anchor='w', padding=(8, 0))
# /*********************************************************************** # /***********************************************************************

View file

@ -527,6 +527,7 @@ def tkhtml_main(args):
except: except:
url = os.path.join(os.pardir, os.pardir, "data", "html", "index.html") url = os.path.join(os.pardir, os.pardir, "data", "html", "index.html")
top = Tkinter.Tk() top = Tkinter.Tk()
top.tk.call("package", "require", "tile")
top.wm_minsize(400, 200) top.wm_minsize(400, 200)
viewer = HTMLViewer(top) viewer = HTMLViewer(top)
viewer.app = None viewer.app = None

View file

@ -300,229 +300,98 @@ class SingleGame_StatsDialog(MfxDialog):
# // # //
# ************************************************************************/ # ************************************************************************/
class CanvasWriter(PysolStatsFormatter.StringWriter): class TreeWriter(PysolStatsFormatter.StringWriter):
def __init__(self, canvas, parent_window, font, w, h): def __init__(self, tree, parent_window, font, w, h):
self.canvas = canvas self.tree = tree
self.parent_window = parent_window self.parent_window = parent_window
##self.fg = canvas.cget("insertbackground")
self.fg = canvas.option_get('foreground', '') or canvas.cget("insertbackground")
self.font = font self.font = font
self.w = w
self.h = h
self.x = self.y = 0
self.gameid = None self.gameid = None
self.gamenumber = None self.gamenumber = None
self.canvas.config(yscrollincrement=h)
self._tabs = None self._tabs = None
self.w = w
def _addItem(self, id): self.h = h
self.canvas.dialog.nodes[id] = (self.gameid, self.gamenumber)
def p(self, s): def p(self, s):
if self.y > 16000: pass
return
h1, h2 = 0, 0
while s and s[0] == "\n":
s = s[1:]
h1 = h1 + self.h
while s and s[-1] == "\n":
s = s[:-1]
h2 = h2 + self.h
self.y = self.y + h1
if s:
id = self.canvas.create_text(self.x, self.y, text=s, anchor="nw",
font=self.font, fill=self.fg)
self._addItem(id)
self.y = self.y + h2
def pheader(self, s): def pheader(self, s):
pass pass
def _calc_tabs(self, arg): def _calc_tabs(self, arg):
tw = 15*self.w if self.parent_window.tree_tabs:
self._tabs = self.parent_window.tree_tabs
return
tw = 20*self.w
##tw = 160 ##tw = 160
self._tabs = [tw] self._tabs = [tw]
font = tkFont.Font(self.canvas, self.font) font = tkFont.Font(self.tree, self.font)
for t in arg[1:]: for t in arg[1:]:
tw = font.measure(t)+20 tw = font.measure(t)+20
self._tabs.append(tw) self._tabs.append(tw)
self._tabs.append(10) self._tabs.append(10)
self.parent_window.tree_tabs = self._tabs
def pstats(self, *args, **kwargs): def pstats(self, *args, **kwargs):
gameid=kwargs.get('gameid', None)
header = False header = False
if self._tabs is None: if self._tabs is None:
# header # header
header = True
self._calc_tabs(args) self._calc_tabs(args)
self.gameid = 'header' header = True
self.gamenumber = None
## if False:
## sort_by = ( 'name', 'played', 'won', 'lost',
## 'time', 'moves', 'percent', )
## frame = Tkinter.Frame(self.canvas)
## i = 0
## for t in args:
## w = self._tabs[i]
## if i == 0:
## w += 10
## b = Tkinter.Button(frame, text=t)
## b.grid(row=0, column=i, sticky='ew')
## b.bind('<1>', lambda e, f=self.parent_window.rearrange, s=sort_by[i]: f(s))
## frame.columnconfigure(i, minsize=w)
## i += 1
## self.canvas.create_window(0, 0, window=frame, anchor='nw')
## self.y += 20
## return
## if False:
## i = 0
## x = 0
## for t in args:
## w = self._tabs[i]
## h = 18
## anchor = 'ne'
## y = 0
## self.canvas.create_rectangle(x+2, y, x+w, y+h, width=1,
## fill="#00ff00", outline="#000000")
## x += w
## self.canvas.create_text(x-3, y+3, text=t, anchor=anchor)
## i += 1
## self.y += 20
## return
else:
self.gameid = gameid
self.gamenumber = None
if self.y > 16000:
return
x, y = 1, self.y
p = self._pstats_text
t1, t2, t3, t4, t5, t6, t7 = args t1, t2, t3, t4, t5, t6, t7 = args
h = 0
if not header: t1=gettext(t1) # game name if not header: t1=gettext(t1) # game name
for var, text, anchor, tab in ( if header:
('name', t1, 'nw', self._tabs[0]+self._tabs[1]), for column, text, anchor, tab in (
('played', t2, 'ne', self._tabs[2]), ('#0', t1, 'nw', self._tabs[0]),
('won', t3, 'ne', self._tabs[3]), ('played', t2, 'ne', self._tabs[1]),
('lost', t4, 'ne', self._tabs[4]), ('won', t3, 'ne', self._tabs[2]),
('time', t5, 'ne', self._tabs[5]), ('lost', t4, 'ne', self._tabs[3]),
('moves', t6, 'ne', self._tabs[6]), ('time', t5, 'ne', self._tabs[4]),
('percent', t7, 'ne', self._tabs[7]), ): ('moves', t6, 'ne', self._tabs[5]),
if header: self.gamenumber=var ('percent', t7, 'ne', self._tabs[6]), ):
h = max(h, p(x, y, anchor=anchor, text=text)) self.tree.heading(column, text=text,
x += tab command=lambda par=self.parent_window, col=column: par.headerClick(col))
self.tree.column(column, width=tab)
else:
id = self.tree.insert(None, "end", text=t1,
values=(t2, t3, t4, t5, t6, t7))
self.parent_window.tree_items.append(id)
self.pstats_perc(x, y, t7) def plog(self, *args, **kwargs):
self.y += h header = False
self.gameid = None if self._tabs is None:
return # header
self._calc_tabs(('', '99999999999999999999', '9999-99-99 99:99', 'XXXXXXXXXXXX'))
header = True
## h = max(h, p(x, y, anchor="nw", text=t1)) t1, t2, t3, t4 = args[:4]
## if header: self.gamenumber='played' if not header: t1=gettext(t1) # game name
## x += self._tabs[0]+self._tabs[1]
## h = max(h, p(x, y, anchor="ne", text=t2))
## if header: self.gamenumber='won'
## x += self._tabs[2]
## h = max(h, p(x, y, anchor="ne", text=t3))
## if header: self.gamenumber='lost'
## x += self._tabs[3]
## h = max(h, p(x, y, anchor="ne", text=t4))
## if header: self.gamenumber='time'
## x += self._tabs[4]
## h = max(h, p(x, y, anchor="ne", text=t5))
## if header: self.gamenumber='moves'
## x += self._tabs[5]
## h = max(h, p(x, y, anchor="ne", text=t6))
## if header: self.gamenumber='percent'
## x += self._tabs[6]
## h = max(h, p(x, y, anchor="ne", text=t7))
## x += self._tabs[7]
## self.pstats_perc(x, y, t7)
## self.y += h
## self.gameid = None
def _pstats_text(self, x, y, **kw): if header:
kwdefault(kw, font=self.font, fill=self.fg) for column, text, anchor, tab in (
id = apply(self.canvas.create_text, (x, y), kw) ('#0', t1, 'nw', self._tabs[0]),
self._addItem(id) ('gamenumber', t2, 'ne', self._tabs[1]),
return self.h ('date', t3, 'ne', self._tabs[2]),
##bbox = self.canvas.bbox(id) ('status', t4, 'ne', self._tabs[3]), ):
##return bbox[3] - bbox[1] self.tree.heading(column, text=text,
command=lambda par=self.parent_window, col=column: par.headerClick(col))
def pstats_perc(self, x, y, t): self.tree.column(column, width=tab)
if not (t and "0" <= t[0] <= "9"): ##if column in ('gamenumber', 'date', 'status'):
return ## self.tree.column(column, anchor='center')
perc = int(round(float(str(t)))) else:
if perc < 1: id = self.tree.insert(None, "end", text=t1, values=(t2, t3, t4))
return self.parent_window.tree_items.append(id)
rx, ry, rw, rh = x, y+1, 2 + 8*10, self.h-5
if 1:
w = int(round(rw*perc/100.0))
if 1 and w < 1:
return
if w > 0:
w = max(3, w)
w = min(rw - 2, w)
id = self.canvas.create_rectangle(rx, ry, rx+w, ry+rh, width=1,
fill="#00ff00", outline="#000000")
if w < rw:
id = self.canvas.create_rectangle(rx+w, ry, rx+rw, ry+rh, width=1,
fill="#ff0000", outline="#000000")
return
##fill = "#ffffff"
##fill = self.canvas["bg"]
fill = None
id = self.canvas.create_rectangle(rx, ry, rx+rw, ry+rh, width=1,
fill=fill, outline="#808080")
if 1:
rx, rw = rx + 1, rw - 1
ry, rh = ry + 1, rh - 1
w = int(round(rw*perc/100.0))
if w > 0:
id = self.canvas.create_rectangle(rx, ry, rx+w, ry+rh, width=0,
fill="#00ff00", outline="")
if w < rw:
id = self.canvas.create_rectangle(rx+w, ry, rx+rw, ry+rh, width=0,
fill="#ff0000", outline="")
return
p = 1.0
ix = rx + 2
for i in (1, 11, 21, 31, 41, 51, 61, 71, 81, 91):
if perc < i:
break
##c = "#ff8040"
r, g, b = 255, 128*p, 64*p
c = "#%02x%02x%02x" % (int(r), int(g), int(b))
id = self.canvas.create_rectangle(ix, ry+2, ix+6, ry+rh-2, width=0,
fill=c, outline=c)
ix = ix + 8
p = max(0.0, p - 0.1)
def plog(self, gamename, gamenumber, date, status, gameid=-1, won=-1):
if gameid > 0 and "0" <= gamenumber[0:1] <= "9":
self.gameid = gameid
self.gamenumber = gamenumber
self.p("%-25s %-20s %17s %s\n" % (gamename, gamenumber, date, status))
self.gameid = None
self.gamenumber = None
# /*********************************************************************** # /***********************************************************************
# // # //
# ************************************************************************/ # ************************************************************************/
class AllGames_StatsDialogScrolledCanvas(MfxScrolledCanvas):
pass
class AllGames_StatsDialog(MfxDialog): class AllGames_StatsDialog(MfxDialog):
# for font "canvas_fixed"
#CHAR_W, CHAR_H = 7, 16
#if os.name == "mac": CHAR_W = 6
#
YVIEW = 0
FONT_TYPE = "default" FONT_TYPE = "default"
COLUMNS = ('played', 'won', 'lost', 'time', 'moves', 'percent')
def __init__(self, parent, title, app, player, **kw): def __init__(self, parent, title, app, player, **kw):
lines = 25 lines = 25
@ -539,6 +408,8 @@ class AllGames_StatsDialog(MfxDialog):
self.player = player self.player = player
self.title = title self.title = title
self.sort_by = 'name' self.sort_by = 'name'
self.tree_items = []
self.tree_tabs = None
# #
kwdefault(kw, width=self.CHAR_W*64, height=lines*self.CHAR_H) kwdefault(kw, width=self.CHAR_W*64, height=lines*self.CHAR_H)
kw = self.initKw(kw) kw = self.initKw(kw)
@ -549,22 +420,15 @@ class AllGames_StatsDialog(MfxDialog):
self.top.wm_minsize(200, 200) self.top.wm_minsize(200, 200)
self.button = kw.default self.button = kw.default
# #
self.sc = AllGames_StatsDialogScrolledCanvas(top_frame, frame = Tkinter.Frame(top_frame)
width=kw.width, height=kw.height) frame.pack(fill='both', expand=True, padx=kw.padx, pady=kw.pady)
self.sc.pack(fill=Tkinter.BOTH, expand=1, padx=kw.padx, pady=kw.pady) sb = Tkinter.Scrollbar(frame)
# sb.pack(side='right', fill='y')
self.nodes = {} self.tree = Tkinter.Treeview(frame, columns=self.COLUMNS)
self.canvas = self.sc.canvas self.tree.pack(side='left', fill='both', expand=True)
self.canvas.dialog = self self.tree.config(yscrollcommand=sb.set)
bind(self.canvas, "<1>", self.singleClick) sb.config(command=self.tree.yview)
self.fillCanvas(player, title) self.fillCanvas(player, title)
bbox = self.canvas.bbox("all")
##print bbox
##self.canvas.config(scrollregion=bbox)
dx, dy = 4, 0
self.canvas.config(scrollregion=(-dx,-dy,bbox[2]+dx,bbox[3]+dy))
self.canvas.xview_moveto(-dx)
self.canvas.yview_moveto(self.YVIEW)
# #
focus = self.createButtons(bottom_frame, kw) focus = self.createButtons(bottom_frame, kw)
self.mainloop(focus, kw.timeout) self.mainloop(focus, kw.timeout)
@ -583,47 +447,32 @@ class AllGames_StatsDialog(MfxDialog):
def destroy(self): def destroy(self):
self.app = None self.app = None
self.canvas.dialog = None self.tree.destroy()
self.nodes = {}
self.sc.destroy()
MfxDialog.destroy(self) MfxDialog.destroy(self)
def rearrange(self, sort_by): def headerClick(self, column):
if column == '#0':
sort_by = 'name'
else:
sort_by = column
if self.sort_by == sort_by: return if self.sort_by == sort_by: return
self.sort_by = sort_by self.sort_by = sort_by
self.fillCanvas(self.player, self.title) self.fillCanvas(self.player, self.title)
def singleClick(self, event=None):
id = self.canvas.find_withtag(Tkinter.CURRENT)
if not id:
return
##print id, self.nodes.get(id[0])
gameid, gamenumber = self.nodes.get(id[0], (None, None))
if gameid == 'header':
if self.sort_by == gamenumber: return
self.sort_by = gamenumber
self.fillCanvas(self.player, self.title)
return
## FIXME / TODO
return
if gameid and gamenumber:
print gameid, gamenumber
elif gameid:
print gameid
# #
# #
# #
def fillCanvas(self, player, header): def fillCanvas(self, player, header):
self.canvas.delete('all') if self.tree_items:
self.nodes = {} self.tree.delete(tuple(self.tree_items))
self.tree_items = []
a = PysolStatsFormatter(self.app) a = PysolStatsFormatter(self.app)
#print 'CHAR_W:', self.CHAR_W writer = TreeWriter(self.tree, self,
writer = CanvasWriter(self.canvas, self, self.font, self.CHAR_W, self.CHAR_H)
self.font, self.CHAR_W, self.CHAR_H)
if not a.writeStats(writer, player, header, sort_by=self.sort_by): if not a.writeStats(writer, player, header, sort_by=self.sort_by):
writer.p(_("No entries for player ") + player + "\n") # FIXME
pass
destruct(writer) destruct(writer)
destruct(a) destruct(a)
@ -633,35 +482,45 @@ class AllGames_StatsDialog(MfxDialog):
# ************************************************************************/ # ************************************************************************/
class FullLog_StatsDialog(AllGames_StatsDialog): class FullLog_StatsDialog(AllGames_StatsDialog):
YVIEW = 1
FONT_TYPE = "fixed" FONT_TYPE = "fixed"
COLUMNS = ('gamenumber', 'date', 'status')
def fillCanvas(self, player, header): def fillCanvas(self, player, header):
a = PysolStatsFormatter(self.app) a = PysolStatsFormatter(self.app)
writer = CanvasWriter(self.canvas, self, self.font, self.CHAR_W, self.CHAR_H) writer = TreeWriter(self.tree, self, self.font,
self.CHAR_W, self.CHAR_H)
if not a.writeFullLog(writer, player, header): if not a.writeFullLog(writer, player, header):
writer.p(_("No log entries for %s\n") % player) # FIXME
pass
destruct(a) destruct(a)
def initKw(self, kw): def initKw(self, kw):
kw = KwStruct(kw, kw = KwStruct(kw,
strings=(_("&OK"), (_("Session &log..."), 104), (_("&Save to file"), 203)), default=0, strings=(_("&OK"), (_("Session &log..."), 104),
(_("&Save to file"), 203)), default=0,
width=76*self.CHAR_W, width=76*self.CHAR_W,
) )
return AllGames_StatsDialog.initKw(self, kw) return AllGames_StatsDialog.initKw(self, kw)
def headerClick(self, column):
pass
class SessionLog_StatsDialog(FullLog_StatsDialog): class SessionLog_StatsDialog(FullLog_StatsDialog):
def fillCanvas(self, player, header): def fillCanvas(self, player, header):
a = PysolStatsFormatter(self.app) a = PysolStatsFormatter(self.app)
writer = CanvasWriter(self.canvas, self, self.font, self.CHAR_W, self.CHAR_H) writer = TreeWriter(self.tree, self, self.font,
self.CHAR_W, self.CHAR_H)
if not a.writeSessionLog(writer, player, header): if not a.writeSessionLog(writer, player, header):
writer.p(_("No current session log entries for %s\n") % player) # FIXME
pass
destruct(a) destruct(a)
def initKw(self, kw): def initKw(self, kw):
kw = KwStruct(kw, kw = KwStruct(kw,
strings=(_("&OK"), (_("&Full log..."), 103), (_("&Save to file"), 204)), default=0, strings=(_("&OK"), (_("&Full log..."), 103),
(_("&Save to file"), 204)), default=0,
) )
return FullLog_StatsDialog.initKw(self, kw) return FullLog_StatsDialog.initKw(self, kw)

View file

@ -430,5 +430,12 @@ def load_theme(app, top, theme):
top.tk_setPalette(bg) top.tk_setPalette(bg)
bg = top.tk.call('style', 'lookup', '.', '-background', 'active') bg = top.tk.call('style', 'lookup', '.', '-background', 'active')
top.option_add('*Menu.activeBackground', bg) top.option_add('*Menu.activeBackground', bg)
font = app.opt.fonts['default']
if font:
top.tk.call('style', 'configure', '.', '-font', font)
else:
font = top.tk.call('style', 'lookup', '.', '-font')
top.option_add('*font', font)