From cb6fbd18f374773a6cd6ea1db42f6d6ff6147a1e Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 27 Dec 2022 19:41:33 +0100 Subject: Improve database tab --- src/base_tab/BaseTab.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/base_tab/BaseTab.cpp') diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp index 5db4f53..8434840 100644 --- a/src/base_tab/BaseTab.cpp +++ b/src/base_tab/BaseTab.cpp @@ -1,6 +1,8 @@ #include "BaseTab.hpp" #include +wxDEFINE_EVENT(REFRESH_MANAGE_TAB, wxCommandEvent); + BaseTab::BaseTab(wxFrame *parent, std::string base_file) : TabBase(parent), TabInfos(TabInfos::BASE), base_file(base_file){ @@ -14,7 +16,7 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file) import_tab=new BaseImportTab((wxFrame *)notebook,base,this); notebook->AddPage(import_tab, "Import games"); // Manage tab - manage_tab=new BaseManageTab((wxFrame *)notebook, base, games_tab->glm); + manage_tab=new BaseManageTab((wxFrame *)notebook, base, games_tab->glm,import_tab,games_tab); notebook->AddPage(manage_tab, "Manage database"); // Refresh dynamic elements of the database (tab title, available db for import etc.) @@ -23,6 +25,9 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file) // Bindings this->Bind(wxEVT_BUTTON, &BaseTab::OnSave, this, ID_SAVE_BUTTON); this->Bind(wxEVT_LIST_ITEM_ACTIVATED, &BaseTab::OnOpenGame, this, ID_TABGAMES_GAME_LIST); + Bind(REFRESH_MANAGE_TAB,[tab=manage_tab](wxCommandEvent &e){ + tab->RefreshInformations(); + },wxID_ANY); } void BaseTab::OnOpenGame(wxListEvent &event){ -- cgit v1.2.3