mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-30 17:07:45 +00:00
Update import
This commit is contained in:
parent
11a46aadf7
commit
05ffd7c9e5
5 changed files with 18 additions and 7 deletions
src/base_tab
|
@ -1,13 +1,22 @@
|
|||
#include "BaseImportTab.hpp"
|
||||
|
||||
BaseImportTab::BaseImportTab(wxFrame *parent):
|
||||
TabBase_TabImport(parent)
|
||||
BaseImportTab::BaseImportTab(wxFrame *parent, TabInfos *main_tab):
|
||||
TabBase_TabImport(parent), main_tab(main_tab)
|
||||
{
|
||||
RefreshImportLists();
|
||||
}
|
||||
|
||||
void BaseImportTab::RefreshImportLists(){
|
||||
for (TabInfos *i : wxGetApp().ListTabInfos()) {
|
||||
if (i->type == TabInfos::GAME || i->type == TabInfos::BASE) {
|
||||
if (i->type == TabInfos::GAME) {
|
||||
wxWindow *win = dynamic_cast<wxWindow *>(i);
|
||||
opened_game_list->Append(win->GetLabel(),i);
|
||||
opened_game_list->SetSelection(0);
|
||||
}
|
||||
else if (i->type == TabInfos::BASE && i->id != main_tab->id) {
|
||||
wxWindow *win = dynamic_cast<wxWindow *>(i);
|
||||
opened_db_list->Append(win->GetLabel(),i);
|
||||
opened_db_list->SetSelection(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
class BaseImportTab : public TabBase_TabImport {
|
||||
|
||||
TabInfos *main_tab;
|
||||
|
||||
public:
|
||||
BaseImportTab(wxFrame *parent);
|
||||
BaseImportTab(wxFrame *parent, TabInfos *main_tab);
|
||||
void RefreshImportLists();
|
||||
};
|
|
@ -9,7 +9,7 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file)
|
|||
games_tab=new BaseGameTab((wxFrame *)notebook,base_file,this);
|
||||
notebook->AddPage(games_tab, "Games list",true); // true for selecting the tab
|
||||
// Import tab
|
||||
import_tab=new BaseImportTab((wxFrame *)notebook);
|
||||
import_tab=new BaseImportTab((wxFrame *)notebook,this);
|
||||
notebook->AddPage(import_tab, "Import games");
|
||||
// Manage tab
|
||||
manage_tab=new BaseManageTab((wxFrame *)notebook);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue