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: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@84 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
skomoroh 2006-11-01 23:06:59 +00:00
parent 9752088973
commit 4a1892eb97
49 changed files with 727 additions and 716 deletions

3
README
View file

@ -13,7 +13,8 @@ Requirements.
or
- 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
- 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 ""
msgstr ""
"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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -768,6 +768,9 @@ msgstr ""
msgid "Double Grasshopper"
msgstr ""
msgid "Double Kingsley"
msgstr ""
msgid "Double Klondike"
msgstr ""
@ -1518,6 +1521,9 @@ msgstr ""
msgid "Kingsdown Eights"
msgstr ""
msgid "Kingsley"
msgstr ""
msgid "Klondike"
msgstr ""
@ -2631,6 +2637,9 @@ msgstr ""
msgid "Pegged Triangle 2"
msgstr ""
msgid "Penelope's Web"
msgstr ""
msgid "Penguin"
msgstr ""
@ -2946,6 +2955,9 @@ msgstr ""
msgid "Scarab"
msgstr ""
msgid "Scarp"
msgstr ""
msgid "Scheidungsgrund"
msgstr ""
@ -3447,6 +3459,9 @@ msgstr ""
msgid "Trapdoor"
msgstr ""
msgid "Trapdoor Spider"
msgstr ""
msgid "Treasure Trove"
msgstr ""

View file

