mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
* new config file option: solver_presets
git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@269 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
parent
4f66f1bff4
commit
31fa595081
3 changed files with 28 additions and 24 deletions
|
@ -105,6 +105,7 @@ recent_gameid = int_list
|
|||
favorite_gameid = int_list
|
||||
visible_buttons = string_list
|
||||
translate_game_names = boolean
|
||||
solver_presets = string_list
|
||||
|
||||
[sound_samples]
|
||||
move = boolean
|
||||
|
@ -237,6 +238,7 @@ class Options:
|
|||
('sound_sample_buffer_size', 'int'),
|
||||
('tabletile_name', 'str'),
|
||||
('translate_game_names', 'bool'),
|
||||
('solver_presets', 'list'),
|
||||
#('toolbar_vars', 'list'),
|
||||
#('recent_gameid', 'list'),
|
||||
#('favorite_gameid', 'list'),
|
||||
|
@ -382,6 +384,22 @@ class Options:
|
|||
self.scale_y = 1.0
|
||||
self.auto_scale = False
|
||||
self.preserve_aspect_ratio = True
|
||||
# solver
|
||||
self.solver_presets = [
|
||||
'none',
|
||||
'abra-kadabra',
|
||||
'cool-jives',
|
||||
'crooked-nose',
|
||||
'fools-gold',
|
||||
'good-intentions',
|
||||
'hello-world',
|
||||
'john-galt-line',
|
||||
'rin-tin-tin',
|
||||
'yellow-brick-road',
|
||||
'the-last-mohican',
|
||||
'blue-yonder',
|
||||
'slick-rock',
|
||||
]
|
||||
|
||||
def setDefaults(self, top=None):
|
||||
WIN_SYSTEM = settings.WIN_SYSTEM
|
||||
|
@ -467,6 +485,7 @@ class Options:
|
|||
visible_buttons = [b for b in self.toolbar_vars
|
||||
if self.toolbar_vars[b]]
|
||||
config['general']['visible_buttons'] = visible_buttons
|
||||
config['general']['solver_presets'].remove('none')
|
||||
|
||||
# sound_samples
|
||||
config['sound_samples'] = self.sound_samples
|
||||
|
@ -603,6 +622,13 @@ class Options:
|
|||
for key in TOOLBAR_BUTTONS:
|
||||
self.toolbar_vars[key] = (key in visible_buttons)
|
||||
|
||||
# solver
|
||||
solver_presets = self._getOption('general', 'solver_presets', 'list')
|
||||
if solver_presets is not None:
|
||||
if 'none' not in solver_presets:
|
||||
solver_presets.insert(0, 'none')
|
||||
self.solver_presets = solver_presets
|
||||
|
||||
# sound_samples
|
||||
for key in self.sound_samples:
|
||||
val = self._getOption('sound_samples', key, 'bool')
|
||||
|
|
|
@ -111,18 +111,7 @@ class SolverDialog(MfxDialog):
|
|||
row += 1
|
||||
ttk.Label(frame, text=_('Preset:'), anchor='w'
|
||||
).grid(row=row, column=0, sticky='ew', padx=2, pady=2)
|
||||
presets = [
|
||||
'none',
|
||||
'abra-kadabra',
|
||||
'cool-jives',
|
||||
'crooked-nose',
|
||||
'fools-gold',
|
||||
'good-intentions',
|
||||
'hello-world',
|
||||
'john-galt-line',
|
||||
'rin-tin-tin',
|
||||
'yellow-brick-road',
|
||||
]
|
||||
presets = app.opt.solver_presets
|
||||
self.presets = presets
|
||||
cb = PysolCombo(frame, values=tuple(presets), state='readonly')
|
||||
cb.grid(row=row, column=1, sticky='ew', padx=2, pady=2)
|
||||
|
|
|
@ -114,18 +114,7 @@ class SolverDialog(MfxDialog):
|
|||
row += 1
|
||||
Tkinter.Label(frame, text=_('Preset:'), anchor='w'
|
||||
).grid(row=row, column=0, sticky='ew', padx=2, pady=2)
|
||||
presets = [
|
||||
'none',
|
||||
'abra-kadabra',
|
||||
'cool-jives',
|
||||
'crooked-nose',
|
||||
'fools-gold',
|
||||
'good-intentions',
|
||||
'hello-world',
|
||||
'john-galt-line',
|
||||
'rin-tin-tin',
|
||||
'yellow-brick-road',
|
||||
]
|
||||
presets = app.opt.solver_presets
|
||||
self.presets = presets
|
||||
self.preset_var = var = Tkinter.StringVar()
|
||||
var.set('none')
|
||||
|
|
Loading…
Add table
Reference in a new issue