mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Remember the solver's max iterations setting.
See https://github.com/shlomif/PySolFC/issues/38 .
This commit is contained in:
parent
0da917250c
commit
5c85816641
2 changed files with 8 additions and 1 deletions
|
@ -112,6 +112,7 @@ visible_buttons = string_list
|
|||
translate_game_names = boolean
|
||||
solver_presets = string_list
|
||||
solver_show_progress = boolean
|
||||
solver_max_iterations = integer
|
||||
|
||||
[sound_samples]
|
||||
move = boolean
|
||||
|
@ -246,6 +247,7 @@ class Options:
|
|||
('translate_game_names', 'bool'),
|
||||
('solver_presets', 'list'),
|
||||
('solver_show_progress', 'bool'),
|
||||
('solver_max_iterations', 'int'),
|
||||
# ('toolbar_vars', 'list'),
|
||||
# ('recent_gameid', 'list'),
|
||||
# ('favorite_gameid', 'list'),
|
||||
|
@ -413,6 +415,7 @@ class Options:
|
|||
'yellow-brick-road',
|
||||
]
|
||||
self.solver_show_progress = True
|
||||
self.solver_max_iterations = 100000
|
||||
|
||||
def setDefaults(self, top=None):
|
||||
WIN_SYSTEM = pysollib.settings.WIN_SYSTEM
|
||||
|
|
|
@ -9,6 +9,9 @@ class BaseSolverDialog:
|
|||
def _ToggleShowProgressButton(self, *args):
|
||||
self.app.opt.solver_show_progress = self.progress_var.get()
|
||||
|
||||
def _OnAssignToMaxIters(self, *args):
|
||||
self.app.opt.solver_max_iterations = self.max_iters_var.get()
|
||||
|
||||
def __init__(self, parent, app, **kw):
|
||||
self.parent = parent
|
||||
self.app = app
|
||||
|
@ -52,12 +55,13 @@ class BaseSolverDialog:
|
|||
#
|
||||
row += 1
|
||||
self.max_iters_var = tkinter.IntVar()
|
||||
self.max_iters_var.set(10e4)
|
||||
self.max_iters_var.set(self.app.opt.solver_max_iterations)
|
||||
self._calcToolkit().Label(
|
||||
frame, text=_('Max iterations:'), anchor='w').grid(
|
||||
row=row, column=0, sticky='ew', padx=2, pady=2)
|
||||
spin = tkinter.Spinbox(frame, bg='white', from_=1000, to=10e6,
|
||||
increment=1000, textvariable=self.max_iters_var)
|
||||
self.max_iters_var.trace('w', self._OnAssignToMaxIters)
|
||||
spin.grid(row=row, column=1, sticky='w', padx=2, pady=2)
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue