From 4ffba108e367926f1c254bb1e2f07b6dbace4f32 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 25 Dec 2022 11:13:05 +0100 Subject: Update the db import game feature --- src/base_tab/AppendGameDialog.cpp | 2 +- src/base_tab/BaseImportTab.cpp | 9 +++++++-- src/base_tab/BaseImportTab.hpp | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/base_tab') diff --git a/src/base_tab/AppendGameDialog.cpp b/src/base_tab/AppendGameDialog.cpp index 52a6f3d..260ba90 100644 --- a/src/base_tab/AppendGameDialog.cpp +++ b/src/base_tab/AppendGameDialog.cpp @@ -5,7 +5,7 @@ AppendGameDialog::AppendGameDialog(wxWindow *parent, std::shared_ptr base) : DialogAppendGame(parent), base(base) { - for (TabInfos *i : MAINWIN->ListTabInfos()) { + for (TabInfos *i : wxGetApp().ListTabInfos()) { if (i->type == TabInfos::GAME || i->type == TabInfos::BASE) { wxWindow *win = dynamic_cast(i); game_list->Append(win->GetLabel()); diff --git a/src/base_tab/BaseImportTab.cpp b/src/base_tab/BaseImportTab.cpp index 6c3ef5d..cd0d980 100644 --- a/src/base_tab/BaseImportTab.cpp +++ b/src/base_tab/BaseImportTab.cpp @@ -1,8 +1,13 @@ #include "BaseImportTab.hpp" - BaseImportTab::BaseImportTab(wxFrame *parent): TabBase_TabImport(parent) { - + for (TabInfos *i : wxGetApp().ListTabInfos()) { + if (i->type == TabInfos::GAME || i->type == TabInfos::BASE) { + wxWindow *win = dynamic_cast(i); + opened_game_list->Append(win->GetLabel(),i); + opened_game_list->SetSelection(0); + } + } } diff --git a/src/base_tab/BaseImportTab.hpp b/src/base_tab/BaseImportTab.hpp index e39f921..3d15e51 100644 --- a/src/base_tab/BaseImportTab.hpp +++ b/src/base_tab/BaseImportTab.hpp @@ -1,7 +1,5 @@ #include "ochess.hpp" - - class BaseImportTab : public TabBase_TabImport { -- cgit v1.2.3