@ -14,7 +14,7 @@ msgid ""
msgstr ""
"#-#-#-#-# pysol-1.pot (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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
"#-#-#-#-# pysol-2.pot (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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -32,45 +32,45 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\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"
msgstr ""
#: pysollib/actions.py:273 pysollib/tk/menubar.py:815
#: pysollib/actions.py:271 pysollib/tk/menubar.py:815
#: pysollib/tk/menubar.py:829
msgid "Select game"
msgstr ""
#: pysollib/actions.py:287
#: pysollib/actions.py:285
msgid "Invalid game number"
msgstr ""
#: pysollib/actions.py:288
#: pysollib/actions.py:286
msgid "Invalid game number\n"
msgstr ""
#: pysollib/actions.py:305
#: pysollib/actions.py:303
msgid "Select next game number"
msgstr ""
#: pysollib/actions.py:314 pysollib/actions.py:324
#: pysollib/actions.py:312 pysollib/actions.py:322
msgid "Select new game number"
msgstr ""
#: pysollib/actions.py:315
#: pysollib/actions.py:313
msgid ""
"\n"
"\n"
"Enter new game number"
msgstr ""
#: pysollib/actions.py:316
#: pysollib/actions.py:314
msgid "&Next number"
msgstr ""
#: pysollib/actions.py:316 pysollib/app.py:1150 pysollib/app.py:1162
#: pysollib/game.py:925 pysollib/game.py:1861 pysollib/main.py:478
#: pysollib/main.py:486 pysollib/tk/colorsdialog.py:122
#: pysollib/actions.py:314 pysollib/app.py:892 pysollib/app.py:1155
#: pysollib/app.py:1167 pysollib/game.py:929 pysollib/game.py:1865
#: 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/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155
#: pysollib/tk/playeroptionsdialog.py:85
@ -78,149 +78,141 @@ msgstr ""
#: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159
#: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211
#: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:499
#: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:573
#: pysollib/tk/tkstats.py:647 pysollib/tk/tkstats.py:663
#: pysollib/tk/tkstats.py:705 pysollib/tk/tkstats.py:777
#: pysollib/tk/tkstats.py:861 pysollib/tk/tkwidget.py:159
#: pysollib/tk/tkwidget.py:324
#: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512
#: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594
#: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708
#: pysollib/tk/tkstats.py:792 pysollib/tk/tkwidget.py:160
#: pysollib/tk/tkwidget.py:325
msgid "&OK"
msgstr ""
#: pysollib/actions.py:316 pysollib/app.py:1162 pysollib/game.py:925
#: pysollib/game.py:1311 pysollib/game.py:1326 pysollib/game.py:1333
#: pysollib/game.py:1339 pysollib/tk/colorsdialog.py:122
#: pysollib/actions.py:314 pysollib/app.py:893 pysollib/app.py:1167
#: pysollib/game.py:929 pysollib/game.py:1315 pysollib/game.py:1330
#: 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/fontsdialog.py:205 pysollib/tk/menubar.py:1122
#: pysollib/tk/menubar.py:1124 pysollib/tk/playeroptionsdialog.py:85
#: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241
#: pysollib/tk/selectgame.py:266 pysollib/tk/selectgame.py:407
#: 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"
msgstr ""
#: pysollib/actions.py:332
#: pysollib/actions.py:330
msgid "Select random game"
msgstr ""
#: pysollib/actions.py:368
#: pysollib/actions.py:366
msgid "Select next game"
msgstr ""
#: pysollib/actions.py:401 pysollib/tk/toolbar.py:211
#: pysollib/actions.py:399 pysollib/tk/toolbar.py:211
msgid "Quit "
msgstr ""
#: pysollib/actions.py:451
#: pysollib/actions.py:449
msgid "Clear bookmarks"
msgstr ""
#: pysollib/actions.py:452
#: pysollib/actions.py:450
msgid "Clear all bookmarks ?"
msgstr ""
#: pysollib/actions.py:462
#: pysollib/actions.py:460
msgid "Restart game"
msgstr ""
#: pysollib/actions.py:463
#: pysollib/actions.py:461
msgid "Restart this game ?"
msgstr ""
#: pysollib/actions.py:504
#: pysollib/actions.py:502
msgid ""
"Comments for %s:\n"
"\n"
msgstr ""
#: pysollib/actions.py:506
#: pysollib/actions.py:504
msgid "Comments for "
msgstr ""
#: pysollib/actions.py:524 pysollib/actions.py:554
#: pysollib/actions.py:522 pysollib/actions.py:550
msgid "Error while writing to file"
msgstr ""
#: pysollib/actions.py:527 pysollib/actions.py:557
#: pysollib/actions.py:525 pysollib/actions.py:553
msgid " Info"
msgstr ""
#: pysollib/actions.py:528
#: pysollib/actions.py:526
msgid ""
"Comments were appended to\n"
"\n"
msgstr ""
#: pysollib/actions.py:539
#: pysollib/actions.py:537
msgid "Demo statistics"
msgstr ""
#: pysollib/actions.py:542
#: pysollib/actions.py:540
msgid "Your statistics"
msgstr ""
#: pysollib/actions.py:558
#: pysollib/actions.py:554
msgid ""
" were appended to\n"
"\n"
msgstr ""
#: pysollib/actions.py:572
#: pysollib/actions.py:568
msgid " Demo"
msgstr ""
#: pysollib/actions.py:572
#: pysollib/actions.py:568
msgid " Demo "
msgstr ""
#: pysollib/actions.py:575 pysollib/actions.py:593
#: pysollib/actions.py:571 pysollib/actions.py:589
msgid " for "
msgstr ""
#: pysollib/actions.py:581 pysollib/actions.py:600
#: pysollib/actions.py:577 pysollib/stats.py:206
msgid "Statistics for "
msgstr ""
#: pysollib/actions.py:584 pysollib/tk/selectgame.py:350
#: pysollib/actions.py:580 pysollib/tk/selectgame.py:350
#: pysollib/tk/toolbar.py:208
msgid "Statistics"
msgstr ""
#: pysollib/actions.py:587 data/glade-translations:31
#: pysollib/actions.py:583 data/glade-translations:31
msgid "Full log"
msgstr ""
#: pysollib/actions.py:590 data/glade-translations:32
#: pysollib/actions.py:586 data/glade-translations:32
msgid "Session log"
msgstr ""
#: pysollib/actions.py:596
#: pysollib/actions.py:592
msgid "Game Info"
msgstr ""
#: pysollib/actions.py:605
msgid "Full log for "
msgstr ""
#: pysollib/actions.py:610
msgid "Session log for "
msgstr ""
#: pysollib/actions.py:615
#: pysollib/actions.py:608
msgid "Reset all statistics"
msgstr ""
#: pysollib/actions.py:616
#: pysollib/actions.py:609
msgid ""
"Reset ALL statistics and logs for player\n"
"%s ?"
msgstr ""
#: pysollib/actions.py:622
#: pysollib/actions.py:615
msgid "Reset game statistics"
msgstr ""
#: pysollib/actions.py:623
#: pysollib/actions.py:616
msgid ""
"Reset statistics and logs for player\n"
"%s\n"
@ -228,23 +220,23 @@ msgid ""
"%s ?"
msgstr ""
#: pysollib/actions.py:678
#: pysollib/actions.py:671
msgid "Play demo"
msgstr ""
#: pysollib/actions.py:689
#: pysollib/actions.py:682
msgid "Set player options"
msgstr ""
#: pysollib/actions.py:703 data/glade-translations:40
#: pysollib/actions.py:696 data/glade-translations:40
msgid "Set colors"
msgstr ""
#: pysollib/actions.py:723
#: pysollib/actions.py:716
msgid "Set fonts"
msgstr ""
#: pysollib/actions.py:732 data/glade-translations:33
#: pysollib/actions.py:725 data/glade-translations:33
msgid "Set timeouts"
msgstr ""
@ -252,23 +244,28 @@ msgstr ""
msgid "Unknown"
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..."
msgstr ""
#: pysollib/app.py:1047
#: pysollib/app.py:1052
msgid " load error"
msgstr ""
#: pysollib/app.py:1048
#: pysollib/app.py:1053
msgid "Error while loading "
msgstr ""
#: pysollib/app.py:1142
#: pysollib/app.py:1147
msgid "Incompatible "
msgstr ""
#: pysollib/app.py:1144
#: pysollib/app.py:1149
msgid ""
"The currently selected %s %s\n"
"is not compatible with the game\n"
@ -277,57 +274,57 @@ msgid ""
"Please select a %s type %s.\n"
msgstr ""
#: pysollib/app.py:1160
#: pysollib/app.py:1165
msgid "Please select a %s type %s"
msgstr ""
#: pysollib/game.py:844 pysollib/game.py:850
#: pysollib/game.py:848 pysollib/game.py:854
msgid "Player\n"
msgstr ""
#: pysollib/game.py:921
#: pysollib/game.py:925
msgid "Discard current game ?"
msgstr ""
#: pysollib/game.py:1265
#: pysollib/game.py:1269
msgid ""
"\n"
"You have reached\n"
"#%d in the %s of playing time"
msgstr ""
#: pysollib/game.py:1268
#: pysollib/game.py:1272
msgid ""
"\n"
"and #%d in the %s of moves"
msgstr ""
#: pysollib/game.py:1270
#: pysollib/game.py:1274
msgid ""
"\n"
"You have reached\n"
"#%d in the %s of moves"
msgstr ""
#: pysollib/game.py:1273
#: pysollib/game.py:1277
msgid ""
"\n"
"and #%d in the %s of total moves"
msgstr ""
#: pysollib/game.py:1275
#: pysollib/game.py:1279
msgid ""
"\n"
"You have reached\n"
"#%d in the %s of total moves"
msgstr ""
#: pysollib/game.py:1302 pysollib/game.py:1318
#: pysollib/game.py:1306 pysollib/game.py:1322
#: pysollib/tk/soundoptionsdialog.py:100
msgid "Game won"
msgstr ""
#: pysollib/game.py:1303
#: pysollib/game.py:1307
msgid ""
"\n"
"Congratulations, this\n"
@ -338,12 +335,7 @@ msgid ""
"%s\n"
msgstr ""
#: pysollib/game.py:1311 pysollib/game.py:1326 pysollib/game.py:1333
#: pysollib/game.py:1339 pysollib/tk/menubar.py:363
msgid "&New game"
msgstr ""
#: pysollib/game.py:1319
#: pysollib/game.py:1323
msgid ""
"\n"
"Congratulations, you did it !\n"
@ -353,100 +345,100 @@ msgid ""
"%s\n"
msgstr ""
#: pysollib/game.py:1331 pysollib/game.py:1337
#: pysollib/game.py:1335 pysollib/game.py:1341
#: pysollib/tk/soundoptionsdialog.py:98
msgid "Game finished"
msgstr ""
#: pysollib/game.py:1332 pysollib/game.py:1862
#: pysollib/game.py:1336 pysollib/game.py:1866
msgid ""
"\n"
"Game finished\n"
msgstr ""
#: pysollib/game.py:1338
#: pysollib/game.py:1342
msgid ""
"\n"
"Game finished, but not without my help...\n"
msgstr ""
#: pysollib/game.py:1339
#: pysollib/game.py:1343
msgid "&Restart"
msgstr ""
#: pysollib/game.py:1753
#: pysollib/game.py:1757
msgid "Score %6d"
msgstr ""
#: pysollib/game.py:1852
#: pysollib/game.py:1856
msgid "&Cool"
msgstr ""
#: pysollib/game.py:1852
#: pysollib/game.py:1856
msgid "&Great"
msgstr ""
#: pysollib/game.py:1852
#: pysollib/game.py:1856
msgid "&Wow"
msgstr ""
#: pysollib/game.py:1852
#: pysollib/game.py:1856
msgid "&Yeah"
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"
msgstr ""
#: pysollib/game.py:1854
#: pysollib/game.py:1858
msgid ""
"\n"
"Game solved in %d moves.\n"
msgstr ""
#: pysollib/game.py:1877
#: pysollib/game.py:1881
msgid "&Hmm"
msgstr ""
#: pysollib/game.py:1877
#: pysollib/game.py:1881
msgid "&Oh well"
msgstr ""
#: pysollib/game.py:1877
#: pysollib/game.py:1881
msgid "&That's life"
msgstr ""
#: pysollib/game.py:1879
#: pysollib/game.py:1883
msgid ""
"\n"
"This won't come out...\n"
msgstr ""
#: pysollib/game.py:2291
#: pysollib/game.py:2295
msgid "Set bookmark"
msgstr ""
#: pysollib/game.py:2292
#: pysollib/game.py:2296
msgid "Replace existing bookmark %d ?"
msgstr ""
#: pysollib/game.py:2314
#: pysollib/game.py:2318
msgid "Goto bookmark"
msgstr ""
#: pysollib/game.py:2315
#: pysollib/game.py:2319
msgid "Goto bookmark %d ?"
msgstr ""
#: pysollib/game.py:2346
#: pysollib/game.py:2350
msgid "Open game"
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"
msgstr ""
#: pysollib/game.py:2358
#: pysollib/game.py:2362
msgid ""
"Error while loading game.\n"
"\n"
@ -454,22 +446,22 @@ msgid ""
"but this could also be a bug you might want to report."
msgstr ""
#: pysollib/game.py:2367
#: pysollib/game.py:2371
msgid "Error while loading game"
msgstr ""
#: pysollib/game.py:2372
#: pysollib/game.py:2376
msgid ""
"Internal error while loading game.\n"
"\n"
"Please report this bug."
msgstr ""
#: pysollib/game.py:2397
#: pysollib/game.py:2401
msgid "Save game error"
msgstr ""
#: pysollib/game.py:2398
#: pysollib/game.py:2402
msgid "Error while saving game"
msgstr ""
@ -683,7 +675,7 @@ msgstr ""
#: pysollib/games/auldlangsyne.py:158 pysollib/games/calculation.py:104
#: 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."
msgstr ""
@ -801,7 +793,7 @@ msgstr ""
msgid "Deal %d"
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."
msgstr ""
@ -1235,7 +1227,7 @@ msgstr ""
msgid " Help"
msgstr ""
#: pysollib/main.py:67 pysollib/main.py:386
#: pysollib/main.py:67 pysollib/main.py:282
msgid " installation error"
msgstr ""
@ -1249,7 +1241,7 @@ msgid ""
"Please check your %s installation.\n"
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"
msgstr ""
@ -1289,7 +1281,7 @@ msgid ""
"try %s --help for more information"
msgstr ""
#: pysollib/main.py:387
#: pysollib/main.py:283
msgid ""
"\n"
"No games were found !!!\n"
@ -1300,25 +1292,25 @@ msgid ""
"Please check your %s installation.\n"
msgstr ""
#: pysollib/main.py:473 pysollib/main.py:481
#: pysollib/main.py:369 pysollib/main.py:377
msgid " installation problem"
msgstr ""
#: pysollib/main.py:474
#: pysollib/main.py:370
msgid ""
"Your Python installation is compiled without thread support.\n"
"\n"
"Sounds and background music will be disabled."
msgstr ""
#: pysollib/main.py:482
#: pysollib/main.py:378
msgid ""
"The pysolsoundserver module was not found.\n"
"\n"
"Sounds and background music will be disabled."
msgstr ""
#: pysollib/main.py:489
#: pysollib/main.py:385
msgid "Welcome to "
msgstr ""
@ -1801,76 +1793,84 @@ msgstr ""
msgid "Free cell."
msgstr ""
#: pysollib/stats.py:118 pysollib/tk/tkstats.py:78
msgid "Demo games"
#: pysollib/stats.py:53 pysollib/stats.py:119
msgid "Game"
msgstr ""
#: pysollib/stats.py:119
#: pysollib/stats.py:54
msgid "Played"
msgstr ""
#: pysollib/stats.py:120 pysollib/stats.py:200
#: pysollib/stats.py:55 pysollib/stats.py:158
msgid "Won"
msgstr ""
#: pysollib/stats.py:121 pysollib/stats.py:200
#: pysollib/stats.py:56 pysollib/stats.py:158
msgid "Lost"
msgstr ""
#: pysollib/stats.py:122 pysollib/tk/statusbar.py:156
#: pysollib/stats.py:57 pysollib/tk/statusbar.py:156
#: data/glade-translations:25
msgid "Playing time"
msgstr ""
#: pysollib/stats.py:123 data/glade-translations:26
#: pysollib/stats.py:58 data/glade-translations:26
msgid "Moves"
msgstr ""
#: pysollib/stats.py:124
#: pysollib/stats.py:59
msgid "% won"
msgstr ""
#: pysollib/stats.py:153
msgid "Total (%d out of %d games)"
msgstr ""
#: pysollib/stats.py:162
msgid "Game"
msgstr ""
#: pysollib/stats.py:162
#: pysollib/stats.py:119
msgid "Status"
msgstr ""
#: pysollib/stats.py:162 pysollib/tk/statusbar.py:158
#: pysollib/tk/tkstats.py:735
#: pysollib/stats.py:119 pysollib/tk/statusbar.py:158
#: pysollib/tk/tkstats.py:666
msgid "Game number"
msgstr ""
#: pysollib/stats.py:162 pysollib/tk/tkstats.py:738
#: pysollib/stats.py:119 pysollib/tk/tkstats.py:669
msgid "Started at"
msgstr ""
#: pysollib/stats.py:185
#: pysollib/stats.py:143
msgid "** UNKNOWN %d **"
msgstr ""
#: pysollib/stats.py:193
#: pysollib/stats.py:151
msgid "** ERROR **"
msgstr ""
#: pysollib/stats.py:200
#: pysollib/stats.py:158
msgid "Loaded"
msgstr ""
#: pysollib/stats.py:200
#: pysollib/stats.py:158
msgid "Not won"
msgstr ""
#: pysollib/stats.py:200
#: pysollib/stats.py:158
msgid "Perfect"
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
msgid "Text foreground:"
msgstr ""
@ -2792,12 +2792,12 @@ msgstr ""
msgid "Lost:"
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
msgid "Playing time:"
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
msgid "Moves:"
msgstr ""
@ -3034,6 +3034,10 @@ msgstr ""
msgid "Unable to service request:\n"
msgstr ""
#: pysollib/tk/tkstats.py:78
msgid "Demo games"
msgstr ""
#: pysollib/tk/tkstats.py:95 data/glade-translations:16
msgid "Total"
msgstr ""
@ -3059,140 +3063,128 @@ msgstr ""
msgid "&Reset..."
msgstr ""
#: pysollib/tk/tkstats.py:574 pysollib/tk/tkstats.py:647
#: pysollib/tk/tkstats.py:663
#: pysollib/tk/tkstats.py:513 pysollib/tk/tkstats.py:579
#: pysollib/tk/tkstats.py:594
msgid "&Save to file"
msgstr ""
#: pysollib/tk/tkstats.py:575
#: pysollib/tk/tkstats.py:514
msgid "&Reset all..."
msgstr ""
#: pysollib/tk/tkstats.py:625
msgid "No entries for player "
msgstr ""
#: pysollib/tk/tkstats.py:642
msgid "No log entries for %s\n"
msgstr ""
#: pysollib/tk/tkstats.py:647
#: pysollib/tk/tkstats.py:579
msgid "Session &log..."
msgstr ""
#: pysollib/tk/tkstats.py:658
msgid "No current session log entries for %s\n"
msgstr ""
#: pysollib/tk/tkstats.py:663
#: pysollib/tk/tkstats.py:594
msgid "&Full log..."
msgstr ""
#: pysollib/tk/tkstats.py:678
#: pysollib/tk/tkstats.py:609
msgid "Highlight piles: "
msgstr ""
#: pysollib/tk/tkstats.py:679
#: pysollib/tk/tkstats.py:610
msgid "Highlight cards: "
msgstr ""
#: pysollib/tk/tkstats.py:680
#: pysollib/tk/tkstats.py:611
msgid "Highlight same rank: "
msgstr ""
#: pysollib/tk/tkstats.py:683
#: pysollib/tk/tkstats.py:614
msgid ""
"\n"
"Redeals: "
msgstr ""
#: pysollib/tk/tkstats.py:684
#: pysollib/tk/tkstats.py:615
msgid ""
"\n"
"Cards in Talon: "
msgstr ""
#: pysollib/tk/tkstats.py:686
#: pysollib/tk/tkstats.py:617
msgid ""
"\n"
"Cards in Waste: "
msgstr ""
#: pysollib/tk/tkstats.py:688
#: pysollib/tk/tkstats.py:619
msgid ""
"\n"
"Cards in Foundations: "
msgstr ""
#: pysollib/tk/tkstats.py:691
#: pysollib/tk/tkstats.py:622
msgid "Game status"
msgstr ""
#: pysollib/tk/tkstats.py:694
#: pysollib/tk/tkstats.py:625
msgid "Playing time: "
msgstr ""
#: pysollib/tk/tkstats.py:695
#: pysollib/tk/tkstats.py:626
msgid "Started at: "
msgstr ""
#: pysollib/tk/tkstats.py:696
#: pysollib/tk/tkstats.py:627
msgid "Moves: "
msgstr ""
#: pysollib/tk/tkstats.py:697
#: pysollib/tk/tkstats.py:628
msgid "Undo moves: "
msgstr ""
#: pysollib/tk/tkstats.py:698
#: pysollib/tk/tkstats.py:629
msgid "Bookmark moves: "
msgstr ""
#: pysollib/tk/tkstats.py:699
#: pysollib/tk/tkstats.py:630
msgid "Demo moves: "
msgstr ""
#: pysollib/tk/tkstats.py:700
#: pysollib/tk/tkstats.py:631
msgid "Total player moves: "
msgstr ""
#: pysollib/tk/tkstats.py:701
#: pysollib/tk/tkstats.py:632
msgid "Total moves in this game: "
msgstr ""
#: pysollib/tk/tkstats.py:702
#: pysollib/tk/tkstats.py:633
msgid "Hints: "
msgstr ""
#: pysollib/tk/tkstats.py:706
#: pysollib/tk/tkstats.py:637
msgid "&Statistics..."
msgstr ""
#: pysollib/tk/tkstats.py:732
#: pysollib/tk/tkstats.py:663
msgid "N"
msgstr ""
#: pysollib/tk/tkstats.py:741
#: pysollib/tk/tkstats.py:672
msgid "Result"
msgstr ""
#: pysollib/tk/tkstats.py:797 data/glade-translations:21
#: pysollib/tk/tkstats.py:728 data/glade-translations:21
msgid "Minimum"
msgstr ""
#: pysollib/tk/tkstats.py:798 data/glade-translations:22
#: pysollib/tk/tkstats.py:729 data/glade-translations:22
msgid "Maximum"
msgstr ""
#: pysollib/tk/tkstats.py:799 data/glade-translations:23
#: pysollib/tk/tkstats.py:730 data/glade-translations:23
msgid "Average"
msgstr ""
#: pysollib/tk/tkstats.py:819 data/glade-translations:20
#: pysollib/tk/tkstats.py:750 data/glade-translations:20
msgid "Total moves:"
msgstr ""
#: pysollib/tk/tkstats.py:850
#: pysollib/tk/tkstats.py:781
msgid "No TOP for this game"
msgstr ""

