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

Enhancements to other graphics menu.

This commit is contained in:
Joe R 2023-11-24 12:24:32 -05:00
parent c3ffbff146
commit 78ca717778
27 changed files with 284 additions and 51 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

View file

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

View file

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

View file

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

View file

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 161 B

View file

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 103 B

View file

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

View file

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 139 B

View file

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

View file

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:08-0500\n" "PO-Revision-Date: 2023-11-24 12:21-0500\n"
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n" "Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"Language: de\n" "Language: de\n"
@ -2934,6 +2934,18 @@ msgstr "Links"
msgid "Right" msgid "Right"
msgstr "Rechts" msgstr "Rechts"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
msgid "Startup splash screen" msgid "Startup splash screen"
msgstr "Progammstart Anzeige" msgstr "Progammstart Anzeige"
@ -5379,13 +5391,13 @@ msgstr "&Demo logo"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1.02\n" "Project-Id-Version: 1.02\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:08-0500\n" "PO-Revision-Date: 2023-11-24 12:21-0500\n"
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n" "Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr\n" "Language: fr\n"
@ -2974,6 +2974,18 @@ msgstr "Gauche"
msgid "Right" msgid "Right"
msgstr "Droite" msgstr "Droite"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
msgid "Startup splash screen" msgid "Startup splash screen"
msgstr "Écran de démarrage" msgstr "Écran de démarrage"
@ -5424,13 +5436,13 @@ msgstr "Logo de &démo"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: it_pysol\n" "Project-Id-Version: it_pysol\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:09-0500\n" "PO-Revision-Date: 2023-11-24 12:21-0500\n"
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n" "Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
"Language-Team: Italiano <it@li.org>\n" "Language-Team: Italiano <it@li.org>\n"
"Language: it\n" "Language: it\n"
@ -3033,6 +3033,18 @@ msgstr "Sinistra"
msgid "Right" msgid "Right"
msgstr "Destra" msgstr "Destra"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
#, fuzzy #, fuzzy
msgid "Startup splash screen" msgid "Startup splash screen"
@ -5488,13 +5500,13 @@ msgstr "&Demo logo"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PySolFC\n" "Project-Id-Version: PySolFC\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:09-0500\n" "PO-Revision-Date: 2023-11-24 12:21-0500\n"
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n" "Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
"Language-Team: Polish <pl@li.org>\n" "Language-Team: Polish <pl@li.org>\n"
"Language: pl\n" "Language: pl\n"
@ -2987,6 +2987,18 @@ msgstr "Lewa strona"
msgid "Right" msgid "Right"
msgstr "Prawa strona" msgstr "Prawa strona"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
msgid "Startup splash screen" msgid "Startup splash screen"
msgstr "Ek&ran powitalny" msgstr "Ek&ran powitalny"
@ -5440,13 +5452,13 @@ msgstr "&Demo logo"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:09-0500\n" "PO-Revision-Date: 2023-11-24 12:20-0500\n"
"Last-Translator: Matheus Knack <mtknack555@gmail.com>\n" "Last-Translator: Matheus Knack <mtknack555@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: pt_BR\n" "Language: pt_BR\n"
@ -2995,6 +2995,18 @@ msgstr "Esquerda"
msgid "Right" msgid "Right"
msgstr "Direita" msgstr "Direita"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
msgid "Startup splash screen" msgid "Startup splash screen"
msgstr "Iniciar tela de inicialização" msgstr "Iniciar tela de inicialização"
@ -5446,13 +5458,13 @@ msgstr "&Logo da demo"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -2805,6 +2805,18 @@ msgstr ""
msgid "Right" msgid "Right"
msgstr "" msgstr ""
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
msgid "Startup splash screen" msgid "Startup splash screen"
msgstr "" msgstr ""
@ -5173,13 +5185,13 @@ msgstr ""
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-20 20:10-0500\n" "PO-Revision-Date: 2023-11-24 12:20-0500\n"
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n" "Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"Language: ru\n" "Language: ru\n"
@ -3044,6 +3044,18 @@ msgstr "Слева"
msgid "Right" msgid "Right"
msgstr "Справа" msgstr "Справа"
msgid "Other graphics"
msgstr ""
msgid "Demo logo"
msgstr ""
msgid "Pause text"
msgstr ""
msgid "Redeal icons"
msgstr ""
#: pysollib/kivy/menubar.py:1062 #: pysollib/kivy/menubar.py:1062
#, fuzzy #, fuzzy
msgid "Startup splash screen" msgid "Startup splash screen"
@ -5514,13 +5526,13 @@ msgstr "Д&емо лого"
msgid "D&ialog icons" msgid "D&ialog icons"
msgstr "" msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text" msgid "&Pause text"
msgstr "" msgstr ""
msgid "&Redeal iconso" msgid "&Redeal icons"
msgstr ""
msgid "&Tree icons"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:640 #: pysollib/ui/tktile/menubar.py:640

