From 518edf6f3050022fa4d1a15d147efe6665459863 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 9 Jan 2023 14:43:54 +0100 Subject: Bind settings of the Editor (still ongoing) --- src/preferences/EditorPrefs.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/preferences') diff --git a/src/preferences/EditorPrefs.hpp b/src/preferences/EditorPrefs.hpp index 9a8ca0d..4287410 100644 --- a/src/preferences/EditorPrefs.hpp +++ b/src/preferences/EditorPrefs.hpp @@ -17,15 +17,25 @@ public: } virtual bool TransferDataToWindow() { + CONFIG_OPEN(config); + row_size->SetValue(config->Read("editor/row_size", 50)); + col_size->SetValue(config->Read("editor/col_size", 100)); + show_move_icons->SetValue(config->Read("editor/show_move_icons", true)); + CONFIG_CLOSE(config); return true; } void ApplyPreferences() { - + CONFIG_OPEN(config); + config->Write("editor/row_size", row_size->GetValue()); + config->Write("editor/col_size", col_size->GetValue()); + config->Write("editor/show_move_icons", show_move_icons->GetValue()); + CONFIG_CLOSE(config); } virtual bool TransferDataFromWindow() { - + ApplyPreferences(); + MAINWIN->ApplyPreferences(); return (true); } }; -- cgit v1.2.3