View file

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Sat Oct 7 20:02:33 2006\n"
"PO-Revision-Date: 2006-10-08 18:43+0400\n"
"POT-Creation-Date: Tue Oct 31 19:32:40 2006\n"
"PO-Revision-Date: 2006-10-31 19:57+0300\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n"
@ -774,6 +774,10 @@ msgstr "Двойной Золотой рудник"
msgid "Double Grasshopper"
msgstr "Двойной кузнечик"
#, fuzzy
msgid "Double Kingsley"
msgstr "Двойной Бисли"
msgid "Double Klondike"
msgstr "Двойной Клондайк"
@ -953,9 +957,8 @@ msgstr "Экспресс"
msgid "Eye"
msgstr "Глаз"
#, fuzzy
msgid "F-15 Eagle"
msgstr "Маджонг F-15 Eagle"
msgstr "F-15 Eagle"
msgid "Faerie Queen"
msgstr "Королева фей"
@ -1538,6 +1541,10 @@ msgstr "Короли"
msgid "Kingsdown Eights"
msgstr ""
#, fuzzy
msgid "Kingsley"
msgstr "Короли"
msgid "Klondike"
msgstr "Клондайк"
@ -2677,6 +2684,9 @@ msgstr ""
msgid "Pegged Triangle 2"
msgstr ""
msgid "Penelope's Web"
msgstr ""
msgid "Penguin"
msgstr "Пингвин"
@ -2995,6 +3005,9 @@ msgstr "Саксония"
msgid "Scarab"
msgstr "Скарабей"
msgid "Scarp"
msgstr "Откос"
msgid "Scheidungsgrund"
msgstr "Scheidungsgrund"
@ -3317,7 +3330,6 @@ msgstr "Улицы"
msgid "Streets and Alleys"
msgstr "Улицы и аллеи"
#, fuzzy
msgid "Striptease"
msgstr "Стриптиз"
@ -3414,13 +3426,11 @@ msgstr "Сад"
msgid "The Great Wall"
msgstr "Великая Стена"
#, fuzzy
msgid "The Last Monarch"
msgstr "Последний Монарх"
#, fuzzy
msgid "The Last Monarch II"
msgstr "Последний Монарх"
msgstr "Последний Монарх II"
msgid "The Little Corporal"
msgstr "Маленький Капрал"
@ -3515,6 +3525,10 @@ msgstr "Маджонг Traditional Reviewed"
msgid "Trapdoor"
msgstr "Люк"
#, fuzzy
msgid "Trapdoor Spider"
msgstr "Люк"
msgid "Treasure Trove"
msgstr "Клад"
@ -3648,7 +3662,7 @@ msgid "Victory Arrow"
msgstr "Маджонг Victory Arrow"
msgid "Virginia Reel"
msgstr ""
msgstr "Виргинский Рил"
#, fuzzy
msgid "Wake-Robin"
@ -3767,26 +3781,3 @@ msgstr ""
msgid "Zodiac"
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
## -*- coding: iso-8859-1 -*-
##
## vim:ts=4:et:nowrap
##
#!/usr/bin/env python
##---------------------------------------------------------------------------##
##
## 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
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
@ -30,48 +18,14 @@
## If not, write to the Free Software Foundation, Inc.,
## 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
from pysollib.init import init
init()
import sys
from pysollib.main import main
sys.exit(main(sys.argv))