View file

@ -564,7 +564,7 @@ class Application:
def loadImages3(self): def loadImages3(self):
# load treeview images # load treeview images
SelectDialogTreeData.img = [] SelectDialogTreeData.img = []
dirname = os.path.join('images', 'tree') dirname = os.path.join('images', 'tree', self.opt.tree_icon_style)
for f in ('folder', 'openfolder', 'node', 'emptynode'): for f in ('folder', 'openfolder', 'node', 'emptynode'):
fn = self.dataloader.findImage(f, dirname) fn = self.dataloader.findImage(f, dirname)
im = loadImage(fn) im = loadImage(fn)

View file

@ -1136,7 +1136,7 @@ class OptionsMenuDialog(LMenuDialog):
for w in TOOLBAR_BUTTONS: for w in TOOLBAR_BUTTONS:
w0 = w[0].upper() w0 = w[0].upper()
ww = w[1:] ww = w[1:]
self.addCheckNode(tv, rg, self.addCheckNode(tv, rg1,
_(w0+ww), # noqa _(w0+ww), # noqa
self.menubar.tkopt.toolbar_vars[w], self.menubar.tkopt.toolbar_vars[w],
self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa
@ -1159,6 +1159,55 @@ class OptionsMenuDialog(LMenuDialog):
variable=self.tkopt.helpbar, variable=self.tkopt.helpbar,
command=self.mOptHelpbar) command=self.mOptHelpbar)
''' '''
# -------------------------------------------
# Other graphics settings
rg = tv.add_node(
LTreeNode(text=_('Other graphics')))
data_dir = os.path.join(self.app.dataloader.dir, 'images', 'demo')
dl = tv.add_node(
LTreeNode(text=_('Demo logo')), rg)
styledirs = os.listdir(data_dir)
styledirs.append("none")
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if (os.path.isdir(d) and os.path.exists(os.path.join(d))) \
or f == "none":
name = f.replace('_', ' ').capitalize()
self.addRadioNode(tv, dl,
_(name),
self.menubar.tkopt.demo_logo_style, f,
self.menubar.mOptDemoLogoStyle)
data_dir = os.path.join(self.app.dataloader.dir, 'images', 'pause')
dl = tv.add_node(
LTreeNode(text=_('Pause text')), rg)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
self.addRadioNode(tv, dl,
_(name),
self.menubar.tkopt.pause_text_style, f,
self.menubar.mOptPauseTextStyle)
data_dir = os.path.join(self.app.dataloader.dir, 'images',
'redealicons')
dl = tv.add_node(
LTreeNode(text=_('Redeal icons')), rg)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
self.addRadioNode(tv, dl,
_(name),
self.menubar.tkopt.redeal_icon_style, f,
self.menubar.mOptRedealIconStyle)
# ------------------------------------------- # -------------------------------------------
# general options # general options
@ -1375,6 +1424,9 @@ class PysolMenubarTk:
save_games_geometry=BooleanVar(), save_games_geometry=BooleanVar(),
splashscreen=BooleanVar(), splashscreen=BooleanVar(),
demo_logo=BooleanVar(), demo_logo=BooleanVar(),
demo_logo_style=StringVar(),
pause_text_style=StringVar(),
redeal_icon_style=StringVar(),
mouse_type=StringVar(), mouse_type=StringVar(),
mouse_undo=BooleanVar(), mouse_undo=BooleanVar(),
negative_bottom=BooleanVar(), negative_bottom=BooleanVar(),
@ -1437,6 +1489,9 @@ class PysolMenubarTk:
tkopt.statusbar.set(opt.statusbar) tkopt.statusbar.set(opt.statusbar)
tkopt.save_games_geometry.set(opt.save_games_geometry) tkopt.save_games_geometry.set(opt.save_games_geometry)
tkopt.demo_logo.set(opt.demo_logo) tkopt.demo_logo.set(opt.demo_logo)
tkopt.demo_logo_style.set(opt.demo_logo_style)
tkopt.pause_text_style.set(opt.pause_text_style)
tkopt.redeal_icon_style.set(opt.redeal_icon_style)
tkopt.splashscreen.set(opt.splashscreen) tkopt.splashscreen.set(opt.splashscreen)
tkopt.mouse_type.set(opt.mouse_type) tkopt.mouse_type.set(opt.mouse_type)
tkopt.mouse_undo.set(opt.mouse_undo) tkopt.mouse_undo.set(opt.mouse_undo)
@ -2344,6 +2399,15 @@ the next time you restart the %(app)s""") % {'app': TITLE})
def mOptToolbarConfig(self, w): def mOptToolbarConfig(self, w):
self.toolbarConfig(w, self.tkopt.toolbar_vars[w].get()) self.toolbarConfig(w, self.tkopt.toolbar_vars[w].get())
def mOptDemoLogoStyle(self, *event):
self.setDemoLogoStyle(self.tkopt.demo_logo_style.get())
def mOptPauseTextStyle(self, *event):
self.setPauseTextStyle(self.tkopt.pause_text_style.get())
def mOptRedealIconStyle(self, *event):
self.setRedealIconStyle(self.tkopt.redeal_icon_style.get())
def mOptStatusbar(self, *event): def mOptStatusbar(self, *event):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
return return
@ -2463,6 +2527,55 @@ the next time you restart the %(app)s""") % {'app': TITLE})
self.app.opt.toolbar_vars[w] = v self.app.opt.toolbar_vars[w] = v
self.top.update_idletasks() self.top.update_idletasks()
#
# other graphics
#
def setDemoLogoStyle(self, style):
if self._cancelDrag(break_pause=False):
return
if style == "none":
self.app.opt.demo_logo = False
else:
self.app.opt.demo_logo = True
self.app.opt.demo_logo_style = style
self.tkopt.demo_logo_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def setDialogIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.dialog_icon_style = style
self.tkopt.dialog_icon_style.set(style) # update radiobutton
self.app.loadImages1()
self.app.loadImages4()
def setPauseTextStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.pause_text_style = style
self.tkopt.pause_text_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def setRedealIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.redeal_icon_style = style
self.tkopt.redeal_icon_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
# #
# stacks descriptions # stacks descriptions
# #

