diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-13 10:42:57 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-13 10:42:57 +0100 |
| commit | f754a93f9f13fa7f30386caba397b91e127aab2c (patch) | |
| tree | 9b3cd0a464d40657a9ed252f7065403669c8b9de /src/engine_tab | |
| parent | 7009469e96505ab7c2445e7dea43d6c6d2fcbd08 (diff) | |
Debug MainWindow and add comments
Diffstat (limited to 'src/engine_tab')
| -rw-r--r-- | src/engine_tab/EngineTab.cpp | 8 | ||||
| -rw-r--r-- | src/engine_tab/EngineTab.hpp | 1 |
2 files changed, 9 insertions, 0 deletions
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(); } diff --git a/src/engine_tab/EngineTab.hpp b/src/engine_tab/EngineTab.hpp index 0daa404..711c3c7 100644 --- a/src/engine_tab/EngineTab.hpp +++ b/src/engine_tab/EngineTab.hpp @@ -4,6 +4,7 @@ // Foreign event wxDECLARE_EVENT(CLOSE_TAB_EVENT, wxCommandEvent); wxDECLARE_EVENT(REFRESH_ENGINE_LIST, wxCommandEvent); +wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent); class EngineTab : public TabEngine, public TabInfos { uciadapter::UCI *engine; |
