mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
consolidate diffs
This commit is contained in:
parent
3c93a19508
commit
70e1159947
2 changed files with 8 additions and 9 deletions
|
@ -21,7 +21,6 @@
|
|||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
import os
|
||||
|
||||
from pysollib.gamedb import GI
|
||||
|
@ -80,7 +79,8 @@ class SelectGameData(SelectDialogTreeData):
|
|||
def __init__(self, app):
|
||||
SelectDialogTreeData.__init__(self)
|
||||
self.all_games_gi = list(map(
|
||||
app.gdb.get, app.gdb.getGamesIdSortedByName()))
|
||||
app.gdb.get,
|
||||
app.gdb.getGamesIdSortedByName()))
|
||||
self.no_games = [SelectGameLeaf(None, None, _("(no games)"), None), ]
|
||||
#
|
||||
s_by_type = s_oriental = s_special = s_original = s_contrib = \
|
||||
|
@ -321,7 +321,7 @@ class SelectGameDialog(MfxDialog):
|
|||
if button == 0: # Ok or double click
|
||||
self.gameid = self.tree.selection_key
|
||||
self.tree.n_expansions = 1 # save xyview in any case
|
||||
if button == 10: # Rules
|
||||
if button == 1: # Rules
|
||||
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
||||
if not doc:
|
||||
return
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
import os
|
||||
|
||||
from pysollib.gamedb import GI
|
||||
from pysollib.help import help_html
|
||||
from pysollib.mfxutil import KwStruct, Struct, destruct
|
||||
from pysollib.mfxutil import format_time
|
||||
from pysollib.mygettext import _
|
||||
|
@ -39,11 +38,11 @@ from .selecttree import SelectDialogTreeCanvas
|
|||
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
||||
from .tkwidget import MfxDialog, MfxScrolledCanvas
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Nodes
|
||||
# ************************************************************************
|
||||
|
||||
|
||||
class SelectGameLeaf(SelectDialogTreeLeaf):
|
||||
pass
|
||||
|
||||
|
@ -137,7 +136,6 @@ class SelectGameData(SelectDialogTreeData):
|
|||
if 1 and gg:
|
||||
s_by_compatibility = SelectGameNode(None, _("by Compatibility"),
|
||||
tuple(gg))
|
||||
pass
|
||||
#
|
||||
s_by_pysol_version, gg = None, []
|
||||
for name, games in GI.GAMES_BY_PYSOL_VERSION:
|
||||
|
@ -308,8 +306,8 @@ class SelectGameDialog(MfxDialog):
|
|||
def initKw(self, kw):
|
||||
kw = KwStruct(kw,
|
||||
strings=(None, None, _("&Cancel"),), default=0,
|
||||
separator=True,
|
||||
resizable=True,
|
||||
separator=True,
|
||||
padx=10, pady=10,
|
||||
buttonpadx=10, buttonpady=5,
|
||||
)
|
||||
|
@ -322,14 +320,15 @@ class SelectGameDialog(MfxDialog):
|
|||
MfxDialog.destroy(self)
|
||||
|
||||
def mDone(self, button):
|
||||
if button == 0: # Ok or double click
|
||||
if button == 0: # Ok or double click
|
||||
self.gameid = self.tree.selection_key
|
||||
self.tree.n_expansions = 1 # save xyview in any case
|
||||
if button == 1: # Rules
|
||||
if button == 1: # Rules
|
||||
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
||||
if not doc:
|
||||
return
|
||||
dir = os.path.join("html", "rules")
|
||||
from pysollib.help import help_html
|
||||
help_html(self.app, doc, dir, self.top)
|
||||
return
|
||||
MfxDialog.mDone(self, button)
|
||||
|
|
Loading…
Add table
Reference in a new issue