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
b3f6232dd7
commit
c524900e69
2 changed files with 8 additions and 9 deletions
|
@ -21,7 +21,6 @@
|
||||||
#
|
#
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from pysollib.gamedb import GI
|
from pysollib.gamedb import GI
|
||||||
|
@ -80,7 +79,8 @@ class SelectGameData(SelectDialogTreeData):
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
SelectDialogTreeData.__init__(self)
|
SelectDialogTreeData.__init__(self)
|
||||||
self.all_games_gi = list(map(
|
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), ]
|
self.no_games = [SelectGameLeaf(None, None, _("(no games)"), None), ]
|
||||||
#
|
#
|
||||||
s_by_type = s_oriental = s_special = s_original = s_contrib = \
|
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
|
if button == 0: # Ok or double click
|
||||||
self.gameid = self.tree.selection_key
|
self.gameid = self.tree.selection_key
|
||||||
self.tree.n_expansions = 1 # save xyview in any case
|
self.tree.n_expansions = 1 # save xyview in any case
|
||||||
if button == 10: # Rules
|
if button == 1: # Rules
|
||||||
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
||||||
if not doc:
|
if not doc:
|
||||||
return
|
return
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from pysollib.gamedb import GI
|
from pysollib.gamedb import GI
|
||||||
from pysollib.help import help_html
|
|
||||||
from pysollib.mfxutil import KwStruct, Struct, destruct
|
from pysollib.mfxutil import KwStruct, Struct, destruct
|
||||||
from pysollib.mfxutil import format_time
|
from pysollib.mfxutil import format_time
|
||||||
from pysollib.mygettext import _
|
from pysollib.mygettext import _
|
||||||
|
@ -39,11 +38,11 @@ from .selecttree import SelectDialogTreeCanvas
|
||||||
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
|
||||||
from .tkwidget import MfxDialog, MfxScrolledCanvas
|
from .tkwidget import MfxDialog, MfxScrolledCanvas
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Nodes
|
# * Nodes
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
|
|
||||||
class SelectGameLeaf(SelectDialogTreeLeaf):
|
class SelectGameLeaf(SelectDialogTreeLeaf):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -137,7 +136,6 @@ class SelectGameData(SelectDialogTreeData):
|
||||||
if 1 and gg:
|
if 1 and gg:
|
||||||
s_by_compatibility = SelectGameNode(None, _("by Compatibility"),
|
s_by_compatibility = SelectGameNode(None, _("by Compatibility"),
|
||||||
tuple(gg))
|
tuple(gg))
|
||||||
pass
|
|
||||||
#
|
#
|
||||||
s_by_pysol_version, gg = None, []
|
s_by_pysol_version, gg = None, []
|
||||||
for name, games in GI.GAMES_BY_PYSOL_VERSION:
|
for name, games in GI.GAMES_BY_PYSOL_VERSION:
|
||||||
|
@ -308,8 +306,8 @@ 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,
|
||||||
separator=True,
|
|
||||||
resizable=True,
|
resizable=True,
|
||||||
|
separator=True,
|
||||||
padx=10, pady=10,
|
padx=10, pady=10,
|
||||||
buttonpadx=10, buttonpady=5,
|
buttonpadx=10, buttonpady=5,
|
||||||
)
|
)
|
||||||
|
@ -322,14 +320,15 @@ class SelectGameDialog(MfxDialog):
|
||||||
MfxDialog.destroy(self)
|
MfxDialog.destroy(self)
|
||||||
|
|
||||||
def mDone(self, button):
|
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.gameid = self.tree.selection_key
|
||||||
self.tree.n_expansions = 1 # save xyview in any case
|
self.tree.n_expansions = 1 # save xyview in any case
|
||||||
if button == 1: # Rules
|
if button == 1: # Rules
|
||||||
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
doc = self.app.getGameRulesFilename(self.tree.selection_key)
|
||||||
if not doc:
|
if not doc:
|
||||||
return
|
return
|
||||||
dir = os.path.join("html", "rules")
|
dir = os.path.join("html", "rules")
|
||||||
|
from pysollib.help import help_html
|
||||||
help_html(self.app, doc, dir, self.top)
|
help_html(self.app, doc, dir, self.top)
|
||||||
return
|
return
|
||||||
MfxDialog.mDone(self, button)
|
MfxDialog.mDone(self, button)
|
||||||
|
|
Loading…
Add table
Reference in a new issue