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

+ new file: pysollib/init.py

* improved tile binding
* misc. improvements and bugs fixes
* update ru translation


git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@84 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2006-11-01 23:06:59 +00:00
parent 9f6d8c62a0
commit 2226957e90
49 changed files with 727 additions and 716 deletions

3
README
View file

@ -13,7 +13,8 @@ Requirements.
or or
- PyGame: http://www.pygame.org/ (mp3, ogg, wav, midi, tracker music) - PyGame: http://www.pygame.org/ (mp3, ogg, wav, midi, tracker music)
** other modules (not necessarily) ** ** other packages (not necessarily) **
- Tile: http://tktable.sourceforge.net/tile/ (0.7.8 or later)
- PIL (Python Image Library): http://www.pythonware.com/products/pil - PIL (Python Image Library): http://www.pythonware.com/products/pil
- Freecell Solver: http://vipe.technion.ac.il/~shlomif/freecell-solver/ - Freecell Solver: http://vipe.technion.ac.il/~shlomif/freecell-solver/

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

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: Sat Oct 7 20:02:33 2006\n" "POT-Creation-Date: Tue Oct 31 19:32:40 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"
@ -768,6 +768,9 @@ msgstr ""
msgid "Double Grasshopper" msgid "Double Grasshopper"
msgstr "" msgstr ""
msgid "Double Kingsley"
msgstr ""
msgid "Double Klondike" msgid "Double Klondike"
msgstr "" msgstr ""
@ -1518,6 +1521,9 @@ msgstr ""
msgid "Kingsdown Eights" msgid "Kingsdown Eights"
msgstr "" msgstr ""
msgid "Kingsley"
msgstr ""
msgid "Klondike" msgid "Klondike"
msgstr "" msgstr ""
@ -2631,6 +2637,9 @@ msgstr ""
msgid "Pegged Triangle 2" msgid "Pegged Triangle 2"
msgstr "" msgstr ""
msgid "Penelope's Web"
msgstr ""
msgid "Penguin" msgid "Penguin"
msgstr "" msgstr ""
@ -2946,6 +2955,9 @@ msgstr ""
msgid "Scarab" msgid "Scarab"
msgstr "" msgstr ""
msgid "Scarp"
msgstr ""
msgid "Scheidungsgrund" msgid "Scheidungsgrund"
msgstr "" msgstr ""
@ -3447,6 +3459,9 @@ msgstr ""
msgid "Trapdoor" msgid "Trapdoor"
msgstr "" msgstr ""
msgid "Trapdoor Spider"
msgstr ""
msgid "Treasure Trove" msgid "Treasure Trove"
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: Sat Oct 7 20:03:30 2006\n" "POT-Creation-Date: Tue Oct 31 19:33: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"
@ -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-10-07 20:03+0400\n" "POT-Creation-Date: 2006-10-31 19:33+0300\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"
@ -32,45 +32,45 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: pysollib/actions.py:260 pysollib/tk/toolbar.py:197 #: pysollib/actions.py:258 pysollib/tk/toolbar.py:197
msgid "New game" msgid "New game"
msgstr "" msgstr ""
#: pysollib/actions.py:273 pysollib/tk/menubar.py:815 #: pysollib/actions.py:271 pysollib/tk/menubar.py:815
#: pysollib/tk/menubar.py:829 #: pysollib/tk/menubar.py:829
msgid "Select game" msgid "Select game"
msgstr "" msgstr ""
#: pysollib/actions.py:287 #: pysollib/actions.py:285
msgid "Invalid game number" msgid "Invalid game number"
msgstr "" msgstr ""
#: pysollib/actions.py:288 #: pysollib/actions.py:286
msgid "Invalid game number\n" msgid "Invalid game number\n"
msgstr "" msgstr ""
#: pysollib/actions.py:305 #: pysollib/actions.py:303
msgid "Select next game number" msgid "Select next game number"
msgstr "" msgstr ""
#: pysollib/actions.py:314 pysollib/actions.py:324 #: pysollib/actions.py:312 pysollib/actions.py:322
msgid "Select new game number" msgid "Select new game number"
msgstr "" msgstr ""
#: pysollib/actions.py:315 #: pysollib/actions.py:313
msgid "" msgid ""
"\n" "\n"
"\n" "\n"
"Enter new game number" "Enter new game number"
msgstr "" msgstr ""
#: pysollib/actions.py:316 #: pysollib/actions.py:314
msgid "&Next number" msgid "&Next number"
msgstr "" msgstr ""
#: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162 #: pysollib/actions.py:314 pysollib/app.py:892 pysollib/app.py:1155
#: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:478 #: pysollib/app.py:1167 pysollib/game.py:929 pysollib/game.py:1865
#: pysollib/main.py:486 pysollib/tk/colorsdialog.py:122 #: pysollib/main.py:374 pysollib/main.py:382 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
@ -78,149 +78,141 @@ msgstr ""
#: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159 #: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159
#: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211 #: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211
#: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:499 #: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:499
#: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:573 #: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512
#: pysollib/tk/tkstats.py:647 pysollib/tk/tkstats.py:663 #: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594
#: pysollib/tk/tkstats.py:705 pysollib/tk/tkstats.py:777 #: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708
#: pysollib/tk/tkstats.py:861 pysollib/tk/tkwidget.py:159 #: pysollib/tk/tkstats.py:792 pysollib/tk/tkwidget.py:160
#: pysollib/tk/tkwidget.py:324 #: pysollib/tk/tkwidget.py:325
msgid "&OK" msgid "&OK"
msgstr "" msgstr ""
#: pysollib/actions.py:316 pysollib/app.py:1162 pysollib/game.py:925 #: pysollib/actions.py:314 pysollib/app.py:893 pysollib/app.py:1167
#: pysollib/game.py:1311 pysollib/game.py:1326 pysollib/game.py:1333 #: pysollib/game.py:929 pysollib/game.py:1315 pysollib/game.py:1330
#: pysollib/game.py:1339 pysollib/tk/colorsdialog.py:122 #: pysollib/game.py:1337 pysollib/game.py:1343 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/menubar.py:1122 #: pysollib/tk/fontsdialog.py:205 pysollib/tk/menubar.py:1122
#: pysollib/tk/menubar.py:1124 pysollib/tk/playeroptionsdialog.py:85 #: pysollib/tk/menubar.py:1124 pysollib/tk/playeroptionsdialog.py:85
#: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241 #: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241
#: pysollib/tk/selectgame.py:266 pysollib/tk/selectgame.py:407 #: pysollib/tk/selectgame.py:266 pysollib/tk/selectgame.py:407
#: pysollib/tk/selecttile.py:159 pysollib/tk/soundoptionsdialog.py:170 #: pysollib/tk/selecttile.py:159 pysollib/tk/soundoptionsdialog.py:170
#: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkwidget.py:324 #: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkwidget.py:325
msgid "&Cancel" msgid "&Cancel"
msgstr "" msgstr ""
#: pysollib/actions.py:332 #: pysollib/actions.py:330
msgid "Select random game" msgid "Select random game"
msgstr "" msgstr ""
#: pysollib/actions.py:368 #: pysollib/actions.py:366
msgid "Select next game" msgid "Select next game"
msgstr "" msgstr ""
#: pysollib/actions.py:401 pysollib/tk/toolbar.py:211 #: pysollib/actions.py:399 pysollib/tk/toolbar.py:211
msgid "Quit " msgid "Quit "
msgstr "" msgstr ""
#: pysollib/actions.py:451 #: pysollib/actions.py:449
msgid "Clear bookmarks" msgid "Clear bookmarks"
msgstr "" msgstr ""
#: pysollib/actions.py:452 #: pysollib/actions.py:450
msgid "Clear all bookmarks ?" msgid "Clear all bookmarks ?"
msgstr "" msgstr ""
#: pysollib/actions.py:462 #: pysollib/actions.py:460
msgid "Restart game" msgid "Restart game"
msgstr "" msgstr ""
#: pysollib/actions.py:463 #: pysollib/actions.py:461
msgid "Restart this game ?" msgid "Restart this game ?"
msgstr "" msgstr ""
#: pysollib/actions.py:504 #: pysollib/actions.py:502
msgid "" msgid ""
"Comments for %s:\n" "Comments for %s:\n"
"\n" "\n"
msgstr "" msgstr ""
#: pysollib/actions.py:506 #: pysollib/actions.py:504
msgid "Comments for " msgid "Comments for "
msgstr "" msgstr ""
#: pysollib/actions.py:524 pysollib/actions.py:554 #: pysollib/actions.py:522 pysollib/actions.py:550
msgid "Error while writing to file" msgid "Error while writing to file"
msgstr "" msgstr ""
#: pysollib/actions.py:527 pysollib/actions.py:557 #: pysollib/actions.py:525 pysollib/actions.py:553
msgid " Info" msgid " Info"
msgstr "" msgstr ""
#: pysollib/actions.py:528 #: pysollib/actions.py:526
msgid "" msgid ""
"Comments were appended to\n" "Comments were appended to\n"
"\n" "\n"
msgstr "" msgstr ""
#: pysollib/actions.py:539 #: pysollib/actions.py:537
msgid "Demo statistics" msgid "Demo statistics"
msgstr "" msgstr ""
#: pysollib/actions.py:542 #: pysollib/actions.py:540
msgid "Your statistics" msgid "Your statistics"
msgstr "" msgstr ""
#: pysollib/actions.py:558 #: pysollib/actions.py:554
msgid "" msgid ""
" were appended to\n" " were appended to\n"
"\n" "\n"
msgstr "" msgstr ""
#: pysollib/actions.py:572 #: pysollib/actions.py:568
msgid " Demo" msgid " Demo"
msgstr "" msgstr ""
#: pysollib/actions.py:572 #: pysollib/actions.py:568
msgid " Demo " msgid " Demo "
msgstr "" msgstr ""
#: pysollib/actions.py:575 pysollib/actions.py:593 #: pysollib/actions.py:571 pysollib/actions.py:589
msgid " for " msgid " for "
msgstr "" msgstr ""
#: pysollib/actions.py:581 pysollib/actions.py:600 #: pysollib/actions.py:577 pysollib/stats.py:206
msgid "Statistics for " msgid "Statistics for "
msgstr "" msgstr ""
#: pysollib/actions.py:584 pysollib/tk/selectgame.py:350 #: pysollib/actions.py:580 pysollib/tk/selectgame.py:350
#: pysollib/tk/toolbar.py:208 #: pysollib/tk/toolbar.py:208
msgid "Statistics" msgid "Statistics"
msgstr "" msgstr ""
#: pysollib/actions.py:587 data/glade-translations:31 #: pysollib/actions.py:583 data/glade-translations:31
msgid "Full log" msgid "Full log"
msgstr "" msgstr ""
#: pysollib/actions.py:590 data/glade-translations:32 #: pysollib/actions.py:586 data/glade-translations:32
msgid "Session log" msgid "Session log"
msgstr "" msgstr ""
#: pysollib/actions.py:596 #: pysollib/actions.py:592
msgid "Game Info" msgid "Game Info"
msgstr "" msgstr ""
#: pysollib/actions.py:605 #: pysollib/actions.py:608
msgid "Full log for "
msgstr ""
#: pysollib/actions.py:610
msgid "Session log for "
msgstr ""
#: pysollib/actions.py:615
msgid "Reset all statistics" msgid "Reset all statistics"
msgstr "" msgstr ""
#: pysollib/actions.py:616 #: pysollib/actions.py:609
msgid "" msgid ""
"Reset ALL statistics and logs for player\n" "Reset ALL statistics and logs for player\n"
"%s ?" "%s ?"
msgstr "" msgstr ""
#: pysollib/actions.py:622 #: pysollib/actions.py:615
msgid "Reset game statistics" msgid "Reset game statistics"
msgstr "" msgstr ""
#: pysollib/actions.py:623 #: pysollib/actions.py:616
msgid "" msgid ""
"Reset statistics and logs for player\n" "Reset statistics and logs for player\n"
"%s\n" "%s\n"
@ -228,23 +220,23 @@ msgid ""
"%s ?" "%s ?"
msgstr "" msgstr ""
#: pysollib/actions.py:678 #: pysollib/actions.py:671
msgid "Play demo" msgid "Play demo"
msgstr "" msgstr ""
#: pysollib/actions.py:689 #: pysollib/actions.py:682
msgid "Set player options" msgid "Set player options"
msgstr "" msgstr ""
#: pysollib/actions.py:703 data/glade-translations:40 #: pysollib/actions.py:696 data/glade-translations:40
msgid "Set colors" msgid "Set colors"
msgstr "" msgstr ""
#: pysollib/actions.py:723 #: pysollib/actions.py:716
msgid "Set fonts" msgid "Set fonts"
msgstr "" msgstr ""
#: pysollib/actions.py:732 data/glade-translations:33 #: pysollib/actions.py:725 data/glade-translations:33
msgid "Set timeouts" msgid "Set timeouts"
msgstr "" msgstr ""
@ -252,23 +244,28 @@ msgstr ""
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr ""
#: pysollib/app.py:1012 #: pysollib/app.py:894 pysollib/game.py:1315 pysollib/game.py:1330
#: pysollib/game.py:1337 pysollib/game.py:1343 pysollib/tk/menubar.py:363
msgid "&New game"
msgstr ""
#: pysollib/app.py:1017
msgid "Loading %s %s..." msgid "Loading %s %s..."
msgstr "" msgstr ""
#: pysollib/app.py:1047 #: pysollib/app.py:1052
msgid " load error" msgid " load error"
msgstr "" msgstr ""
#: pysollib/app.py:1048 #: pysollib/app.py:1053
msgid "Error while loading " msgid "Error while loading "
msgstr "" msgstr ""
#: pysollib/app.py:1142 #: pysollib/app.py:1147
msgid "Incompatible " msgid "Incompatible "
msgstr "" msgstr ""
#: pysollib/app.py:1144 #: pysollib/app.py:1149
msgid "" msgid ""
"The currently selected %s %s\n" "The currently selected %s %s\n"
"is not compatible with the game\n" "is not compatible with the game\n"
@ -277,57 +274,57 @@ msgid ""
"Please select a %s type %s.\n" "Please select a %s type %s.\n"
msgstr "" msgstr ""
#: pysollib/app.py:1160 #: pysollib/app.py:1165
msgid "Please select a %s type %s" msgid "Please select a %s type %s"
msgstr "" msgstr ""
#: pysollib/game.py:844 pysollib/game.py:850 #: pysollib/game.py:848 pysollib/game.py:854
msgid "Player\n" msgid "Player\n"
msgstr "" msgstr ""
#: pysollib/game.py:921 #: pysollib/game.py:925
msgid "Discard current game ?" msgid "Discard current game ?"
msgstr "" msgstr ""
#: pysollib/game.py:1265 #: pysollib/game.py:1269
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
"#%d in the %s of playing time" "#%d in the %s of playing time"
msgstr "" msgstr ""
#: pysollib/game.py:1268 #: pysollib/game.py:1272
msgid "" msgid ""
"\n" "\n"
"and #%d in the %s of moves" "and #%d in the %s of moves"
msgstr "" msgstr ""
#: pysollib/game.py:1270 #: pysollib/game.py:1274
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
"#%d in the %s of moves" "#%d in the %s of moves"
msgstr "" msgstr ""
#: pysollib/game.py:1273 #: pysollib/game.py:1277
msgid "" msgid ""
"\n" "\n"
"and #%d in the %s of total moves" "and #%d in the %s of total moves"
msgstr "" msgstr ""
#: pysollib/game.py:1275 #: pysollib/game.py:1279
msgid "" msgid ""
"\n" "\n"
"You have reached\n" "You have reached\n"
"#%d in the %s of total moves" "#%d in the %s of total moves"
msgstr "" msgstr ""
#: pysollib/game.py:1302 pysollib/game.py:1318 #: pysollib/game.py:1306 pysollib/game.py:1322
#: pysollib/tk/soundoptionsdialog.py:100 #: pysollib/tk/soundoptionsdialog.py:100
msgid "Game won" msgid "Game won"
msgstr "" msgstr ""
#: pysollib/game.py:1303 #: pysollib/game.py:1307
msgid "" msgid ""
"\n" "\n"
"Congratulations, this\n" "Congratulations, this\n"
@ -338,12 +335,7 @@ msgid ""
"%s\n" "%s\n"
msgstr "" msgstr ""
#: pysollib/game.py:1311 pysollib/game.py:1326 pysollib/game.py:1333 #: pysollib/game.py:1323
#: pysollib/game.py:1339 pysollib/tk/menubar.py:363
msgid "&New game"
msgstr ""
#: pysollib/game.py:1319
msgid "" msgid ""
"\n" "\n"
"Congratulations, you did it !\n" "Congratulations, you did it !\n"
@ -353,100 +345,100 @@ msgid ""
"%s\n" "%s\n"
msgstr "" msgstr ""
#: pysollib/game.py:1331 pysollib/game.py:1337 #: pysollib/game.py:1335 pysollib/game.py:1341
#: pysollib/tk/soundoptionsdialog.py:98 #: pysollib/tk/soundoptionsdialog.py:98
msgid "Game finished" msgid "Game finished"
msgstr "" msgstr ""
#: pysollib/game.py:1332 pysollib/game.py:1862 #: pysollib/game.py:1336 pysollib/game.py:1866
msgid "" msgid ""
"\n" "\n"
"Game finished\n" "Game finished\n"
msgstr "" msgstr ""
#: pysollib/game.py:1338 #: pysollib/game.py:1342
msgid "" msgid ""
"\n" "\n"
"Game finished, but not without my help...\n" "Game finished, but not without my help...\n"
msgstr "" msgstr ""
#: pysollib/game.py:1339 #: pysollib/game.py:1343
msgid "&Restart" msgid "&Restart"
msgstr "" msgstr ""
#: pysollib/game.py:1753 #: pysollib/game.py:1757
msgid "Score %6d" msgid "Score %6d"
msgstr "" msgstr ""
#: pysollib/game.py:1852 #: pysollib/game.py:1856
msgid "&Cool" msgid "&Cool"
msgstr "" msgstr ""
#: pysollib/game.py:1852 #: pysollib/game.py:1856
msgid "&Great" msgid "&Great"
msgstr "" msgstr ""
#: pysollib/game.py:1852 #: pysollib/game.py:1856
msgid "&Wow" msgid "&Wow"
msgstr "" msgstr ""
#: pysollib/game.py:1852 #: pysollib/game.py:1856
msgid "&Yeah" msgid "&Yeah"
msgstr "" msgstr ""
#: pysollib/game.py:1853 pysollib/game.py:1865 pysollib/game.py:1878 #: pysollib/game.py:1857 pysollib/game.py:1869 pysollib/game.py:1882
msgid " Autopilot" msgid " Autopilot"
msgstr "" msgstr ""
#: pysollib/game.py:1854 #: pysollib/game.py:1858
msgid "" msgid ""
"\n" "\n"
"Game solved in %d moves.\n" "Game solved in %d moves.\n"
msgstr "" msgstr ""
#: pysollib/game.py:1877 #: pysollib/game.py:1881
msgid "&Hmm" msgid "&Hmm"
msgstr "" msgstr ""
#: pysollib/game.py:1877 #: pysollib/game.py:1881
msgid "&Oh well" msgid "&Oh well"
msgstr "" msgstr ""
#: pysollib/game.py:1877 #: pysollib/game.py:1881
msgid "&That's life" msgid "&That's life"
msgstr "" msgstr ""
#: pysollib/game.py:1879 #: pysollib/game.py:1883
msgid "" msgid ""
"\n" "\n"
"This won't come out...\n" "This won't come out...\n"
msgstr "" msgstr ""
#: pysollib/game.py:2291 #: pysollib/game.py:2295
msgid "Set bookmark" msgid "Set bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2292 #: pysollib/game.py:2296
msgid "Replace existing bookmark %d ?" msgid "Replace existing bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2314 #: pysollib/game.py:2318
msgid "Goto bookmark" msgid "Goto bookmark"
msgstr "" msgstr ""
#: pysollib/game.py:2315 #: pysollib/game.py:2319
msgid "Goto bookmark %d ?" msgid "Goto bookmark %d ?"
msgstr "" msgstr ""
#: pysollib/game.py:2346 #: pysollib/game.py:2350
msgid "Open game" msgid "Open game"
msgstr "" msgstr ""
#: pysollib/game.py:2357 pysollib/game.py:2366 pysollib/game.py:2371 #: pysollib/game.py:2361 pysollib/game.py:2370 pysollib/game.py:2375
msgid "Load game error" msgid "Load game error"
msgstr "" msgstr ""
#: pysollib/game.py:2358 #: pysollib/game.py:2362
msgid "" msgid ""
"Error while loading game.\n" "Error while loading game.\n"
"\n" "\n"
@ -454,22 +446,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:2367 #: pysollib/game.py:2371
msgid "Error while loading game" msgid "Error while loading game"
msgstr "" msgstr ""
#: pysollib/game.py:2372 #: pysollib/game.py:2376
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:2397 #: pysollib/game.py:2401
msgid "Save game error" msgid "Save game error"
msgstr "" msgstr ""
#: pysollib/game.py:2398 #: pysollib/game.py:2402
msgid "Error while saving game" msgid "Error while saving game"
msgstr "" msgstr ""
@ -683,7 +675,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:752 #: pysollib/games/numerica.py:644 pysollib/games/numerica.py:757
msgid "Tableau. Build regardless of rank and suit." msgid "Tableau. Build regardless of rank and suit."
msgstr "" msgstr ""
@ -801,7 +793,7 @@ msgstr ""
msgid "Deal %d" msgid "Deal %d"
msgstr "" msgstr ""
#: pysollib/games/numerica.py:259 pysollib/games/royalcotillion.py:840 #: pysollib/games/numerica.py:259 pysollib/games/royalcotillion.py:849
msgid "Foundation. Build up by color." msgid "Foundation. Build up by color."
msgstr "" msgstr ""
@ -1235,7 +1227,7 @@ msgstr ""
msgid " Help" msgid " Help"
msgstr "" msgstr ""
#: pysollib/main.py:67 pysollib/main.py:386 #: pysollib/main.py:67 pysollib/main.py:282
msgid " installation error" msgid " installation error"
msgstr "" msgstr ""
@ -1249,7 +1241,7 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:75 pysollib/main.py:394 pysollib/tk/menubar.py:382 #: pysollib/main.py:75 pysollib/main.py:290 pysollib/tk/menubar.py:382
msgid "&Quit" msgid "&Quit"
msgstr "" msgstr ""
@ -1289,7 +1281,7 @@ msgid ""
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:387 #: pysollib/main.py:283
msgid "" msgid ""
"\n" "\n"
"No games were found !!!\n" "No games were found !!!\n"
@ -1300,25 +1292,25 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:473 pysollib/main.py:481 #: pysollib/main.py:369 pysollib/main.py:377
msgid " installation problem" msgid " installation problem"
msgstr "" msgstr ""
#: pysollib/main.py:474 #: pysollib/main.py:370
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:482 #: pysollib/main.py:378
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:489 #: pysollib/main.py:385
msgid "Welcome to " msgid "Welcome to "
msgstr "" msgstr ""
@ -1801,76 +1793,84 @@ msgstr ""
msgid "Free cell." msgid "Free cell."
msgstr "" msgstr ""
#: pysollib/stats.py:118 pysollib/tk/tkstats.py:78 #: pysollib/stats.py:53 pysollib/stats.py:119
msgid "Demo games" msgid "Game"
msgstr "" msgstr ""
#: pysollib/stats.py:119 #: pysollib/stats.py:54
msgid "Played" msgid "Played"
msgstr "" msgstr ""
#: pysollib/stats.py:120 pysollib/stats.py:200 #: pysollib/stats.py:55 pysollib/stats.py:158
msgid "Won" msgid "Won"
msgstr "" msgstr ""
#: pysollib/stats.py:121 pysollib/stats.py:200 #: pysollib/stats.py:56 pysollib/stats.py:158
msgid "Lost" msgid "Lost"
msgstr "" msgstr ""
#: pysollib/stats.py:122 pysollib/tk/statusbar.py:156 #: pysollib/stats.py:57 pysollib/tk/statusbar.py:156
#: data/glade-translations:25 #: data/glade-translations:25
msgid "Playing time" msgid "Playing time"
msgstr "" msgstr ""
#: pysollib/stats.py:123 data/glade-translations:26 #: pysollib/stats.py:58 data/glade-translations:26
msgid "Moves" msgid "Moves"
msgstr "" msgstr ""
#: pysollib/stats.py:124 #: pysollib/stats.py:59
msgid "% won" msgid "% won"
msgstr "" msgstr ""
#: pysollib/stats.py:153 #: pysollib/stats.py:119
msgid "Total (%d out of %d games)"
msgstr ""
#: pysollib/stats.py:162
msgid "Game"
msgstr ""
#: pysollib/stats.py:162
msgid "Status" msgid "Status"
msgstr "" msgstr ""
#: pysollib/stats.py:162 pysollib/tk/statusbar.py:158 #: pysollib/stats.py:119 pysollib/tk/statusbar.py:158
#: pysollib/tk/tkstats.py:735 #: pysollib/tk/tkstats.py:666
msgid "Game number" msgid "Game number"
msgstr "" msgstr ""
#: pysollib/stats.py:162 pysollib/tk/tkstats.py:738 #: pysollib/stats.py:119 pysollib/tk/tkstats.py:669
msgid "Started at" msgid "Started at"
msgstr "" msgstr ""
#: pysollib/stats.py:185 #: pysollib/stats.py:143
msgid "** UNKNOWN %d **" msgid "** UNKNOWN %d **"
msgstr "" msgstr ""
#: pysollib/stats.py:193 #: pysollib/stats.py:151
msgid "** ERROR **" msgid "** ERROR **"
msgstr "" msgstr ""
#: pysollib/stats.py:200 #: pysollib/stats.py:158
msgid "Loaded" msgid "Loaded"
msgstr "" msgstr ""
#: pysollib/stats.py:200 #: pysollib/stats.py:158
msgid "Not won" msgid "Not won"
msgstr "" msgstr ""
#: pysollib/stats.py:200 #: pysollib/stats.py:158
msgid "Perfect" msgid "Perfect"
msgstr "" msgstr ""
#: pysollib/stats.py:205 pysollib/stats.py:236 pysollib/stats.py:242
msgid "Demo"
msgstr ""
#: pysollib/stats.py:216 pysollib/tk/tkstats.py:418
msgid "Total (%d out of %d games)"
msgstr ""
#: pysollib/stats.py:237
msgid "Full log for "
msgstr ""
#: pysollib/stats.py:243
msgid "Session log for "
msgstr ""
#: pysollib/tk/colorsdialog.py:71 data/glade-translations:41 #: pysollib/tk/colorsdialog.py:71 data/glade-translations:41
msgid "Text foreground:" msgid "Text foreground:"
msgstr "" msgstr ""
@ -2792,12 +2792,12 @@ msgstr ""
msgid "Lost:" msgid "Lost:"
msgstr "" msgstr ""
#: pysollib/tk/selectgame.py:373 pysollib/tk/tkstats.py:805 #: pysollib/tk/selectgame.py:373 pysollib/tk/tkstats.py:736
#: data/glade-translations:18 #: data/glade-translations:18
msgid "Playing time:" msgid "Playing time:"
msgstr "" msgstr ""
#: pysollib/tk/selectgame.py:374 pysollib/tk/tkstats.py:812 #: pysollib/tk/selectgame.py:374 pysollib/tk/tkstats.py:743
#: data/glade-translations:19 #: data/glade-translations:19
msgid "Moves:" msgid "Moves:"
msgstr "" msgstr ""
@ -3034,6 +3034,10 @@ msgstr ""
msgid "Unable to service request:\n" msgid "Unable to service request:\n"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:78
msgid "Demo games"
msgstr ""
#: pysollib/tk/tkstats.py:95 data/glade-translations:16 #: pysollib/tk/tkstats.py:95 data/glade-translations:16
msgid "Total" msgid "Total"
msgstr "" msgstr ""
@ -3059,140 +3063,128 @@ msgstr ""
msgid "&Reset..." msgid "&Reset..."
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:574 pysollib/tk/tkstats.py:647 #: pysollib/tk/tkstats.py:513 pysollib/tk/tkstats.py:579
#: pysollib/tk/tkstats.py:663 #: pysollib/tk/tkstats.py:594
msgid "&Save to file" msgid "&Save to file"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:575 #: pysollib/tk/tkstats.py:514
msgid "&Reset all..." msgid "&Reset all..."
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:625 #: pysollib/tk/tkstats.py:579
msgid "No entries for player "
msgstr ""
#: pysollib/tk/tkstats.py:642
msgid "No log entries for %s\n"
msgstr ""
#: pysollib/tk/tkstats.py:647
msgid "Session &log..." msgid "Session &log..."
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:658 #: pysollib/tk/tkstats.py:594
msgid "No current session log entries for %s\n"
msgstr ""
#: pysollib/tk/tkstats.py:663
msgid "&Full log..." msgid "&Full log..."
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:678 #: pysollib/tk/tkstats.py:609
msgid "Highlight piles: " msgid "Highlight piles: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:679 #: pysollib/tk/tkstats.py:610
msgid "Highlight cards: " msgid "Highlight cards: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:680 #: pysollib/tk/tkstats.py:611
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:683 #: pysollib/tk/tkstats.py:614
msgid "" msgid ""
"\n" "\n"
"Redeals: " "Redeals: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:684 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
"\n" "\n"
"Cards in Talon: " "Cards in Talon: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:686 #: pysollib/tk/tkstats.py:617
msgid "" msgid ""
"\n" "\n"
"Cards in Waste: " "Cards in Waste: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:688 #: pysollib/tk/tkstats.py:619
msgid "" msgid ""
"\n" "\n"
"Cards in Foundations: " "Cards in Foundations: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:691 #: pysollib/tk/tkstats.py:622
msgid "Game status" msgid "Game status"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:694 #: pysollib/tk/tkstats.py:625
msgid "Playing time: " msgid "Playing time: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:695 #: pysollib/tk/tkstats.py:626
msgid "Started at: " msgid "Started at: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:696 #: pysollib/tk/tkstats.py:627
msgid "Moves: " msgid "Moves: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:697 #: pysollib/tk/tkstats.py:628
msgid "Undo moves: " msgid "Undo moves: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:698 #: pysollib/tk/tkstats.py:629
msgid "Bookmark moves: " msgid "Bookmark moves: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:699 #: pysollib/tk/tkstats.py:630
msgid "Demo moves: " msgid "Demo moves: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:700 #: pysollib/tk/tkstats.py:631
msgid "Total player moves: " msgid "Total player moves: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:701 #: pysollib/tk/tkstats.py:632
msgid "Total moves in this game: " msgid "Total moves in this game: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:702 #: pysollib/tk/tkstats.py:633
msgid "Hints: " msgid "Hints: "
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:706 #: pysollib/tk/tkstats.py:637
msgid "&Statistics..." msgid "&Statistics..."
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:732 #: pysollib/tk/tkstats.py:663
msgid "N" msgid "N"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:741 #: pysollib/tk/tkstats.py:672
msgid "Result" msgid "Result"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:797 data/glade-translations:21 #: pysollib/tk/tkstats.py:728 data/glade-translations:21
msgid "Minimum" msgid "Minimum"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:798 data/glade-translations:22 #: pysollib/tk/tkstats.py:729 data/glade-translations:22
msgid "Maximum" msgid "Maximum"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:799 data/glade-translations:23 #: pysollib/tk/tkstats.py:730 data/glade-translations:23
msgid "Average" msgid "Average"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:819 data/glade-translations:20 #: pysollib/tk/tkstats.py:750 data/glade-translations:20
msgid "Total moves:" msgid "Total moves:"
msgstr "" msgstr ""
#: pysollib/tk/tkstats.py:850 #: pysollib/tk/tkstats.py:781
msgid "No TOP for this game" msgid "No TOP for this game"
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: Sat Oct 7 20:02:33 2006\n" "POT-Creation-Date: Tue Oct 31 19:32:40 2006\n"
"PO-Revision-Date: 2006-10-08 18:43+0400\n" "PO-Revision-Date: 2006-10-31 19:57+0300\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"
@ -774,6 +774,10 @@ msgstr "Двойной Золотой рудник"
msgid "Double Grasshopper" msgid "Double Grasshopper"
msgstr "Двойной кузнечик" msgstr "Двойной кузнечик"
#, fuzzy
msgid "Double Kingsley"
msgstr "Двойной Бисли"
msgid "Double Klondike" msgid "Double Klondike"
msgstr "Двойной Клондайк" msgstr "Двойной Клондайк"
@ -953,9 +957,8 @@ msgstr "Экспресс"
msgid "Eye" msgid "Eye"
msgstr "Глаз" msgstr "Глаз"
#, fuzzy
msgid "F-15 Eagle" msgid "F-15 Eagle"
msgstr "Маджонг F-15 Eagle" msgstr "F-15 Eagle"
msgid "Faerie Queen" msgid "Faerie Queen"
msgstr "Королева фей" msgstr "Королева фей"
@ -1538,6 +1541,10 @@ msgstr "Короли"
msgid "Kingsdown Eights" msgid "Kingsdown Eights"
msgstr "" msgstr ""
#, fuzzy
msgid "Kingsley"
msgstr "Короли"
msgid "Klondike" msgid "Klondike"
msgstr "Клондайк" msgstr "Клондайк"
@ -2677,6 +2684,9 @@ msgstr ""
msgid "Pegged Triangle 2" msgid "Pegged Triangle 2"
msgstr "" msgstr ""
msgid "Penelope's Web"
msgstr ""
msgid "Penguin" msgid "Penguin"
msgstr "Пингвин" msgstr "Пингвин"
@ -2995,6 +3005,9 @@ msgstr "Саксония"
msgid "Scarab" msgid "Scarab"
msgstr "Скарабей" msgstr "Скарабей"
msgid "Scarp"
msgstr "Откос"
msgid "Scheidungsgrund" msgid "Scheidungsgrund"
msgstr "Scheidungsgrund" msgstr "Scheidungsgrund"
@ -3317,7 +3330,6 @@ msgstr "Улицы"
msgid "Streets and Alleys" msgid "Streets and Alleys"
msgstr "Улицы и аллеи" msgstr "Улицы и аллеи"
#, fuzzy
msgid "Striptease" msgid "Striptease"
msgstr "Стриптиз" msgstr "Стриптиз"
@ -3414,13 +3426,11 @@ msgstr "Сад"
msgid "The Great Wall" msgid "The Great Wall"
msgstr "Великая Стена" msgstr "Великая Стена"
#, fuzzy
msgid "The Last Monarch" msgid "The Last Monarch"
msgstr "Последний Монарх" msgstr "Последний Монарх"
#, fuzzy
msgid "The Last Monarch II" msgid "The Last Monarch II"
msgstr "Последний Монарх" msgstr "Последний Монарх II"
msgid "The Little Corporal" msgid "The Little Corporal"
msgstr "Маленький Капрал" msgstr "Маленький Капрал"
@ -3515,6 +3525,10 @@ msgstr "Маджонг Traditional Reviewed"
msgid "Trapdoor" msgid "Trapdoor"
msgstr "Люк" msgstr "Люк"
#, fuzzy
msgid "Trapdoor Spider"
msgstr "Люк"
msgid "Treasure Trove" msgid "Treasure Trove"
msgstr "Клад" msgstr "Клад"
@ -3648,7 +3662,7 @@ msgid "Victory Arrow"
msgstr "Маджонг Victory Arrow" msgstr "Маджонг Victory Arrow"
msgid "Virginia Reel" msgid "Virginia Reel"
msgstr "" msgstr "Виргинский Рил"
#, fuzzy #, fuzzy
msgid "Wake-Robin" msgid "Wake-Robin"
@ -3767,26 +3781,3 @@ msgstr ""
msgid "Zodiac" msgid "Zodiac"
msgstr "Зодиак" msgstr "Зодиак"
#~ msgid "Leo"
#~ msgstr "Лев"
#~ msgid "Mahjongg Leo"
#~ msgstr "Маджонг Лев"
#, fuzzy
#~ msgid "Big Ground"
#~ msgstr "Большая гора"
#, fuzzy
#~ msgid "Tri Peaks"
#~ msgstr "Три вершины"
#~ msgid "Ground for a Divorce (3 decks)"
#~ msgstr "Повод для разрыва (3 колоды)"
#~ msgid "Ground for a Divorce (4 decks)"
#~ msgstr "Повод для разрыва (4 колоды)"
#~ msgid "Triple York"
#~ msgstr "Тройной Йорк"