View file

@ -99,6 +99,7 @@ demo_logo_style = string
pause_text_style = string pause_text_style = string
redeal_icon_style = string redeal_icon_style = string
dialog_icon_style = string dialog_icon_style = string
tree_icon_style = string
tile_theme = string tile_theme = string
default_tile_theme = string default_tile_theme = string
toolbar = integer(0, 4) toolbar = integer(0, 4)
@ -266,6 +267,7 @@ class Options:
('pause_text_style', 'str'), ('pause_text_style', 'str'),
('redeal_icon_style', 'str'), ('redeal_icon_style', 'str'),
('dialog_icon_style', 'str'), ('dialog_icon_style', 'str'),
('tree_icon_style', 'str'),
('tile_theme', 'str'), ('tile_theme', 'str'),
('default_tile_theme', 'str'), ('default_tile_theme', 'str'),
('toolbar', 'int'), ('toolbar', 'int'),
@ -365,10 +367,11 @@ class Options:
self.shrink_face_down = True self.shrink_face_down = True
self.shade_filled_stacks = True self.shade_filled_stacks = True
self.demo_logo = True self.demo_logo = True
self.demo_logo_style = 'classic' self.demo_logo_style = 'komika'
self.pause_text_style = 'classic' self.pause_text_style = 'komika'
self.redeal_icon_style = 'modern' self.redeal_icon_style = 'modern'
self.dialog_icon_style = 'remix' self.dialog_icon_style = 'remix'
self.tree_icon_style = 'remix'
self.tile_theme = 'default' self.tile_theme = 'default'
self.default_tile_theme = 'default' self.default_tile_theme = 'default'
self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, lef, right self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, lef, right

View file

