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

+ 1 new game

* some changes in settings.py: added TITLE, renamed FC_VERSION to VERSION



git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@184 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2007-07-05 21:29:11 +00:00
parent cf787d633e
commit 959a14b1eb
28 changed files with 237 additions and 105 deletions

View file

@ -41,7 +41,7 @@ import os, locale
from mfxutil import SubclassResponsibility from mfxutil import SubclassResponsibility
from mfxutil import Struct, openURL from mfxutil import Struct, openURL
from pysolrandom import constructRandom from pysolrandom import constructRandom
from settings import PACKAGE, PACKAGE_URL from settings import TITLE, PACKAGE_URL
from settings import TOP_TITLE from settings import TOP_TITLE
from settings import DEBUG from settings import DEBUG
from gamedb import GI from gamedb import GI
@ -406,7 +406,7 @@ class PysolMenubarActions:
def mQuit(self, *args): def mQuit(self, *args):
if self._cancelDrag(): return if self._cancelDrag(): return
if self.changed(): if self.changed():
if not self.game.areYouSure(_("Quit ") + PACKAGE): return if not self.game.areYouSure(_("Quit ") + TITLE): return
self.game.endGame() self.game.endGame()
self.game.quitGame() self.game.quitGame()
@ -543,7 +543,7 @@ 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 = MfxMessageDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info", d = MfxMessageDialog(self.top, title=TITLE+_(" Info"), bitmap="info",
text=_("Comments were appended to\n\n") + fn) text=_("Comments were appended to\n\n") + fn)
self._setCommentMenu(bool(game.gsaveinfo.comment)) self._setCommentMenu(bool(game.gsaveinfo.comment))
@ -571,7 +571,7 @@ 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 = MfxMessageDialog(self.top, title=PACKAGE+_(" Info"), bitmap="info", d = MfxMessageDialog(self.top, title=TITLE+_(" Info"), bitmap="info",
text=text + _(" were appended to\n\n") + filename) text=text + _(" were appended to\n\n") + filename)
@ -587,7 +587,7 @@ class PysolMenubarActions:
d = Struct(status=-1, button=-1) d = Struct(status=-1, button=-1)
if demo: if demo:
player = None player = None
p0, p1, p2 = PACKAGE+_(" Demo"), PACKAGE+_(" Demo "), "" p0, p1, p2 = TITLE+_(" Demo"), TITLE+_(" Demo "), ""
else: else:
player = self.app.opt.player player = self.app.opt.player
p0, p1, p2 = player, "", _(" for ") + player p0, p1, p2 = player, "", _(" for ") + player

View file

