diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-25 11:13:05 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-25 11:13:05 +0100 |
| commit | 4ffba108e367926f1c254bb1e2f07b6dbace4f32 (patch) | |
| tree | dbd0cb1795622da335035895c1a03c30ed037eeb /src/base_tab | |
| parent | 1293b59ed55423671dc204d3cb09822c9c599e55 (diff) | |
Update the db import game feature
Diffstat (limited to 'src/base_tab')
| -rw-r--r-- | src/base_tab/AppendGameDialog.cpp | 2 | ||||
| -rw-r--r-- | src/base_tab/BaseImportTab.cpp | 9 | ||||
| -rw-r--r-- | src/base_tab/BaseImportTab.hpp | 2 |
3 files changed, 8 insertions, 5 deletions
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<GameBase> 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<wxWindow *>(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<wxWindow *>(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 { |
