Skip to content

Commit 956c580

Browse files
committed
reload main config files if they change on the harddisk
1 parent f8f7e11 commit 956c580

File tree

1 file changed

+5
-1
lines changed
  • src/gazeMapper/GUI/_impl

1 file changed

+5
-1
lines changed

src/gazeMapper/GUI/_impl/gui.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ def _config_change_callback(self, change_path: pathlib.Path, change_type: str):
319319
if change_path.suffix != '.json':
320320
# irrelevant
321321
return
322-
# TODO
322+
# reload config
323+
try:
324+
self.study_config = config.Study.load_from_json(config_dir, strict_check=False)
325+
except Exception as exc:
326+
gt_gui.utils.push_popup(self, gt_gui.msg_box.msgbox, "Project reloading error", f"The project's settings were changed, but failed to reload:\n{exc}", gt_gui.msg_box.MsgBox.error, more=gt_gui.utils.get_traceback(type(exc), exc, exc.__traceback__))
323327
elif change_path.parent.parent!=config_dir:
324328
# we're also not dealing with a plane directory, skip
325329
return

0 commit comments

Comments
 (0)