mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-30 00:47:46 +00:00
Debug MainWindow and add comments
This commit is contained in:
parent
7009469e96
commit
f754a93f9f
7 changed files with 29 additions and 12 deletions
src/engine_tab
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue