Debug MainWindow and add comments

This commit is contained in:
Loic Guegan 2023-01-13 10:42:57 +01:00
parent 7009469e96
commit f754a93f9f
7 changed files with 29 additions and 12 deletions
src/engine_tab

View file

@ -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();
}