File diff suppressed because it is too large Load diff

58
pysol
View file

@ -1,20 +1,8 @@
#! /usr/bin/env python #!/usr/bin/env python
## -*- coding: iso-8859-1 -*-
##
## vim:ts=4:et:nowrap
##
##---------------------------------------------------------------------------## ##---------------------------------------------------------------------------##
## ##
## PySol -- a Python Solitaire game ## PySol -- a Python Solitaire game
## ##
## Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
## All Rights Reserved.
##
## This program is free software; you can redistribute it and/or modify ## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or ## the Free Software Foundation; either version 2 of the License, or
@ -30,48 +18,14 @@
## If not, write to the Free Software Foundation, Inc., ## If not, write to the Free Software Foundation, Inc.,
## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
## ##
## Markus F.X.J. Oberhumer
## <markus@oberhumer.com>
## http://www.oberhumer.com/pysol
##
##---------------------------------------------------------------------------## ##---------------------------------------------------------------------------##
import sys, os
if os.name == 'nt' and not os.environ.has_key('LANG'):
try:
import locale
l = locale.getdefaultlocale()
os.environ['LANG'] = l[0]
except:
pass
##locale.setlocale(locale.LC_ALL, '')
import gettext
##locale_dir = 'locale'
locale_dir = None
if os.path.isdir(sys.path[0]):
d = os.path.join(sys.path[0], 'locale')
else:
# i.e. library.zip
d = os.path.join(os.path.dirname(sys.path[0]), 'locale')
if os.path.exists(d) and os.path.isdir(d):
locale_dir = d
##if locale_dir: locale_dir = os.path.normpath(locale_dir)
gettext.install('pysol', locale_dir, unicode=True)
## init toolkit
import pysollib.settings
if '--tile' in sys.argv:
#pysollib.settings.TOOLKIT = 'gtk'
pysollib.settings.USE_TILE = True
sys.argv.remove('--tile')
elif '--gtk' in sys.argv:
pysollib.settings.TOOLKIT = 'gtk'
sys.argv.remove('--gtk')
from pysollib.main import main
#import pychecker.checker #import pychecker.checker
from pysollib.init import init
init()
import sys
from pysollib.main import main
sys.exit(main(sys.argv)) sys.exit(main(sys.argv))

