From f754a93f9f13fa7f30386caba397b91e127aab2c Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 13 Jan 2023 10:42:57 +0100 Subject: Debug MainWindow and add comments --- src/engine_tab/EngineTab.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/engine_tab/EngineTab.cpp') diff --git a/src/engine_tab/EngineTab.cpp b/src/engine_tab/EngineTab.cpp index 91886ee..1f82218 100644 --- a/src/engine_tab/EngineTab.cpp +++ b/src/engine_tab/EngineTab.cpp @@ -27,6 +27,7 @@ EngineTab::EngineTab(wxWindow *parent, uciadapter::UCI *engine, Bind(wxEVT_BUTTON, &EngineTab::OnSave, this, ENGINE_SAVE_CONF_BUTTON); Bind(wxEVT_BUTTON, &EngineTab::OnDelete, this, ENGINE_DELETE_CONF_BUTTON); + Bind(wxEVT_PG_CHANGED, [p=this](wxPropertyGridEvent& event){p->is_dirty=true;}); } EngineTab::EngineTab(wxWindow *parent, std::string name) @@ -107,6 +108,12 @@ void EngineTab::OnSave(wxCommandEvent &event) { engineName = new_engine_name; confGroup = "engines/" + engineName; conf2->SetPath(".."); + SetLabel(new_engine_name); + // First refresh tab title + wxCommandEvent refreshTitle(REFRESH_TAB_TITLE, GetId()); + refreshTitle.SetEventObject(this); + wxLogDebug("New engine name is %s",this->GetLabel()); + ProcessEvent(refreshTitle); } long index; std::string optsPath = confGroup + "/options"; @@ -128,6 +135,7 @@ void EngineTab::OnSave(wxCommandEvent &event) { } while (conf2->GetNextGroup(opt_name, index)); } CONFIG_CLOSE(conf2); + // Notify all other tabs about this new configuration RefreshItemList(); } -- cgit v1.2.3