aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/AppendGameDialog.cpp
blob: 8a76028ceb22270c30c5b7764eb4a699ef496719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "AppendGameDialog.hpp"
#include "MainWindow.hpp"
#include "ochess.hpp"

AppendGameDialog::AppendGameDialog(wxWindow *parent, GameBase *base)
    : AppendGameDialogBF(parent), base(base) {

  tinfos = MAINWIN->ListTabInfos();
  for (TabInfos *i : tinfos) {
    wxWindow *win = dynamic_cast<wxWindow *>(i);
    game_list->Append(win->GetLabel());
  }

  Bind(wxEVT_BUTTON, &AppendGameDialog::OnCancel, this,
       ID_DIALOG_CANCEL_BUTTON);
  Bind(wxEVT_BUTTON, &AppendGameDialog::OnImport, this,
       ID_DIALOG_IMPORT_BUTTON);
}

void AppendGameDialog::OnCancel(wxCommandEvent &event) { this->Close(); }

void AppendGameDialog::OnImport(wxCommandEvent &event) {
  std::vector<std::uint32_t> to_ignore;
  std::vector<GameBase *> new_games_bases;
  std::vector<Game *> new_games;

  this->Close();
}