aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/AppendGameDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_tab/AppendGameDialog.cpp')
-rw-r--r--src/base_tab/AppendGameDialog.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/base_tab/AppendGameDialog.cpp b/src/base_tab/AppendGameDialog.cpp
deleted file mode 100644
index 260ba90..0000000
--- a/src/base_tab/AppendGameDialog.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "AppendGameDialog.hpp"
-#include "MainWindow.hpp"
-#include "ochess.hpp"
-
-AppendGameDialog::AppendGameDialog(wxWindow *parent, std::shared_ptr<GameBase> base)
- : DialogAppendGame(parent), base(base) {
-
- 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());
- tinfos.push_back(i);
- }
- }
-
- Bind(wxEVT_BUTTON, &AppendGameDialog::OnCancel, this,
- ID_DIALOG_CANCEL_BUTTON);
- Bind(wxEVT_BUTTON, &AppendGameDialog::OnImport, this,
- ID_DIALOG_IMPORT_BUTTON);
- Bind(wxEVT_CLOSE_WINDOW, &AppendGameDialog::OnClose, this);
-}
-
-void AppendGameDialog::OnClose(wxCloseEvent &e) { Destroy(); }
-
-void AppendGameDialog::OnCancel(wxCommandEvent &event) { this->Close(); }
-
-void AppendGameDialog::OnImport(wxCommandEvent &event) {
- std::vector<std::uint32_t> to_ignore;
- std::vector<std::shared_ptr<GameBase>> new_games_bases;
- std::vector<std::shared_ptr<Game>> new_games;
-
- wxArrayInt selections;
- game_list->GetSelections(selections);
-
- for (int &i : selections) {
- TabInfos *tinfo = tinfos[i];
- if (tinfo->type == TabInfos::BASE) {
- new_games_bases.push_back(tinfo->GetBase());
- } else if (tinfo->type == TabInfos::GAME) {
- new_games.push_back(tinfo->GetGame());
- }
- }
-
- base->Save(to_ignore, new_games_bases, new_games);
-
- this->Close();
-} \ No newline at end of file