@ -46,8 +46,8 @@ from mfxutil import Image, ImageTk
from mfxutil import destruct, Struct, SubclassResponsibility from mfxutil import destruct, Struct, SubclassResponsibility
from mfxutil import uclock, usleep from mfxutil import uclock, usleep
from mfxutil import format_time from mfxutil import format_time
from settings import PACKAGE, TOOLKIT, TOP_TITLE from settings import PACKAGE, TITLE, TOOLKIT, TOP_TITLE
from settings import VERSION, VERSION_TUPLE, FC_VERSION from settings import VERSION, VERSION_TUPLE
from settings import DEBUG from settings import DEBUG
from gamedb import GI from gamedb import GI
from pysolrandom import PysolRandom, LCRandom31 from pysolrandom import PysolRandom, LCRandom31
@ -154,8 +154,8 @@ class Game:
self.__createCommon(app) self.__createCommon(app)
self.setCursor(cursor=CURSOR_WATCH) self.setCursor(cursor=CURSOR_WATCH)
#print 'gameid:', self.id #print 'gameid:', self.id
self.top.wm_title(PACKAGE + " - " + self.getTitleName()) self.top.wm_title(TITLE + " - " + self.getTitleName())
self.top.wm_iconname(PACKAGE + " - " + self.getTitleName()) self.top.wm_iconname(TITLE + " - " + self.getTitleName())
# create the game # create the game
if self.app.intro.progress: self.app.intro.progress.update(step=1) if self.app.intro.progress: self.app.intro.progress.update(step=1)
self.createGame() self.createGame()
@ -1009,7 +1009,7 @@ class Game:
if confirm < 0: if confirm < 0:
confirm = self.app.opt.confirm confirm = self.app.opt.confirm
if confirm: if confirm:
if not title: title = PACKAGE if not title: title = TITLE
if not text: text = _("Discard current game ?") if not text: text = _("Discard current game ?")
self.playSample("areyousure") self.playSample("areyousure")
d = MfxMessageDialog(self.top, title=title, text=text, d = MfxMessageDialog(self.top, title=title, text=text,
@ -2282,7 +2282,7 @@ for %d moves.
self.playSample("autopilotwon", priority=1000) self.playSample("autopilotwon", priority=1000)
s = self.app.miscrandom.choice((_("&Great"), _("&Cool"), s = self.app.miscrandom.choice((_("&Great"), _("&Cool"),
_("&Yeah"), _("&Wow"))) _("&Yeah"), _("&Wow")))
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"), d = MfxMessageDialog(self.top, title=TITLE+_(" Autopilot"),
text=_("\nGame solved in %d moves.\n") % text=_("\nGame solved in %d moves.\n") %
self.moves.index, self.moves.index,
image=self.app.gimages.logos[4], image=self.app.gimages.logos[4],
@ -2296,7 +2296,7 @@ for %d moves.
text = _("\nGame finished\n") text = _("\nGame finished\n")
if DEBUG: if DEBUG:
text += "\nplayer_moves: %d\ndemo_moves: %d\n" % (self.stats.player_moves, self.stats.demo_moves) text += "\nplayer_moves: %d\ndemo_moves: %d\n" % (self.stats.player_moves, self.stats.demo_moves)
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"), d = MfxMessageDialog(self.top, title=TITLE+_(" 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
@ -2308,7 +2308,7 @@ for %d moves.
if player_moves == 0: if player_moves == 0:
self.playSample("autopilotlost", priority=1000) self.playSample("autopilotlost", priority=1000)
s = self.app.miscrandom.choice((_("&Oh well"), _("&That's life"), _("&Hmm"))) # ??? accelerators s = self.app.miscrandom.choice((_("&Oh well"), _("&That's life"), _("&Hmm"))) # ??? accelerators
d = MfxMessageDialog(self.top, title=PACKAGE+_(" Autopilot"), d = MfxMessageDialog(self.top, title=TITLE+_(" 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)
@ -2823,7 +2823,7 @@ Error while loading game.
Probably the game file is damaged, Probably the game file is damaged,
but this could also be a bug you might want to report.""")) but this could also be a bug you might want to report."""))
traceback.print_exc() traceback.print_exc()
except (Exception, UnpicklingError), ex: except UnpicklingError, ex:
self.updateMenus() self.updateMenus()
self.setCursor(cursor=self.app.top_cursor) self.setCursor(cursor=self.app.top_cursor)
d = MfxExceptionDialog(self.top, ex, title=_("Load game error"), d = MfxExceptionDialog(self.top, ex, title=_("Load game error"),
@ -2894,34 +2894,36 @@ Please report this bug."""))
if isinstance(t, type): if isinstance(t, type):
assert isinstance(obj, t), err_txt assert isinstance(obj, t), err_txt
return obj return obj
def validate(v, txt):
if not v:
raise UnpicklingError(txt)
# #
package = pload(str) package = pload(str)
assert package == PACKAGE, err_txt validate(package == PACKAGE, err_txt)
version = pload(str) version = pload(str)
#assert isinstance(version, str) and len(version) <= 20, err_txt #validate(isinstance(version, str) and len(version) <= 20, err_txt)
version_tuple = pload(tuple) version_tuple = pload(tuple)
if version_tuple < (10,): validate(version_tuple >= (1,0), _('''\
raise UnpicklingError(_('''\
Cannot load games saved with Cannot load games saved with
%s version %s''') % (PACKAGE, version)) %s version %s''') % (PACKAGE, version))
game_version = 1 game_version = 1
bookmark = pload(int) bookmark = pload(int)
assert 0 <= bookmark <= 2, err_txt validate(0 <= bookmark <= 2, err_txt)
game_version = pload(int) game_version = pload(int)
assert game_version > 0, err_txt validate(game_version > 0, err_txt)
# #
id = pload(int) id = pload(int)
assert id > 0, err_txt validate(id > 0, err_txt)
if id not in GI.PROTECTED_GAMES: if id not in GI.PROTECTED_GAMES:
game = app.constructGame(id) game = app.constructGame(id)
if game: if game:
if not game.canLoadGame(version_tuple, game_version): if not game.canLoadGame(version_tuple, game_version):
destruct(game) destruct(game)
game = None game = None
assert game is not None, _('''\ validate(game is not None, _('''\
Cannot load this game from version %s Cannot load this game from version %s
as the game rules have changed as the game rules have changed
in the current implementation.''') % version in the current implementation.''') % version)
game.version = version game.version = version
game.version_tuple = version_tuple game.version_tuple = version_tuple
# #
@ -2937,18 +2939,18 @@ in the current implementation.''') % version
game.loadinfo.stacks = [] game.loadinfo.stacks = []
game.loadinfo.ncards = 0 game.loadinfo.ncards = 0
nstacks = pload(int) nstacks = pload(int)
assert 1 <= nstacks, err_txt validate(1 <= nstacks, err_txt)
for i in range(nstacks): for i in range(nstacks):
stack = [] stack = []
ncards = pload(int) ncards = pload(int)
assert 0 <= ncards <= 1024, err_txt validate(0 <= ncards <= 1024, err_txt)
for j in range(ncards): for j in range(ncards):
card_id = pload(int) card_id = pload(int)
face_up = pload(int) face_up = pload(int)
stack.append((card_id, face_up)) stack.append((card_id, face_up))
game.loadinfo.stacks.append(stack) game.loadinfo.stacks.append(stack)
game.loadinfo.ncards = game.loadinfo.ncards + ncards game.loadinfo.ncards = game.loadinfo.ncards + ncards
assert game.loadinfo.ncards == game.gameinfo.ncards, err_txt validate(game.loadinfo.ncards == game.gameinfo.ncards, err_txt)
game.loadinfo.talon_round = pload() game.loadinfo.talon_round = pload()
game.finished = pload() game.finished = pload()
if 0 <= bookmark <= 1: if 0 <= bookmark <= 1:
@ -2967,7 +2969,7 @@ in the current implementation.''') % version
game.stats.__dict__.update(stats.__dict__) game.stats.__dict__.update(stats.__dict__)
game._loadGameHook(p) game._loadGameHook(p)
dummy = pload(str) dummy = pload(str)
assert dummy == "EOF", err_txt validate(dummy == "EOF", err_txt)
if bookmark == 2: if bookmark == 2:
# copy back all variables that are not saved # copy back all variables that are not saved
game.stats = self.stats game.stats = self.stats
@ -2991,7 +2993,7 @@ in the current implementation.''') % version
self.updateTime() self.updateTime()
assert 0 <= bookmark <= 2 assert 0 <= bookmark <= 2
p.dump(PACKAGE) p.dump(PACKAGE)
p.dump(FC_VERSION) p.dump(VERSION)
p.dump(VERSION_TUPLE) p.dump(VERSION_TUPLE)
p.dump(bookmark) p.dump(bookmark)
p.dump(self.GAME_VERSION) p.dump(self.GAME_VERSION)

View file

@ -784,6 +784,135 @@ class School(Fan):
return card1.rank == card2.rank return card1.rank == card2.rank
# /***********************************************************************
# // Forest Glade
# ************************************************************************/
class ForestGlade_Talon(DealRowRedealTalonStack):
def _redeal(self, rows=None, frames=0):
# move all cards to the talon
num_cards = 0
if rows is None:
rows = self.game.s.rows
for r in rows:
for i in range(len(r.cards)):
num_cards += 1
self.game.moveMove(1, r, self, frames=frames, shadow=0)
if self.cards[-1].face_up:
self.game.flipMove(self)
return num_cards
def canDealCards(self):
if self.round == self.max_rounds:
if not self.cards:
return False
for r in self.game.s.rows:
if not r.cards:
return True
return False
return True
def dealCards(self, sound=0):
rows = [r for r in self.game.s.rows if not r.cards]
if not rows or not self.cards:
if sound and self.game.app.opt.animations:
self.game.startDealSample()
# move all cards to the talon
ncards = self._redeal(frames=4)
# shuffle
self.game.shuffleStackMove(self)
# deal
if self.cards:
for r in self.game.s.rows:
for i in range(3):
if not self.cards:
break
ncards += self.dealRowAvail(rows=[r], frames=4)
#
self.game.nextRoundMove(self)
if sound:
self.game.stopSamples()
return ncards
#
if sound and self.game.app.opt.animations:
self.game.startDealSample()
ncards = 0
for r in rows:
for i in range(3):
if not self.cards:
break
ncards += self.dealRowAvail(rows=[r], sound=0)
if sound:
self.game.stopSamples()
return ncards
class ForestGlade(Game):
Hint_Class = CautiousDefaultHint
def createGame(self):
l, s = Layout(self), self.s
playcards = 7
w0 = l.XS+(playcards-1)*l.XOFFSET
w, h = l.XM + 3*w0 + 4*l.XS, l.YM+6*l.YS
self.setSize(w, h)
x1, x2 = l.XM, self.width - 2*l.XS
for i in range(2):
y = l.YM
for j in range(4):
s.foundations.append(SS_FoundationStack(x1, y, self,
suit=j, dir=2, max_cards=7))
s.foundations.append(SS_FoundationStack(x2, y, self,
base_rank=1, suit=j, dir=2, max_cards=6))
y += l.YS
x1 += l.XS
x2 += l.XS
x, y = l.XM + 3*l.XS, l.YM
for i in (0, 1):
stack = SS_RowStack(x, y, self, max_move=1, base_rank=KING)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
s.rows.append(stack)
x += w0
y = l.YM+l.YS
for i in range(4):
x = l.XM + 2*l.XS
for j in range(3):
stack = SS_RowStack(x, y, self, max_move=1, base_rank=KING)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
s.rows.append(stack)
x += w0
y += l.YS
x, y = l.XM + 3*l.XS, l.YM + 5*l.YS
for i in (0, 1):
stack = SS_RowStack(x, y, self, max_move=1, base_rank=KING)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
s.rows.append(stack)
x += w0
x, y = l.XM, self.height - l.YS
s.talon = ForestGlade_Talon(x, y, self, max_rounds=3)
l.createText(s.talon, 'ne')
tx, ty, ta, tf = l.getTextAttr(s.talon, 'se')
font=self.app.getFont('canvas_default')
s.talon.texts.rounds = MfxCanvasText(self.canvas, tx, ty,
anchor=ta, font=font)
l.defaultStackGroups()
def startGame(self):
for i in range(2):
self.s.talon.dealRow(frames=0)
self.startDealSample()
self.s.talon.dealRow()
shallHighlightMatch = Game._shallHighlightMatch_SS
# register the game # register the game
registerGame(GameInfo(56, FanGame, "Fan", registerGame(GameInfo(56, FanGame, "Fan",
@ -828,4 +957,6 @@ registerGame(GameInfo(714, ShamrocksII, "Shamrocks II",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL)) GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(719, School, "School", registerGame(GameInfo(719, School, "School",
GI.GT_FAN_TYPE, 1, 2, GI.SL_MOSTLY_SKILL)) GI.GT_FAN_TYPE, 1, 2, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(739, ForestGlade, "Forest Glade",
GI.GT_FAN_TYPE, 2, 2, GI.SL_MOSTLY_SKILL))

View file

@ -37,7 +37,7 @@
# imports # imports
# PySol imports # PySol imports
from settings import PACKAGE, PACKAGE_URL, TOOLKIT, FC_VERSION from settings import TITLE, PACKAGE_URL, TOOLKIT, VERSION
from pysoltk import make_help_toplevel from pysoltk import make_help_toplevel
from pysoltk import MfxMessageDialog from pysoltk import MfxMessageDialog
from pysoltk import PysolAboutDialog from pysoltk import PysolAboutDialog
@ -57,8 +57,8 @@ def help_about(app, timeout=0, sound=1):
strings=(_("&Nice"), _("&Credits...")) strings=(_("&Nice"), _("&Credits..."))
if timeout: if timeout:
strings=(_("&Enjoy"),) strings=(_("&Enjoy"),)
version = _("Version %s") % FC_VERSION version = _("Version %s") % VERSION
d = PysolAboutDialog(app, app.top, title=_("About ") + PACKAGE, d = PysolAboutDialog(app, app.top, title=_("About ") + TITLE,
timeout=timeout, timeout=timeout,
text=_('''PySol Fan Club edition text=_('''PySol Fan Club edition
%s%s %s%s
@ -91,7 +91,7 @@ def help_credits(app, timeout=0, sound=1):
elif TOOLKIT == "kde": t = "pyKDE" elif TOOLKIT == "kde": t = "pyKDE"
elif TOOLKIT == "wx" : t = "wxPython" elif TOOLKIT == "wx" : t = "wxPython"
d = MfxMessageDialog(app.top, title=_("Credits"), timeout=timeout, d = MfxMessageDialog(app.top, title=_("Credits"), timeout=timeout,
text=PACKAGE+_(''' credits go to: text=TITLE+_(''' 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
@ -126,7 +126,7 @@ def help_html(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 EnvironmentError: except EnvironmentError:
d = MfxMessageDialog(app.top, title=PACKAGE + _(" HTML Problem"), d = MfxMessageDialog(app.top, title=TITLE + _(" HTML Problem"),
text=_("Cannot find help document\n") + document, text=_("Cannot find help document\n") + document,
bitmap="warning") bitmap="warning")
return None return None
@ -140,7 +140,7 @@ def help_html(app, document, dir_, top=None):
viewer.display(doc, relpath=0) viewer.display(doc, relpath=0)
except: except:
##traceback.print_exc() ##traceback.print_exc()
top = make_help_toplevel(app, title=PACKAGE+_(" Help")) top = make_help_toplevel(app, title=TITLE+_(" Help"))
if top.winfo_screenwidth() < 800 or top.winfo_screenheight() < 600: if top.winfo_screenwidth() < 800 or top.winfo_screenheight() < 600:
#maximized = 1 #maximized = 1
top.wm_minsize(300, 150) top.wm_minsize(300, 150)

View file

@ -110,12 +110,12 @@ def init():
sys.argv.remove('--tile') sys.argv.remove('--tile')
if settings.TOOLKIT == 'tk': if settings.TOOLKIT == 'tk':
import Tkinter import Tkinter
root = Tkinter.Tk(className=settings.PACKAGE) root = Tkinter.Tk(className=settings.TITLE)
root.withdraw() root.withdraw()
if Tkinter.TkVersion < 8.4: if Tkinter.TkVersion < 8.4:
# we need unicode support # we need unicode support
sys.exit("%s needs Tcl/Tk 8.4 or better (you have %s)" % sys.exit("%s needs Tcl/Tk 8.4 or better (you have %s)" %
(settings.PACKAGE, str(Tkinter.TkVersion))) (settings.TITLE, str(Tkinter.TkVersion)))
settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem') settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem')
if settings.WIN_SYSTEM == 'aqua': if settings.WIN_SYSTEM == 'aqua':
# TkAqua displays the console automatically in application # TkAqua displays the console automatically in application

View file

@ -46,7 +46,7 @@ from resource import Tile
from app import Application from app import Application
from pysolaudio import AbstractAudioClient, PysolSoundServerModuleClient from pysolaudio import AbstractAudioClient, PysolSoundServerModuleClient
from pysolaudio import Win32AudioClient, OSSAudioClient, PyGameAudioClient from pysolaudio import Win32AudioClient, OSSAudioClient, PyGameAudioClient
from settings import PACKAGE, SOUND_MOD from settings import TITLE, SOUND_MOD
from winsystems import init_root_window from winsystems import init_root_window
# Toolkit imports # Toolkit imports
@ -62,14 +62,14 @@ from pysoltk import PysolProgressBar
def fatal_no_cardsets(app): def fatal_no_cardsets(app):
app.wm_withdraw() app.wm_withdraw()
d = MfxMessageDialog(app.top, title=_("%s installation error") % PACKAGE, d = MfxMessageDialog(app.top, title=_("%s installation error") % TITLE,
text=_('''No cardsets were found !!! text=_('''No cardsets were found !!!
Main data directory is: Main data directory is:
%s %s
Please check your %s installation. Please check your %s installation.
''') % (app.dataloader.dir, PACKAGE), ''') % (app.dataloader.dir, TITLE),
bitmap="error", strings=(_("&Quit"),)) bitmap="error", strings=(_("&Quit"),))
@ -203,7 +203,7 @@ def pysol_init(app, args):
pass pass
# init toolkit 1) # init toolkit 1)
top = MfxRoot(className=PACKAGE) top = MfxRoot(className=TITLE)
app.top = top app.top = top
app.top_bg = top.cget("bg") app.top_bg = top.cget("bg")
app.top_cursor = top.cget("cursor") app.top_cursor = top.cget("cursor")
@ -255,7 +255,7 @@ 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 = MfxMessageDialog(top, title=_("%s installation error") % PACKAGE, d = MfxMessageDialog(top, title=_("%s installation error") % TITLE,
text=_(''' text=_('''
No games were found !!! No games were found !!!
@ -263,7 +263,7 @@ Main data directory is:
%s %s
Please check your %s installation. Please check your %s installation.
''') % (app.dataloader.dir, PACKAGE), bitmap="error", strings=(_("&Quit"),)) ''') % (app.dataloader.dir, TITLE), bitmap="error", strings=(_("&Quit"),))
return 1 return 1
# init cardsets # init cardsets
@ -325,7 +325,7 @@ Please check your %s installation.
app.wm_withdraw() app.wm_withdraw()
# create the progress bar # create the progress bar
title = _("Welcome to %s") % PACKAGE title = _("Welcome to %s") % TITLE
color = app.opt.colors['table'] color = app.opt.colors['table']
if app.tabletile_index > 0: if app.tabletile_index > 0:
color = "#008200" color = "#008200"

View file

@ -39,7 +39,7 @@ from gtk import gdk
# PySol imports # PySol imports
from pysollib.gamedb import GI from pysollib.gamedb import GI
from pysollib.actions import PysolMenubarActions from pysollib.actions import PysolMenubarActions
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# toolkit imports # toolkit imports
from tkutil import setTransient from tkutil import setTransient
@ -229,7 +229,7 @@ class PysolMenubar(PysolMenubarActions):
ltk2gtk('&Contents'), '<control>F1', ltk2gtk('&Contents'), '<control>F1',
None, self.mHelp), None, self.mHelp),
('aboutpysol', None, ('aboutpysol', None,
ltk2gtk('&About ')+PACKAGE+'...', ltk2gtk('&About ')+TITLE+'...',
None,None,self.mHelpAbout), None,None,self.mHelpAbout),
('updateall', None, ('updateall', None,
'Redraw Game', '<control>L', 'Redraw Game', '<control>L',

View file

@ -51,7 +51,7 @@ if __name__ == '__main__':
# PySol imports # PySol imports
from pysollib.mfxutil import Struct, openURL from pysollib.mfxutil import Struct, openURL
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# Toolkit imports # Toolkit imports
from tkutil import bind, unbind_destroy, loadImage from tkutil import bind, unbind_destroy, loadImage
@ -444,7 +444,7 @@ class HTMLViewer:
for p in REMOTE_PROTOCOLS: for p in REMOTE_PROTOCOLS:
if url.startswith(p): if url.startswith(p):
if not openURL(url): if not openURL(url):
self.errorDialog(PACKAGE + _('''HTML limitation: self.errorDialog(TITLE + _('''HTML limitation:
The %s protocol is not supported yet. The %s protocol is not supported yet.
Please use your standard web browser Please use your standard web browser
@ -544,7 +544,7 @@ to open the following URL:
self.display(self.home, relpath=0) self.display(self.home, relpath=0)
def errorDialog(self, msg): def errorDialog(self, msg):
d = MfxMessageDialog(self.parent, title=PACKAGE+' HTML Problem', d = MfxMessageDialog(self.parent, title=TITLE+' HTML Problem',
text=msg, bitmap='warning', text=msg, bitmap='warning',
strings=(_('&OK'),), default=0) strings=(_('&OK'),), default=0)

View file

@ -27,7 +27,7 @@ import gtk.glade
# PySol imports # PySol imports
from pysollib.mfxutil import format_time from pysollib.mfxutil import format_time
from pysollib.settings import TOP_TITLE, PACKAGE from pysollib.settings import TOP_TITLE, TITLE
from pysollib.stats import PysolStatsFormatter from pysollib.stats import PysolStatsFormatter
# Toolkit imports # Toolkit imports
@ -166,7 +166,7 @@ class Game_StatsDialog:
dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT) dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
dialog.set_transient_for(parent) dialog.set_transient_for(parent)
dialog.resize(500, 340) dialog.resize(500, 340)
dialog.set_title(PACKAGE+' - '+_("Statistics")) dialog.set_title(TITLE+' - '+_("Statistics"))
# #
dialog.run() dialog.run()
self.status = -1 self.status = -1

View file

@ -38,7 +38,7 @@ from gtk import gdk
# PySol imports # PySol imports
## from pysollib.images import Images ## from pysollib.images import Images
from pysollib.settings import PACKAGE, VERSION from pysollib.settings import TITLE, VERSION
# Toolkit imports # Toolkit imports
from tkutil import makeToplevel, loadImage from tkutil import makeToplevel, loadImage
@ -236,8 +236,8 @@ class MfxRoot(_MfxToplevel):
def initToolkit(self, app, fg=None, bg=None, font=None, theme=None): def initToolkit(self, app, fg=None, bg=None, font=None, theme=None):
sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth() sw, sh, sd = self.winfo_screenwidth(), self.winfo_screenheight(), self.winfo_screendepth()
##self.wm_group(self) ##self.wm_group(self)
self.wm_title(PACKAGE + ' ' + VERSION) self.wm_title(TITLE + ' ' + VERSION)
##self.wm_iconname(PACKAGE + ' ' + VERSION) ##self.wm_iconname(TITLE + ' ' + VERSION)
if sw < 640 or sh < 480: if sw < 640 or sh < 480:
self.wm_minsize(400, 300) self.wm_minsize(400, 300)
else: else:

View file

@ -24,16 +24,15 @@ import os
n_ = lambda x: x # for gettext n_ = lambda x: x # for gettext
#PACKAGE = 'PySolFC' PACKAGE = 'PySolFC'
PACKAGE = 'PySol' TITLE = 'PySol'
#PACKAGE_URL = 'http://pysolfc/sourceforge.net/' #PACKAGE_URL = 'http://pysolfc.sourceforge.net/'
PACKAGE_URL = 'http://sourceforge.net/projects/pysolfc/' PACKAGE_URL = 'http://sourceforge.net/projects/pysolfc/'
VERSION = '4.82' VERSION = '1.0.1'
FC_VERSION = '1.0.1' VERSION_TUPLE = (1, 0, 1)
VERSION_TUPLE = (10, 0, 1)
# Tk windowing system (auto determine in init.py) # Tk windowing system (auto set up in init.py)
WIN_SYSTEM = 'x11' # win32, x11, aqua, classic WIN_SYSTEM = 'x11' # win32, x11, aqua, classic
# toolkit # toolkit

View file

@ -33,7 +33,7 @@ from tkutil import after, after_cancel
from tkutil import bind, unbind_destroy, makeImage from tkutil import bind, unbind_destroy, makeImage
from tkcanvas import MfxCanvas, MfxCanvasGroup, MfxCanvasImage, MfxCanvasRectangle from tkcanvas import MfxCanvas, MfxCanvasGroup, MfxCanvasImage, MfxCanvasRectangle
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# /*********************************************************************** # /***********************************************************************
@ -130,7 +130,7 @@ class FindCardDialog(Tkinter.Toplevel):
i += 1 i += 1
w, h = dx*j+2, dy*i+2 w, h = dx*j+2, dy*i+2
self.canvas.config(width=w, height=h) self.canvas.config(width=w, height=h)
self.wm_iconname(PACKAGE + " - " + game.getTitleName()) self.wm_iconname(TITLE + " - " + game.getTitleName())
self.wm_geometry('') # cancel user-specified geometry self.wm_geometry('') # cancel user-specified geometry
def enterEvent(self, suit, rank, rect, group): def enterEvent(self, suit, rank, rect, group):

View file

@ -46,7 +46,7 @@ import tkFileDialog
from pysollib.mfxutil import Struct, kwdefault from pysollib.mfxutil import Struct, kwdefault
from pysollib.mfxutil import Image from pysollib.mfxutil import Image
from pysollib.util import CARDSET from pysollib.util import CARDSET
from pysollib.settings import PACKAGE, WIN_SYSTEM from pysollib.settings import TITLE, WIN_SYSTEM
from pysollib.settings import SELECT_GAME_MENU from pysollib.settings import SELECT_GAME_MENU
from pysollib.settings import USE_FREECELL_SOLVER from pysollib.settings import USE_FREECELL_SOLVER
from pysollib.settings import DEBUG from pysollib.settings import DEBUG
@ -347,7 +347,7 @@ class PysolMenubar(PysolMenubarActions):
if WIN_SYSTEM == "aqua": if WIN_SYSTEM == "aqua":
applemenu=MfxMenu(self.__menubar, "apple") applemenu=MfxMenu(self.__menubar, "apple")
applemenu.add_command(label=_("&About ")+PACKAGE, command=self.mHelpAbout) applemenu.add_command(label=_("&About ")+TITLE, command=self.mHelpAbout)
menu = MfxMenu(self.__menubar, n_("&File")) menu = MfxMenu(self.__menubar, n_("&File"))
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N") menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
@ -517,7 +517,7 @@ class PysolMenubar(PysolMenubarActions):
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews) ##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
if WIN_SYSTEM != "aqua": if WIN_SYSTEM != "aqua":
menu.add_separator() menu.add_separator()
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout) menu.add_command(label=n_("&About ")+TITLE+"...", command=self.mHelpAbout)
MfxMenubar.addPath = None MfxMenubar.addPath = None
@ -973,7 +973,7 @@ class PysolMenubar(PysolMenubarActions):
# #
DEFAULTEXTENSION = ".pso" DEFAULTEXTENSION = ".pso"
FILETYPES = ((PACKAGE+" files", "*"+DEFAULTEXTENSION), ("All files", "*")) FILETYPES = ((TITLE+" files", "*"+DEFAULTEXTENSION), ("All files", "*"))
def mAddFavor(self, *event): def mAddFavor(self, *event):
gameid = self.app.game.id gameid = self.app.game.id
@ -1346,7 +1346,7 @@ class PysolMenubar(PysolMenubarActions):
d = MfxMessageDialog(self.top, title=_("Change theme"), d = MfxMessageDialog(self.top, title=_("Change theme"),
text=_("""\ text=_("""\
This settings will take effect This settings will take effect
the next time you restart """)+PACKAGE, the next time you restart """)+TITLE,
bitmap="warning", bitmap="warning",
default=0, strings=(_("&OK"),)) default=0, strings=(_("&OK"),))

View file

@ -32,7 +32,7 @@ import Tkinter
import Tile import Tile
# PySol imports # PySol imports
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.mfxutil import KwStruct from pysollib.mfxutil import KwStruct
# Toolkit imports # Toolkit imports
@ -50,7 +50,7 @@ class SolverDialog(MfxDialog):
def __init__(self, parent, app, **kw): def __init__(self, parent, app, **kw):
self.parent = parent self.parent = parent
self.app = app self.app = app
title = PACKAGE+' - FreeCell Solver' title = TITLE+' - FreeCell Solver'
kw = self.initKw(kw) kw = self.initKw(kw)
MfxDialog.__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)

View file

@ -42,7 +42,7 @@ import Tile
# PySol imports # PySol imports
from pysollib.mfxutil import KwStruct from pysollib.mfxutil import KwStruct
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.pysolaudio import pysolsoundserver from pysollib.pysolaudio import pysolsoundserver
# Toolkit imports # Toolkit imports
@ -201,7 +201,7 @@ class SoundOptionsDialog(MfxDialog):
d = MfxMessageDialog(self.top, title=_("Sound preferences info"), d = MfxMessageDialog(self.top, title=_("Sound preferences info"),
text=_("""\ text=_("""\
Changing DirectX settings will take effect Changing DirectX settings will take effect
the next time you restart """)+PACKAGE, the next time you restart """)+TITLE,
bitmap="warning", bitmap="warning",
default=0, strings=(_("&OK"),)) default=0, strings=(_("&OK"),))

View file

@ -49,7 +49,7 @@ if __name__ == '__main__':
# PySol imports # PySol imports
from pysollib.mfxutil import Struct, openURL from pysollib.mfxutil import Struct, openURL
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# Toolkit imports # Toolkit imports
from tkutil import bind, unbind_destroy from tkutil import bind, unbind_destroy
@ -388,7 +388,7 @@ class HTMLViewer:
for p in REMOTE_PROTOCOLS: for p in REMOTE_PROTOCOLS:
if url.startswith(p): if url.startswith(p):
if not openURL(url): if not openURL(url):
self.errorDialog(PACKAGE + _('''HTML limitation: self.errorDialog(TITLE + _('''HTML limitation:
The %s protocol is not supported yet. The %s protocol is not supported yet.
Please use your standard web browser Please use your standard web browser
@ -500,7 +500,7 @@ to open the following URL:
self.display(self.home, relpath=0) self.display(self.home, relpath=0)
def errorDialog(self, msg): def errorDialog(self, msg):
d = MfxMessageDialog(self.parent, title=PACKAGE+" HTML Problem", d = MfxMessageDialog(self.parent, title=TITLE+" HTML Problem",
text=msg, text=msg,
##bitmap="warning", # FIXME: this interp don't have images ##bitmap="warning", # FIXME: this interp don't have images
strings=(_("&OK"),), default=0) strings=(_("&OK"),), default=0)

View file

@ -62,7 +62,7 @@ from tkFont import Font
# PySol imports # PySol imports
from pysollib.mfxutil import Image, ImageTk, ImageOps from pysollib.mfxutil import Image, ImageTk, ImageOps
from pysollib.settings import PACKAGE, WIN_SYSTEM from pysollib.settings import TITLE, WIN_SYSTEM
# /*********************************************************************** # /***********************************************************************
@ -125,7 +125,7 @@ def makeToplevel(parent, title=None):
# #
# This is a shortcut for a Toplevel() instantiation plus calls to # This is a shortcut for a Toplevel() instantiation plus calls to
# set the title and icon name of the window. # set the title and icon name of the window.
window = Tkinter.Toplevel(parent) #, class_=PACKAGE) window = Tkinter.Toplevel(parent) #, class_=TITLE)
##window.wm_group(parent) ##window.wm_group(parent)
##window.wm_command("") ##window.wm_command("")
if WIN_SYSTEM == "x11": if WIN_SYSTEM == "x11":
@ -139,7 +139,7 @@ def makeToplevel(parent, title=None):
def make_help_toplevel(app, title=None): def make_help_toplevel(app, title=None):
# Create an independent Toplevel window. # Create an independent Toplevel window.
from pysollib.winsystems import init_root_window from pysollib.winsystems import init_root_window
window = Tkinter.Tk(className=PACKAGE) window = Tkinter.Tk(className=TITLE)
init_root_window(window, app) init_root_window(window, app)
return window return window

View file

@ -44,7 +44,7 @@ import Tile
from pysollib.mfxutil import destruct from pysollib.mfxutil import destruct
from pysollib.mfxutil import Image, ImageTk from pysollib.mfxutil import Image, ImageTk
from pysollib.util import IMAGE_EXTENSIONS from pysollib.util import IMAGE_EXTENSIONS
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.actions import PysolToolbarActions from pysollib.actions import PysolToolbarActions
from pysollib.winsystems import TkSettings from pysollib.winsystems import TkSettings
@ -200,7 +200,7 @@ class PysolToolbar(PysolToolbarActions):
(n_("Statistics"), self.mPlayerStats, _("View statistics")), (n_("Statistics"), self.mPlayerStats, _("View statistics")),
(n_("Rules"), self.mHelpRules, _("Rules for this game")), (n_("Rules"), self.mHelpRules, _("Rules for this game")),
(None, None, None), (None, None, None),
(n_("Quit"), self.mQuit, _("Quit ")+PACKAGE), (n_("Quit"), self.mQuit, _("Quit ")+TITLE),
): ):
if l is None: if l is None:
sep = self._createSeparator() sep = self._createSeparator()

View file

@ -36,7 +36,7 @@ from tkutil import after, after_cancel
from tkutil import bind, unbind_destroy, makeImage from tkutil import bind, unbind_destroy, makeImage
from tkcanvas import MfxCanvas, MfxCanvasGroup, MfxCanvasImage, MfxCanvasRectangle from tkcanvas import MfxCanvas, MfxCanvasGroup, MfxCanvasImage, MfxCanvasRectangle
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# /*********************************************************************** # /***********************************************************************
@ -133,7 +133,7 @@ class FindCardDialog(Tkinter.Toplevel):
i += 1 i += 1
w, h = dx*j+2, dy*i+2 w, h = dx*j+2, dy*i+2
self.canvas.config(width=w, height=h) self.canvas.config(width=w, height=h)
self.wm_iconname(PACKAGE + " - " + game.getTitleName()) self.wm_iconname(TITLE + " - " + game.getTitleName())
self.wm_geometry('') # cancel user-specified geometry self.wm_geometry('') # cancel user-specified geometry
def enterEvent(self, suit, rank, rect, group): def enterEvent(self, suit, rank, rect, group):

View file

@ -45,7 +45,7 @@ import Tkinter, tkFileDialog
from pysollib.mfxutil import Struct, kwdefault from pysollib.mfxutil import Struct, kwdefault
from pysollib.mfxutil import Image from pysollib.mfxutil import Image
from pysollib.util import CARDSET from pysollib.util import CARDSET
from pysollib.settings import PACKAGE, WIN_SYSTEM from pysollib.settings import TITLE, WIN_SYSTEM
from pysollib.settings import TOP_TITLE from pysollib.settings import TOP_TITLE
from pysollib.settings import SELECT_GAME_MENU from pysollib.settings import SELECT_GAME_MENU
from pysollib.settings import USE_FREECELL_SOLVER from pysollib.settings import USE_FREECELL_SOLVER
@ -344,7 +344,7 @@ class PysolMenubar(PysolMenubarActions):
if WIN_SYSTEM == "aqua": if WIN_SYSTEM == "aqua":
applemenu=MfxMenu(self.__menubar, "apple") applemenu=MfxMenu(self.__menubar, "apple")
applemenu.add_command(label=_("&About ")+PACKAGE, command=self.mHelpAbout) applemenu.add_command(label=_("&About ")+TITLE, command=self.mHelpAbout)
menu = MfxMenu(self.__menubar, n_("&File")) menu = MfxMenu(self.__menubar, n_("&File"))
menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N") menu.add_command(label=n_("&New game"), command=self.mNewGame, accelerator="N")
@ -521,7 +521,7 @@ class PysolMenubar(PysolMenubarActions):
##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews) ##menu.add_command(label=n_("What's &new ?"), command=self.mHelpNews)
if WIN_SYSTEM != "aqua": if WIN_SYSTEM != "aqua":
menu.add_separator() menu.add_separator()
menu.add_command(label=n_("&About ")+PACKAGE+"...", command=self.mHelpAbout) menu.add_command(label=n_("&About ")+TITLE+"...", command=self.mHelpAbout)
MfxMenubar.addPath = None MfxMenubar.addPath = None
@ -977,7 +977,7 @@ class PysolMenubar(PysolMenubarActions):
# #
DEFAULTEXTENSION = ".pso" DEFAULTEXTENSION = ".pso"
FILETYPES = ((PACKAGE+" files", "*"+DEFAULTEXTENSION), ("All files", "*")) FILETYPES = ((TITLE+" files", "*"+DEFAULTEXTENSION), ("All files", "*"))
def mAddFavor(self, *event): def mAddFavor(self, *event):
gameid = self.app.game.id gameid = self.app.game.id

View file

@ -33,7 +33,7 @@ import Tkinter
# PySol imports # PySol imports
from pysollib.mfxutil import KwStruct from pysollib.mfxutil import KwStruct
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# Toolkit imports # Toolkit imports
from tkconst import EVENT_HANDLED from tkconst import EVENT_HANDLED
@ -49,7 +49,7 @@ class SolverDialog(MfxDialog):
def __init__(self, parent, app, **kw): def __init__(self, parent, app, **kw):
self.parent = parent self.parent = parent
self.app = app self.app = app
title = PACKAGE+' - FreeCell Solver' title = TITLE+' - FreeCell Solver'
kw = self.initKw(kw) kw = self.initKw(kw)
MfxDialog.__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)

View file

@ -41,7 +41,7 @@ import Tkinter
# PySol imports # PySol imports
from pysollib.mfxutil import KwStruct from pysollib.mfxutil import KwStruct
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.pysolaudio import pysolsoundserver from pysollib.pysolaudio import pysolsoundserver
# Toolkit imports # Toolkit imports
@ -201,7 +201,7 @@ class SoundOptionsDialog(MfxDialog):
d = MfxMessageDialog(self.top, title=_("Sound preferences info"), d = MfxMessageDialog(self.top, title=_("Sound preferences info"),
text=_("""\ text=_("""\
Changing DirectX settings will take effect Changing DirectX settings will take effect
the next time you restart """)+PACKAGE, the next time you restart """)+TITLE,
bitmap="warning", bitmap="warning",
default=0, strings=(_("&OK"),)) default=0, strings=(_("&OK"),))

View file

@ -48,7 +48,7 @@ if __name__ == '__main__':
# PySol imports # PySol imports
from pysollib.mfxutil import Struct, openURL from pysollib.mfxutil import Struct, openURL
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
# Toolkit imports # Toolkit imports
from tkutil import bind, unbind_destroy from tkutil import bind, unbind_destroy
@ -383,7 +383,7 @@ class HTMLViewer:
for p in REMOTE_PROTOCOLS: for p in REMOTE_PROTOCOLS:
if url.startswith(p): if url.startswith(p):
if not openURL(url): if not openURL(url):
self.errorDialog(PACKAGE + _('''HTML limitation: self.errorDialog(TITLE + _('''HTML limitation:
The %s protocol is not supported yet. The %s protocol is not supported yet.
Please use your standard web browser Please use your standard web browser
@ -495,7 +495,7 @@ to open the following URL:
self.display(self.home, relpath=0) self.display(self.home, relpath=0)
def errorDialog(self, msg): def errorDialog(self, msg):
d = MfxMessageDialog(self.parent, title=PACKAGE+" HTML Problem", d = MfxMessageDialog(self.parent, title=TITLE+" HTML Problem",
text=msg, text=msg,
##bitmap="warning", # FIXME: this interp don't have images ##bitmap="warning", # FIXME: this interp don't have images
strings=(_("&OK"),), default=0) strings=(_("&OK"),), default=0)

View file

@ -62,7 +62,7 @@ from tkFont import Font
# PySol imports # PySol imports
from pysollib.mfxutil import Image, ImageTk, ImageOps from pysollib.mfxutil import Image, ImageTk, ImageOps
from pysollib.settings import PACKAGE, WIN_SYSTEM from pysollib.settings import TITLE, WIN_SYSTEM
# /*********************************************************************** # /***********************************************************************
@ -125,7 +125,7 @@ def makeToplevel(parent, title=None):
# #
# This is a shortcut for a Toplevel() instantiation plus calls to # This is a shortcut for a Toplevel() instantiation plus calls to
# set the title and icon name of the window. # set the title and icon name of the window.
window = Tkinter.Toplevel(parent) #, class_=PACKAGE) window = Tkinter.Toplevel(parent) #, class_=TITLE)
##window.wm_group(parent) ##window.wm_group(parent)
##window.wm_command("") ##window.wm_command("")
if WIN_SYSTEM == "x11": if WIN_SYSTEM == "x11":
@ -139,7 +139,7 @@ def makeToplevel(parent, title=None):
def make_help_toplevel(app, title=None): def make_help_toplevel(app, title=None):
# Create an independent Toplevel window. # Create an independent Toplevel window.
from pysollib.winsystems import init_root_window from pysollib.winsystems import init_root_window
window = Tkinter.Tk(className=PACKAGE) window = Tkinter.Tk(className=TITLE)
init_root_window(window, app) init_root_window(window, app)
return window return window

View file

@ -43,7 +43,7 @@ import Tkinter
from pysollib.mfxutil import destruct from pysollib.mfxutil import destruct
from pysollib.mfxutil import Image, ImageTk from pysollib.mfxutil import Image, ImageTk
from pysollib.util import IMAGE_EXTENSIONS from pysollib.util import IMAGE_EXTENSIONS
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.actions import PysolToolbarActions from pysollib.actions import PysolToolbarActions
from pysollib.winsystems import TkSettings from pysollib.winsystems import TkSettings
@ -200,7 +200,7 @@ class PysolToolbar(PysolToolbarActions):
(n_("Statistics"), self.mPlayerStats, _("View statistics")), (n_("Statistics"), self.mPlayerStats, _("View statistics")),
(n_("Rules"), self.mHelpRules, _("Rules for this game")), (n_("Rules"), self.mHelpRules, _("Rules for this game")),
(None, None, None), (None, None, None),
(n_("Quit"), self.mQuit, _("Quit ")+PACKAGE), (n_("Quit"), self.mQuit, _("Quit ")+TITLE),
): ):
if l is None: if l is None:
sep = self._createSeparator() sep = self._createSeparator()

View file

@ -21,8 +21,8 @@
import sys, os, traceback import sys, os, traceback
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.settings import FC_VERSION as VERSION from pysollib.settings import VERSION
from pysollib.settings import TOOLKIT, USE_TILE from pysollib.settings import TOOLKIT, USE_TILE
from pysollib.settings import DEBUG from pysollib.settings import DEBUG
from pysollib.mfxutil import print_err from pysollib.mfxutil import print_err
@ -87,8 +87,8 @@ def get_font_name(font):
def base_init_root_window(root, app): def base_init_root_window(root, app):
#root.wm_group(root) #root.wm_group(root)
root.wm_title(PACKAGE + ' ' + VERSION) root.wm_title(TITLE + ' ' + VERSION)
root.wm_iconname(PACKAGE + ' ' + VERSION) root.wm_iconname(TITLE + ' ' + VERSION)
# set minsize # set minsize
sw, sh, sd = (root.winfo_screenwidth(), sw, sh, sd = (root.winfo_screenwidth(),
root.winfo_screenheight(), root.winfo_screenheight(),

View file

@ -24,7 +24,7 @@ import sys, os, traceback
import Tkinter import Tkinter
import tkFont import tkFont
from pysollib.settings import PACKAGE from pysollib.settings import TITLE
from pysollib.settings import TOOLKIT, USE_TILE from pysollib.settings import TOOLKIT, USE_TILE
from pysollib.tile import Tile from pysollib.tile import Tile
@ -106,7 +106,7 @@ def init_root_window(root, app):
root.option_add('*selectBorderWidth', 0, 60) root.option_add('*selectBorderWidth', 0, 60)
font = root.option_get('font', PACKAGE) font = root.option_get('font', TITLE)
if font: if font:
# use font from xrdb # use font from xrdb
fn = get_font_name(font) fn = get_font_name(font)
@ -150,7 +150,7 @@ def init_root_window(root, app):
root.option_add('*Menu.activeBorderWidth', 1, 60) root.option_add('*Menu.activeBorderWidth', 1, 60)
#root.option_add('*Button.HighlightBackground', '#595d59') #root.option_add('*Button.HighlightBackground', '#595d59')
#root.option_add('*Button.HighlightThickness', '1') #root.option_add('*Button.HighlightThickness', '1')
font = root.option_get('font', PACKAGE) font = root.option_get('font', TITLE)
if font: if font:
fn = get_font_name(font) fn = get_font_name(font)
app.opt.fonts['default'] = fn app.opt.fonts['default'] = fn

View file

@ -3,7 +3,7 @@
import os import os
from distutils.core import setup from distutils.core import setup
from pysollib.settings import FC_VERSION as VERSION from pysollib.settings import VERSION
from pysollib.settings import PACKAGE_URL from pysollib.settings import PACKAGE_URL
if os.name == 'nt': if os.name == 'nt':
import py2exe import py2exe