@ -90,15 +90,13 @@ def createOtherGraphicsMenu(menubar, menu):
tearoff = menu.cget('tearoff') tearoff = menu.cget('tearoff')
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'demo') data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'demo')
submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff)
submenu.add_checkbutton(
label=n_("&Show demo logo"), variable=menubar.tkopt.demo_logo,
command=menubar.mOptDemoLogo)
submenu.add_separator()
styledirs = os.listdir(data_dir) styledirs = os.listdir(data_dir)
styledirs.append("none")
styledirs.sort() styledirs.sort()
for f in styledirs: for f in styledirs:
d = os.path.join(data_dir, f) d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)): if (os.path.isdir(d) and os.path.exists(os.path.join(d))) \
or f == "none":
name = f.replace('_', ' ').capitalize() name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton( submenu.add_radiobutton(
label=name, label=name,
@ -141,6 +139,18 @@ def createOtherGraphicsMenu(menubar, menu):
label=name, label=name,
variable=menubar.tkopt.redeal_icon_style, variable=menubar.tkopt.redeal_icon_style,
value=f, command=menubar.mOptRedealIconStyle) value=f, command=menubar.mOptRedealIconStyle)
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'tree')
submenu = MfxMenu(menu, label=n_('&Tree icons'), tearoff=tearoff)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.tree_icon_style,
value=f, command=menubar.mOptTreeIconStyle)
def createResamplingMenu(menubar, menu): def createResamplingMenu(menubar, menu):
@ -321,6 +331,7 @@ class PysolMenubarTkCommon:
pause_text_style=tkinter.StringVar(), pause_text_style=tkinter.StringVar(),
redeal_icon_style=tkinter.StringVar(), redeal_icon_style=tkinter.StringVar(),
dialog_icon_style=tkinter.StringVar(), dialog_icon_style=tkinter.StringVar(),
tree_icon_style=tkinter.StringVar(),
mouse_type=tkinter.StringVar(), mouse_type=tkinter.StringVar(),
mouse_undo=tkinter.BooleanVar(), mouse_undo=tkinter.BooleanVar(),
negative_bottom=tkinter.BooleanVar(), negative_bottom=tkinter.BooleanVar(),
@ -385,10 +396,14 @@ class PysolMenubarTkCommon:
# tkopt.num_cards.set(opt.num_cards) # tkopt.num_cards.set(opt.num_cards)
# tkopt.helpbar.set(opt.helpbar) # tkopt.helpbar.set(opt.helpbar)
tkopt.demo_logo.set(opt.demo_logo) tkopt.demo_logo.set(opt.demo_logo)
tkopt.demo_logo_style.set(opt.demo_logo_style) if opt.demo_logo:
tkopt.demo_logo_style.set(opt.demo_logo_style)
else:
tkopt.demo_logo_style.set("none")
tkopt.pause_text_style.set(opt.pause_text_style) tkopt.pause_text_style.set(opt.pause_text_style)
tkopt.redeal_icon_style.set(opt.redeal_icon_style) tkopt.redeal_icon_style.set(opt.redeal_icon_style)
tkopt.dialog_icon_style.set(opt.dialog_icon_style) tkopt.dialog_icon_style.set(opt.dialog_icon_style)
tkopt.tree_icon_style.set(opt.tree_icon_style)
tkopt.splashscreen.set(opt.splashscreen) tkopt.splashscreen.set(opt.splashscreen)
tkopt.mouse_type.set(opt.mouse_type) tkopt.mouse_type.set(opt.mouse_type)
tkopt.mouse_undo.set(opt.mouse_undo) tkopt.mouse_undo.set(opt.mouse_undo)
@ -1920,6 +1935,9 @@ Unsupported game for import.
def mOptRedealIconStyle(self, *event): def mOptRedealIconStyle(self, *event):
self.setRedealIconStyle(self.tkopt.redeal_icon_style.get()) self.setRedealIconStyle(self.tkopt.redeal_icon_style.get())
def mOptTreeIconStyle(self, *event):
self.setTreeIconStyle(self.tkopt.tree_icon_style.get())
def mOptNumCards(self, *event): def mOptNumCards(self, *event):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
return return
@ -2010,13 +2028,17 @@ Unsupported game for import.
def setDemoLogoStyle(self, style): def setDemoLogoStyle(self, style):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
return return
self.app.opt.demo_logo_style = style if style == "none":
self.tkopt.demo_logo_style.set(style) # update radiobutton self.app.opt.demo_logo = False
self.app.loadImages2() else:
self.app.loadImages4() self.app.opt.demo_logo = True
self.app.updateCardset() self.app.opt.demo_logo_style = style
self.game.endGame(bookmark=1) self.tkopt.demo_logo_style.set(style) # update radiobutton
self.game.quitGame(bookmark=1) self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def setDialogIconStyle(self, style): def setDialogIconStyle(self, style):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
@ -2048,6 +2070,17 @@ Unsupported game for import.
self.game.endGame(bookmark=1) self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1) self.game.quitGame(bookmark=1)
def setTreeIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.tree_icon_style = style
self.tkopt.tree_icon_style.set(style) # update radiobutton
self.app.loadImages3()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def wizardDialog(self, edit=False): def wizardDialog(self, edit=False):
from pysollib.wizardutil import write_game, reset_wizard from pysollib.wizardutil import write_game, reset_wizard
WizardDialog = self._calcWizardDialog() WizardDialog = self._calcWizardDialog()