aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/BaseImportTab.hpp
blob: 5fe2383a80e7a4b155781b54718826e0003ba8d5 (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
29
30
#pragma once

#include "ochess.hpp"
#include "GameListManager.hpp"
#include "game_tab/Game.hpp"
#include <vector>
#include <utility>

class BaseImportTab : public TabBase_TabImport {
  TabInfos *main_tab;
  std::shared_ptr<GameListManager> glm;
  std::vector<std::shared_ptr<Game>> games_to_import;
  std::vector<std::string> databases_to_import;
  /// @brief Old for each pair of DB (file path) and game id, the given game object
  std::unordered_map<std::string, std::unordered_map<long,std::shared_ptr<Game>>> selected_games_to_import;
  std::shared_ptr<GameBase> base;
  std::shared_ptr<GameBase> selected_base;

  void RefreshPendingImports();
public:
    BaseImportTab(wxFrame *parent,  std::shared_ptr<GameBase> db, TabInfos *main_tab);
    void RefreshImportLists();
    void OnLoad(wxCommandEvent &event);
    void OnImportGame(wxCommandEvent &event);
    void OnImportSelection(wxCommandEvent &event);
    void OnImportDatabase(wxCommandEvent &event);
    void Reset(std::shared_ptr<GameBase> base);
    std::vector<std::shared_ptr<Game>> GetGameToImport();
    std::vector<std::string> GetDatabaseToImport() {return databases_to_import;};
};