Improve database game import

This commit is contained in:
Loic Guegan 2022-02-26 12:30:07 +01:00
parent 3b6e7d39cf
commit e0a1894928
15 changed files with 547 additions and 155 deletions

View file

@ -56,6 +56,10 @@ MainWindow::MainWindow()
Bind(REFRESH_TAB_TITLE, &MainWindow::OnRefreshTabTitle, this, wxID_ANY);
Bind(NEW_GAME_EVENT, &MainWindow::OnNewGame, this, wxID_ANY);
Bind(wxEVT_CLOSE_WINDOW, &MainWindow::OnClose, this);
/*BaseTab *bt = new BaseTab((wxFrame *)notebook, "/home/loic/hartwig.pgn");
notebook->AddPage(bt, bt->GetLabel());
notebook->SetSelection(notebook->GetPageIndex(bt));*/
}
void MainWindow::OnSettings(wxCommandEvent &event) {
@ -77,6 +81,14 @@ void MainWindow::ApplyPreferences() {
void MainWindow::OnExit(wxCommandEvent &event) { Close(true); }
std::vector<TabInfos *> MainWindow::ListTabInfos() {
std::vector<TabInfos *> tinfos;
for (int i = 0; i < notebook->GetPageCount(); i++) {
tinfos.push_back(dynamic_cast<TabInfos *>(notebook->GetPage(i)));
}
return (tinfos);
}
void MainWindow::OnClose(wxCloseEvent &e) {
if (prefsEditor != NULL) {
prefsEditor->Dismiss();