mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
- fixed game `Jane'
- added game `Granada' - added support accel-keys for buttons of dialogs - changed widget's styles - updated russian translation - updated GAMES_BY_PYSOL_VERSION (gamedb.py) - other minor fixes git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@4 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
parent
48672a12ec
commit
16934784ba
52 changed files with 1930 additions and 1358 deletions
3
Makefile
3
Makefile
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
PYSOLLIB_FILES=pysollib/tk/*.py pysollib/*.py \
|
PYSOLLIB_FILES=pysollib/tk/*.py pysollib/*.py \
|
||||||
pysollib/games/*.py pysollib/games/special/*.py \
|
pysollib/games/*.py pysollib/games/special/*.py \
|
||||||
pysollib/games/contrib/*.py pysollib/games/ultra/*.py
|
pysollib/games/contrib/*.py pysollib/games/ultra/*.py \
|
||||||
|
pysollib/games/mahjongg/*.py
|
||||||
|
|
||||||
.PHONY : install dist all_games_html rules pot mo
|
.PHONY : install dist all_games_html rules pot mo
|
||||||
|
|
||||||
|
|
|
@ -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: Fri May 26 20:25:43 2006\n"
|
"POT-Creation-Date: Tue Jun 6 02:20:52 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"
|
||||||
|
@ -63,9 +63,6 @@ msgstr ""
|
||||||
msgid "Acme"
|
msgid "Acme"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Adelaide"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Agnes Bernauer"
|
msgid "Agnes Bernauer"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -2322,6 +2319,9 @@ msgstr ""
|
||||||
msgid "Raw Prawn"
|
msgid "Raw Prawn"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Realm"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Rectangle"
|
msgid "Rectangle"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
1014
po/pysol.pot
1014
po/pysol.pot
File diff suppressed because it is too large
Load diff
|
@ -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: Fri May 26 20:25:43 2006\n"
|
"POT-Creation-Date: Tue Jun 6 02:20:52 2006\n"
|
||||||
"PO-Revision-Date: 2006-05-13 17:41+0400\n"
|
"PO-Revision-Date: 2006-06-03 03:28+0400\n"
|
||||||
"Last-Translator: Скоморох <skomoroh@gmail.com>\n"
|
"Last-Translator: Скоморох <skomoroh@gmail.com>\n"
|
||||||
"Language-Team: Russian <ru@li.org>\n"
|
"Language-Team: Russian <ru@li.org>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -63,10 +63,6 @@ msgstr ""
|
||||||
msgid "Acme"
|
msgid "Acme"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, fuzzy
|
|
||||||
msgid "Adelaide"
|
|
||||||
msgstr "Поляна"
|
|
||||||
|
|
||||||
msgid "Agnes Bernauer"
|
msgid "Agnes Bernauer"
|
||||||
msgstr "Агнесса Берно"
|
msgstr "Агнесса Берно"
|
||||||
|
|
||||||
|
@ -2417,6 +2413,10 @@ msgstr "Крыса"
|
||||||
msgid "Raw Prawn"
|
msgid "Raw Prawn"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Realm"
|
||||||
|
msgstr "Овен"
|
||||||
|
|
||||||
msgid "Rectangle"
|
msgid "Rectangle"
|
||||||
msgstr "Прямоугольник"
|
msgstr "Прямоугольник"
|
||||||
|
|
||||||
|
@ -3186,3 +3186,7 @@ msgstr "Церлин (3 колоды)"
|
||||||
|
|
||||||
msgid "Zeus"
|
msgid "Zeus"
|
||||||
msgstr "Зевс"
|
msgstr "Зевс"
|
||||||
|
|
||||||
|
#, fuzzy
|
||||||
|
#~ msgid "Adelaide"
|
||||||
|
#~ msgstr "Аделаида"
|
||||||
|
|
1166
po/ru_pysol.po
1166
po/ru_pysol.po
File diff suppressed because it is too large
Load diff
|
@ -55,12 +55,11 @@ from pysoltk import GameInfoDialog
|
||||||
|
|
||||||
# toolkit imports
|
# toolkit imports
|
||||||
from pysoltk import EVENT_HANDLED, EVENT_PROPAGATE
|
from pysoltk import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from pysoltk import MfxDialog, MfxSimpleEntry
|
from pysoltk import MfxMessageDialog, MfxSimpleEntry
|
||||||
from pysoltk import MfxExceptionDialog
|
from pysoltk import MfxExceptionDialog
|
||||||
from pysoltk import BooleanVar, IntVar, StringVar
|
from pysoltk import BooleanVar, IntVar, StringVar
|
||||||
from pysoltk import PlayerOptionsDialog
|
from pysoltk import PlayerOptionsDialog
|
||||||
from pysoltk import SoundOptionsDialog
|
from pysoltk import SoundOptionsDialog
|
||||||
from pysoltk import DemoOptionsDialog
|
|
||||||
#from pysoltk import HintOptionsDialog
|
#from pysoltk import HintOptionsDialog
|
||||||
from pysoltk import TimeoutsDialog
|
from pysoltk import TimeoutsDialog
|
||||||
from pysoltk import ColorsDialog
|
from pysoltk import ColorsDialog
|
||||||
|
@ -378,9 +377,9 @@ class PysolMenubarActions:
|
||||||
if not self.app.getGameInfo(id):
|
if not self.app.getGameInfo(id):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
except (ValueError, TypeError), ex:
|
except (ValueError, TypeError), ex:
|
||||||
d = MfxDialog(self.top, title=_("Invalid game number"),
|
d = MfxMessageDialog(self.top, title=_("Invalid game number"),
|
||||||
text=_("Invalid game number\n") + str(seed),
|
text=_("Invalid game number\n") + str(seed),
|
||||||
bitmap="error")
|
bitmap="error")
|
||||||
return
|
return
|
||||||
f = self.game.nextGameFlags(id, random)
|
f = self.game.nextGameFlags(id, random)
|
||||||
if f & 17 == 0:
|
if f & 17 == 0:
|
||||||
|
@ -407,7 +406,7 @@ class PysolMenubarActions:
|
||||||
id, f = None, self.game.getGameNumber(format=0)
|
id, f = None, self.game.getGameNumber(format=0)
|
||||||
d = MfxSimpleEntry(self.top, _("Select new game number"),
|
d = MfxSimpleEntry(self.top, _("Select new game number"),
|
||||||
_("\n\nEnter new game number"), f,
|
_("\n\nEnter new game number"), f,
|
||||||
strings=(_("OK"), _("Next number"), _("Cancel")),
|
strings=(_("&OK"), _("&Next number"), _("&Cancel")),
|
||||||
default=0, e_width=25)
|
default=0, e_width=25)
|
||||||
if d.status != 0: return
|
if d.status != 0: return
|
||||||
if d.button == 2: return
|
if d.button == 2: return
|
||||||
|
@ -614,8 +613,8 @@ class PysolMenubarActions:
|
||||||
text=_("Error while writing to file"))
|
text=_("Error while writing to file"))
|
||||||
else:
|
else:
|
||||||
if fd: fd.close()
|
if fd: fd.close()
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info",
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info",
|
||||||
text=_("Comments were appended to\n\n") + fn)
|
text=_("Comments were appended to\n\n") + fn)
|
||||||
self.tkopt.comment.set(bool(game.gsaveinfo.comment))
|
self.tkopt.comment.set(bool(game.gsaveinfo.comment))
|
||||||
|
|
||||||
|
|
||||||
|
@ -650,8 +649,8 @@ class PysolMenubarActions:
|
||||||
text=_("Error while writing to file"))
|
text=_("Error while writing to file"))
|
||||||
else:
|
else:
|
||||||
if file: file.close()
|
if file: file.close()
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info",
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info",
|
||||||
text=text + _(" were appended to\n\n") + filename)
|
text=text + _(" were appended to\n\n") + filename)
|
||||||
|
|
||||||
|
|
||||||
def mPlayerStats(self, *args, **kw):
|
def mPlayerStats(self, *args, **kw):
|
||||||
|
@ -891,20 +890,6 @@ class PysolMenubarActions:
|
||||||
if self._cancelDrag(): return
|
if self._cancelDrag(): return
|
||||||
self.app.opt.irregular_piles = self.tkopt.irregular_piles.get()
|
self.app.opt.irregular_piles = self.tkopt.irregular_piles.get()
|
||||||
|
|
||||||
def mOptDemoOptions(self, *args):
|
|
||||||
if self._cancelDrag(break_pause=False): return
|
|
||||||
d = DemoOptionsDialog(self.top, _("Set demo options"), self.app)
|
|
||||||
if d.status == 0 and d.button == 0:
|
|
||||||
self.app.opt.demo_logo = d.demo_logo
|
|
||||||
self.app.opt.demo_score = d.demo_score
|
|
||||||
self.app.opt.demo_sleep = d.demo_sleep
|
|
||||||
|
|
||||||
## def mOptHintOptions(self, *args):
|
|
||||||
## if self._cancelDrag(break_pause=False): return
|
|
||||||
## d = HintOptionsDialog(self.top, "Set hint options", self.app)
|
|
||||||
## if d.status == 0 and d.button == 0:
|
|
||||||
## self.app.opt.hint_sleep = d.hint_sleep
|
|
||||||
|
|
||||||
def mOptColorsOptions(self, *args):
|
def mOptColorsOptions(self, *args):
|
||||||
if self._cancelDrag(break_pause=False): return
|
if self._cancelDrag(break_pause=False): return
|
||||||
d = ColorsDialog(self.top, _("Set colors"), self.app)
|
d = ColorsDialog(self.top, _("Set colors"), self.app)
|
||||||
|
@ -953,9 +938,9 @@ class PysolMenubarActions:
|
||||||
text=_("Error while saving options"))
|
text=_("Error while saving options"))
|
||||||
else:
|
else:
|
||||||
# tell the player where their config files reside
|
# tell the player where their config files reside
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Info"),
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info",
|
||||||
text=_("Options were saved to\n\n") + self.app.fn.opt,
|
text=_("Options were saved to\n\n") + self.app.fn.opt)
|
||||||
bitmap="info")
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Help menu
|
# Help menu
|
||||||
|
|
|
@ -60,7 +60,7 @@ from settings import TOP_SIZE, TOP_TITLE
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from pysoltk import tkname, tkversion, wm_withdraw, loadImage
|
from pysoltk import tkname, tkversion, wm_withdraw, loadImage
|
||||||
from pysoltk import bind, unbind_destroy
|
from pysoltk import bind, unbind_destroy
|
||||||
from pysoltk import MfxDialog, MfxExceptionDialog
|
from pysoltk import 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
|
||||||
|
@ -77,6 +77,7 @@ gettext = _
|
||||||
# // Options
|
# // Options
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
class Options:
|
class Options:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.version_tuple = VERSION_TUPLE
|
self.version_tuple = VERSION_TUPLE
|
||||||
|
@ -158,8 +159,8 @@ class Options:
|
||||||
self.recent_gameid = []
|
self.recent_gameid = []
|
||||||
self.favorite_gameid = []
|
self.favorite_gameid = []
|
||||||
self.last_gameid = 0 # last game played
|
self.last_gameid = 0 # last game played
|
||||||
self.last_player = None # last player
|
#self.last_player = None # last player
|
||||||
self.last_save_dir = None # last directory for load/save
|
#self.last_save_dir = None # last directory for load/save
|
||||||
self.game_holded = 0
|
self.game_holded = 0
|
||||||
self.wm_maximized = 0
|
self.wm_maximized = 0
|
||||||
#
|
#
|
||||||
|
@ -176,7 +177,6 @@ class Options:
|
||||||
if top:
|
if top:
|
||||||
sw, sh, sd = top.winfo_screenwidth(), top.winfo_screenheight(), top.winfo_screendepth()
|
sw, sh, sd = top.winfo_screenwidth(), top.winfo_screenheight(), top.winfo_screendepth()
|
||||||
if sd > 8:
|
if sd > 8:
|
||||||
#self.tabletile_name = "Fade_Green.ppm" # basename
|
|
||||||
self.tabletile_name = "Nostalgy.gif" # basename
|
self.tabletile_name = "Nostalgy.gif" # basename
|
||||||
else:
|
else:
|
||||||
self.tabletile_name = None
|
self.tabletile_name = None
|
||||||
|
@ -185,8 +185,6 @@ class Options:
|
||||||
c = "Standard"
|
c = "Standard"
|
||||||
if sw < 800 or sh < 600:
|
if sw < 800 or sh < 600:
|
||||||
c = "2000"
|
c = "2000"
|
||||||
## elif sw >= 1024 and sh >= 768 and sd > 8:
|
|
||||||
## c = "Dondorf Whist A"
|
|
||||||
self.cardset = {
|
self.cardset = {
|
||||||
0: (c, ""),
|
0: (c, ""),
|
||||||
CSI.TYPE_FRENCH: (c, ""),
|
CSI.TYPE_FRENCH: (c, ""),
|
||||||
|
@ -517,8 +515,9 @@ class Application:
|
||||||
self.dn.__dict__[k] = v
|
self.dn.__dict__[k] = v
|
||||||
# file names
|
# file names
|
||||||
self.fn = Struct(
|
self.fn = Struct(
|
||||||
opt = os.path.join(self.dn.config, "options.dat"),
|
opt = os.path.join(self.dn.config, "options.dat"),
|
||||||
stats = os.path.join(self.dn.config, "statistics.dat"),
|
opt_conf = os.path.join(self.dn.config, "options.conf"),
|
||||||
|
stats = os.path.join(self.dn.config, "statistics.dat"),
|
||||||
holdgame = os.path.join(self.dn.config, "holdgame.dat"),
|
holdgame = os.path.join(self.dn.config, "holdgame.dat"),
|
||||||
comments = os.path.join(self.dn.config, "comments.dat"),
|
comments = os.path.join(self.dn.config, "comments.dat"),
|
||||||
)
|
)
|
||||||
|
@ -822,13 +821,22 @@ 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):
|
||||||
MfxDialog.img = []
|
MfxMessageDialog.img = {}
|
||||||
#dir = os.path.join('images', 'dialog', 'default')
|
#dir = os.path.join('images', 'dialog', 'default')
|
||||||
dir = os.path.join('images', 'dialog', 'bluecurve')
|
dir = os.path.join('images', 'dialog', 'bluecurve')
|
||||||
for f in ('error', 'info', 'question', 'warning'):
|
for f in ('error', 'info', 'question', 'warning'):
|
||||||
fn = self.dataloader.findImage(f, dir)
|
fn = self.dataloader.findImage(f, dir)
|
||||||
im = loadImage(fn)
|
im = loadImage(fn)
|
||||||
MfxDialog.img.append(im)
|
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
|
||||||
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'):
|
||||||
|
@ -1071,7 +1079,7 @@ class Application:
|
||||||
return 1
|
return 1
|
||||||
#
|
#
|
||||||
t = self.checkCompatibleCardsetType(gi, self.cardset)
|
t = self.checkCompatibleCardsetType(gi, self.cardset)
|
||||||
d = MfxDialog(self.top, title=_("Incompatible ")+CARDSET,
|
d = MfxMessageDialog(self.top, title=_("Incompatible ")+CARDSET,
|
||||||
bitmap="warning",
|
bitmap="warning",
|
||||||
text=_('''The currently selected %s %s
|
text=_('''The currently selected %s %s
|
||||||
is not compatible with the game
|
is not compatible with the game
|
||||||
|
@ -1079,7 +1087,7 @@ is not compatible with the game
|
||||||
|
|
||||||
Please select a %s type %s.
|
Please select a %s type %s.
|
||||||
''') % (CARDSET, self.cardset.name, gi.name, t[0], CARDSET),
|
''') % (CARDSET, self.cardset.name, gi.name, t[0], CARDSET),
|
||||||
strings=(_("OK"),), default=0)
|
strings=(_("&OK"),), default=0)
|
||||||
cs = self.__selectCardsetDialog(t)
|
cs = self.__selectCardsetDialog(t)
|
||||||
if cs is None:
|
if cs is None:
|
||||||
return -1
|
return -1
|
||||||
|
@ -1091,7 +1099,7 @@ Please select a %s type %s.
|
||||||
d = SelectCardsetByTypeDialogWithPreview(
|
d = SelectCardsetByTypeDialogWithPreview(
|
||||||
self.top, title=_("Please select a %s type %s") % (t[0], CARDSET),
|
self.top, title=_("Please select a %s type %s") % (t[0], CARDSET),
|
||||||
app=self, manager=self.cardset_manager, key=key,
|
app=self, manager=self.cardset_manager, key=key,
|
||||||
strings=(None, _("OK"), _("Cancel")), default=1)
|
strings=(None, _("&OK"), _("&Cancel")), default=1)
|
||||||
if d.status != 0 or d.button != 1:
|
if d.status != 0 or d.button != 1:
|
||||||
return None
|
return None
|
||||||
cs = self.cardset_manager.get(d.key)
|
cs = self.cardset_manager.get(d.key)
|
||||||
|
@ -1240,7 +1248,7 @@ Please select a %s type %s.
|
||||||
def getGameMenuitemName(self, id):
|
def getGameMenuitemName(self, id):
|
||||||
gi = self.gdb.get(id)
|
gi = self.gdb.get(id)
|
||||||
if gi is None: return None
|
if gi is None: return None
|
||||||
return gi.short_name
|
return gettext(gi.short_name)
|
||||||
|
|
||||||
def getGameRulesFilename(self, id):
|
def getGameRulesFilename(self, id):
|
||||||
gi = self.gdb.get(id)
|
gi = self.gdb.get(id)
|
||||||
|
@ -1248,7 +1256,7 @@ Please select a %s type %s.
|
||||||
if gi.rules_filename is not None:
|
if gi.rules_filename is not None:
|
||||||
return gi.rules_filename
|
return gi.rules_filename
|
||||||
n = gi.name
|
n = gi.name
|
||||||
n = re.sub(r"[\[\(].*$", "", n)
|
##n = re.sub(r"[\[\(].*$", "", n)
|
||||||
n = latin1_to_ascii(n)
|
n = latin1_to_ascii(n)
|
||||||
n = re.sub(r"[^\w]", "", n)
|
n = re.sub(r"[^\w]", "", n)
|
||||||
n = n.lower() + ".html"
|
n = n.lower() + ".html"
|
||||||
|
|
|
@ -55,7 +55,7 @@ from pysoltk import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from pysoltk import CURSOR_WATCH, ANCHOR_SW, ANCHOR_SE
|
from pysoltk import CURSOR_WATCH, ANCHOR_SW, ANCHOR_SE
|
||||||
from pysoltk import tkname, bind, wm_map
|
from pysoltk import tkname, bind, wm_map
|
||||||
from pysoltk import after, after_idle, after_cancel
|
from pysoltk import after, after_idle, after_cancel
|
||||||
from pysoltk import MfxDialog, MfxExceptionDialog
|
from pysoltk import MfxMessageDialog, MfxExceptionDialog
|
||||||
from pysoltk import MfxCanvasText, MfxCanvasImage
|
from pysoltk import MfxCanvasText, MfxCanvasImage
|
||||||
from pysoltk import MfxCanvasLine, MfxCanvasRectangle
|
from pysoltk import MfxCanvasLine, MfxCanvasRectangle
|
||||||
from pysoltk import Card
|
from pysoltk import Card
|
||||||
|
@ -823,18 +823,18 @@ class Game:
|
||||||
if not title: title = PACKAGE
|
if not title: title = PACKAGE
|
||||||
if not text: text = _("Discard current game ?")
|
if not text: text = _("Discard current game ?")
|
||||||
self.playSample("areyousure")
|
self.playSample("areyousure")
|
||||||
d = MfxDialog(self.top, title=title, text=text,
|
d = MfxMessageDialog(self.top, title=title, text=text,
|
||||||
bitmap="question",
|
bitmap="question",
|
||||||
Default=default, strings=(_("OK"), _("Cancel")))
|
strings=(_("&OK"), _("&Cancel")))
|
||||||
if d.status != 0 or d.button != 0:
|
if d.status != 0 or d.button != 0:
|
||||||
return 0
|
return 0
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def notYetImplemented(self):
|
def notYetImplemented(self):
|
||||||
# don't used
|
# don't used
|
||||||
d = MfxDialog(self.top, title="Not yet implemented",
|
d = MfxMessageDialog(self.top, title="Not yet implemented",
|
||||||
text="This function is\nnot yet implemented.",
|
text="This function is\nnot yet implemented.",
|
||||||
bitmap="error")
|
bitmap="error")
|
||||||
|
|
||||||
# main animation method
|
# main animation method
|
||||||
def animatedMoveTo(self, from_stack, to_stack, cards, x, y, tkraise=1, frames=-1, shadow=-1):
|
def animatedMoveTo(self, from_stack, to_stack, cards, x, y, tkraise=1, frames=-1, shadow=-1):
|
||||||
|
@ -1193,8 +1193,8 @@ class Game:
|
||||||
time = self.getTime()
|
time = self.getTime()
|
||||||
self.finished = True
|
self.finished = True
|
||||||
self.playSample("winperfect", priority=1000)
|
self.playSample("winperfect", priority=1000)
|
||||||
d = MfxDialog(self.top, title=_("Game won"),
|
d = MfxMessageDialog(self.top, title=_("Game won"),
|
||||||
text=_('''
|
text=_('''
|
||||||
Congratulations, this
|
Congratulations, this
|
||||||
was a truly perfect game !
|
was a truly perfect game !
|
||||||
|
|
||||||
|
@ -1202,33 +1202,33 @@ Your playing time is %s
|
||||||
for %d moves.
|
for %d moves.
|
||||||
%s
|
%s
|
||||||
''') % (time, self.moves.index, top_msg),
|
''') % (time, self.moves.index, top_msg),
|
||||||
strings=(_("New game"), None, _("Cancel")),
|
strings=(_("&New game"), None, _("&Cancel")),
|
||||||
image=self.app.gimages.logos[5], separatorwidth=2)
|
image=self.app.gimages.logos[5], separatorwidth=2)
|
||||||
elif status == 1:
|
elif status == 1:
|
||||||
top_msg = self.updateStats()
|
top_msg = self.updateStats()
|
||||||
time = self.getTime()
|
time = self.getTime()
|
||||||
self.finished = True
|
self.finished = True
|
||||||
self.playSample("winwon", priority=1000)
|
self.playSample("winwon", priority=1000)
|
||||||
d = MfxDialog(self.top, title=_("Game won"),
|
d = MfxMessageDialog(self.top, title=_("Game won"),
|
||||||
text=_('''
|
text=_('''
|
||||||
Congratulations, you did it !
|
Congratulations, you did it !
|
||||||
|
|
||||||
Your playing time is %s
|
Your playing time is %s
|
||||||
for %d moves.
|
for %d moves.
|
||||||
%s
|
%s
|
||||||
''') % (time, self.moves.index, top_msg),
|
''') % (time, self.moves.index, top_msg),
|
||||||
strings=(_("New game"), None, _("Cancel")),
|
strings=(_("&New game"), None, _("&Cancel")),
|
||||||
image=self.app.gimages.logos[4], separatorwidth=2)
|
image=self.app.gimages.logos[4], separatorwidth=2)
|
||||||
elif self.gstats.updated < 0:
|
elif self.gstats.updated < 0:
|
||||||
self.playSample("winfinished", priority=1000)
|
self.playSample("winfinished", priority=1000)
|
||||||
d = MfxDialog(self.top, title=_("Game finished"), bitmap="info",
|
d = MfxMessageDialog(self.top, title=_("Game finished"), bitmap="info",
|
||||||
text=_("\nGame finished\n"),
|
text=_("\nGame finished\n"),
|
||||||
strings=(_("New game"), None, _("Cancel")))
|
strings=(_("&New game"), None, _("&Cancel")))
|
||||||
else:
|
else:
|
||||||
self.playSample("winlost", priority=1000)
|
self.playSample("winlost", priority=1000)
|
||||||
d = MfxDialog(self.top, title=_("Game finished"), bitmap="info",
|
d = MfxMessageDialog(self.top, title=_("Game finished"), bitmap="info",
|
||||||
text=_("\nGame finished, but not without my help...\n"),
|
text=_("\nGame finished, but not without my help...\n"),
|
||||||
strings=(_("New game"), _("Restart"), _("Cancel")))
|
strings=(_("&New game"), _("&Restart"), _("&Cancel")))
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
if d.status == 0 and d.button == 0:
|
if d.status == 0 and d.button == 0:
|
||||||
# new game
|
# new game
|
||||||
|
@ -1631,20 +1631,21 @@ for %d moves.
|
||||||
status = 2
|
status = 2
|
||||||
elif player_moves == 0:
|
elif player_moves == 0:
|
||||||
self.playSample("autopilotwon")
|
self.playSample("autopilotwon")
|
||||||
s = self.app.miscrandom.choice((_("Great"), _("Cool"), _("Yeah"), _("Wow")))
|
s = self.app.miscrandom.choice((_("&Great"), _("&Cool"), _("&Yeah"), _("&Wow"))) # ??? accelerators
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
||||||
text=_("\nGame solved in %d moves.\n") % self.moves.index,
|
text=_("\nGame solved in %d moves.\n") % self.moves.index,
|
||||||
image=self.app.gimages.logos[4], strings=(s,),
|
image=self.app.gimages.logos[4], strings=(s,),
|
||||||
separatorwidth=2, timeout=timeout)
|
separatorwidth=2, timeout=timeout)
|
||||||
status = d.status
|
status = d.status
|
||||||
else:
|
else:
|
||||||
s = self.app.miscrandom.choice((_("OK"), _("OK")))
|
##s = self.app.miscrandom.choice((_("&OK"), _("&OK")))
|
||||||
|
s = _("&OK")
|
||||||
text = _("\nGame finished\n")
|
text = _("\nGame finished\n")
|
||||||
if self.app.debug:
|
if self.app.debug:
|
||||||
text = text + "\n%d %d\n" % (self.stats.player_moves, self.stats.demo_moves)
|
text = text + "\n%d %d\n" % (self.stats.player_moves, self.stats.demo_moves)
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
||||||
text=text, bitmap=bitmap, strings=(s,),
|
text=text, bitmap=bitmap, strings=(s,),
|
||||||
padx=30, timeout=timeout)
|
padx=30, timeout=timeout)
|
||||||
status = d.status
|
status = d.status
|
||||||
elif finished:
|
elif finished:
|
||||||
##self.stopPlayTimer()
|
##self.stopPlayTimer()
|
||||||
|
@ -1653,11 +1654,11 @@ for %d moves.
|
||||||
else:
|
else:
|
||||||
if player_moves == 0:
|
if player_moves == 0:
|
||||||
self.playSample("autopilotlost")
|
self.playSample("autopilotlost")
|
||||||
s = self.app.miscrandom.choice((_("Oh well"), _("That's life"), _("Hmm")))
|
s = self.app.miscrandom.choice((_("&Oh well"), _("&That's life"), _("&Hmm"))) # ??? accelerators
|
||||||
d = MfxDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"),
|
||||||
text=_("\nThis won't come out...\n"),
|
text=_("\nThis won't come out...\n"),
|
||||||
bitmap=bitmap, strings=(s,),
|
bitmap=bitmap, strings=(s,),
|
||||||
padx=30, timeout=timeout)
|
padx=30, timeout=timeout)
|
||||||
status = d.status
|
status = d.status
|
||||||
if finished:
|
if finished:
|
||||||
self.updateStats(demo=1)
|
self.updateStats(demo=1)
|
||||||
|
@ -2125,8 +2126,8 @@ for %d moves.
|
||||||
except AssertionError, ex:
|
except AssertionError, ex:
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
self.setCursor(cursor=self.app.top_cursor)
|
self.setCursor(cursor=self.app.top_cursor)
|
||||||
d = MfxDialog(self.top, title=_("Load game error"), bitmap="error",
|
d = MfxMessageDialog(self.top, title=_("Load game error"), bitmap="error",
|
||||||
text=_("""\
|
text=_("""\
|
||||||
Error while loading game.
|
Error while loading game.
|
||||||
|
|
||||||
Probably the game file is damaged,
|
Probably the game file is damaged,
|
||||||
|
@ -2139,8 +2140,8 @@ but this could also be a bug you might want to report."""))
|
||||||
except:
|
except:
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
self.setCursor(cursor=self.app.top_cursor)
|
self.setCursor(cursor=self.app.top_cursor)
|
||||||
d = MfxDialog(self.top, title=_("Load game error"), bitmap="error",
|
d = MfxMessageDialog(self.top, title=_("Load game error"), bitmap="error",
|
||||||
text=_("""\
|
text=_("""\
|
||||||
Internal error while loading game.
|
Internal error while loading game.
|
||||||
|
|
||||||
Please report this bug."""))
|
Please report this bug."""))
|
||||||
|
|
|
@ -307,7 +307,7 @@ class GI:
|
||||||
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
|
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
|
||||||
100, 101, 102, 103, 104, 107, 108,)),
|
100, 101, 102, 103, 104, 107, 108,)),
|
||||||
("3.10", (109, 110, 111, 112, 113, 114, 116, 117, 118, 119,
|
("3.10", (109, 110, 111, 112, 113, 114, 116, 117, 118, 119,
|
||||||
120,-121,-122, 123, 124, 125, 127)),
|
120, 121, 122, 123, 124, 125, 127)),
|
||||||
("3.20", (128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
|
("3.20", (128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
|
||||||
138, 139, 140, 141, 142,
|
138, 139, 140, 141, 142,
|
||||||
12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352)),
|
12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352)),
|
||||||
|
@ -318,16 +318,35 @@ class GI:
|
||||||
("4.20", (165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
|
("4.20", (165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
|
||||||
175, 176, 177, 178)),
|
175, 176, 177, 178)),
|
||||||
("4.30", (179, 180, 181, 182, 183, 184)),
|
("4.30", (179, 180, 181, 182, 183, 184)),
|
||||||
("4.41", (185, 186,-187,-188,-189,-190,-191,-192, 193,-194,
|
("4.41", (185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
|
||||||
195, 196,-197,-198, 199)),
|
195, 196, 197, 198, 199)),
|
||||||
("4.60", (200, 201, 202, 203, 204, 205,
|
("4.60", (200, 201, 202, 203, 204, 205,
|
||||||
206, 207, 208, 209,
|
206, 207, 208, 209,
|
||||||
210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
|
210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
|
||||||
220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
|
220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
|
||||||
230, 231, 232, 233, 234, 235, 236)),
|
230, 231, 232, 233, 234, 235, 236)),
|
||||||
## ## + tuple(range(353, 370)),
|
|
||||||
## ),
|
|
||||||
("4.70", (237,)),
|
("4.70", (237,)),
|
||||||
|
('fc-0.5.0', (#121, 122, 187, 188, 189, 190, 191, 192, 194, 197, 198,
|
||||||
|
5301, 5302, 9011, 11001, 11002, 11003, 11004, 11005,
|
||||||
|
11006, 12353, 12354, 12355, 12356, 12357, 12358, 12359,
|
||||||
|
12360, 12361, 12362, 12363, 12364, 12365, 12366, 12367,
|
||||||
|
12368, 12369, 12370, 12371, 12372, 12373, 12374, 12375,
|
||||||
|
12376, 12377, 12378, 12379, 12380, 12381, 12382, 12383,
|
||||||
|
12384, 12385, 13001, 13002, 13003, 13004, 13005, 13006,
|
||||||
|
13007, 13008, 13009, 13010, 13011, 13012, 13013, 13014,
|
||||||
|
13163, 13164, 13165, 13166, 13167, 14401, 14402, 14403,
|
||||||
|
14404, 14405, 14406, 14407, 14408, 14409, 14410, 14411,
|
||||||
|
14412, 14413, 15406, 15407, 15408, 15409, 15410, 15411,
|
||||||
|
15412, 15413, 15414, 15415, 15416, 15417, 15418, 15419,
|
||||||
|
15420, 15421, 15422, 16000, 16001, 16002, 16003, 16004,
|
||||||
|
16666, 16667, 16668, 16669, 16670, 16671, 16672, 16673,
|
||||||
|
16674, 16675, 16676, 16677, 16678, 16679, 16680, 22216,
|
||||||
|
22217, 22218, 22219, 22220, 22221, 22223, 22224, 22225,
|
||||||
|
22226, 22227, 22228, 22229, 22230, 22231, 22232,)),
|
||||||
|
('fc-0.8.0', tuple(range(263, 323))),
|
||||||
|
('fc-0.9.0', tuple(range(323, 421))),
|
||||||
|
('fc-0.9.1', tuple(range(421, 441))),
|
||||||
|
('fc-0.9.2', tuple(range(441, 466))),
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
@ -489,11 +508,8 @@ class GameManager:
|
||||||
for n in gi.altnames:
|
for n in gi.altnames:
|
||||||
if self.__all_gamenames.has_key(n):
|
if self.__all_gamenames.has_key(n):
|
||||||
raise GameInfoException, "duplicate altgame name " + str(gi.id) + ": " + n
|
raise GameInfoException, "duplicate altgame name " + str(gi.id) + ": " + n
|
||||||
if 0 and gi.si.game_flags & GI.GT_XORIGINAL:
|
##if 0 and gi.si.game_flags & GI.GT_XORIGINAL:
|
||||||
return
|
## return
|
||||||
if 0 and (206 <= gi.id <= 236):
|
|
||||||
##print gi.id
|
|
||||||
return
|
|
||||||
##print gi.id, gi.name
|
##print gi.id, gi.name
|
||||||
self.__all_games[gi.id] = gi
|
self.__all_games[gi.id] = gi
|
||||||
self.__all_gamenames[gi.name] = gi
|
self.__all_gamenames[gi.name] = gi
|
||||||
|
@ -510,6 +526,11 @@ class GameManager:
|
||||||
# update registry
|
# update registry
|
||||||
k = gi.si.game_type
|
k = gi.si.game_type
|
||||||
self.registered_game_types[k] = self.registered_game_types.get(k, 0) + 1
|
self.registered_game_types[k] = self.registered_game_types.get(k, 0) + 1
|
||||||
|
## if not gi.si.game_type == GI.GT_MAHJONGG:
|
||||||
|
## for v, k in GI.GAMES_BY_PYSOL_VERSION:
|
||||||
|
## if gi.id in k: break
|
||||||
|
## else:
|
||||||
|
## print gi.id
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -165,5 +165,5 @@ registerGame(GameInfo(321, Carthage, "Carthage",
|
||||||
registerGame(GameInfo(322, AlgerianPatience, "Algerian Patience",
|
registerGame(GameInfo(322, AlgerianPatience, "Algerian Patience",
|
||||||
GI.GT_2DECK_TYPE, 2, 0))
|
GI.GT_2DECK_TYPE, 2, 0))
|
||||||
registerGame(GameInfo(457, AlgerianPatience3, "Algerian Patience (3 decks)",
|
registerGame(GameInfo(457, AlgerianPatience3, "Algerian Patience (3 decks)",
|
||||||
GI.GT_3DECK_TYPE, 3, 0))
|
GI.GT_3DECK_TYPE | GI.GT_ORIGINAL, 3, 0))
|
||||||
|
|
||||||
|
|
|
@ -641,7 +641,7 @@ registerGame(GameInfo(148, Chessboard, "Chessboard",
|
||||||
registerGame(GameInfo(300, Stronghold, "Stronghold",
|
registerGame(GameInfo(300, Stronghold, "Stronghold",
|
||||||
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0))
|
||||||
registerGame(GameInfo(301, Fastness, "Fastness",
|
registerGame(GameInfo(301, Fastness, "Fastness",
|
||||||
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(306, Zerline, "Zerline",
|
registerGame(GameInfo(306, Zerline, "Zerline",
|
||||||
GI.GT_BELEAGUERED_CASTLE, 2, 0))
|
GI.GT_BELEAGUERED_CASTLE, 2, 0))
|
||||||
registerGame(GameInfo(324, Bastion, "Bastion",
|
registerGame(GameInfo(324, Bastion, "Bastion",
|
||||||
|
@ -653,7 +653,7 @@ registerGame(GameInfo(351, Chequers, "Chequers",
|
||||||
registerGame(GameInfo(393, CastleOfIndolence, "Castle of Indolence",
|
registerGame(GameInfo(393, CastleOfIndolence, "Castle of Indolence",
|
||||||
GI.GT_BELEAGUERED_CASTLE, 2, 0))
|
GI.GT_BELEAGUERED_CASTLE, 2, 0))
|
||||||
registerGame(GameInfo(395, Zerline3Decks, "Zerline (3 decks)",
|
registerGame(GameInfo(395, Zerline3Decks, "Zerline (3 decks)",
|
||||||
GI.GT_BELEAGUERED_CASTLE, 3, 0))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_ORIGINAL, 3, 0))
|
||||||
registerGame(GameInfo(400, Rittenhouse, "Rittenhouse",
|
registerGame(GameInfo(400, Rittenhouse, "Rittenhouse",
|
||||||
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 2, 0))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 2, 0))
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,11 @@ class Gloria(Game):
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // Adelaide
|
# // Realm
|
||||||
# // Mancunian
|
# // Mancunian
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class Adelaide(Game):
|
class Realm(Game):
|
||||||
|
|
||||||
Hint_Class = CautiousDefaultHint
|
Hint_Class = CautiousDefaultHint
|
||||||
RowStack_Class = StackWrapper(UD_AC_RowStack, base_rank=NO_RANK)
|
RowStack_Class = StackWrapper(UD_AC_RowStack, base_rank=NO_RANK)
|
||||||
|
@ -236,7 +236,7 @@ class Adelaide(Game):
|
||||||
return card1.color != card2.color and abs(card1.rank-card2.rank) == 1
|
return card1.color != card2.color and abs(card1.rank-card2.rank) == 1
|
||||||
|
|
||||||
|
|
||||||
class Mancunian(Adelaide):
|
class Mancunian(Realm):
|
||||||
RowStack_Class = StackWrapper(UD_RK_RowStack, base_rank=NO_RANK)
|
RowStack_Class = StackWrapper(UD_RK_RowStack, base_rank=NO_RANK)
|
||||||
|
|
||||||
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
@ -247,11 +247,11 @@ class Mancunian(Adelaide):
|
||||||
registerGame(GameInfo(290, Bisley, "Bisley",
|
registerGame(GameInfo(290, Bisley, "Bisley",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
||||||
registerGame(GameInfo(372, DoubleBisley, "Double Bisley",
|
registerGame(GameInfo(372, DoubleBisley, "Double Bisley",
|
||||||
GI.GT_2DECK_TYPE | GI.GT_OPEN, 2, 0))
|
GI.GT_2DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(373, Gloria, "Gloria",
|
registerGame(GameInfo(373, Gloria, "Gloria",
|
||||||
GI.GT_2DECK_TYPE | GI.GT_OPEN, 2, 0))
|
GI.GT_2DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(374, Adelaide, "Adelaide",
|
registerGame(GameInfo(374, Realm, "Realm",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(375, Mancunian, "Mancunian",
|
registerGame(GameInfo(375, Mancunian, "Mancunian",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ class Backbone(Game):
|
||||||
l, s = Layout(self), self.s
|
l, s = Layout(self), self.s
|
||||||
|
|
||||||
# set window
|
# set window
|
||||||
w, h = l.XM+(rows+2)*l.XS, l.YM+3*l.XS+10*l.YOFFSET
|
w, h = l.XM+(rows+2)*l.XS, max(l.YM+3*l.XS+10*l.YOFFSET, l.YM+2*l.YS+11*l.YOFFSET+20)
|
||||||
self.setSize(w, h)
|
self.setSize(w, h)
|
||||||
|
|
||||||
# create stacks
|
# create stacks
|
||||||
|
|
|
@ -313,13 +313,13 @@ registerGame(GameInfo(311, Dumfries, "Dumfries",
|
||||||
registerGame(GameInfo(312, Galloway, "Galloway",
|
registerGame(GameInfo(312, Galloway, "Galloway",
|
||||||
GI.GT_1DECK_TYPE, 1, 0))
|
GI.GT_1DECK_TYPE, 1, 0))
|
||||||
registerGame(GameInfo(313, Robin, "Robin",
|
registerGame(GameInfo(313, Robin, "Robin",
|
||||||
GI.GT_2DECK_TYPE, 2, 0))
|
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(348, Arachnida, "Arachnida",
|
registerGame(GameInfo(348, Arachnida, "Arachnida",
|
||||||
GI.GT_SPIDER, 2, 0))
|
GI.GT_SPIDER, 2, 0))
|
||||||
registerGame(GameInfo(349, MissMuffet, "Miss Muffet",
|
registerGame(GameInfo(349, MissMuffet, "Miss Muffet",
|
||||||
GI.GT_SPIDER | GI.GT_OPEN, 1, 0))
|
GI.GT_SPIDER | GI.GT_OPEN, 1, 0))
|
||||||
registerGame(GameInfo(352, Nordic, "Nordic",
|
registerGame(GameInfo(352, Nordic, "Nordic",
|
||||||
GI.GT_SPIDER | GI.GT_OPEN, 1, 0))
|
GI.GT_SPIDER | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(414, GermanPatience, "German Patience",
|
registerGame(GameInfo(414, GermanPatience, "German Patience",
|
||||||
GI.GT_2DECK_TYPE, 2, 0))
|
GI.GT_2DECK_TYPE, 2, 0))
|
||||||
registerGame(GameInfo(415, BavarianPatience, "Bavarian Patience",
|
registerGame(GameInfo(415, BavarianPatience, "Bavarian Patience",
|
||||||
|
|
|
@ -520,7 +520,7 @@ registerGame(GameInfo(365, SevenByFive, "Seven by Five",
|
||||||
registerGame(GameInfo(383, Bath, "Bath",
|
registerGame(GameInfo(383, Bath, "Bath",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 1, 0))
|
GI.GT_FREECELL | GI.GT_OPEN, 1, 0))
|
||||||
registerGame(GameInfo(394, Clink, "Clink",
|
registerGame(GameInfo(394, Clink, "Clink",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 1, 0))
|
GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(448, Repair, "Repair",
|
registerGame(GameInfo(448, Repair, "Repair",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
||||||
registerGame(GameInfo(451, Cell11, "Cell 11",
|
registerGame(GameInfo(451, Cell11, "Cell 11",
|
||||||
|
|
|
@ -343,10 +343,10 @@ registerGame(GameInfo(142, DieSchlange, "Snake",
|
||||||
registerGame(GameInfo(279, Kings, "Kings",
|
registerGame(GameInfo(279, Kings, "Kings",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
||||||
registerGame(GameInfo(286, Retinue, "Retinue",
|
registerGame(GameInfo(286, Retinue, "Retinue",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(299, SalicLaw, "Salic Law",
|
registerGame(GameInfo(299, SalicLaw, "Salic Law",
|
||||||
GI.GT_2DECK_TYPE, 2, 0))
|
GI.GT_2DECK_TYPE, 2, 0))
|
||||||
registerGame(GameInfo(442, Deep, "Deep",
|
registerGame(GameInfo(442, Deep, "Deep",
|
||||||
GI.GT_FREECELL | GI.GT_OPEN, 2, 0))
|
GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -576,8 +576,9 @@ class Jane(Klondike):
|
||||||
self.sg.dropstacks.append(s.talon)
|
self.sg.dropstacks.append(s.talon)
|
||||||
x, y = l.XM, self.height - l.YM
|
x, y = l.XM, self.height - l.YM
|
||||||
# ???
|
# ???
|
||||||
self.texts.info = MfxCanvasText(self.canvas, x, y, anchor="sw",
|
#self.texts.info = MfxCanvasText(self.canvas, x, y, anchor="sw",
|
||||||
font=self.app.getFont("canvas_default"))
|
# font=self.app.getFont("canvas_default"))
|
||||||
|
l.createText(s.talon, 'ss')
|
||||||
|
|
||||||
def startGame(self, flip=0, reverse=1):
|
def startGame(self, flip=0, reverse=1):
|
||||||
for i in range(1, len(self.s.rows)):
|
for i in range(1, len(self.s.rows)):
|
||||||
|
|
|
@ -396,9 +396,9 @@ registerGame(GameInfo(63, BlueMoon, "Blue Moon",
|
||||||
registerGame(GameInfo(117, RedMoon, "Red Moon",
|
registerGame(GameInfo(117, RedMoon, "Red Moon",
|
||||||
GI.GT_MONTANA | GI.GT_OPEN, 1, 2))
|
GI.GT_MONTANA | GI.GT_OPEN, 1, 2))
|
||||||
registerGame(GameInfo(275, Galary, "Galary",
|
registerGame(GameInfo(275, Galary, "Galary",
|
||||||
GI.GT_MONTANA | GI.GT_OPEN, 1, 2))
|
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2))
|
||||||
registerGame(GameInfo(276, Moonlight, "Moonlight",
|
registerGame(GameInfo(276, Moonlight, "Moonlight",
|
||||||
GI.GT_MONTANA | GI.GT_OPEN, 1, 2,
|
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2,
|
||||||
si={"ncards": 48}))
|
si={"ncards": 48}))
|
||||||
registerGame(GameInfo(380, Jungle, "Jungle",
|
registerGame(GameInfo(380, Jungle, "Jungle",
|
||||||
GI.GT_MONTANA | GI.GT_OPEN, 1, 1))
|
GI.GT_MONTANA | GI.GT_OPEN, 1, 1))
|
||||||
|
|
|
@ -791,7 +791,7 @@ registerGame(GameInfo(328, TheWish, "The Wish",
|
||||||
GI.GT_PAIRING_TYPE, 1, 0,
|
GI.GT_PAIRING_TYPE, 1, 0,
|
||||||
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
|
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
|
||||||
registerGame(GameInfo(329, TheWishOpen, "The Wish (open)",
|
registerGame(GameInfo(329, TheWishOpen, "The Wish (open)",
|
||||||
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0,
|
GI.GT_PAIRING_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
|
||||||
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
|
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
|
||||||
registerGame(GameInfo(368, Vertical, "Vertical",
|
registerGame(GameInfo(368, Vertical, "Vertical",
|
||||||
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0))
|
||||||
|
|
|
@ -532,11 +532,11 @@ registerGame(GameInfo(356, Fly, "Fly",
|
||||||
registerGame(GameInfo(357, Gnat, "Gnat",
|
registerGame(GameInfo(357, Gnat, "Gnat",
|
||||||
GI.GT_NUMERICA, 1, 0))
|
GI.GT_NUMERICA, 1, 0))
|
||||||
registerGame(GameInfo(378, Gloaming, "Gloaming",
|
registerGame(GameInfo(378, Gloaming, "Gloaming",
|
||||||
GI.GT_NUMERICA | GI.GT_OPEN, 1, 0))
|
GI.GT_NUMERICA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(379, Chamberlain, "Chamberlain",
|
registerGame(GameInfo(379, Chamberlain, "Chamberlain",
|
||||||
GI.GT_NUMERICA | GI.GT_OPEN, 1, 0))
|
GI.GT_NUMERICA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(402, Toad, "Toad",
|
registerGame(GameInfo(402, Toad, "Toad",
|
||||||
GI.GT_NUMERICA, 2, 0))
|
GI.GT_NUMERICA | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(430, PussInTheCorner, "Puss in the Corner",
|
registerGame(GameInfo(430, PussInTheCorner, "Puss in the Corner",
|
||||||
GI.GT_NUMERICA, 1, 0))
|
GI.GT_NUMERICA, 1, 0))
|
||||||
registerGame(GameInfo(435, Shifting, "Shifting",
|
registerGame(GameInfo(435, Shifting, "Shifting",
|
||||||
|
|
|
@ -292,11 +292,11 @@ registerGame(GameInfo(59, Osmosis, "Osmosis",
|
||||||
registerGame(GameInfo(60, Peek, "Peek",
|
registerGame(GameInfo(60, Peek, "Peek",
|
||||||
GI.GT_1DECK_TYPE, 1, -1))
|
GI.GT_1DECK_TYPE, 1, -1))
|
||||||
registerGame(GameInfo(298, OpenPeek, "Open Peek",
|
registerGame(GameInfo(298, OpenPeek, "Open Peek",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(370, Genesis, "Genesis",
|
registerGame(GameInfo(370, Genesis, "Genesis",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(371, GenesisPlus, "Genesis +",
|
registerGame(GameInfo(371, GenesisPlus, "Genesis +",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(409, Bridesmaids, "Bridesmaids",
|
registerGame(GameInfo(409, Bridesmaids, "Bridesmaids",
|
||||||
GI.GT_1DECK_TYPE, 1, -1))
|
GI.GT_1DECK_TYPE, 1, -1))
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ registerGame(GameInfo(41, PileOn, "PileOn",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0,
|
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0,
|
||||||
altnames=("Fifteen Puzzle",) ))
|
altnames=("Fifteen Puzzle",) ))
|
||||||
registerGame(GameInfo(289, SmallPileOn, "Small PileOn",
|
registerGame(GameInfo(289, SmallPileOn, "Small PileOn",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0,
|
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
|
||||||
ranks=(0, 5, 6, 7, 8, 9, 10, 11, 12),
|
ranks=(0, 5, 6, 7, 8, 9, 10, 11, 12),
|
||||||
rules_filename = "pileon.html"))
|
rules_filename = "pileon.html"))
|
||||||
## registerGame(GameInfo(341, PileOn2Decks, "PileOn (2 decks)",
|
## registerGame(GameInfo(341, PileOn2Decks, "PileOn (2 decks)",
|
||||||
|
|
|
@ -219,21 +219,49 @@ class Kingdom(RoyalCotillion):
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // Alhambra
|
# // Alhambra
|
||||||
|
# // Granada
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class Alhambra_Waste(WasteStack):
|
class Alhambra_RowStack(UD_SS_RowStack):
|
||||||
def acceptsCards(self, from_stack, cards):
|
def getBottomImage(self):
|
||||||
if not WasteStack.acceptsCards(self, from_stack, cards):
|
return self.game.app.images.getReserveBottom()
|
||||||
return 0
|
|
||||||
# check cards
|
|
||||||
if not self.cards:
|
class Alhambra_Talon(DealRowTalonStack):
|
||||||
return 0
|
def canDealCards(self):
|
||||||
c1, c2 = self.cards[-1], cards[0]
|
r_cards = sum([len(r.cards) for r in self.game.s.rows])
|
||||||
return c1.suit == c2.suit and ((c1.rank + 1) % self.cap.mod == c2.rank or (c2.rank + 1) % self.cap.mod == c1.rank)
|
if self.cards:
|
||||||
|
return True
|
||||||
|
elif r_cards and self.round != self.max_rounds:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def dealCards(self, sound=0):
|
||||||
|
old_state = self.game.enterState(self.game.S_DEAL)
|
||||||
|
num_cards = 0
|
||||||
|
rows = self.game.s.rows
|
||||||
|
r_cards = sum([len(r.cards) for r in self.game.s.rows])
|
||||||
|
if self.cards:
|
||||||
|
if sound and not self.game.demo:
|
||||||
|
self.game.playSample("dealwaste")
|
||||||
|
num_cards = self.dealRowAvail(sound=0, frames=4)
|
||||||
|
elif r_cards and self.round != self.max_rounds:
|
||||||
|
if sound:
|
||||||
|
self.game.playSample("turnwaste", priority=20)
|
||||||
|
for r in rows:
|
||||||
|
for i in range(len(r.cards)):
|
||||||
|
self.game.moveMove(1, r, self, frames=0)
|
||||||
|
self.game.flipMove(self)
|
||||||
|
num_cards = self.dealRowAvail(sound=0, frames=4)
|
||||||
|
self.game.nextRoundMove(self)
|
||||||
|
self.game.leaveState(old_state)
|
||||||
|
return num_cards
|
||||||
|
|
||||||
|
|
||||||
class Alhambra(Game):
|
class Alhambra(Game):
|
||||||
def createGame(self):
|
Hint_Class = CautiousDefaultHint
|
||||||
|
|
||||||
|
def createGame(self, rows=1):
|
||||||
# create layout
|
# create layout
|
||||||
l, s = Layout(self), self.s
|
l, s = Layout(self), self.s
|
||||||
|
|
||||||
|
@ -243,35 +271,40 @@ class Alhambra(Game):
|
||||||
# create stacks
|
# create stacks
|
||||||
x, y, = l.XM, l.YM
|
x, y, = l.XM, l.YM
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
s.foundations.append(SS_FoundationStack(x, y, self, suit=i, max_move=0))
|
s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
|
||||||
|
max_move=0))
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
s.foundations.append(SS_FoundationStack(x, y, self, suit=i, max_move=0,
|
s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
|
||||||
base_rank=KING, dir=-1))
|
max_move=0, base_rank=KING, dir=-1))
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x, y, = l.XM, y + l.YS
|
x, y, = l.XM, y + l.YS
|
||||||
for i in range(8):
|
for i in range(8):
|
||||||
s.reserves.append(BasicRowStack(x, y, self, max_accept=0))
|
stack = OpenStack(x, y, self, max_accept=0)
|
||||||
|
stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET
|
||||||
|
s.reserves.append(stack)
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x, y = l.XM + 3*l.XS, y + 2*l.YS
|
x, y = l.XM+(8-1-rows)*l.XS/2, y+l.YS+5*l.YOFFSET
|
||||||
s.talon = WasteTalonStack(x, y, self, max_rounds=3)
|
s.talon = Alhambra_Talon(x, y, self, max_rounds=3)
|
||||||
l.createText(s.talon, "sw")
|
l.createText(s.talon, "sw")
|
||||||
x = x + l.XS
|
x += l.XS
|
||||||
s.waste = Alhambra_Waste(x, y, self, mod=13, max_accept=1)
|
for i in range(rows):
|
||||||
l.createText(s.waste, "se")
|
stack = Alhambra_RowStack(x, y, self, mod=13,
|
||||||
|
max_accept=1, base_rank=ANY_RANK)
|
||||||
|
stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0
|
||||||
|
s.rows.append(stack)
|
||||||
|
x += l.XS
|
||||||
|
|
||||||
# define stack-groups (non default)
|
# define stack-groups (non default)
|
||||||
s.rows.append(s.waste)
|
|
||||||
l.defaultStackGroups()
|
l.defaultStackGroups()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# game overrides
|
# game overrides
|
||||||
#
|
#
|
||||||
|
|
||||||
def _shuffleHook(self, cards):
|
def _shuffleHook(self, cards):
|
||||||
# move one Aces and Kings of first deck to top of the Talon (i.e. first card to be dealt)
|
# move one Aces and Kings of first deck to top of the Talon (i.e. first card to be dealt)
|
||||||
return self._shuffleHookMoveToTop(cards, lambda c: (c.deck == 0 and c.rank in (0, 12), (c.rank, c.suit)), 8)
|
return self._shuffleHookMoveToTop(cards, lambda c: (c.deck == 0 and c.rank in (ACE, KING), (c.rank, c.suit)), 8)
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
self.s.talon.dealRow(rows=self.s.foundations, frames=0)
|
self.s.talon.dealRow(rows=self.s.foundations, frames=0)
|
||||||
|
@ -282,6 +315,11 @@ class Alhambra(Game):
|
||||||
self.s.talon.dealCards()
|
self.s.talon.dealCards()
|
||||||
|
|
||||||
|
|
||||||
|
class Granada(Alhambra):
|
||||||
|
def createGame(self):
|
||||||
|
Alhambra.createGame(self, rows=4)
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // Carpet
|
# // Carpet
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
@ -502,9 +540,11 @@ registerGame(GameInfo(391, BritishConstitution, "British Constitution",
|
||||||
ranks=range(11) # without Queens and Kings
|
ranks=range(11) # without Queens and Kings
|
||||||
))
|
))
|
||||||
registerGame(GameInfo(392, NewBritishConstitution, "New British Constitution",
|
registerGame(GameInfo(392, NewBritishConstitution, "New British Constitution",
|
||||||
GI.GT_2DECK_TYPE, 2, 0,
|
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0,
|
||||||
ranks=range(11) # without Queens and Kings
|
ranks=range(11) # without Queens and Kings
|
||||||
))
|
))
|
||||||
registerGame(GameInfo(443, Twenty, "Twenty",
|
registerGame(GameInfo(443, Twenty, "Twenty",
|
||||||
GI.GT_2DECK_TYPE, 2, 0))
|
GI.GT_2DECK_TYPE, 2, 0))
|
||||||
|
registerGame(GameInfo(465, Granada, "Granada",
|
||||||
|
GI.GT_2DECK_TYPE, 2, 2))
|
||||||
|
|
||||||
|
|
|
@ -1020,9 +1020,9 @@ registerGame(GameInfo(401, GroundForADivorce3Decks,
|
||||||
"Ground for a Divorce (3 decks)",
|
"Ground for a Divorce (3 decks)",
|
||||||
GI.GT_SPIDER, 3, 0))
|
GI.GT_SPIDER, 3, 0))
|
||||||
registerGame(GameInfo(441, York, "York",
|
registerGame(GameInfo(441, York, "York",
|
||||||
GI.GT_SPIDER | GI.GT_OPEN, 2, 0))
|
GI.GT_SPIDER | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0))
|
||||||
registerGame(GameInfo(444, TripleYork, "Triple York",
|
registerGame(GameInfo(444, TripleYork, "Triple York",
|
||||||
GI.GT_SPIDER | GI.GT_OPEN, 3, 0))
|
GI.GT_SPIDER | GI.GT_OPEN | GI.GT_ORIGINAL, 3, 0))
|
||||||
registerGame(GameInfo(445, BigSpider1Suit, "Big Spider (1 suit)",
|
registerGame(GameInfo(445, BigSpider1Suit, "Big Spider (1 suit)",
|
||||||
GI.GT_SPIDER, 3, 0,
|
GI.GT_SPIDER, 3, 0,
|
||||||
suits=(0, 0, 0, 0),
|
suits=(0, 0, 0, 0),
|
||||||
|
@ -1032,7 +1032,7 @@ registerGame(GameInfo(446, BigSpider2Suits, "Big Spider (2 suits)",
|
||||||
suits=(0, 0, 2, 2),
|
suits=(0, 0, 2, 2),
|
||||||
rules_filename = "bigspider.html"))
|
rules_filename = "bigspider.html"))
|
||||||
registerGame(GameInfo(449, Spider3x3, "Spider 3x3",
|
registerGame(GameInfo(449, Spider3x3, "Spider 3x3",
|
||||||
GI.GT_SPIDER, 3, 0,
|
GI.GT_SPIDER | GI.GT_ORIGINAL, 3, 0,
|
||||||
suits=(0, 1, 2),
|
suits=(0, 1, 2),
|
||||||
rules_filename = "bigspider.html"))
|
rules_filename = "bigspider.html"))
|
||||||
registerGame(GameInfo(454, Spider4Decks, "Spider (4 decks)",
|
registerGame(GameInfo(454, Spider4Decks, "Spider (4 decks)",
|
||||||
|
|
|
@ -532,7 +532,7 @@ registerGame(GameInfo(272, TripleYukon, "Triple Yukon",
|
||||||
registerGame(GameInfo(284, TenAcross, "Ten Across",
|
registerGame(GameInfo(284, TenAcross, "Ten Across",
|
||||||
GI.GT_YUKON, 1, 0))
|
GI.GT_YUKON, 1, 0))
|
||||||
registerGame(GameInfo(285, Panopticon, "Panopticon",
|
registerGame(GameInfo(285, Panopticon, "Panopticon",
|
||||||
GI.GT_YUKON, 1, 0))
|
GI.GT_YUKON | GI.GT_ORIGINAL, 1, 0))
|
||||||
registerGame(GameInfo(339, Moosehide, "Moosehide",
|
registerGame(GameInfo(339, Moosehide, "Moosehide",
|
||||||
GI.GT_YUKON, 1, 0))
|
GI.GT_YUKON, 1, 0))
|
||||||
registerGame(GameInfo(387, Roslin, "Roslin",
|
registerGame(GameInfo(387, Roslin, "Roslin",
|
||||||
|
@ -542,4 +542,4 @@ registerGame(GameInfo(447, AustralianPatience, "Australian Patience",
|
||||||
registerGame(GameInfo(450, RawPrawn, "Raw Prawn",
|
registerGame(GameInfo(450, RawPrawn, "Raw Prawn",
|
||||||
GI.GT_YUKON, 1, 0))
|
GI.GT_YUKON, 1, 0))
|
||||||
registerGame(GameInfo(456, BimBom, "Bim Bom",
|
registerGame(GameInfo(456, BimBom, "Bim Bom",
|
||||||
GI.GT_YUKON, 2, 0))
|
GI.GT_YUKON | GI.GT_ORIGINAL, 2, 0))
|
||||||
|
|
|
@ -44,7 +44,7 @@ from mfxutil import EnvError
|
||||||
from settings import PACKAGE, PACKAGE_URL
|
from settings import PACKAGE, PACKAGE_URL
|
||||||
from version import VERSION, FC_VERSION
|
from version import VERSION, FC_VERSION
|
||||||
from pysoltk import tkname, makeHelpToplevel, wm_map, wm_set_icon
|
from pysoltk import tkname, makeHelpToplevel, wm_map, wm_set_icon
|
||||||
from pysoltk import MfxDialog
|
from pysoltk import MfxMessageDialog
|
||||||
from pysoltk import tkHTMLViewer
|
from pysoltk import tkHTMLViewer
|
||||||
from gamedb import GAME_DB
|
from gamedb import GAME_DB
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ from gamedb import GAME_DB
|
||||||
# //
|
# //
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class AboutDialog(MfxDialog):
|
class AboutDialog(MfxMessageDialog):
|
||||||
def createFrames(self, kw):
|
def createFrames(self, kw):
|
||||||
top_frame, bottom_frame = MfxDialog.createFrames(self, kw)
|
top_frame, bottom_frame = MfxMessageDialog.createFrames(self, kw)
|
||||||
return top_frame, bottom_frame
|
return top_frame, bottom_frame
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ def helpAbout(app, timeout=0, sound=1):
|
||||||
t = _("A Python Solitaire Game Collection\n")
|
t = _("A Python Solitaire Game Collection\n")
|
||||||
if app.miscrandom.random() < 0.8:
|
if app.miscrandom.random() < 0.8:
|
||||||
t = _("A World Domination Project\n")
|
t = _("A World Domination Project\n")
|
||||||
strings=(_("Nice"), _("Credits..."))
|
strings=(_("&Nice"), _("&Credits..."))
|
||||||
if timeout:
|
if timeout:
|
||||||
strings=(_("Enjoy"),)
|
strings=(_("&Enjoy"),)
|
||||||
##version = _("Version %s (%s)\n\n") % (FC_VERSION, VERSION)
|
##version = _("Version %s (%s)\n\n") % (FC_VERSION, VERSION)
|
||||||
version = _("Version %s\n\n") % FC_VERSION
|
version = _("Version %s\n\n") % FC_VERSION
|
||||||
d = AboutDialog(app.top, title=_("About ") + PACKAGE, timeout=timeout,
|
d = AboutDialog(app.top, title=_("About ") + PACKAGE, timeout=timeout,
|
||||||
|
@ -99,8 +99,8 @@ def helpCredits(app, timeout=0, sound=1):
|
||||||
elif tkname == "gnome": t = "PyGTK, "
|
elif tkname == "gnome": t = "PyGTK, "
|
||||||
elif tkname == "kde": t = "pyKDE, "
|
elif tkname == "kde": t = "pyKDE, "
|
||||||
elif tkname == "wx": t = "wxPython, "
|
elif tkname == "wx": t = "wxPython, "
|
||||||
d = MfxDialog(app.top, title=_("Credits"), timeout=timeout,
|
d = MfxMessageDialog(app.top, title=_("Credits"), timeout=timeout,
|
||||||
text=PACKAGE+_(''' credits go to:
|
text=PACKAGE+_(''' credits go to:
|
||||||
|
|
||||||
Volker Weidner for getting me into Solitaire
|
Volker Weidner for getting me into Solitaire
|
||||||
Guido van Rossum for the initial example program
|
Guido van Rossum for the initial example program
|
||||||
|
@ -135,9 +135,9 @@ def helpHTML(app, document, dir_, top=None):
|
||||||
document, dir_ = "index.html", "html"
|
document, dir_ = "index.html", "html"
|
||||||
help_html_index = app.dataloader.findFile(document, dir_)
|
help_html_index = app.dataloader.findFile(document, dir_)
|
||||||
except EnvError:
|
except EnvError:
|
||||||
d = MfxDialog(app.top, title=PACKAGE + _(" HTML Problem"),
|
d = MfxMessageDialog(app.top, title=PACKAGE + _(" HTML Problem"),
|
||||||
text=_("Cannot find help document\n") + document,
|
text=_("Cannot find help document\n") + document,
|
||||||
bitmap="warning")
|
bitmap="warning")
|
||||||
return None
|
return None
|
||||||
##print doc, help_html_index
|
##print doc, help_html_index
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -700,14 +700,17 @@ if os.name == 'nt':
|
||||||
fcs_command = os.path.join(os.path.split(sys.path[0])[0], 'fc-solve.exe')
|
fcs_command = os.path.join(os.path.split(sys.path[0])[0], 'fc-solve.exe')
|
||||||
fcs_command = '"%s"' % fcs_command
|
fcs_command = '"%s"' % fcs_command
|
||||||
|
|
||||||
try:
|
if os.name in ('posix', 'nt'):
|
||||||
pin, pout, perr = os.popen3(fcs_command+' --help')
|
try:
|
||||||
if pout.readline().startswith('fc-solve'):
|
pin, pout, perr = os.popen3(fcs_command+' --help')
|
||||||
FreecellSolver = True
|
if pout.readline().startswith('fc-solve'):
|
||||||
del pin, pout, perr
|
FreecellSolver = True
|
||||||
except:
|
del pin, pout, perr
|
||||||
##traceback.print_exc()
|
if os.name == 'posix':
|
||||||
pass
|
os.wait()
|
||||||
|
except:
|
||||||
|
##traceback.print_exc()
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class FreeCellSolverWrapper:
|
class FreeCellSolverWrapper:
|
||||||
|
@ -855,6 +858,8 @@ class FreeCellSolverWrapper:
|
||||||
if hint:
|
if hint:
|
||||||
self.hints.append(hint)
|
self.hints.append(hint)
|
||||||
##print self.hints
|
##print self.hints
|
||||||
|
if os.name == 'posix':
|
||||||
|
os.wait()
|
||||||
|
|
||||||
|
|
||||||
def computeHints_mod(self):
|
def computeHints_mod(self):
|
||||||
|
|
|
@ -53,7 +53,7 @@ from pysolaudio import AbstractAudioClient, PysolSoundServerModuleClient, Win32A
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from pysoltk import tkname, tkversion, wm_withdraw, wm_set_icon, loadImage
|
from pysoltk import tkname, tkversion, wm_withdraw, wm_set_icon, loadImage
|
||||||
from pysoltk import MfxDialog, MfxExceptionDialog
|
from pysoltk import MfxMessageDialog, MfxExceptionDialog
|
||||||
from pysoltk import TclError, MfxRoot
|
from pysoltk import TclError, MfxRoot
|
||||||
from pysoltk import PysolProgressBar
|
from pysoltk import PysolProgressBar
|
||||||
|
|
||||||
|
@ -65,15 +65,15 @@ from tkFont import Font
|
||||||
|
|
||||||
def fatal_no_cardsets(app):
|
def fatal_no_cardsets(app):
|
||||||
app.wm_withdraw()
|
app.wm_withdraw()
|
||||||
d = MfxDialog(app.top, title=PACKAGE + _(" installation error"),
|
d = MfxMessageDialog(app.top, title=PACKAGE + _(" installation error"),
|
||||||
text=_('''No %ss were found !!!
|
text=_('''No %ss were found !!!
|
||||||
|
|
||||||
Main data directory is:
|
Main data directory is:
|
||||||
%s
|
%s
|
||||||
|
|
||||||
Please check your %s installation.
|
Please check your %s installation.
|
||||||
''') % (CARDSET, app.dataloader.dir, PACKAGE),
|
''') % (CARDSET, app.dataloader.dir, PACKAGE),
|
||||||
bitmap="error", strings=(_("Quit"),))
|
bitmap="error", strings=(_("&Quit"),))
|
||||||
##raise Exception, "no "+CARDSET+"s found !"
|
##raise Exception, "no "+CARDSET+"s found !"
|
||||||
|
|
||||||
|
|
||||||
|
@ -256,10 +256,7 @@ def pysol_init(app, args):
|
||||||
# set global color scheme
|
# set global color scheme
|
||||||
if not opts["fg"] and not opts["bg"]:
|
if not opts["fg"] and not opts["bg"]:
|
||||||
if os.name == "posix": # Unix/X11
|
if os.name == "posix": # Unix/X11
|
||||||
top.option_add('*selectBackground', '#00008b', 50)
|
pass
|
||||||
top.option_add('*selectForeground', 'white', 50)
|
|
||||||
top.option_add('*Entry.background', 'white', 50)
|
|
||||||
top.option_add('*Listbox.background', 'white', 50)
|
|
||||||
if os.name == "mac":
|
if os.name == "mac":
|
||||||
color, priority = "#d9d9d9", "60"
|
color, priority = "#d9d9d9", "60"
|
||||||
classes = (
|
classes = (
|
||||||
|
@ -280,6 +277,20 @@ def pysol_init(app, args):
|
||||||
top.option_add("*foreground", fg)
|
top.option_add("*foreground", fg)
|
||||||
app.top_palette[0] = fg
|
app.top_palette[0] = fg
|
||||||
|
|
||||||
|
#
|
||||||
|
if os.name == "posix": # Unix/X11
|
||||||
|
top.option_add('*Entry.background', 'white', 60)
|
||||||
|
top.option_add('*Entry.foreground', 'black', 60)
|
||||||
|
top.option_add('*Listbox.background', 'white', 60)
|
||||||
|
top.option_add('*Listbox.foreground', 'black', 60)
|
||||||
|
##top.option_add('*borderWidth', '1', 50)
|
||||||
|
##top.option_add('*Button.borderWidth', '1', 50)
|
||||||
|
top.option_add('*Scrollbar.elementBorderWidth', '1', 60)
|
||||||
|
top.option_add('*Scrollbar.borderWidth', '1', 60)
|
||||||
|
top.option_add('*Menu.borderWidth', '1', 60)
|
||||||
|
#top.option_add('*Button.HighlightBackground', '#595d59')
|
||||||
|
#top.option_add('*Button.HighlightThickness', '1')
|
||||||
|
|
||||||
# font
|
# font
|
||||||
if opts["fn"]:
|
if opts["fn"]:
|
||||||
font = opts["fn"]
|
font = opts["fn"]
|
||||||
|
@ -307,8 +318,8 @@ def pysol_init(app, args):
|
||||||
# check games
|
# check games
|
||||||
if len(app.gdb.getGamesIdSortedByName()) == 0:
|
if len(app.gdb.getGamesIdSortedByName()) == 0:
|
||||||
app.wm_withdraw()
|
app.wm_withdraw()
|
||||||
d = MfxDialog(top, title=PACKAGE + _(" installation error"),
|
d = MfxMessageDialog(top, title=PACKAGE + _(" installation error"),
|
||||||
text=_('''
|
text=_('''
|
||||||
No games were found !!!
|
No games were found !!!
|
||||||
|
|
||||||
Main data directory is:
|
Main data directory is:
|
||||||
|
@ -316,7 +327,7 @@ Main data directory is:
|
||||||
|
|
||||||
Please check your %s installation.
|
Please check your %s installation.
|
||||||
''') % (app.dataloader.dir, PACKAGE),
|
''') % (app.dataloader.dir, PACKAGE),
|
||||||
bitmap="error", strings=(_("Quit"),))
|
bitmap="error", strings=(_("&Quit"),))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# init cardsets
|
# init cardsets
|
||||||
|
@ -394,14 +405,20 @@ Please check your %s installation.
|
||||||
if not opts["nosound"]:
|
if not opts["nosound"]:
|
||||||
if warn_thread:
|
if warn_thread:
|
||||||
top.update()
|
top.update()
|
||||||
d = MfxDialog(top, title=PACKAGE + _(" installation problem"),
|
d = MfxMessageDialog(top, title=PACKAGE + _(" installation problem"),
|
||||||
text=_("Your Python installation is compiled without thread support.\n\nSounds and background music will be disabled."),
|
text=_('''\
|
||||||
bitmap="warning", strings=(_("OK"),))
|
Your Python installation is compiled without thread support.
|
||||||
|
|
||||||
|
Sounds and background music will be disabled.'''),
|
||||||
|
bitmap="warning", strings=(_("&OK"),))
|
||||||
elif warn_pysolsoundserver:
|
elif warn_pysolsoundserver:
|
||||||
top.update()
|
top.update()
|
||||||
d = MfxDialog(top, title=PACKAGE + _(" installation problem"),
|
d = MfxMessageDialog(top, title=PACKAGE + _(" installation problem"),
|
||||||
text=_("The pysolsoundserver module was not found.\n\nSounds and background music will be disabled."),
|
text=_('''\
|
||||||
bitmap="warning", strings=(_("OK"),))
|
The pysolsoundserver module was not found.
|
||||||
|
|
||||||
|
Sounds and background music will be disabled.'''),
|
||||||
|
bitmap="warning", strings=(_("&OK"),))
|
||||||
|
|
||||||
# create the progress bar
|
# create the progress bar
|
||||||
title = _("Welcome to ") + PACKAGE
|
title = _("Welcome to ") + PACKAGE
|
||||||
|
@ -486,9 +503,9 @@ def pysol_main(args):
|
||||||
## raise
|
## raise
|
||||||
## t = str(ex.__class__)
|
## t = str(ex.__class__)
|
||||||
## if str(ex): t = t + ":\n" + str(ex)
|
## if str(ex): t = t + ":\n" + str(ex)
|
||||||
## d = MfxDialog(app.top, title=PACKAGE + " internal error",
|
## d = MfxMessageDialog(app.top, title=PACKAGE + " internal error",
|
||||||
## text="Internal errror. Please report this bug:\n\n"+t,
|
## text="Internal errror. Please report this bug:\n\n"+t,
|
||||||
## strings=("Quit",), bitmap="error")
|
## strings=("&Quit",), bitmap="error")
|
||||||
try:
|
try:
|
||||||
pysol_exit(app)
|
pysol_exit(app)
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -29,7 +29,6 @@ from tk.edittextdialog import *
|
||||||
from tk.tkstats import *
|
from tk.tkstats import *
|
||||||
from tk.playeroptionsdialog import *
|
from tk.playeroptionsdialog import *
|
||||||
from tk.soundoptionsdialog import *
|
from tk.soundoptionsdialog import *
|
||||||
from tk.demooptionsdialog import *
|
|
||||||
from tk.timeoutsdialog import *
|
from tk.timeoutsdialog import *
|
||||||
from tk.colorsdialog import *
|
from tk.colorsdialog import *
|
||||||
from tk.fontsdialog import *
|
from tk.fontsdialog import *
|
||||||
|
|
|
@ -239,75 +239,87 @@ class CSI:
|
||||||
TYPE_TRUMP_ONLY = 9
|
TYPE_TRUMP_ONLY = 9
|
||||||
|
|
||||||
TYPE = {
|
TYPE = {
|
||||||
1: "French type (52 cards)",
|
1: _("French type (52 cards)"),
|
||||||
2: "Hanafuda type (48 cards)",
|
2: _("Hanafuda type (48 cards)"),
|
||||||
3: "Tarock type (78 cards)",
|
3: _("Tarock type (78 cards)"),
|
||||||
4: "Mahjongg type (42 tiles)",
|
4: _("Mahjongg type (42 tiles)"),
|
||||||
5: "Hex A Deck type (68 cards)",
|
5: _("Hex A Deck type (68 cards)"),
|
||||||
6: "Mughal Ganjifa type (96 cards)",
|
6: _("Mughal Ganjifa type (96 cards)"),
|
||||||
7: "Navagraha Ganjifa type (108 cards)",
|
7: _("Navagraha Ganjifa type (108 cards)"),
|
||||||
8: "Dashavatara Ganjifa type (120 cards)",
|
8: _("Dashavatara Ganjifa type (120 cards)"),
|
||||||
9: "Trumps only type (variable cards)",
|
9: _("Trumps only type (variable cards)"),
|
||||||
|
}
|
||||||
|
|
||||||
|
TYPE_NAME = {
|
||||||
|
1: _("French"),
|
||||||
|
2: _("Hanafuda"),
|
||||||
|
3: _("Tarock"),
|
||||||
|
4: _("Mahjongg"),
|
||||||
|
5: _("Hex A Deck"),
|
||||||
|
6: _("Mughal Ganjifa"),
|
||||||
|
7: _("Navagraha Ganjifa"),
|
||||||
|
8: _("Dashavatara Ganjifa"),
|
||||||
|
9: _("Trumps only"),
|
||||||
}
|
}
|
||||||
|
|
||||||
# cardset styles
|
# cardset styles
|
||||||
STYLE = {
|
STYLE = {
|
||||||
1: "Adult", #
|
1: _("Adult"), #
|
||||||
2: "Animals", #
|
2: _("Animals"), #
|
||||||
3: "Anime", #
|
3: _("Anime"), #
|
||||||
4: "Art", #
|
4: _("Art"), #
|
||||||
5: "Cartoons", #
|
5: _("Cartoons"), #
|
||||||
6: "Children", #
|
6: _("Children"), #
|
||||||
7: "Classic look", #
|
7: _("Classic look"), #
|
||||||
8: "Collectors", # scanned collectors cardsets
|
8: _("Collectors"), # scanned collectors cardsets
|
||||||
9: "Computers", #
|
9: _("Computers"), #
|
||||||
10: "Engines", #
|
10: _("Engines"), #
|
||||||
11: "Fantasy", #
|
11: _("Fantasy"), #
|
||||||
30: "Ganjifa", #
|
30: _("Ganjifa"), #
|
||||||
12: "Hanafuda", #
|
12: _("Hanafuda"), #
|
||||||
29: "Hex A Deck", #
|
29: _("Hex A Deck"), #
|
||||||
13: "Holiday", #
|
13: _("Holiday"), #
|
||||||
28: "Mahjongg", #
|
28: _("Mahjongg"), #
|
||||||
14: "Movies", #
|
14: _("Movies"), #
|
||||||
31: "Matrix", #
|
31: _("Matrix"), #
|
||||||
15: "Music", #
|
15: _("Music"), #
|
||||||
16: "Nature", #
|
16: _("Nature"), #
|
||||||
17: "Operating Systems", # e.g. cards with Linux logos
|
17: _("Operating Systems"), # e.g. cards with Linux logos
|
||||||
19: "People", # famous people
|
19: _("People"), # famous people
|
||||||
20: "Places", #
|
20: _("Places"), #
|
||||||
21: "Plain", #
|
21: _("Plain"), #
|
||||||
22: "Products", #
|
22: _("Products"), #
|
||||||
18: "Round cardsets", #
|
18: _("Round cardsets"), #
|
||||||
23: "Science Fiction", #
|
23: _("Science Fiction"), #
|
||||||
24: "Sports", #
|
24: _("Sports"), #
|
||||||
27: "Tarock", #
|
27: _("Tarock"), #
|
||||||
25: "Vehicels", #
|
25: _("Vehicels"), #
|
||||||
26: "Video Games", #
|
26: _("Video Games"), #
|
||||||
}
|
}
|
||||||
|
|
||||||
# cardset nationality (suit and rank symbols)
|
# cardset nationality (suit and rank symbols)
|
||||||
NATIONALITY = {
|
NATIONALITY = {
|
||||||
1021: "Australia", #
|
1021: _("Australia"), #
|
||||||
1001: "Austria", #
|
1001: _("Austria"), #
|
||||||
1019: "Belgium", #
|
1019: _("Belgium"), #
|
||||||
1010: "Canada", #
|
1010: _("Canada"), #
|
||||||
1011: "China", #
|
1011: _("China"), #
|
||||||
1012: "Czech Republic", #
|
1012: _("Czech Republic"), #
|
||||||
1013: "Denmark", #
|
1013: _("Denmark"), #
|
||||||
1003: "England", #
|
1003: _("England"), #
|
||||||
1004: "France", #
|
1004: _("France"), #
|
||||||
1006: "Germany", #
|
1006: _("Germany"), #
|
||||||
1014: "Great Britain", #
|
1014: _("Great Britain"), #
|
||||||
1015: "Hungary", #
|
1015: _("Hungary"), #
|
||||||
1020: "India", #
|
1020: _("India"), #
|
||||||
1005: "Italy", #
|
1005: _("Italy"), #
|
||||||
1016: "Japan", #
|
1016: _("Japan"), #
|
||||||
1002: "Netherlands", #
|
1002: _("Netherlands"), #
|
||||||
1007: "Russia", #
|
1007: _("Russia"), #
|
||||||
1008: "Spain", #
|
1008: _("Spain"), #
|
||||||
1017: "Sweden", #
|
1017: _("Sweden"), #
|
||||||
1009: "Switzerland", #
|
1009: _("Switzerland"), #
|
||||||
1018: "USA", #
|
1018: _("USA"), #
|
||||||
}
|
}
|
||||||
|
|
||||||
# cardset creation date
|
# cardset creation date
|
||||||
|
@ -327,19 +339,17 @@ class CSI:
|
||||||
22: "2200 - 2299",
|
22: "2200 - 2299",
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
## #
|
||||||
TYPE_NAME = {}
|
## TYPE_NAME = {}
|
||||||
|
## def create_csi_type_name():
|
||||||
def create_csi_type_name():
|
## for id, type in CSI.TYPE.items():
|
||||||
for id, type in CSI.TYPE.items():
|
## i = type.find('type')
|
||||||
i = type.find('type')
|
## if i > 0:
|
||||||
if i > 0:
|
## CSI.TYPE_NAME[id] = type[:i-1]
|
||||||
CSI.TYPE_NAME[id] = type[:i-1]
|
## else:
|
||||||
else:
|
## CSI.TYPE_NAME[id] = type
|
||||||
CSI.TYPE_NAME[id] = type
|
## if not CSI.TYPE_NAME:
|
||||||
|
## create_csi_type_name()
|
||||||
if not CSI.TYPE_NAME:
|
|
||||||
create_csi_type_name()
|
|
||||||
|
|
||||||
|
|
||||||
class CardsetConfig(Struct):
|
class CardsetConfig(Struct):
|
||||||
|
|
|
@ -327,6 +327,8 @@ class Stack:
|
||||||
|
|
||||||
def prepareView(self):
|
def prepareView(self):
|
||||||
##assertView(self)
|
##assertView(self)
|
||||||
|
if (self.CARD_XOFFSET == 0 and self.CARD_YOFFSET == 0):
|
||||||
|
assert self.cap.max_move <= 1
|
||||||
# prepare some variables
|
# prepare some variables
|
||||||
ox, oy = self.CARD_XOFFSET, self.CARD_YOFFSET
|
ox, oy = self.CARD_XOFFSET, self.CARD_YOFFSET
|
||||||
if type(ox) is types.IntType:
|
if type(ox) is types.IntType:
|
||||||
|
|
|
@ -43,8 +43,6 @@ from mfxutil import format_time
|
||||||
from util import PACKAGE, VERSION
|
from util import PACKAGE, VERSION
|
||||||
from gamedb import GI
|
from gamedb import GI
|
||||||
|
|
||||||
# Toolkit imports
|
|
||||||
from pysoltk import MfxDialog
|
|
||||||
|
|
||||||
|
|
||||||
# // FIXME - this a quick hack and needs a rewrite
|
# // FIXME - this a quick hack and needs a rewrite
|
||||||
|
@ -128,7 +126,7 @@ class PysolStatsFormatter:
|
||||||
twon, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0
|
twon, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0
|
||||||
g = sort_func()
|
g = sort_func()
|
||||||
for id in g:
|
for id in g:
|
||||||
name = app.getGameMenuitemName(id)
|
name = app.getGameTitleName(id)
|
||||||
#won, lost = app.stats.getStats(player, id)
|
#won, lost = app.stats.getStats(player, id)
|
||||||
won, lost, time, moves = app.stats.getFullStats(player, id)
|
won, lost, time, moves = app.stats.getFullStats(player, id)
|
||||||
twon, tlost = twon + won, tlost + lost
|
twon, tlost = twon + won, tlost + lost
|
||||||
|
@ -161,7 +159,7 @@ class PysolStatsFormatter:
|
||||||
if not player or not prev_games:
|
if not player or not prev_games:
|
||||||
return 0
|
return 0
|
||||||
self.writeHeader(writer, header, 71)
|
self.writeHeader(writer, header, 71)
|
||||||
writer.plog(_("Game"), _("Game number"), _("Started at "), _("Status"))
|
writer.plog(_("Game"), _("Game number"), _("Started at"), _("Status"))
|
||||||
writer.nl()
|
writer.nl()
|
||||||
twon, tlost = 0, 0
|
twon, tlost = 0, 0
|
||||||
for pg in prev_games:
|
for pg in prev_games:
|
||||||
|
|
|
@ -31,7 +31,7 @@ from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -40,7 +40,7 @@ from tkwidget import _ToplevelDialog, MfxDialog
|
||||||
class ColorsDialog(MfxDialog):
|
class ColorsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -128,8 +128,8 @@ class ColorsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")),
|
||||||
separatorwidth = 0,
|
default=0,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
|
@ -1,112 +0,0 @@
|
||||||
## vim:ts=4:et:nowrap
|
|
||||||
##
|
|
||||||
##---------------------------------------------------------------------------##
|
|
||||||
##
|
|
||||||
## 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
|
|
||||||
## (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.
|
|
||||||
##
|
|
||||||
## Markus F.X.J. Oberhumer
|
|
||||||
## <markus@oberhumer.com>
|
|
||||||
## http://www.oberhumer.com/pysol
|
|
||||||
##
|
|
||||||
##---------------------------------------------------------------------------##
|
|
||||||
|
|
||||||
__all__ = ['DemoOptionsDialog']
|
|
||||||
|
|
||||||
# imports
|
|
||||||
import os, sys, Tkinter
|
|
||||||
|
|
||||||
# PySol imports
|
|
||||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
|
||||||
|
|
||||||
# Toolkit imports
|
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# //
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
class DemoOptionsDialog(MfxDialog):
|
|
||||||
def __init__(self, parent, title, app, **kw):
|
|
||||||
kw = self.initKw(kw)
|
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
|
||||||
self.createBitmaps(top_frame, kw)
|
|
||||||
#
|
|
||||||
self.demo_logo_var = Tkinter.BooleanVar()
|
|
||||||
self.demo_logo_var.set(app.opt.demo_logo != 0)
|
|
||||||
self.demo_score_var = Tkinter.BooleanVar()
|
|
||||||
self.demo_score_var.set(app.opt.demo_score != 0)
|
|
||||||
self.demo_sleep_var = Tkinter.DoubleVar()
|
|
||||||
self.demo_sleep_var.set(app.opt.demo_sleep)
|
|
||||||
widget = Tkinter.Checkbutton(top_frame, variable=self.demo_logo_var,
|
|
||||||
text=_("Display floating Demo logo"))
|
|
||||||
widget.pack(side=Tkinter.TOP, padx=kw.padx, pady=kw.pady)
|
|
||||||
widget = Tkinter.Checkbutton(top_frame, variable=self.demo_score_var,
|
|
||||||
text=_("Show score in statusbar"))
|
|
||||||
widget.pack(side=Tkinter.TOP, padx=kw.padx, pady=kw.pady)
|
|
||||||
widget = Tkinter.Scale(top_frame, from_=0.2, to=9.9,
|
|
||||||
resolution=0.1, orient=Tkinter.HORIZONTAL,
|
|
||||||
length="3i", label=_("Set demo delay in seconds"),
|
|
||||||
variable=self.demo_sleep_var, takefocus=0)
|
|
||||||
widget.pack(side=Tkinter.TOP, padx=kw.padx, pady=kw.pady)
|
|
||||||
#
|
|
||||||
focus = self.createButtons(bottom_frame, kw)
|
|
||||||
self.mainloop(focus, kw.timeout)
|
|
||||||
#
|
|
||||||
self.demo_logo = self.demo_logo_var.get()
|
|
||||||
self.demo_score = self.demo_score_var.get()
|
|
||||||
self.demo_sleep = self.demo_sleep_var.get()
|
|
||||||
|
|
||||||
|
|
||||||
def initKw(self, kw):
|
|
||||||
kw = KwStruct(kw,
|
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
|
||||||
separatorwidth = 0,
|
|
||||||
)
|
|
||||||
return MfxDialog.initKw(self, kw)
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# //
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
def demooptionsdialog_main(args):
|
|
||||||
from tkutil import wm_withdraw
|
|
||||||
opt = Struct(demo_logo=1, demo_sleep=1.5)
|
|
||||||
app = Struct(opt=opt)
|
|
||||||
tk = Tkinter.Tk()
|
|
||||||
wm_withdraw(tk)
|
|
||||||
tk.update()
|
|
||||||
d = DemoOptionsDialog(tk, "Demo options", app)
|
|
||||||
print d.status, d.button, ":", d.demo_logo, d.demo_sleep
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import sys
|
|
||||||
sys.exit(demooptionsdialog_main(sys.argv))
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ import os, sys, Tkinter
|
||||||
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -52,7 +52,7 @@ class EditTextDialog(MfxDialog):
|
||||||
|
|
||||||
def __init__(self, parent, title, text, **kw):
|
def __init__(self, parent, title, text, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -79,9 +79,10 @@ class EditTextDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=-1,
|
strings=(_("&OK"), _("&Cancel")),
|
||||||
resizable = 1,
|
default=-1,
|
||||||
separatorwidth = 0,
|
resizable=1,
|
||||||
|
separatorwidth=0,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
from tkutil import bind
|
from tkutil import bind
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
@ -43,7 +43,7 @@ class FontChooserDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, init_font, **kw):
|
def __init__(self, parent, title, init_font, **kw):
|
||||||
##print init_font
|
##print init_font
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class FontChooserDialog(MfxDialog):
|
||||||
self.entry = Entry(frame, bg='white')
|
self.entry = Entry(frame, bg='white')
|
||||||
self.entry.grid(row=0, column=0, columnspan=2, sticky=W+E+N+S)
|
self.entry.grid(row=0, column=0, columnspan=2, sticky=W+E+N+S)
|
||||||
self.entry.insert(END, _('abcdefghABCDEFGH'))
|
self.entry.insert(END, _('abcdefghABCDEFGH'))
|
||||||
self.list_box = Listbox(frame, width=36)
|
self.list_box = Listbox(frame, width=36, exportselection=False)
|
||||||
sb = Scrollbar(frame)
|
sb = Scrollbar(frame)
|
||||||
self.list_box.configure(yscrollcommand=sb.set)
|
self.list_box.configure(yscrollcommand=sb.set)
|
||||||
sb.configure(command=self.list_box.yview)
|
sb.configure(command=self.list_box.yview)
|
||||||
|
@ -137,8 +137,8 @@ class FontChooserDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")),
|
||||||
separatorwidth=0,
|
default=0,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
@ -151,7 +151,7 @@ class FontChooserDialog(MfxDialog):
|
||||||
class FontsDialog(MfxDialog):
|
class FontsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -201,8 +201,8 @@ class FontsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")),
|
||||||
separatorwidth = 0,
|
default=0,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ from pysollib.mfxutil import KwStruct
|
||||||
from pysollib.gamedb import GI
|
from pysollib.gamedb import GI
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -40,7 +40,7 @@ from tkwidget import _ToplevelDialog, MfxDialog
|
||||||
class GameInfoDialog(MfxDialog):
|
class GameInfoDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -130,7 +130,8 @@ class GameInfoDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"),), default=0,
|
strings=(_("&OK"),),
|
||||||
separatorwidth = 2,
|
default=0,
|
||||||
|
separatorwidth=2,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
|
@ -364,8 +364,6 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
submenu.add_radiobutton(label=n_("&Very slow"), variable=self.tkopt.animations, value=4, command=self.mOptAnimations)
|
submenu.add_radiobutton(label=n_("&Very slow"), variable=self.tkopt.animations, value=4, command=self.mOptAnimations)
|
||||||
menu.add_checkbutton(label=n_("Stick&y mouse"), variable=self.tkopt.sticky_mouse, command=self.mOptStickyMouse)
|
menu.add_checkbutton(label=n_("Stick&y mouse"), variable=self.tkopt.sticky_mouse, command=self.mOptStickyMouse)
|
||||||
menu.add_separator()
|
menu.add_separator()
|
||||||
#menu.add_command(label="&Hint options...", command=self.mOptHintOptions)
|
|
||||||
#menu.add_command(label="&Demo options...", command=self.mOptDemoOptions)
|
|
||||||
menu.add_command(label=n_("&Fonts..."), command=self.mOptFontsOptions)
|
menu.add_command(label=n_("&Fonts..."), command=self.mOptFontsOptions)
|
||||||
menu.add_command(label=n_("&Colors..."), command=self.mOptColorsOptions)
|
menu.add_command(label=n_("&Colors..."), command=self.mOptColorsOptions)
|
||||||
menu.add_command(label=n_("Time&outs..."), command=self.mOptTimeoutsOptions)
|
menu.add_command(label=n_("Time&outs..."), command=self.mOptTimeoutsOptions)
|
||||||
|
@ -852,10 +850,10 @@ 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 = ("&OK", "&Load", "&Cancel"), 0
|
||||||
strings, default = (None, _("Load"), _("Cancel"),), 1
|
strings, default = (None, _("&Load"), _("&Cancel"),), 1
|
||||||
##if os.name == "posix":
|
##if os.name == "posix":
|
||||||
strings, default = (None, _("Load"), _("Cancel"), _("Info..."),), 1
|
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,
|
||||||
|
|
|
@ -43,7 +43,7 @@ from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
from tkutil import bind
|
from tkutil import bind
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,8 +54,7 @@ from tkutil import bind
|
||||||
class SelectUserNameDialog(MfxDialog):
|
class SelectUserNameDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, usernames=[], **kw):
|
def __init__(self, parent, title, usernames=[], **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title,
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
kw.resizable, kw.default)
|
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -83,7 +82,7 @@ class SelectUserNameDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||||
separatorwidth=0,
|
separatorwidth=0,
|
||||||
resizable=0,
|
resizable=0,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
|
@ -96,7 +95,7 @@ class SelectUserNameDialog(MfxDialog):
|
||||||
class PlayerOptionsDialog(MfxDialog):
|
class PlayerOptionsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
self.app = app
|
self.app = app
|
||||||
|
@ -158,9 +157,7 @@ class PlayerOptionsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||||
separatorwidth=2,
|
|
||||||
resizable=0,
|
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
|
@ -45,7 +45,7 @@ from pysollib.resource import CSI
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkutil import loadImage
|
from tkutil import loadImage
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog, MfxScrolledCanvas
|
from tkwidget import MfxDialog, MfxScrolledCanvas
|
||||||
from tkcanvas import MfxCanvasImage
|
from tkcanvas import MfxCanvasImage
|
||||||
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
||||||
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
||||||
|
@ -181,7 +181,7 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
||||||
|
|
||||||
def __init__(self, parent, title, app, manager, key=None, **kw):
|
def __init__(self, parent, title, app, manager, key=None, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -237,9 +237,9 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Load"), _("Cancel"),), default=0,
|
strings=(_("&OK"), _("&Load"), _("&Cancel"),),
|
||||||
separatorwidth=2, resizable=1,
|
default=0,
|
||||||
font=None,
|
resizable=1,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
@ -308,7 +308,7 @@ class SelectCardsetByTypeDialogWithPreview(SelectCardsetDialogWithPreview):
|
||||||
class CardsetInfoDialog(MfxDialog):
|
class CardsetInfoDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, cardset, images, **kw):
|
def __init__(self, parent, title, cardset, images, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
frame = Tkinter.Frame(top_frame)
|
frame = Tkinter.Frame(top_frame)
|
||||||
|
@ -393,9 +393,10 @@ class CardsetInfoDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"),), default=0,
|
strings=(_("&OK"),),
|
||||||
resizable = 1,
|
default=0,
|
||||||
separatorwidth = 2,
|
resizable=1,
|
||||||
|
separatorwidth=2,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
|
|
@ -47,7 +47,7 @@ from pysollib.resource import CSI
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkutil import unbind_destroy
|
from tkutil import unbind_destroy
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog, MfxScrolledCanvas
|
from tkwidget import MfxDialog, MfxScrolledCanvas
|
||||||
from tkcanvas import MfxCanvasText
|
from tkcanvas import MfxCanvasText
|
||||||
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
||||||
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
||||||
|
@ -156,7 +156,7 @@ class SelectGameData(SelectDialogTreeData):
|
||||||
select_func = lambda gi, games=games: gi.id in games
|
select_func = lambda gi, games=games: gi.id in games
|
||||||
if name is None or not filter(select_func, self.all_games_gi):
|
if name is None or not filter(select_func, self.all_games_gi):
|
||||||
continue
|
continue
|
||||||
name = _("New games in v") + name
|
name = _("New games in v.") + name
|
||||||
gg.append(SelectGameNode(None, name, select_func))
|
gg.append(SelectGameNode(None, name, select_func))
|
||||||
if 1 and gg:
|
if 1 and gg:
|
||||||
s_by_pysol_version = SelectGameNode(None, _("by PySol version"), tuple(gg))
|
s_by_pysol_version = SelectGameNode(None, _("by PySol version"), tuple(gg))
|
||||||
|
@ -241,7 +241,7 @@ class SelectGameDialog(MfxDialog):
|
||||||
|
|
||||||
def __init__(self, parent, title, app, gameid, **kw):
|
def __init__(self, parent, title, app, gameid, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -265,9 +265,9 @@ class SelectGameDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(None, None, _("Cancel"),), default=0,
|
strings=(None, None, _("&Cancel"),), default=0,
|
||||||
separatorwidth=2, resizable=1,
|
separatorwidth=2,
|
||||||
font=None,
|
resizable=1,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
@ -302,7 +302,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
|
|
||||||
def __init__(self, parent, title, app, gameid, bookmark=None, **kw):
|
def __init__(self, parent, title, app, gameid, bookmark=None, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -406,7 +406,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("Select"), _("Rules"), _("Cancel"),),
|
strings=(_("&Select"), _("&Rules"), _("&Cancel"),),
|
||||||
default=0,
|
default=0,
|
||||||
)
|
)
|
||||||
return SelectGameDialog.initKw(self, kw)
|
return SelectGameDialog.initKw(self, kw)
|
||||||
|
@ -485,8 +485,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
self.preview_game.endGame()
|
self.preview_game.endGame()
|
||||||
self.preview_game.destruct()
|
self.preview_game.destruct()
|
||||||
##self.top.wm_title("Select Game - " + self.app.getGameTitleName(gameid))
|
##self.top.wm_title("Select Game - " + self.app.getGameTitleName(gameid))
|
||||||
#title = gettext(unicode(self.app.getGameTitleName(gameid), 'utf-8'))
|
title = self.app.getGameTitleName(gameid)
|
||||||
title = gettext(self.app.getGameTitleName(gameid))
|
|
||||||
self.top.wm_title(_("Playable Preview - ") + title)
|
self.top.wm_title(_("Playable Preview - ") + title)
|
||||||
## if False:
|
## if False:
|
||||||
## cw, ch = canvas.winfo_width(), canvas.winfo_height()
|
## cw, ch = canvas.winfo_width(), canvas.winfo_height()
|
||||||
|
|
|
@ -44,7 +44,7 @@ from pysollib.resource import CSI
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkutil import loadImage
|
from tkutil import loadImage
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog, MfxScrolledCanvas
|
from tkwidget import MfxDialog, MfxScrolledCanvas
|
||||||
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
from selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
||||||
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
from selecttree import SelectDialogTreeData, SelectDialogTreeCanvas
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class SelectTileDialogWithPreview(MfxDialog):
|
||||||
|
|
||||||
def __init__(self, parent, title, app, manager, key=None, **kw):
|
def __init__(self, parent, title, app, manager, key=None, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -155,8 +155,9 @@ class SelectTileDialogWithPreview(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Solid color..."), _("Cancel"),), default=0,
|
strings=(_("&OK"), _("&Solid color..."), _("&Cancel"),),
|
||||||
separatorwidth=2, resizable=1,
|
default=0,
|
||||||
|
resizable=1,
|
||||||
font=None,
|
font=None,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
|
|
|
@ -44,7 +44,6 @@ from pysollib.mfxutil import destruct, Struct, KwStruct, kwdefault
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkutil import makeImage
|
from tkutil import makeImage
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog, MfxScrolledCanvas
|
|
||||||
from tkcanvas import MfxCanvas
|
from tkcanvas import MfxCanvas
|
||||||
from tktree import MfxTreeLeaf, MfxTreeNode, MfxTreeInCanvas
|
from tktree import MfxTreeLeaf, MfxTreeNode, MfxTreeInCanvas
|
||||||
|
|
||||||
|
@ -183,8 +182,3 @@ class SelectDialogTreeCanvas(MfxTreeInCanvas):
|
||||||
self.redraw()
|
self.redraw()
|
||||||
return "break"
|
return "break"
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // Canvas for a preview (right side)
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
##SelectDialogPreviewCanvas = MfxScrolledCanvas
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ from pysollib.settings import MIXERS
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -59,7 +59,7 @@ class SoundOptionsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
self.app = app
|
self.app = app
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -103,15 +103,15 @@ class SoundOptionsDialog(MfxDialog):
|
||||||
self.mainloop(focus, kw.timeout)
|
self.mainloop(focus, kw.timeout)
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
strings=[_("OK"), _("Apply"), _("Mixer..."), _("Cancel"),]
|
strings=[_("&OK"), _("&Apply"), _("&Mixer..."), _("&Cancel"),]
|
||||||
if self.MIXER is None:
|
if self.MIXER is None:
|
||||||
strings[2] = (_("Mixer..."), -1)
|
strings[2] = (_("&Mixer..."), -1)
|
||||||
## if os.name != "nt" and not self.app.debug:
|
## if os.name != "nt" and not self.app.debug:
|
||||||
## strings[2] = None
|
## strings[2] = None
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=strings, default=0,
|
strings=strings,
|
||||||
separatorwidth=2, resizable=1,
|
default=0,
|
||||||
font=None,
|
resizable=1,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
@ -155,7 +155,7 @@ class SoundOptionsDialog(MfxDialog):
|
||||||
d = MfxDialog(self.top, title=_("Sound preferences info"),
|
d = MfxDialog(self.top, title=_("Sound preferences info"),
|
||||||
text=_("Changing DirectX settings will take effect\nthe next time you restart ")+PACKAGE,
|
text=_("Changing DirectX settings will take effect\nthe next time you restart ")+PACKAGE,
|
||||||
bitmap="warning",
|
bitmap="warning",
|
||||||
default=0, strings=(_("OK"),))
|
default=0, strings=(_("&OK"),))
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
|
|
@ -62,10 +62,12 @@ class MfxStatusbar:
|
||||||
self.padx = 1
|
self.padx = 1
|
||||||
self.pady = 2
|
self.pady = 2
|
||||||
#
|
#
|
||||||
self.frame = Tkinter.Frame(self.top, bd=1) #, relief='raised')
|
self.frame = Tkinter.Frame(self.top, bd=1)
|
||||||
self.frame.grid(row=self._row, column=self._column,
|
self.frame.grid(row=self._row, column=self._column,
|
||||||
columnspan=self._columnspan, sticky='ew',
|
columnspan=self._columnspan, sticky='ew',
|
||||||
padx=self.padx, pady=self.pady)
|
padx=self.padx, pady=self.pady)
|
||||||
|
#if os.name == "mac":
|
||||||
|
# Tkinter.Label(self.frame, width=2).pack(side='right')
|
||||||
|
|
||||||
# util
|
# util
|
||||||
def _createLabel(self, name,
|
def _createLabel(self, name,
|
||||||
|
|
|
@ -30,7 +30,7 @@ from pysollib.mfxutil import destruct, kwdefault, KwStruct, Struct
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -39,7 +39,7 @@ from tkwidget import _ToplevelDialog, MfxDialog
|
||||||
class TimeoutsDialog(MfxDialog):
|
class TimeoutsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
#self.createBitmaps(top_frame, kw)
|
#self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -89,8 +89,8 @@ class TimeoutsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||||
separatorwidth=0,
|
padx=10, pady=10,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ to open the following URL:
|
||||||
def errorDialog(self, msg):
|
def errorDialog(self, msg):
|
||||||
d = MfxDialog(self.parent, title=PACKAGE+" HTML Problem",
|
d = MfxDialog(self.parent, title=PACKAGE+" HTML Problem",
|
||||||
text=msg, bitmap="warning",
|
text=msg, bitmap="warning",
|
||||||
strings=(_("OK"),), default=0)
|
strings=(_("&OK"),), default=0)
|
||||||
|
|
||||||
def showImage(self, src, alt, ismap, align, width, height):
|
def showImage(self, src, alt, ismap, align, width, height):
|
||||||
url = self.basejoin(src)
|
url = self.basejoin(src)
|
||||||
|
|
|
@ -54,7 +54,7 @@ from pysollib.settings import TOP_TITLE
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkutil import bind, unbind_destroy, loadImage
|
from tkutil import bind, unbind_destroy, loadImage
|
||||||
from tkwidget import _ToplevelDialog, MfxDialog
|
from tkwidget import MfxDialog, MfxMessageDialog
|
||||||
from tkwidget import MfxScrolledCanvas
|
from tkwidget import MfxScrolledCanvas
|
||||||
|
|
||||||
gettext = _
|
gettext = _
|
||||||
|
@ -70,7 +70,7 @@ class SingleGame_StatsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, player, gameid, **kw):
|
def __init__(self, parent, title, app, player, gameid, **kw):
|
||||||
self.app = app
|
self.app = app
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.top_frame = top_frame
|
self.top_frame = top_frame
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
@ -285,13 +285,11 @@ class SingleGame_StatsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"),
|
strings=(_("&OK"),
|
||||||
(_("All games..."), 102),
|
(_("&All games..."), 102),
|
||||||
(TOP_TITLE+"...", 105),
|
(TOP_TITLE+"...", 105),
|
||||||
(_("Reset..."), 302)), default=0,
|
(_("&Reset..."), 302)), default=0,
|
||||||
image=self.app.gimages.logos[5],
|
image=self.app.gimages.logos[5],
|
||||||
separatorwidth=2,
|
|
||||||
resizable=0,
|
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
@ -543,7 +541,7 @@ class AllGames_StatsDialog(MfxDialog):
|
||||||
#
|
#
|
||||||
kwdefault(kw, width=self.CHAR_W*64, height=lines*self.CHAR_H)
|
kwdefault(kw, width=self.CHAR_W*64, height=lines*self.CHAR_H)
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -570,13 +568,13 @@ class AllGames_StatsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"),
|
strings=(_("&OK"),
|
||||||
(_("Save to file"), 202),
|
(_("&Save to file"), 202),
|
||||||
(_("Reset all..."), 301),),
|
(_("&Reset all..."), 301),),
|
||||||
default=0,
|
default=0,
|
||||||
separatorwidth=2, resizable=1,
|
resizable=1,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
#width=900,
|
#width=900,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
@ -644,7 +642,7 @@ class FullLog_StatsDialog(AllGames_StatsDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), (_("Session log..."), 104), (_("Save to file"), 203)), default=0,
|
strings=(_("&OK"), (_("Session &log..."), 104), (_("&Save to file"), 203)), default=0,
|
||||||
width=76*self.CHAR_W,
|
width=76*self.CHAR_W,
|
||||||
)
|
)
|
||||||
return AllGames_StatsDialog.initKw(self, kw)
|
return AllGames_StatsDialog.initKw(self, kw)
|
||||||
|
@ -660,7 +658,7 @@ class SessionLog_StatsDialog(FullLog_StatsDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), (_("Full log..."), 103), (_("Save to file"), 204)), default=0,
|
strings=(_("&OK"), (_("&Full log..."), 103), (_("&Save to file"), 204)), default=0,
|
||||||
)
|
)
|
||||||
return FullLog_StatsDialog.initKw(self, kw)
|
return FullLog_StatsDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
@ -668,7 +666,7 @@ class SessionLog_StatsDialog(FullLog_StatsDialog):
|
||||||
# //
|
# //
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class Status_StatsDialog(MfxDialog):
|
class Status_StatsDialog(MfxMessageDialog):
|
||||||
def __init__(self, parent, game):
|
def __init__(self, parent, game):
|
||||||
stats, gstats = game.stats, game.gstats
|
stats, gstats = game.stats, game.gstats
|
||||||
w1 = w2 = ""
|
w1 = w2 = ""
|
||||||
|
@ -688,26 +686,27 @@ class Status_StatsDialog(MfxDialog):
|
||||||
w2 = w2 + _("\nCards in Foundations: ") + str(n)
|
w2 = w2 + _("\nCards in Foundations: ") + str(n)
|
||||||
#
|
#
|
||||||
date = time.strftime("%Y-%m-%d %H:%M", time.localtime(game.gstats.start_time))
|
date = time.strftime("%Y-%m-%d %H:%M", time.localtime(game.gstats.start_time))
|
||||||
MfxDialog.__init__(self, parent, title=_("Game status"),
|
MfxMessageDialog.__init__(self, parent, title=_("Game status"),
|
||||||
text=game.getTitleName() + "\n" +
|
text=game.getTitleName() + "\n" +
|
||||||
game.getGameNumber(format=1) + "\n" +
|
game.getGameNumber(format=1) + "\n" +
|
||||||
_("Playing time: ") + game.getTime() + "\n" +
|
_("Playing time: ") + game.getTime() + "\n" +
|
||||||
_("Started at: ") + date + "\n\n"+
|
_("Started at: ") + date + "\n\n"+
|
||||||
_("Moves: ") + str(game.moves.index) + "\n" +
|
_("Moves: ") + str(game.moves.index) + "\n" +
|
||||||
_("Undo moves: ") + str(stats.undo_moves) + "\n" +
|
_("Undo moves: ") + str(stats.undo_moves) + "\n" +
|
||||||
_("Bookmark moves: ") + str(gstats.goto_bookmark_moves) + "\n" +
|
_("Bookmark moves: ") + str(gstats.goto_bookmark_moves) + "\n" +
|
||||||
_("Demo moves: ") + str(stats.demo_moves) + "\n" +
|
_("Demo moves: ") + str(stats.demo_moves) + "\n" +
|
||||||
_("Total player moves: ") + str(stats.player_moves) + "\n" +
|
_("Total player moves: ") + str(stats.player_moves) + "\n" +
|
||||||
_("Total moves in this game: ") + str(stats.total_moves) + "\n" +
|
_("Total moves in this game: ") + str(stats.total_moves) + "\n" +
|
||||||
_("Hints: ") + str(stats.hints) + "\n" +
|
_("Hints: ") + str(stats.hints) + "\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
w1 + w2,
|
w1 + w2,
|
||||||
strings=(_("OK"),
|
strings=(_("&OK"),
|
||||||
(_("Statistics..."), 101),
|
(_("&Statistics..."), 101),
|
||||||
(TOP_TITLE+"...", 105), ),
|
(TOP_TITLE+"...", 105), ),
|
||||||
image=game.app.gimages.logos[3],
|
image=game.app.gimages.logos[3],
|
||||||
image_side="left", image_padx=20,
|
image_side="left", image_padx=20,
|
||||||
padx=20, separatorwidth=2)
|
padx=20,
|
||||||
|
)
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
|
@ -716,7 +715,7 @@ class Status_StatsDialog(MfxDialog):
|
||||||
class _TopDialog(MfxDialog):
|
class _TopDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, top, **kw):
|
def __init__(self, parent, title, top, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -773,7 +772,7 @@ class _TopDialog(MfxDialog):
|
||||||
|
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw, strings=(_('OK'),), default=0, separatorwidth = 2)
|
kw = KwStruct(kw, strings=(_('&OK'),), default=0, separatorwidth=2)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
||||||
|
|
||||||
|
@ -781,7 +780,7 @@ class Top_StatsDialog(MfxDialog):
|
||||||
def __init__(self, parent, title, app, player, gameid, **kw):
|
def __init__(self, parent, title, app, player, gameid, **kw):
|
||||||
self.app = app
|
self.app = app
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -857,8 +856,9 @@ class Top_StatsDialog(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_('OK'),),
|
strings=(_('&OK'),),
|
||||||
default=0,
|
default=0,
|
||||||
image=self.app.gimages.logos[4],
|
image=self.app.gimages.logos[4],
|
||||||
separatorwidth = 2)
|
separatorwidth=2,
|
||||||
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
|
@ -181,6 +181,10 @@ def makeHelpToplevel(app, title=None):
|
||||||
window.option_add('*foreground', fg)
|
window.option_add('*foreground', fg)
|
||||||
window.option_add('*selectBackground', '#00008b', 50)
|
window.option_add('*selectBackground', '#00008b', 50)
|
||||||
window.option_add('*selectForeground', 'white', 50)
|
window.option_add('*selectForeground', 'white', 50)
|
||||||
|
if os.name == "posix":
|
||||||
|
window.option_add('*Scrollbar.elementBorderWidth', '1', 60)
|
||||||
|
window.option_add('*Scrollbar.borderWidth', '1', 60)
|
||||||
|
|
||||||
if title:
|
if title:
|
||||||
window.wm_title(title)
|
window.wm_title(title)
|
||||||
window.wm_iconname(title)
|
window.wm_iconname(title)
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
##
|
##
|
||||||
##---------------------------------------------------------------------------##
|
##---------------------------------------------------------------------------##
|
||||||
|
|
||||||
__all__ = ['MfxDialog',
|
__all__ = ['MfxMessageDialog',
|
||||||
'MfxExceptionDialog',
|
'MfxExceptionDialog',
|
||||||
'MfxSimpleEntry',
|
'MfxSimpleEntry',
|
||||||
'MfxTooltip',
|
'MfxTooltip',
|
||||||
|
@ -56,25 +56,30 @@ from tkutil import bind, unbind_destroy, makeImage
|
||||||
from tkutil import makeToplevel, setTransient
|
from tkutil import makeToplevel, setTransient
|
||||||
from tkcanvas import MfxCanvas
|
from tkcanvas import MfxCanvas
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // abstract base class for the dialogs in this module
|
# // abstract base class for the dialogs in this module
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class _ToplevelDialog:
|
class MfxDialog: # ex. _ToplevelDialog
|
||||||
img = None
|
img = {}
|
||||||
|
button_img = {}
|
||||||
def __init__(self, parent, title="", resizable=0, default=-1):
|
def __init__(self, parent, title="", resizable=0, default=-1):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.status = 0
|
self.status = 0
|
||||||
self.button = default
|
self.button = default
|
||||||
self.timer = None
|
self.timer = None
|
||||||
|
self.accel_keys = {}
|
||||||
self.top = makeToplevel(parent, title=title)
|
self.top = makeToplevel(parent, title=title)
|
||||||
self.top.wm_resizable(resizable, resizable)
|
self.top.wm_resizable(resizable, resizable)
|
||||||
##w, h = self.top.winfo_screenwidth(), self.top.winfo_screenheight()
|
##w, h = self.top.winfo_screenwidth(), self.top.winfo_screenheight()
|
||||||
##self.top.wm_maxsize(w-4, h-32)
|
##self.top.wm_maxsize(w-4, h-32)
|
||||||
bind(self.top, "WM_DELETE_WINDOW", self.wmDeleteWindow)
|
bind(self.top, "WM_DELETE_WINDOW", self.wmDeleteWindow)
|
||||||
|
#
|
||||||
|
|
||||||
def mainloop(self, focus=None, timeout=0):
|
def mainloop(self, focus=None, timeout=0):
|
||||||
bind(self.top, "<Escape>", self.mCancel)
|
bind(self.top, "<Escape>", self.mCancel)
|
||||||
|
bind(self.top, '<Alt-Key>', self.altKeyEvent) # for accelerators
|
||||||
if focus is not None:
|
if focus is not None:
|
||||||
focus.focus()
|
focus.focus()
|
||||||
setTransient(self.top, self.parent)
|
setTransient(self.top, self.parent)
|
||||||
|
@ -131,31 +136,24 @@ class _ToplevelDialog:
|
||||||
self.status = 2
|
self.status = 2
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
def mDone(self, button):
|
||||||
|
self.button = button
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
# /***********************************************************************
|
def altKeyEvent(self, event):
|
||||||
# // replacement for the tk_dialog script
|
key = event.char.lower()
|
||||||
# ************************************************************************/
|
key = unicode(key, 'utf-8')
|
||||||
|
button = self.accel_keys.get(key)
|
||||||
|
if not button is None:
|
||||||
|
self.mDone(button)
|
||||||
|
|
||||||
class MfxDialog(_ToplevelDialog):
|
|
||||||
def __init__(self, parent, title, **kw):
|
|
||||||
kw = self.initKw(kw)
|
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
|
||||||
self.createBitmaps(top_frame, kw)
|
|
||||||
#
|
|
||||||
self.button = kw.default
|
|
||||||
msg = Tkinter.Label(top_frame, text=kw.text, justify=kw.justify,
|
|
||||||
width=kw.width)
|
|
||||||
msg.pack(fill=Tkinter.BOTH, expand=1, padx=kw.padx, pady=kw.pady)
|
|
||||||
#
|
|
||||||
focus = self.createButtons(bottom_frame, kw)
|
|
||||||
self.mainloop(focus, kw.timeout)
|
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
timeout=0, resizable=0,
|
timeout=0, resizable=0,
|
||||||
text="", justify="center",
|
text="", justify="center",
|
||||||
strings=(_("OK"),), default=0,
|
strings=(_("&OK"),),
|
||||||
|
default=0,
|
||||||
width=0,
|
width=0,
|
||||||
padx=20, pady=20,
|
padx=20, pady=20,
|
||||||
bitmap=None, bitmap_side="left",
|
bitmap=None, bitmap_side="left",
|
||||||
|
@ -170,27 +168,21 @@ class MfxDialog(_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=Tkinter.BOTTOM, fill=Tkinter.BOTH, ipady=3)
|
bottom_frame.pack(side='bottom', fill='both', expand=1, ipady=3)
|
||||||
if kw.separatorwidth > 0:
|
if kw.separatorwidth > 0:
|
||||||
separator = Tkinter.Frame(self.top, relief="sunken",
|
separator = Tkinter.Frame(self.top, relief="sunken",
|
||||||
height=kw.separatorwidth, width=kw.separatorwidth,
|
height=kw.separatorwidth, width=kw.separatorwidth,
|
||||||
borderwidth=kw.separatorwidth / 2)
|
borderwidth=kw.separatorwidth / 2)
|
||||||
separator.pack(side=Tkinter.BOTTOM, fill=Tkinter.X)
|
separator.pack(side='bottom', fill='x')
|
||||||
top_frame = Tkinter.Frame(self.top)
|
top_frame = Tkinter.Frame(self.top)
|
||||||
top_frame.pack(side=Tkinter.TOP, fill=Tkinter.BOTH, expand=1)
|
top_frame.pack(side='top', fill='both', expand=1)
|
||||||
return top_frame, bottom_frame
|
return top_frame, bottom_frame
|
||||||
|
|
||||||
def createBitmaps(self, frame, kw):
|
def createBitmaps(self, frame, kw):
|
||||||
bm = ["error", "info", "question", "warning"]
|
if kw.bitmap: ## in ("error", "info", "question", "warning")
|
||||||
if kw.bitmap in bm:
|
img = self.img.get(kw.bitmap)
|
||||||
img = None
|
|
||||||
if self.img:
|
|
||||||
img = self.img[bm.index(kw.bitmap)]
|
|
||||||
b = Tkinter.Label(frame, image=img)
|
b = Tkinter.Label(frame, image=img)
|
||||||
b.pack(side=kw.bitmap_side, padx=kw.bitmap_padx, pady=kw.bitmap_pady)
|
b.pack(side=kw.bitmap_side, padx=kw.bitmap_padx, pady=kw.bitmap_pady)
|
||||||
elif kw.bitmap:
|
|
||||||
b = Tkinter.Label(frame, bitmap=kw.bitmap)
|
|
||||||
b.pack(side=kw.bitmap_side, padx=kw.bitmap_padx, pady=kw.bitmap_pady)
|
|
||||||
elif kw.image:
|
elif kw.image:
|
||||||
b = Tkinter.Label(frame, image=kw.image)
|
b = Tkinter.Label(frame, image=kw.image)
|
||||||
b.pack(side=kw.image_side, padx=kw.image_padx, pady=kw.image_pady)
|
b.pack(side=kw.image_side, padx=kw.image_padx, pady=kw.image_pady)
|
||||||
|
@ -206,6 +198,7 @@ class MfxDialog(_ToplevelDialog):
|
||||||
if s:
|
if s:
|
||||||
##s = re.sub(r"[\s\.\,]", "", s)
|
##s = re.sub(r"[\s\.\,]", "", s)
|
||||||
s = s.replace('...', '.')
|
s = s.replace('...', '.')
|
||||||
|
s = s.replace('&', '')
|
||||||
max_len = max(max_len, len(s))
|
max_len = max(max_len, len(s))
|
||||||
##print s, len(s)
|
##print s, len(s)
|
||||||
if max_len > 12 and os.name == 'posix': button_width = max_len
|
if max_len > 12 and os.name == 'posix': button_width = max_len
|
||||||
|
@ -213,6 +206,8 @@ class MfxDialog(_ToplevelDialog):
|
||||||
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
|
#print 'button_width =', button_width
|
||||||
|
#
|
||||||
|
#
|
||||||
for s in kw.strings:
|
for s in kw.strings:
|
||||||
xbutton = button = button + 1
|
xbutton = button = button + 1
|
||||||
if type(s) is types.TupleType:
|
if type(s) is types.TupleType:
|
||||||
|
@ -221,6 +216,8 @@ class MfxDialog(_ToplevelDialog):
|
||||||
s = s[0]
|
s = s[0]
|
||||||
if s is None:
|
if s is None:
|
||||||
continue
|
continue
|
||||||
|
accel_indx = s.find('&')
|
||||||
|
s = s.replace('&', '')
|
||||||
if button < 0:
|
if button < 0:
|
||||||
b = Tkinter.Button(frame, text=s, state="disabled")
|
b = Tkinter.Button(frame, text=s, state="disabled")
|
||||||
button = xbutton
|
button = xbutton
|
||||||
|
@ -230,30 +227,54 @@ class MfxDialog(_ToplevelDialog):
|
||||||
if button == kw.default:
|
if button == kw.default:
|
||||||
focus = b
|
focus = b
|
||||||
focus.config(default="active")
|
focus.config(default="active")
|
||||||
l = len(s)
|
#
|
||||||
## if 1 and l < max_len:
|
|
||||||
## l = l + (max_len - l) / 2
|
|
||||||
## b.config(width=l)
|
|
||||||
b.config(width=button_width)
|
b.config(width=button_width)
|
||||||
column = column + 1
|
if accel_indx >= 0:
|
||||||
b.grid_configure(column=column, row=0, sticky="ew", padx=padx, pady=pady)
|
# key accelerator
|
||||||
b.grid_columnconfigure(column)
|
b.config(underline=accel_indx)
|
||||||
|
key = s[accel_indx]
|
||||||
|
self.accel_keys[key.lower()] = button
|
||||||
|
#
|
||||||
|
## img = None
|
||||||
|
## if self.button_img:
|
||||||
|
## img = self.button_img.get(s)
|
||||||
|
## b.config(compound='left', image=img)
|
||||||
|
column += 1
|
||||||
|
b.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
|
||||||
|
##frame.columnconfigure(0, weight=1)
|
||||||
return focus
|
return focus
|
||||||
|
|
||||||
def mDone(self, button):
|
|
||||||
self.button = button
|
# /***********************************************************************
|
||||||
raise SystemExit
|
# // replacement for the tk_dialog script
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
class MfxMessageDialog(MfxDialog):
|
||||||
|
def __init__(self, parent, title, **kw):
|
||||||
|
kw = self.initKw(kw)
|
||||||
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
|
self.createBitmaps(top_frame, kw)
|
||||||
|
#
|
||||||
|
self.button = kw.default
|
||||||
|
msg = Tkinter.Label(top_frame, text=kw.text, justify=kw.justify,
|
||||||
|
width=kw.width)
|
||||||
|
msg.pack(fill=Tkinter.BOTH, expand=1, padx=kw.padx, pady=kw.pady)
|
||||||
|
#
|
||||||
|
focus = self.createButtons(bottom_frame, kw)
|
||||||
|
self.mainloop(focus, kw.timeout)
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class MfxExceptionDialog(MfxDialog):
|
class MfxExceptionDialog(MfxMessageDialog):
|
||||||
def __init__(self, parent, ex, title="Error", **kw):
|
def __init__(self, parent, ex, title="Error", **kw):
|
||||||
kw = KwStruct(kw, bitmap="error")
|
kw = KwStruct(kw, bitmap="error")
|
||||||
text = kw.get("text", "")
|
text = kw.get("text", "")
|
||||||
|
@ -265,7 +286,7 @@ class MfxExceptionDialog(MfxDialog):
|
||||||
else:
|
else:
|
||||||
t = str(ex)
|
t = str(ex)
|
||||||
kw.text = text + unicode(t, errors='replace')
|
kw.text = text + unicode(t, errors='replace')
|
||||||
apply(MfxDialog.__init__, (self, parent, title), kw.getKw())
|
apply(MfxMessageDialog.__init__, (self, parent, title), kw.getKw())
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
@ -275,7 +296,7 @@ class MfxExceptionDialog(MfxDialog):
|
||||||
class MfxSimpleEntry(MfxDialog):
|
class MfxSimpleEntry(MfxDialog):
|
||||||
def __init__(self, parent, title, label, value, **kw):
|
def __init__(self, parent, title, label, value, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
_ToplevelDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
#
|
#
|
||||||
|
@ -294,7 +315,7 @@ class MfxSimpleEntry(MfxDialog):
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
kw = KwStruct(kw,
|
kw = KwStruct(kw,
|
||||||
strings=(_("OK"), _("Cancel")), default=0,
|
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||||
separatorwidth = 0,
|
separatorwidth = 0,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return MfxDialog.initKw(self, kw)
|
||||||
|
|
|
@ -220,7 +220,8 @@ class PysolToolbar(PysolToolbarActions):
|
||||||
# (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=0, highlightthickness=1)
|
||||||
self.frame.config(bd=1, relief='raised', highlightthickness=0)
|
relief = self.button_relief == 'flat' and 'raised' or 'flat'
|
||||||
|
self.frame.config(bd=1, relief=relief, highlightthickness=0)
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
self.frame.config(bd=2, relief="groove", padx=2, pady=2)
|
self.frame.config(bd=2, relief="groove", padx=2, pady=2)
|
||||||
#self._createSeparator(width=4, side=Tkinter.LEFT, relief=Tkinter.FLAT)
|
#self._createSeparator(width=4, side=Tkinter.LEFT, relief=Tkinter.FLAT)
|
||||||
|
|
|
@ -27,7 +27,7 @@ from pysollib.resource import CSI
|
||||||
|
|
||||||
def getGameRulesFilename(n):
|
def getGameRulesFilename(n):
|
||||||
if n.startswith('Mahjongg'): return 'mahjongg.html'
|
if n.startswith('Mahjongg'): return 'mahjongg.html'
|
||||||
n = re.sub(r"[\[\(].*$", "", n)
|
##n = re.sub(r"[\[\(].*$", "", n)
|
||||||
n = latin1_to_ascii(n)
|
n = latin1_to_ascii(n)
|
||||||
n = re.sub(r"[^\w]", "", n)
|
n = re.sub(r"[^\w]", "", n)
|
||||||
n = n.lower() + ".html"
|
n = n.lower() + ".html"
|
||||||
|
|
Loading…
Add table
Reference in a new issue