View file

@ -58,7 +58,7 @@ from settings import TOP_SIZE, TOP_TITLE, TOOLKIT
# Toolkit imports # Toolkit imports
from pysoltk import wm_withdraw, loadImage from pysoltk import wm_withdraw, loadImage
from pysoltk import MfxMessageDialog, MfxExceptionDialog from pysoltk import MfxDialog, MfxMessageDialog, MfxExceptionDialog
from pysoltk import TclError, MfxRoot, MfxCanvas, MfxScrolledCanvas from pysoltk import TclError, MfxRoot, MfxCanvas, MfxScrolledCanvas
from pysoltk import PysolMenubar from pysoltk import PysolMenubar
from pysoltk import PysolProgressBar from pysoltk import PysolProgressBar
@ -123,8 +123,8 @@ class Options:
# sound # sound
self.sound = True self.sound = True
self.sound_mode = 1 self.sound_mode = 1
self.sound_sample_volume = 128 self.sound_sample_volume = 80
self.sound_music_volume = 128 self.sound_music_volume = 100
self.sound_samples = { self.sound_samples = {
'areyousure' : True, 'areyousure' : True,
'autodrop' : True, 'autodrop' : True,
@ -230,7 +230,6 @@ class Options:
CSI.TYPE_TAROCK: ("Vienna 2K", ""), CSI.TYPE_TAROCK: ("Vienna 2K", ""),
CSI.TYPE_HEXADECK: ("Hex A Deck", ""), CSI.TYPE_HEXADECK: ("Hex A Deck", ""),
CSI.TYPE_MUGHAL_GANJIFA: ("Mughal Ganjifa", ""), CSI.TYPE_MUGHAL_GANJIFA: ("Mughal Ganjifa", ""),
##CSI.TYPE_MUGHAL_GANJIFA: ("Dashavatara Ganjifa", ""),
##CSI.TYPE_NAVAGRAHA_GANJIFA: ("Navagraha Ganjifa", ""), ##CSI.TYPE_NAVAGRAHA_GANJIFA: ("Navagraha Ganjifa", ""),
CSI.TYPE_NAVAGRAHA_GANJIFA: ("Dashavatara Ganjifa", ""), CSI.TYPE_NAVAGRAHA_GANJIFA: ("Dashavatara Ganjifa", ""),
CSI.TYPE_DASHAVATARA_GANJIFA: ("Dashavatara Ganjifa", ""), CSI.TYPE_DASHAVATARA_GANJIFA: ("Dashavatara Ganjifa", ""),
@ -423,23 +422,25 @@ class Statistics:
return won, lost return won, lost
def updateStats(self, player, game, status): def updateStats(self, player, game, status):
return self.updateLog(player, game, status)
def updateLog(self, player, game, status):
ret = None ret = None
log = (game.id, game.getGameNumber(format=0), status, log = (game.id, game.getGameNumber(format=0), status,
game.gstats.start_time, game.gstats.total_elapsed_time, game.gstats.start_time, game.gstats.total_elapsed_time,
VERSION_TUPLE, game.getGameScore(), game.getGameScoreCasino(), VERSION_TUPLE, game.getGameScore(), game.getGameScoreCasino(),
game.GAME_VERSION) game.GAME_VERSION)
# full log # full log
if player is not None and status >= 0: if status >= 0:
if not self.prev_games.has_key(player): if player is None:
self.prev_games[player] = [] # demo
self.prev_games[player].append(log) ret = self.updateGameStat(player, game, status)
if not self.all_prev_games.has_key(player): else:
self.all_prev_games[player] = [] # player
self.all_prev_games[player].append(log) if not self.prev_games.has_key(player):
ret = self.updateGameStat(player, game, status) self.prev_games[player] = []
self.prev_games[player].append(log)
if not self.all_prev_games.has_key(player):
self.all_prev_games[player] = []
self.all_prev_games[player].append(log)
ret = self.updateGameStat(player, game, status)
# session log # session log
if not self.session_games.has_key(player): if not self.session_games.has_key(player):
self.session_games[player] = [] self.session_games[player] = []
@ -661,7 +662,11 @@ class Application:
# create the canvas # create the canvas
self.scrolled_canvas = MfxScrolledCanvas(self.top) self.scrolled_canvas = MfxScrolledCanvas(self.top)
self.canvas = self.scrolled_canvas.canvas self.canvas = self.scrolled_canvas.canvas
self.scrolled_canvas.grid(row=1, column=1, sticky='nsew') if os.name == 'nt':
self.scrolled_canvas.grid(row=1, column=1, sticky='nsew',
padx=1, pady=1)
else:
self.scrolled_canvas.grid(row=1, column=1, sticky='nsew')
self.top.grid_columnconfigure(1, weight=1) self.top.grid_columnconfigure(1, weight=1)
self.top.grid_rowconfigure(1, weight=1) self.top.grid_rowconfigure(1, weight=1)
self.setTile(self.tabletile_index, force=True) self.setTile(self.tabletile_index, force=True)
@ -873,7 +878,6 @@ class Application:
## self.gimages.stats.append(self.dataloader.findImage(f, dir)) ## self.gimages.stats.append(self.dataloader.findImage(f, dir))
def loadImages3(self): def loadImages3(self):
MfxMessageDialog.img = {}
if os.name == 'posix': if os.name == 'posix':
dir = os.path.join('images', 'dialog', 'bluecurve') dir = os.path.join('images', 'dialog', 'bluecurve')
else: else:
@ -882,15 +886,16 @@ class Application:
fn = self.dataloader.findImage(f, dir) fn = self.dataloader.findImage(f, dir)
im = loadImage(fn) im = loadImage(fn)
MfxMessageDialog.img[f] = im MfxMessageDialog.img[f] = im
## MfxMessageDialog.button_img = {} if 0 and TOOLKIT == 'tk':
## dir = os.path.join('images', 'buttons', 'bluecurve') dir = os.path.join('images', 'buttons', 'bluecurve')
## for n, f in ( for n, f in (
## (_('OK'), 'ok'), (_('&OK'), 'ok'),
## (_('Cancel'), 'cancel'), (_('&Cancel'), 'cancel'),
## ): (_('&New game'), 'new'),
## fn = self.dataloader.findImage(f, dir) ):
## im = loadImage(fn) fn = self.dataloader.findImage(f, dir)
## MfxMessageDialog.button_img[n] = im im = loadImage(fn)
MfxDialog.button_img[n] = im
SelectDialogTreeData.img = [] SelectDialogTreeData.img = []
dir = os.path.join('images', 'tree') dir = os.path.join('images', 'tree')
for f in ('folder', 'openfolder', 'node', 'emptynode'): for f in ('folder', 'openfolder', 'node', 'emptynode'):

View file

@ -1282,9 +1282,9 @@ class Game:
# only update the session log # only update the session log
if self.app.opt.update_player_stats: if self.app.opt.update_player_stats:
if self.gstats.loaded: if self.gstats.loaded:
self.app.stats.updateLog(self.app.opt.player, self, -2) self.app.stats.updateStats(self.app.opt.player, self, -2)
elif self.gstats.updated == 0 and self.stats.demo_updated == 0: elif self.gstats.updated == 0 and self.stats.demo_updated == 0:
self.app.stats.updateLog(self.app.opt.player, self, -1) self.app.stats.updateStats(self.app.opt.player, self, -1)
return '' return ''
def checkForWin(self): def checkForWin(self):

View file

@ -210,12 +210,13 @@ class StrategyPlus(Strategy):
def fillStack(self, stack): def fillStack(self, stack):
if stack is self.s.talon and stack.cards: if stack is self.s.talon and stack.cards:
c = stack.cards[-1] c = stack.cards[-1]
if c.rank == ACE: while c.rank == ACE:
old_state = self.enterState(self.S_FILL) old_state = self.enterState(self.S_FILL)
self.moveMove(1, stack, self.s.foundations[c.suit]) self.moveMove(1, stack, self.s.foundations[c.suit])
if stack.canFlipCard(): if stack.canFlipCard():
stack.flipMove() stack.flipMove()
self.leaveState(old_state) self.leaveState(old_state)
c = stack.cards[-1]
# /*********************************************************************** # /***********************************************************************

View file

@ -697,7 +697,7 @@ class Rittenhouse(Game):
talon = self.s.talon talon = self.s.talon
self.startDealSample() self.startDealSample()
while talon.cards: while talon.cards:
talon.dealRowAvail() talon.dealRowAvail(frames=3)
self.fillAll() self.fillAll()
def fillAll(self): def fillAll(self):
@ -801,6 +801,7 @@ class SelectiveCastle(StreetsAndAlleys, Chessboard):
# ************************************************************************/ # ************************************************************************/
class Soother(Game): class Soother(Game):
Hint_Class = CautiousDefaultHint
def createGame(self, rows=9): def createGame(self, rows=9):
l, s = Layout(self), self.s l, s = Layout(self), self.s

View file

@ -55,6 +55,7 @@ from spider import Spider_Hint
class DoubleKlondike(Game): class DoubleKlondike(Game):
Layout_Method = Layout.harpLayout Layout_Method = Layout.harpLayout
Foundation_Class = SS_FoundationStack
RowStack_Class = KingAC_RowStack RowStack_Class = KingAC_RowStack
Hint_Class = KlondikeType_Hint Hint_Class = KlondikeType_Hint
@ -69,7 +70,7 @@ class DoubleKlondike(Game):
max_rounds=max_rounds, num_deal=num_deal) max_rounds=max_rounds, num_deal=num_deal)
s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self)
for r in l.s.foundations: for r in l.s.foundations:
s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=r.suit))
for r in l.s.rows: for r in l.s.rows:
s.rows.append(self.RowStack_Class(r.x, r.y, self)) s.rows.append(self.RowStack_Class(r.x, r.y, self))
# default # default
@ -278,6 +279,19 @@ class Delivery(BigDeal):
self.s.talon.dealCards() # deal first card to WasteStack self.s.talon.dealCards() # deal first card to WasteStack
# /***********************************************************************
# // Double Kingsley
# ************************************************************************/
class DoubleKingsley(DoubleKlondike):
Foundation_Class = StackWrapper(SS_FoundationStack, base_rank=KING, dir=-1)
RowStack_Class = StackWrapper(KingAC_RowStack, base_rank=ACE, dir=1)
def createGame(self):
DoubleKlondike.createGame(self, max_rounds=1)
# register the game # register the game
registerGame(GameInfo(21, DoubleKlondike, "Double Klondike", registerGame(GameInfo(21, DoubleKlondike, "Double Klondike",
GI.GT_KLONDIKE, 2, -1, GI.SL_BALANCED)) GI.GT_KLONDIKE, 2, -1, GI.SL_BALANCED))
@ -309,5 +323,8 @@ registerGame(GameInfo(590, ChineseKlondike, "Chinese Klondike",
suits=(0, 1, 2) )) suits=(0, 1, 2) ))
registerGame(GameInfo(591, Pantagruel, "Pantagruel", registerGame(GameInfo(591, Pantagruel, "Pantagruel",
GI.GT_KLONDIKE, 2, 0, GI.SL_BALANCED)) GI.GT_KLONDIKE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(668, DoubleKingsley, "Double Kingsley",
GI.GT_KLONDIKE, 2, 0, GI.SL_BALANCED))

View file

@ -1315,6 +1315,35 @@ class Athena(Klondike):
self.s.talon.dealCards() self.s.talon.dealCards()
# /***********************************************************************
# // Kingsley
# ************************************************************************/
class Kingsley(Klondike):
Foundation_Class = StackWrapper(SS_FoundationStack, base_rank=KING, dir=-1)
RowStack_Class = StackWrapper(KingAC_RowStack, base_rank=ACE, dir=1)
def createGame(self):
Klondike.createGame(self, max_rounds=1)
# /***********************************************************************
# // Scarp
# ************************************************************************/
class Scarp(Klondike):
Talon_Class = DealRowTalonStack
RowStack_Class = AC_RowStack
def createGame(self):
Klondike.createGame(self, max_rounds=1, rows=13, waste=0, playcards=28)
def startGame(self):
Klondike.startGame(self, flip=1)
# register the game # register the game
registerGame(GameInfo(2, Klondike, "Klondike", registerGame(GameInfo(2, Klondike, "Klondike",
GI.GT_KLONDIKE, 1, -1, GI.SL_BALANCED)) GI.GT_KLONDIKE, 1, -1, GI.SL_BALANCED))
@ -1452,5 +1481,9 @@ registerGame(GameInfo(634, Chinaman, "Chinaman",
GI.GT_KLONDIKE, 1, 1, GI.SL_BALANCED)) GI.GT_KLONDIKE, 1, 1, GI.SL_BALANCED))
registerGame(GameInfo(651, EightByEight, "Eight by Eight", registerGame(GameInfo(651, EightByEight, "Eight by Eight",
GI.GT_KLONDIKE, 2, 2, GI.SL_BALANCED)) GI.GT_KLONDIKE, 2, 2, GI.SL_BALANCED))
registerGame(GameInfo(667, Kingsley, "Kingsley",
GI.GT_KLONDIKE, 1, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(669, Scarp, "Scarp",
GI.GT_GYPSY | GI.GT_ORIGINAL, 3, 0, GI.SL_MOSTLY_SKILL))

View file

@ -363,6 +363,7 @@ class Jungle_RowStack(Montana_RowStack):
class Jungle(BlueMoon): class Jungle(BlueMoon):
Talon_Class = StackWrapper(Montana_Talon, max_rounds=2) Talon_Class = StackWrapper(Montana_Talon, max_rounds=2)
RowStack_Class = Jungle_RowStack RowStack_Class = Jungle_RowStack
Hint_Class = Galary_Hint
# /*********************************************************************** # /***********************************************************************

76
pysollib/init.py Normal file
View file

@ -0,0 +1,76 @@
##---------------------------------------------------------------------------##
##
## PySol -- a Python Solitaire game
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; see the file COPYING.
## If not, write to the Free Software Foundation, Inc.,
## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
##---------------------------------------------------------------------------##
import sys, os, locale
import traceback
import gettext
# /***********************************************************************
# // init
# ************************************************************************/
def init():
if os.name == 'nt' and not os.environ.has_key('LANG'):
try:
l = locale.getdefaultlocale()
os.environ['LANG'] = l[0]
except:
pass
##locale.setlocale(locale.LC_ALL, '')
##locale_dir = 'locale'
locale_dir = None
if os.path.isdir(sys.path[0]):
d = os.path.join(sys.path[0], 'locale')
else:
# i.e. library.zip
d = os.path.join(os.path.dirname(sys.path[0]), 'locale')
if os.path.exists(d) and os.path.isdir(d):
locale_dir = d
##if locale_dir: locale_dir = os.path.normpath(locale_dir)
gettext.install('pysol', locale_dir, unicode=True)
## init toolkit
import settings
if '--gtk' in sys.argv:
settings.TOOLKIT = 'gtk'
sys.argv.remove('--gtk')
else:
if '--tile' in sys.argv:
settings.USE_TILE = True
sys.argv.remove('--tile')
elif settings.USE_TILE == 'auto':
# check tile
import Tkinter
root = Tkinter.Tk()
root.withdraw()
settings.USE_TILE = False
try:
tile_version = root.tk.call('package', 'require', 'tile')
except:
pass
else:
if tile_version >= '0.7.8':
settings.USE_TILE = True
#root.destroy()
Tkinter._default_root = None

View file

@ -35,7 +35,7 @@
# imports # imports
import sys, os, re, string, time, types import sys, os, locale
import traceback import traceback
import getopt import getopt
import gettext import gettext

View file

@ -21,7 +21,7 @@
import sys, os import sys, os
n_ = lambda x: x n_ = lambda x: x # for gettext
# #
#PACKAGE = 'PySolFC' #PACKAGE = 'PySolFC'
@ -32,9 +32,11 @@ VERSION = '4.82'
FC_VERSION = '0.9.4' FC_VERSION = '0.9.4'
VERSION_TUPLE = (4, 82) VERSION_TUPLE = (4, 82)
TOOLKIT = 'tk' # or 'gtk' TOOLKIT = 'tk' # or 'gtk'
USE_TILE = False USE_TILE = 'auto' # or True or False
TILE_THEME = 'default' # name of tile's theme TILE_THEME = 'default' # name of tile's theme
if os.name == 'nt':
TILE_THEME = 'winnative'
# data dirs # data dirs
DATA_DIRS = [] DATA_DIRS = []

View file

@ -49,7 +49,6 @@ from gamedb import GI
class PysolStatsFormatter: class PysolStatsFormatter:
def getStatHeader(self): def getStatHeader(self):
return (_("Game"), return (_("Game"),
_("Played"), _("Played"),
@ -203,6 +202,7 @@ class FileStatsFormatter(PysolStatsFormatter):
self.pheader("\n") self.pheader("\n")
def writeStats(self, player, sort_by='name'): def writeStats(self, player, sort_by='name'):
if player is None: player = _('Demo')
header = _("Statistics for ") + player header = _("Statistics for ") + player
self.writeHeader(header, 62) self.writeHeader(header, 62)
header = self.getStatHeader() header = self.getStatHeader()
@ -233,11 +233,13 @@ class FileStatsFormatter(PysolStatsFormatter):
return 1 return 1
def writeFullLog(self, player): def writeFullLog(self, player):
if player is None: player = _('Demo')
header = _("Full log for ") + player header = _("Full log for ") + player
prev_games = self.app.stats.prev_games.get(player) prev_games = self.app.stats.prev_games.get(player)
return self.writeLog(player, header, prev_games) return self.writeLog(player, header, prev_games)
def writeSessionLog(self, player): def writeSessionLog(self, player):
if player is None: player = _('Demo')
header = _("Session log for ") + player header = _("Session log for ") + player
prev_games = self.app.stats.session_games.get(player) prev_games = self.app.stats.session_games.get(player)
return self.writeLog(player, header, prev_games) return self.writeLog(player, header, prev_games)

View file

@ -158,8 +158,6 @@ class Combobox(Widget, Tkinter.Entry):
class Entry(Widget, Tkinter.Entry): class Entry(Widget, Tkinter.Entry):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
if kw.has_key('bg'):
del kw['bg']
Widget.__init__(self, master, "ttk::entry", cnf, kw) Widget.__init__(self, master, "ttk::entry", cnf, kw)
def validate(self): def validate(self):
@ -172,26 +170,21 @@ class Entry(Widget, Tkinter.Entry):
class Label(Widget, Tkinter.Label): class Label(Widget, Tkinter.Label):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
for opt in ('bd', 'bg', 'fg', 'padx', 'pady', 'height',
'highlightbackground', 'highlightthickness'):
if kw.has_key(opt):
del kw[opt]
Widget.__init__(self, master, "ttk::label", cnf, kw) Widget.__init__(self, master, "ttk::label", cnf, kw)
class Frame(Widget, Tkinter.Frame): class Frame(Widget, Tkinter.Frame):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
for opt in ('bd', 'highlightbackground', 'highlightthickness',):
if kw.has_key(opt):
del kw[opt]
Widget.__init__(self, master, "ttk::frame", cnf, kw) Widget.__init__(self, master, "ttk::frame", cnf, kw)
class LabelFrame(Widget, Tkinter.Frame): class SizeGrip(Widget):
def __init__(self, master=None, cnf={}, **kw):
Widget.__init__(self, master, "ttk::sizegrip", cnf, kw)
class LabelFrame(Widget, Tkinter.LabelFrame):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
for opt in ('padx', 'pady',):
if kw.has_key(opt):
del kw[opt]
Widget.__init__(self, master, "ttk::labelframe", cnf, kw) Widget.__init__(self, master, "ttk::labelframe", cnf, kw)
@ -202,8 +195,6 @@ class Menubutton(Widget, Tkinter.Menubutton):
class Scale(Widget, Tkinter.Scale): class Scale(Widget, Tkinter.Scale):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
if kw.has_key('resolution'):
del kw['resolution']
Widget.__init__(self, master, "ttk::scale", cnf, kw) Widget.__init__(self, master, "ttk::scale", cnf, kw)
@ -272,7 +263,8 @@ class Paned(Widget):
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
if not kw.has_key('orient'): if not kw.has_key('orient'):
kw['orient'] = 'horizontal' kw['orient'] = 'horizontal'
Widget.__init__(self, master, "ttk::paned", cnf, kw) ##Widget.__init__(self, master, "ttk::paned", cnf, kw)
Widget.__init__(self, master, "ttk::panedwindow", cnf, kw)
def add(self, subwindow, **kw): def add(self, subwindow, **kw):
"""Adds a new pane to the window. subwindow must be a direct child of """Adds a new pane to the window. subwindow must be a direct child of

View file

@ -85,7 +85,7 @@ class FontChooserDialog(MfxDialog):
frame.pack(expand=True, fill='both', padx=5, pady=10) frame.pack(expand=True, fill='both', padx=5, pady=10)
frame.columnconfigure(0, weight=1) frame.columnconfigure(0, weight=1)
#frame.rowconfigure(1, weight=1) #frame.rowconfigure(1, weight=1)
self.entry = Tkinter.Entry(frame, bg='white') self.entry = Tkinter.Entry(frame)
self.entry.grid(row=0, column=0, columnspan=2, sticky='news') self.entry.grid(row=0, column=0, columnspan=2, sticky='news')
self.entry.insert('end', _('abcdefghABCDEFGH')) self.entry.insert('end', _('abcdefghABCDEFGH'))
self.list_box = Tkinter.Listbox(frame, width=36, exportselection=False) self.list_box = Tkinter.Listbox(frame, width=36, exportselection=False)
@ -144,8 +144,6 @@ class FontChooserDialog(MfxDialog):
kw = KwStruct(kw, kw = KwStruct(kw,
strings=(_("&OK"), _("&Cancel")), strings=(_("&OK"), _("&Cancel")),
default=0, default=0,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)

View file

@ -1119,21 +1119,16 @@ class PysolMenubar(PysolMenubarActions):
def mSelectCardsetDialog(self, *event): def mSelectCardsetDialog(self, *event):
if self._cancelDrag(break_pause=False): return if self._cancelDrag(break_pause=False): return
##strings, default = ("&OK", "&Load", "&Cancel"), 0
strings, default = (None, _("&Load"), _("&Cancel"),), 1
##if os.name == "posix":
strings, default = (None, _("&Load"), _("&Cancel"), _("&Info..."),), 1
t = CARDSET t = CARDSET
key = self.app.nextgame.cardset.index key = self.app.nextgame.cardset.index
d = SelectCardsetDialogWithPreview(self.top, title=_("Select ")+t, d = SelectCardsetDialogWithPreview(self.top, title=_("Select ")+t,
app=self.app, manager=self.app.cardset_manager, key=key, app=self.app, manager=self.app.cardset_manager, key=key)
strings=strings, default=default)
cs = self.app.cardset_manager.get(d.key) cs = self.app.cardset_manager.get(d.key)
if cs is None or d.key == self.app.cardset.index: if cs is None or d.key == self.app.cardset.index:
return return
if d.status == 0 and d.button in (0, 1) and d.key >= 0: if d.status == 0 and d.button == 0 and d.key >= 0:
self.app.nextgame.cardset = cs self.app.nextgame.cardset = cs
if d.button == 1: if d.button == 0:
self._cancelDrag() self._cancelDrag()
self.game.endGame(bookmark=1) self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1) self.game.quitGame(bookmark=1)
@ -1159,10 +1154,6 @@ class PysolMenubar(PysolMenubarActions):
def mOptChangeCardback(self, *event): def mOptChangeCardback(self, *event):
self._mOptCardback(self.app.cardset.backindex + 1) self._mOptCardback(self.app.cardset.backindex + 1)
## def mOptTableTile(self, *event):
## if self._cancelDrag(break_pause=False): return
## self._mOptTableTile(self.tkopt.tabletile.get())
def mOptChangeTableTile(self, *event): def mOptChangeTableTile(self, *event):
if self._cancelDrag(break_pause=False): return if self._cancelDrag(break_pause=False): return
n = self.app.tabletile_manager.len() n = self.app.tabletile_manager.len()

View file

@ -86,8 +86,6 @@ class SelectUserNameDialog(MfxDialog):
strings=(_("&OK"), _("&Cancel")), default=0, strings=(_("&OK"), _("&Cancel")), default=0,
separatorwidth=0, separatorwidth=0,
resizable=0, resizable=0,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)
@ -118,7 +116,7 @@ class PlayerOptionsDialog(MfxDialog):
self.player_var = Tkinter.Entry(frame, exportselection=1, width=w) self.player_var = Tkinter.Entry(frame, exportselection=1, width=w)
self.player_var.insert(0, app.opt.player) self.player_var.insert(0, app.opt.player)
self.player_var.grid(row=1, column=0, sticky='ew', padx=0, pady=5) self.player_var.grid(row=1, column=0, sticky='ew', padx=0, pady=5)
widget = Tkinter.Button(frame, text=_('Select...'), widget = Tkinter.Button(frame, text=_('Choose...'),
command=self.selectUserName) command=self.selectUserName)
widget.grid(row=1, column=1, padx=5, pady=5) widget.grid(row=1, column=1, padx=5, pady=5)
widget = Tkinter.Checkbutton(frame, variable=self.confirm_var, widget = Tkinter.Checkbutton(frame, variable=self.confirm_var,

View file

@ -59,8 +59,7 @@ class PysolProgressBar:
self.top.wm_resizable(0, 0) self.top.wm_resizable(0, 0)
self.top.config(cursor="watch") self.top.config(cursor="watch")
# #
self.frame = Tkinter.Frame(self.top, relief=Tkinter.FLAT, bd=0, self.frame = Tkinter.Frame(self.top, relief='flat', borderwidth=0)
takefocus=0)
self.progress = Tkinter.Progressbar(self.frame, maximum=100, length=250) self.progress = Tkinter.Progressbar(self.frame, maximum=100, length=250)
##style = Tkinter.Style(self.progress) ##style = Tkinter.Style(self.progress)
##style.configure('TProgressbar', background=color) ##style.configure('TProgressbar', background=color)

View file

@ -239,19 +239,17 @@ class SelectCardsetDialogWithPreview(MfxDialog):
def initKw(self, kw): def initKw(self, kw):
kw = KwStruct(kw, kw = KwStruct(kw,
strings=(_("&OK"), _("&Load"), _("&Cancel"),), strings = (_("&Load"), _("&Info..."), _("&Cancel"),),
default=0, default=0,
resizable=1, resizable=1,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)
def mDone(self, button): def mDone(self, button):
if button in (0, 1): # Ok/Load if button in (0, 2): # Load/Cancel
self.key = self.tree.selection_key self.key = self.tree.selection_key
self.tree.n_expansions = 1 # save xyview in any case self.tree.n_expansions = 1 # save xyview in any case
if button in (3, 4): if button == 1: # Info
cs = self.manager.get(self.tree.selection_key) cs = self.manager.get(self.tree.selection_key)
if not cs: if not cs:
return return
@ -399,8 +397,6 @@ class CardsetInfoDialog(MfxDialog):
default=0, default=0,
resizable=1, resizable=1,
separatorwidth=2, separatorwidth=2,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)

View file

@ -267,8 +267,6 @@ class SelectGameDialog(MfxDialog):
strings=(None, None, _("&Cancel"),), default=0, strings=(None, None, _("&Cancel"),), default=0,
separatorwidth=2, separatorwidth=2,
resizable=1, resizable=1,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)

View file

@ -161,8 +161,6 @@ class SelectTileDialogWithPreview(MfxDialog):
default=0, default=0,
resizable=1, resizable=1,
font=None, font=None,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)

View file

@ -143,8 +143,7 @@ class SoundOptionsDialog(MfxDialog):
kw.strings[1] = None kw.strings[1] = None
# #
if Tkinter.TkVersion >= 8.4: if Tkinter.TkVersion >= 8.4:
frame = Tkinter.LabelFrame(top_frame, text=_('Enable samles'), frame = Tkinter.LabelFrame(top_frame, text=_('Enable samles'))
padx=5, pady=5)
else: else:
frame = Tkinter.Frame(top_frame, bd=2, relief='groove') frame = Tkinter.Frame(top_frame, bd=2, relief='groove')
frame.pack(expand=1, fill='both', padx=5, pady=5) frame.pack(expand=1, fill='both', padx=5, pady=5)
@ -173,9 +172,6 @@ class SoundOptionsDialog(MfxDialog):
kw = KwStruct(kw, kw = KwStruct(kw,
strings=strings, strings=strings,
default=0, default=0,
resizable=1,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
) )
return MfxDialog.initKw(self, kw) return MfxDialog.initKw(self, kw)

View file

@ -68,37 +68,30 @@ class MfxStatusbar:
# #
self.padx = 1 self.padx = 1
self.label_relief = 'sunken' self.label_relief = 'sunken'
self.frame = Tkinter.Frame(self.top, bd=1) self.top_frame = Tkinter.Frame(self.top)
self.frame.grid(row=self._row, column=self._column, self.top_frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew', columnspan=self._columnspan, sticky='ew')
padx=1, pady=1) self.frame = Tkinter.Frame(self.top_frame)
#if os.name == "mac": self.frame.pack(side='left', expand=True, fill='both', padx=0, pady=1)
# Tkinter.Label(self.frame, width=2).pack(side='right') ## if os.name == "mac":
if os.name == 'nt': ## Tkinter.Label(self.frame, width=2).pack(side='right')
self.frame.config(relief='raised') ## if os.name == 'nt':
self.padx = 0 ## #self.frame.config(relief='raised')
if 0: ## #self.padx = 1
self.frame.config(bd=0) ## pass
self.label_relief = 'flat' ## if 0:
self.padx = 0 ## self.frame.config(bd=0)
## self.label_relief = 'flat'
## self.padx = 0
# util # util
def _createLabel(self, name, side='left', def _createLabel(self, name, side='left',
fill='none', expand=0, width=0, fill='none', expand=0, width=0,
tooltip=None): tooltip=None):
if 0: frame = Tkinter.Frame(self.frame, borderwidth=1, relief=self.label_relief)
frame = Tkinter.Frame(self.frame, bd=1, relief=self.label_relief, frame.pack(side=side, fill=fill, padx=self.padx, expand=expand)
highlightbackground='#9e9a9e', label = Tkinter.Label(frame, width=width)
highlightthickness=1) label.pack(expand=True, fill='both')
frame.pack(side=side, fill=fill, padx=self.padx, expand=expand)
label = Tkinter.Label(frame, width=width, bd=0)
label.pack(expand=True, fill='both')
else:
label = Tkinter.Label(self.frame, width=width,
relief=self.label_relief, bd=1,
highlightbackground='black'
)
label.pack(side=side, fill=fill, padx=self.padx, expand=expand)
setattr(self, name + "_label", label) setattr(self, name + "_label", label)
self._widgets.append(label) self._widgets.append(label)
if tooltip: if tooltip:
@ -107,6 +100,10 @@ class MfxStatusbar:
b.setText(tooltip) b.setText(tooltip)
return label return label
def _createSizeGrip(self):
sg = Tkinter.SizeGrip(self.top_frame)
sg.pack(side='right', anchor='se')
# #
# public methods # public methods
@ -132,11 +129,11 @@ class MfxStatusbar:
self.top.wm_geometry("") # cancel user-specified geometry self.top.wm_geometry("") # cancel user-specified geometry
if not show: if not show:
# hide # hide
self.frame.grid_forget() self.top_frame.grid_forget()
else: else:
# show # show
self.frame.grid(row=self._row, column=self._column, self.top_frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew') columnspan=self._columnspan, sticky='ew')
self._show = show self._show = show
return True return True
@ -154,7 +151,7 @@ class MfxStatusbar:
class PysolStatusbar(MfxStatusbar): class PysolStatusbar(MfxStatusbar):
def __init__(self, top): def __init__(self, top):
MfxStatusbar.__init__(self, top, row=3, column=0, columnspan=3) MfxStatusbar.__init__(self, top, row=4, column=0, columnspan=3)
# #
for n, t, w in ( for n, t, w in (
("time", _("Playing time"), 10), ("time", _("Playing time"), 10),
@ -167,11 +164,12 @@ 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(padding=(8, 0)) l.config(padding=(8, 0))
self._createSizeGrip()
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=3, 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', padding=(8, 0)) l.config(justify="left", anchor='w', padding=(8, 0))
@ -181,6 +179,7 @@ class HtmlStatusbar(MfxStatusbar):
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', padding=(8, 0)) l.config(justify="left", anchor='w', padding=(8, 0))
self._createSizeGrip()
# /*********************************************************************** # /***********************************************************************

View file

@ -268,8 +268,12 @@ class MfxCanvas(Tkinter.Canvas):
## for i in range(len(stack.cards)): ## for i in range(len(stack.cards)):
## if stack.cards[i].item.id in current: ## if stack.cards[i].item.id in current:
## return i ## return i
x = event.x-self.xmargin+self.xview()[0]*int(self.cget('width')) if self.preview:
y = event.y-self.ymargin+self.yview()[0]*int(self.cget('height')) dx, dy = 0, 0
else:
dx, dy = -self.xmargin, -self.ymargin
x = event.x+dx+self.xview()[0]*int(self.cget('width'))
y = event.y+dy+self.yview()[0]*int(self.cget('height'))
##x, y = event.x, event.y ##x, y = event.x, event.y
items = list(self.find_overlapping(x,y,x,y)) items = list(self.find_overlapping(x,y,x,y))
items.reverse() items.reverse()

View file

@ -144,7 +144,7 @@ class SingleGame_StatsDialog(MfxDialog):
self.fg = c.option_get('foreground', '') or c.cget("insertbackground") self.fg = c.option_get('foreground', '') or c.cget("insertbackground")
# #
c.create_rectangle(2, 7, w, h, fill="", outline="#7f7f7f") c.create_rectangle(2, 7, w, h, fill="", outline="#7f7f7f")
l = Tkinter.Label(c, text=text, font=self.font, bd=0, padx=3, pady=1) l = Tkinter.Label(c, text=text)
dy = int(self.font_metrics['ascent']) - 10 dy = int(self.font_metrics['ascent']) - 10
dy = dy/2 dy = dy/2
c.create_window(20, -dy, window=l, anchor="nw") c.create_window(20, -dy, window=l, anchor="nw")

View file

@ -101,9 +101,13 @@ def wm_map(window, maximized=0):
def wm_set_icon(window, filename): def wm_set_icon(window, filename):
if not filename: if not filename:
return return
if os.name == "posix": if os.name == 'nt':
window.wm_iconbitmap("@" + filename) ##window.tk.call('wm', 'iconbitmap', root._w, '-default', '@'+filename)
window.wm_iconmask("@" + filename) pass
elif os.name == "posix":
##window.wm_iconbitmap("@"+filename)
##window.wm_iconmask("@"+filename)
pass
__wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$") __wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$")
@ -424,18 +428,28 @@ def load_theme(app, top, theme):
traceback.print_exc() traceback.print_exc()
pass pass
# set theme # set theme
all_themes = top.tk.call('style', 'theme', 'names')
if theme not in all_themes:
print >> sys.stderr, 'WARNING: invalid theme name:', theme
theme = 'default'
if theme: if theme:
top.tk.call('style', 'theme', 'use', theme) top.tk.call('style', 'theme', 'use', theme)
bg = top.tk.call('style', 'lookup', '.', '-background') if theme not in ('winnative',):
top.tk_setPalette(bg) bg = top.tk.call('style', 'lookup', '.', '-background')
bg = top.tk.call('style', 'lookup', '.', '-background', 'active') top.tk_setPalette(bg)
top.option_add('*Menu.activeBackground', bg) bg = top.tk.call('style', 'lookup', '.', '-background', 'active')
top.option_add('*Menu.activeBackground', bg)
if theme == 'winnative':
top.tk.call('style', 'configure', 'Toolbutton', '-padding', '1 1')
#if 'xpnative' in all_themes:
# theme = 'xpnative'
font = app.opt.fonts['default'] font = app.opt.fonts['default']
if font: if font:
top.tk.call('style', 'configure', '.', '-font', font) top.tk.call('style', 'configure', '.', '-font', font)
else: else:
font = top.tk.call('style', 'lookup', '.', '-font') font = top.tk.call('style', 'lookup', '.', '-font')
top.option_add('*font', font) if font:
top.option_add('*font', font)

View file

@ -33,7 +33,8 @@
## ##
##---------------------------------------------------------------------------## ##---------------------------------------------------------------------------##
__all__ = ['MfxMessageDialog', __all__ = ['MfxDialog',
'MfxMessageDialog',
'MfxExceptionDialog', 'MfxExceptionDialog',
'MfxSimpleEntry', 'MfxSimpleEntry',
'MfxTooltip', 'MfxTooltip',
@ -43,6 +44,7 @@ __all__ = ['MfxMessageDialog',
# imports # imports
import os, sys, time, types import os, sys, time, types
import Tkinter as Tk
import Tile as Tkinter import Tile as Tkinter
import traceback import traceback
@ -147,10 +149,9 @@ class MfxDialog: # ex. _ToplevelDialog
key = event.char key = event.char
key = unicode(key, 'utf-8') key = unicode(key, 'utf-8')
key = key.lower() key = key.lower()
button = self.accel_keys.get(key) widget = self.accel_keys.get(key)
if not button is None: if not widget is None:
self.mDone(button) widget.event_generate('<<Invoke>>')
def initKw(self, kw): def initKw(self, kw):
kw = KwStruct(kw, kw = KwStruct(kw,
@ -172,7 +173,7 @@ class MfxDialog: # ex. _ToplevelDialog
def createFrames(self, kw): def createFrames(self, kw):
bottom_frame = Tkinter.Frame(self.top) bottom_frame = Tkinter.Frame(self.top)
bottom_frame.pack(side='bottom', fill='both', expand=0, ipadx=3, ipady=3) bottom_frame.pack(side='bottom', fill='both', expand=0, ipadx=3, ipady=3, padx=5)
if kw.separatorwidth > 0: if kw.separatorwidth > 0:
separator = Tkinter.Separator(self.top) separator = Tkinter.Separator(self.top)
separator.pack(side='bottom', fill='x', pady=kw.separatorwidth/2) separator.pack(side='bottom', fill='x', pady=kw.separatorwidth/2)
@ -191,7 +192,7 @@ class MfxDialog: # ex. _ToplevelDialog
def createButtons(self, frame, kw): def createButtons(self, frame, kw):
button = column = -1 button = column = -1
padx, pady = kw.get("buttonpadx", 10), kw.get("buttonpady", 10) padx, pady = kw.get("buttonpadx", 5), kw.get("buttonpady", 5)
focus = None focus = None
max_len = 0 max_len = 0
for s in kw.strings: for s in kw.strings:
@ -208,8 +209,6 @@ class MfxDialog: # ex. _ToplevelDialog
elif max_len > 9 : button_width = max_len+1 elif max_len > 9 : button_width = max_len+1
elif max_len > 6 : button_width = max_len+2 elif max_len > 6 : button_width = max_len+2
else : button_width = 8 else : button_width = 8
#print 'button_width =', button_width
#
# #
for s in kw.strings: for s in kw.strings:
xbutton = button = button + 1 xbutton = button = button + 1
@ -220,37 +219,38 @@ class MfxDialog: # ex. _ToplevelDialog
if s is None: if s is None:
continue continue
accel_indx = s.find('&') accel_indx = s.find('&')
button_img = None
if MfxDialog.button_img:
button_img = MfxDialog.button_img.get(s)
s = s.replace('&', '') s = s.replace('&', '')
if button < 0: if button < 0:
b = Tkinter.Button(frame, text=s, state="disabled") widget = Tkinter.Button(frame, text=s, state="disabled")
button = xbutton button = xbutton
else: else:
b = Tkinter.Button(frame, text=s, default="normal", widget = Tkinter.Button(frame, text=s, default="normal",
command=(lambda self=self, button=button: self.mDone(button))) command=(lambda self=self, button=button: self.mDone(button)))
if button == kw.default: if button == kw.default:
focus = b focus = widget
focus.config(default="active") focus.config(default="active")
self.buttons.append(b) self.buttons.append(widget)
# #
b.config(width=button_width) widget.config(width=button_width)
if accel_indx >= 0: if accel_indx >= 0:
# key accelerator # key accelerator
b.config(underline=accel_indx) widget.config(underline=accel_indx)
key = s[accel_indx] key = s[accel_indx]
self.accel_keys[key.lower()] = button self.accel_keys[key.lower()] = widget
# #
## img = None if button_img:
## if self.button_img: widget.config(compound='left', image=button_img)
## img = self.button_img.get(s)
## b.config(compound='left', image=img)
column += 1 column += 1
b.grid(column=column, row=0, sticky="nse", padx=padx, pady=pady) widget.grid(column=column, row=0, sticky="nse", padx=padx, pady=pady)
if focus is not None: if focus is not None:
l = (lambda event=None, self=self, button=kw.default: self.mDone(button)) l = (lambda event=None, self=self, button=kw.default: self.mDone(button))
bind(self.top, "<Return>", l) bind(self.top, "<Return>", l)
bind(self.top, "<KP_Enter>", l) bind(self.top, "<KP_Enter>", l)
# left justify # right justify
##frame.columnconfigure(0, weight=1) frame.columnconfigure(0, weight=1)
return focus return focus
@ -429,7 +429,7 @@ class MfxTooltip:
class MfxScrolledCanvas: class MfxScrolledCanvas:
def __init__(self, parent, hbar=2, vbar=2, **kw): def __init__(self, parent, hbar=2, vbar=2, **kw):
kwdefault(kw, highlightthickness=0, bd=1, relief='sunken') kwdefault(kw, borderwidth=1, relief='sunken')
self.parent = parent self.parent = parent
self.createFrame(kw) self.createFrame(kw)
self.canvas = None self.canvas = None
@ -694,8 +694,7 @@ class StackDesc:
text = stack.getHelp()+'\n'+stack.getBaseCard() text = stack.getHelp()+'\n'+stack.getBaseCard()
text = text.strip() text = text.strip()
if text: if text:
frame = Tkinter.Frame(self.canvas, highlightthickness=1, frame = Tkinter.Frame(self.canvas)
highlightbackground='black')
self.frame = frame self.frame = frame
label = Tkinter.Message(frame, font=font, text=text, width=cardw-8, label = Tkinter.Message(frame, font=font, text=text, width=cardw-8,
fg='#000000', bg='#ffffe0', bd=1) fg='#000000', bg='#ffffe0', bd=1)
@ -725,7 +724,7 @@ class StackDesc:
# // # //
# ************************************************************************/ # ************************************************************************/
class PysolScale: class MyPysolScale:
def __init__(self, parent, **kw): def __init__(self, parent, **kw):
if kw.has_key('resolution'): if kw.has_key('resolution'):
self.resolution = kw['resolution'] self.resolution = kw['resolution']
@ -766,3 +765,13 @@ class PysolScale:
self.scale.configure(**kw) self.scale.configure(**kw)
config = configure config = configure
class TkinterScale(Tk.Scale):
def __init__(self, parent, **kw):
if kw.has_key('value'):
del kw['value']
Tk.Scale.__init__(self, parent, **kw)
#PysolScale = MyPysolScale
PysolScale = TkinterScale

View file

@ -106,7 +106,7 @@ class MfxRoot(Tkinter.Tk):
if sw < 640 or sh < 480: if sw < 640 or sh < 480:
self.wm_minsize(400, 300) self.wm_minsize(400, 300)
else: else:
self.wm_minsize(520, 360) self.wm_minsize(540, 380)
##self.self.wm_maxsize(9999, 9999) # unlimited ##self.self.wm_maxsize(9999, 9999) # unlimited
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow) self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
prog = sys.executable prog = sys.executable

View file

@ -273,16 +273,11 @@ class PysolToolbar(PysolToolbarActions):
# Change the look of the frame to match the platform look # Change the look of the frame to match the platform look
# (see also setRelief) # (see also setRelief)
if os.name == 'posix': if os.name == 'posix':
#self.frame.config(bd=0, highlightthickness=1)
#~self.frame.config(bd=1, relief=self.frame_relief, highlightthickness=0)
self.frame.config(bd=1, relief='raised', highlightthickness=0)
pass pass
elif os.name == "nt": elif os.name == "nt":
self.frame.config(bd=2, relief=self.frame_relief, padx=2, pady=2) self.frame.config(relief=self.frame_relief)
#self._createSeparator(width=4, side=Tkinter.LEFT, relief=Tkinter.FLAT)
#self._createSeparator(width=4, side=Tkinter.RIGHT, relief=Tkinter.FLAT)
else: else:
self.frame.config(bd=0, highlightthickness=1) pass
def config(self, w, v): def config(self, w, v):
if w == 'player': if w == 'player':
@ -353,8 +348,6 @@ class PysolToolbar(PysolToolbarActions):
sep = ToolbarSeparator(self.frame, sep = ToolbarSeparator(self.frame,
position=position, position=position,
toolbar=self, toolbar=self,
bd=1,
highlightthickness=1,
width=4, width=4,
takefocus=0, takefocus=0,
relief=self.separator_relief) relief=self.separator_relief)
@ -367,8 +360,6 @@ class PysolToolbar(PysolToolbarActions):
sep = ToolbarFlatSeparator(self.frame, sep = ToolbarFlatSeparator(self.frame,
position=position, position=position,
toolbar=self, toolbar=self,
bd=1,
highlightthickness=1,
width=5, width=5,
takefocus=0, takefocus=0,
relief='flat') relief='flat')
@ -462,16 +453,16 @@ class PysolToolbar(PysolToolbarActions):
if side == 1: if side == 1:
# top # top
pack_func(row=0, column=1, sticky='ew') pack_func(row=0, column=1, sticky='ew', padx=0, pady=0)
elif side == 2: elif side == 2:
# bottom # bottom
pack_func(row=2, column=1, sticky='ew') pack_func(row=2, column=1, sticky='ew', padx=0, pady=0)
elif side == 3: elif side == 3:
# left # left
pack_func(row=1, column=0, sticky='ns') pack_func(row=1, column=0, sticky='ns', padx=0, pady=1)
else: else:
# right # right
pack_func(row=1, column=2, sticky='ns') pack_func(row=1, column=2, sticky='ns', padx=0, pady=1)
# set orient # set orient
orient = side in (1, 2) and Tkinter.HORIZONTAL or Tkinter.VERTICAL orient = side in (1, 2) and Tkinter.HORIZONTAL or Tkinter.VERTICAL
self._setOrient(orient) self._setOrient(orient)

View file

@ -117,7 +117,7 @@ class PlayerOptionsDialog(MfxDialog):
self.player_var = Tkinter.Entry(frame, exportselection=1, width=w) self.player_var = Tkinter.Entry(frame, exportselection=1, width=w)
self.player_var.insert(0, app.opt.player) self.player_var.insert(0, app.opt.player)
self.player_var.grid(row=1, column=0, sticky='ew', padx=0, pady=5) self.player_var.grid(row=1, column=0, sticky='ew', padx=0, pady=5)
widget = Tkinter.Button(frame, text=_('Select...'), widget = Tkinter.Button(frame, text=_('Choose...'),
command=self.selectUserName) command=self.selectUserName)
widget.grid(row=1, column=1, padx=5, pady=5) widget.grid(row=1, column=1, padx=5, pady=5)
widget = Tkinter.Checkbutton(frame, variable=self.confirm_var, widget = Tkinter.Checkbutton(frame, variable=self.confirm_var,

View file

@ -267,8 +267,12 @@ class MfxCanvas(Tkinter.Canvas):
## for i in range(len(stack.cards)): ## for i in range(len(stack.cards)):
## if stack.cards[i].item.id in current: ## if stack.cards[i].item.id in current:
## return i ## return i
x = event.x-self.xmargin+self.xview()[0]*int(self.cget('width')) if self.preview:
y = event.y-self.ymargin+self.yview()[0]*int(self.cget('height')) dx, dy = 0, 0
else:
dx, dy = -self.xmargin, -self.ymargin
x = event.x+dx+self.xview()[0]*int(self.cget('width'))
y = event.y+dy+self.yview()[0]*int(self.cget('height'))
##x, y = event.x, event.y ##x, y = event.x, event.y
items = list(self.find_overlapping(x,y,x,y)) items = list(self.find_overlapping(x,y,x,y))
items.reverse() items.reverse()

View file

@ -100,9 +100,12 @@ def wm_map(window, maximized=0):
def wm_set_icon(window, filename): def wm_set_icon(window, filename):
if not filename: if not filename:
return return
if os.name == "posix": if os.name == 'nt':
window.wm_iconbitmap("@" + filename) window.wm_iconbitmap(default="@"+filename)
window.wm_iconmask("@" + filename) elif os.name == "posix":
##window.wm_iconbitmap("@" + filename)
##window.wm_iconmask("@" + filename)
pass
__wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$") __wm_get_geometry_re = re.compile(r"^(\d+)x(\d+)\+([\-]?\d+)\+([\-]?\d+)$")

View file

@ -33,7 +33,8 @@
## ##
##---------------------------------------------------------------------------## ##---------------------------------------------------------------------------##
__all__ = ['MfxMessageDialog', __all__ = ['MfxDialog',
'MfxMessageDialog',
'MfxExceptionDialog', 'MfxExceptionDialog',
'MfxSimpleEntry', 'MfxSimpleEntry',
'MfxTooltip', 'MfxTooltip',

View file

@ -216,10 +216,14 @@ class DataLoader:
def findIcon(self, filename=None, subdirs=None): def findIcon(self, filename=None, subdirs=None):
if not filename: if not filename:
filename = PACKAGE.lower() ##filename = PACKAGE.lower()
filename = 'pysol'
root, ext = os.path.splitext(filename) root, ext = os.path.splitext(filename)
if not ext: if not ext:
filename = filename + ".xbm" if os.name == 'nt':
filename = filename + ".ico"
else:
filename = filename + ".xbm"
return self.findFile(filename, subdirs) return self.findFile(filename, subdirs)
def findDir(self, filename, subdirs=None): def findDir(self, filename, subdirs=None):