View file

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

View file

@ -1282,9 +1282,9 @@ class Game:
# only update the session log
if self.app.opt.update_player_stats:
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:
self.app.stats.updateLog(self.app.opt.player, self, -1)
self.app.stats.updateStats(self.app.opt.player, self, -1)
return ''
def checkForWin(self):

View file

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

View file

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

View file

@ -55,6 +55,7 @@ from spider import Spider_Hint
class DoubleKlondike(Game):
Layout_Method = Layout.harpLayout
Foundation_Class = SS_FoundationStack
RowStack_Class = KingAC_RowStack
Hint_Class = KlondikeType_Hint
@ -69,7 +70,7 @@ class DoubleKlondike(Game):
max_rounds=max_rounds, num_deal=num_deal)
s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self)
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:
s.rows.append(self.RowStack_Class(r.x, r.y, self))
# default
@ -278,6 +279,19 @@ class Delivery(BigDeal):
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
registerGame(GameInfo(21, DoubleKlondike, "Double Klondike",
GI.GT_KLONDIKE, 2, -1, GI.SL_BALANCED))
@ -309,5 +323,8 @@ registerGame(GameInfo(590, ChineseKlondike, "Chinese Klondike",
suits=(0, 1, 2) ))
registerGame(GameInfo(591, Pantagruel, "Pantagruel",
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()
# /***********************************************************************
# // 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
registerGame(GameInfo(2, Klondike, "Klondike",
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))
registerGame(GameInfo(651, EightByEight, "Eight by Eight",
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):
Talon_Class = StackWrapper(Montana_Talon, max_rounds=2)
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
import sys, os, re, string, time, types
import sys, os, locale
import traceback
import getopt
import gettext

View file

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

View file

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

View file

@ -158,8 +158,6 @@ class Combobox(Widget, Tkinter.Entry):
class Entry(Widget, Tkinter.Entry):
def __init__(self, master=None, cnf={}, **kw):
if kw.has_key('bg'):
del kw['bg']
Widget.__init__(self, master, "ttk::entry", cnf, kw)
def validate(self):
@ -172,26 +170,21 @@ class Entry(Widget, Tkinter.Entry):
class Label(Widget, Tkinter.Label):
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)
class Frame(Widget, Tkinter.Frame):
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)
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):
for opt in ('padx', 'pady',):
if kw.has_key(opt):
del kw[opt]
Widget.__init__(self, master, "ttk::labelframe", cnf, kw)
@ -202,8 +195,6 @@ class Menubutton(Widget, Tkinter.Menubutton):
class Scale(Widget, Tkinter.Scale):
def __init__(self, master=None, cnf={}, **kw):
if kw.has_key('resolution'):
del kw['resolution']
Widget.__init__(self, master, "ttk::scale", cnf, kw)
@ -272,7 +263,8 @@ class Paned(Widget):
def __init__(self, master=None, cnf={}, **kw):
if not kw.has_key('orient'):
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):
"""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.columnconfigure(0, 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.insert('end', _('abcdefghABCDEFGH'))
self.list_box = Tkinter.Listbox(frame, width=36, exportselection=False)
@ -144,8 +144,6 @@ class FontChooserDialog(MfxDialog):
kw = KwStruct(kw,
strings=(_("&OK"), _("&Cancel")),
default=0,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
)
return MfxDialog.initKw(self, kw)

View file

@ -1119,21 +1119,16 @@ class PysolMenubar(PysolMenubarActions):
def mSelectCardsetDialog(self, *event):
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
key = self.app.nextgame.cardset.index
d = SelectCardsetDialogWithPreview(self.top, title=_("Select ")+t,
app=self.app, manager=self.app.cardset_manager, key=key,
strings=strings, default=default)
app=self.app, manager=self.app.cardset_manager, key=key)
cs = self.app.cardset_manager.get(d.key)
if cs is None or d.key == self.app.cardset.index:
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
if d.button == 1:
if d.button == 0:
self._cancelDrag()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
@ -1159,10 +1154,6 @@ class PysolMenubar(PysolMenubarActions):
def mOptChangeCardback(self, *event):
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):
if self._cancelDrag(break_pause=False): return
n = self.app.tabletile_manager.len()

View file

@ -86,8 +86,6 @@ class SelectUserNameDialog(MfxDialog):
strings=(_("&OK"), _("&Cancel")), default=0,
separatorwidth=0,
resizable=0,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
)
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.insert(0, app.opt.player)
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)
widget.grid(row=1, column=1, padx=5, pady=5)
widget = Tkinter.Checkbutton(frame, variable=self.confirm_var,

View file

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

View file

@ -239,19 +239,17 @@ class SelectCardsetDialogWithPreview(MfxDialog):
def initKw(self, kw):
kw = KwStruct(kw,
strings=(_("&OK"), _("&Load"), _("&Cancel"),),
strings = (_("&Load"), _("&Info..."), _("&Cancel"),),
default=0,
resizable=1,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
)
return MfxDialog.initKw(self, kw)
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.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)
if not cs:
return
@ -399,8 +397,6 @@ class CardsetInfoDialog(MfxDialog):
default=0,
resizable=1,
separatorwidth=2,
padx=10, pady=10,
buttonpadx=10, buttonpady=5,
)
return MfxDialog.initKw(self, kw)

View file

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

View file

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

View file

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

View file

@ -68,37 +68,30 @@ class MfxStatusbar:
#
self.padx = 1
self.label_relief = 'sunken'
self.frame = Tkinter.Frame(self.top, bd=1)
self.frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew',
padx=1, pady=1)
#if os.name == "mac":
# Tkinter.Label(self.frame, width=2).pack(side='right')
if os.name == 'nt':
self.frame.config(relief='raised')
self.padx = 0
if 0:
self.frame.config(bd=0)
self.label_relief = 'flat'
self.padx = 0
self.top_frame = Tkinter.Frame(self.top)
self.top_frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew')
self.frame = Tkinter.Frame(self.top_frame)
self.frame.pack(side='left', expand=True, fill='both', padx=0, pady=1)
## if os.name == "mac":
## Tkinter.Label(self.frame, width=2).pack(side='right')
## if os.name == 'nt':
## #self.frame.config(relief='raised')
## #self.padx = 1
## pass
## if 0:
## self.frame.config(bd=0)
## self.label_relief = 'flat'
## self.padx = 0
# util
def _createLabel(self, name, side='left',
fill='none', expand=0, width=0,
tooltip=None):
if 0:
frame = Tkinter.Frame(self.frame, bd=1, relief=self.label_relief,
highlightbackground='#9e9a9e',
highlightthickness=1)
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)
frame = Tkinter.Frame(self.frame, borderwidth=1, relief=self.label_relief)
frame.pack(side=side, fill=fill, padx=self.padx, expand=expand)
label = Tkinter.Label(frame, width=width)
label.pack(expand=True, fill='both')
setattr(self, name + "_label", label)
self._widgets.append(label)
if tooltip:
@ -107,6 +100,10 @@ class MfxStatusbar:
b.setText(tooltip)
return label
def _createSizeGrip(self):
sg = Tkinter.SizeGrip(self.top_frame)
sg.pack(side='right', anchor='se')
#
# public methods
@ -132,11 +129,11 @@ class MfxStatusbar:
self.top.wm_geometry("") # cancel user-specified geometry
if not show:
# hide
self.frame.grid_forget()
self.top_frame.grid_forget()
else:
# show
self.frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew')
self.top_frame.grid(row=self._row, column=self._column,
columnspan=self._columnspan, sticky='ew')
self._show = show
return True
@ -154,7 +151,7 @@ class MfxStatusbar:
class PysolStatusbar(MfxStatusbar):
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 (
("time", _("Playing time"), 10),
@ -167,11 +164,12 @@ class PysolStatusbar(MfxStatusbar):
l = self._createLabel("info", fill='both', expand=1)
##l.config(text="", justify="left", anchor='w')
l.config(padding=(8, 0))
self._createSizeGrip()
class HelpStatusbar(MfxStatusbar):
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.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)
l = self._createLabel("url", fill='both', expand=1)
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)):
## if stack.cards[i].item.id in current:
## return i
x = event.x-self.xmargin+self.xview()[0]*int(self.cget('width'))
y = event.y-self.ymargin+self.yview()[0]*int(self.cget('height'))
if self.preview:
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
items = list(self.find_overlapping(x,y,x,y))
items.reverse()

View file

@ -144,7 +144,7 @@ class SingleGame_StatsDialog(MfxDialog):
self.fg = c.option_get('foreground', '') or c.cget("insertbackground")
#
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 = dy/2
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):
if not filename:
return
if os.name == "posix":
window.wm_iconbitmap("@" + filename)
window.wm_iconmask("@" + filename)
if os.name == 'nt':
##window.tk.call('wm', 'iconbitmap', root._w, '-default', '@'+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+)$")
@ -424,18 +428,28 @@ def load_theme(app, top, theme):
traceback.print_exc()
pass
# 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:
top.tk.call('style', 'theme', 'use', theme)
bg = top.tk.call('style', 'lookup', '.', '-background')
top.tk_setPalette(bg)
bg = top.tk.call('style', 'lookup', '.', '-background', 'active')
top.option_add('*Menu.activeBackground', bg)
if theme not in ('winnative',):
bg = top.tk.call('style', 'lookup', '.', '-background')
top.tk_setPalette(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']
if font:
top.tk.call('style', 'configure', '.', '-font', font)
else:
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',
'MfxSimpleEntry',
'MfxTooltip',
@ -43,6 +44,7 @@ __all__ = ['MfxMessageDialog',
# imports
import os, sys, time, types
import Tkinter as Tk
import Tile as Tkinter
import traceback
@ -147,10 +149,9 @@ class MfxDialog: # ex. _ToplevelDialog
key = event.char
key = unicode(key, 'utf-8')
key = key.lower()
button = self.accel_keys.get(key)
if not button is None:
self.mDone(button)
widget = self.accel_keys.get(key)
if not widget is None:
widget.event_generate('<<Invoke>>')
def initKw(self, kw):
kw = KwStruct(kw,
@ -172,7 +173,7 @@ class MfxDialog: # ex. _ToplevelDialog
def createFrames(self, kw):
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:
separator = Tkinter.Separator(self.top)
separator.pack(side='bottom', fill='x', pady=kw.separatorwidth/2)
@ -191,7 +192,7 @@ class MfxDialog: # ex. _ToplevelDialog
def createButtons(self, frame, kw):
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
max_len = 0
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 > 6 : button_width = max_len+2
else : button_width = 8
#print 'button_width =', button_width
#
#
for s in kw.strings:
xbutton = button = button + 1
@ -220,37 +219,38 @@ class MfxDialog: # ex. _ToplevelDialog
if s is None:
continue
accel_indx = s.find('&')
button_img = None
if MfxDialog.button_img:
button_img = MfxDialog.button_img.get(s)
s = s.replace('&', '')
if button < 0:
b = Tkinter.Button(frame, text=s, state="disabled")
widget = Tkinter.Button(frame, text=s, state="disabled")
button = xbutton
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)))
if button == kw.default:
focus = b
focus = widget
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:
# key accelerator
b.config(underline=accel_indx)
widget.config(underline=accel_indx)
key = s[accel_indx]
self.accel_keys[key.lower()] = button
self.accel_keys[key.lower()] = widget
#
## img = None
## if self.button_img:
## img = self.button_img.get(s)
## b.config(compound='left', image=img)
if button_img:
widget.config(compound='left', image=button_img)
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:
l = (lambda event=None, self=self, button=kw.default: self.mDone(button))
bind(self.top, "<Return>", l)
bind(self.top, "<KP_Enter>", l)
# left justify
##frame.columnconfigure(0, weight=1)
# right justify
frame.columnconfigure(0, weight=1)
return focus
@ -429,7 +429,7 @@ class MfxTooltip:
class MfxScrolledCanvas:
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.createFrame(kw)
self.canvas = None
@ -694,8 +694,7 @@ class StackDesc:
text = stack.getHelp()+'\n'+stack.getBaseCard()
text = text.strip()
if text:
frame = Tkinter.Frame(self.canvas, highlightthickness=1,
highlightbackground='black')
frame = Tkinter.Frame(self.canvas)
self.frame = frame
label = Tkinter.Message(frame, font=font, text=text, width=cardw-8,
fg='#000000', bg='#ffffe0', bd=1)
@ -725,7 +724,7 @@ class StackDesc:
# //
# ************************************************************************/
class PysolScale:
class MyPysolScale:
def __init__(self, parent, **kw):
if kw.has_key('resolution'):
self.resolution = kw['resolution']
@ -766,3 +765,13 @@ class PysolScale:
self.scale.configure(**kw)
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:
self.wm_minsize(400, 300)
else:
self.wm_minsize(520, 360)
self.wm_minsize(540, 380)
##self.self.wm_maxsize(9999, 9999) # unlimited
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
prog = sys.executable

View file

@ -273,16 +273,11 @@ class PysolToolbar(PysolToolbarActions):
# Change the look of the frame to match the platform look
# (see also setRelief)
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
elif os.name == "nt":
self.frame.config(bd=2, relief=self.frame_relief, padx=2, pady=2)
#self._createSeparator(width=4, side=Tkinter.LEFT, relief=Tkinter.FLAT)
#self._createSeparator(width=4, side=Tkinter.RIGHT, relief=Tkinter.FLAT)
self.frame.config(relief=self.frame_relief)
else:
self.frame.config(bd=0, highlightthickness=1)
pass
def config(self, w, v):
if w == 'player':
@ -353,8 +348,6 @@ class PysolToolbar(PysolToolbarActions):
sep = ToolbarSeparator(self.frame,
position=position,
toolbar=self,
bd=1,
highlightthickness=1,
width=4,
takefocus=0,
relief=self.separator_relief)
@ -367,8 +360,6 @@ class PysolToolbar(PysolToolbarActions):
sep = ToolbarFlatSeparator(self.frame,
position=position,
toolbar=self,
bd=1,
highlightthickness=1,
width=5,
takefocus=0,
relief='flat')
@ -462,16 +453,16 @@ class PysolToolbar(PysolToolbarActions):
if side == 1:
# top
pack_func(row=0, column=1, sticky='ew')
pack_func(row=0, column=1, sticky='ew', padx=0, pady=0)
elif side == 2:
# bottom
pack_func(row=2, column=1, sticky='ew')
pack_func(row=2, column=1, sticky='ew', padx=0, pady=0)
elif side == 3:
# left
pack_func(row=1, column=0, sticky='ns')
pack_func(row=1, column=0, sticky='ns', padx=0, pady=1)
else:
# right
pack_func(row=1, column=2, sticky='ns')
pack_func(row=1, column=2, sticky='ns', padx=0, pady=1)
# set orient
orient = side in (1, 2) and Tkinter.HORIZONTAL or Tkinter.VERTICAL
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.insert(0, app.opt.player)
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)
widget.grid(row=1, column=1, padx=5, pady=5)
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)):
## if stack.cards[i].item.id in current:
## return i
x = event.x-self.xmargin+self.xview()[0]*int(self.cget('width'))
y = event.y-self.ymargin+self.yview()[0]*int(self.cget('height'))
if self.preview:
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
items = list(self.find_overlapping(x,y,x,y))
items.reverse()

View file

@ -100,9 +100,12 @@ def wm_map(window, maximized=0):
def wm_set_icon(window, filename):
if not filename:
return
if os.name == "posix":
window.wm_iconbitmap("@" + filename)
window.wm_iconmask("@" + filename)
if os.name == 'nt':
window.wm_iconbitmap(default="@"+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+)$")

View file

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

View file

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