diff --git a/src/MainWindow.hpp b/src/MainWindow.hpp index 5204220..4bb96dd 100644 --- a/src/MainWindow.hpp +++ b/src/MainWindow.hpp @@ -32,6 +32,7 @@ class MainWindow : public MainFrame { void OnPageChange(wxAuiNotebookEvent &event); void OnRefreshTabTitle(wxCommandEvent &event); void OpenSettings(); + /// @brief Setting up a new chess engine (select executable and open engine tab) void NewEngine(); void OnCloseTabEvent(wxCommandEvent &event); void OnRefreshEngineList(wxCommandEvent &event); @@ -44,5 +45,6 @@ class MainWindow : public MainFrame { public: MainWindow(); TabInfos* NewGame(std::shared_ptr game); + /// @brief Apply preferences to MainWindow and all the opened tabs void ApplyPreferences(); }; \ No newline at end of file diff --git a/src/base_tab/BaseGameTab.hpp b/src/base_tab/BaseGameTab.hpp index 0abcffa..f09a269 100644 --- a/src/base_tab/BaseGameTab.hpp +++ b/src/base_tab/BaseGameTab.hpp @@ -11,7 +11,8 @@ */ class BaseGameTab : public TabBase_TabGames { std::shared_ptr base; - + void OnDelete(wxCommandEvent &event); + void OnApplyFilter(wxCommandEvent &event); public: std::shared_ptr glm; @@ -23,8 +24,6 @@ public: BaseGameTab(wxFrame *parent, std::shared_ptr base); void Reset(std::shared_ptr base); - void OnDelete(wxCommandEvent &event); - void OnApplyFilter(wxCommandEvent &event); std::vector> GetEditedGames(); std::vector GetDeletedGameIds() {return(deleted);}; std::shared_ptr OpenGame(long gameid, long item); diff --git a/src/base_tab/BaseImportTab.hpp b/src/base_tab/BaseImportTab.hpp index 10342bd..24bda24 100644 --- a/src/base_tab/BaseImportTab.hpp +++ b/src/base_tab/BaseImportTab.hpp @@ -24,14 +24,15 @@ class BaseImportTab : public TabBase_TabImport { std::shared_ptr selected_base; void RefreshPendingImports(); + void OnLoad(wxCommandEvent &event); + void OnImportGame(wxCommandEvent &event); + void OnImportSelection(wxCommandEvent &event); + void OnImportDatabase(wxCommandEvent &event); + public: int import_ndb, import_ngames,import_nselect; BaseImportTab(wxFrame *parent, std::shared_ptr 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 base); std::vector> GetGameToImport(); std::vector GetDatabaseToImport() {return databases_to_import;}; diff --git a/src/base_tab/gamebase/GameBase.hpp b/src/base_tab/gamebase/GameBase.hpp index b2c1488..8e02fd1 100644 --- a/src/base_tab/gamebase/GameBase.hpp +++ b/src/base_tab/gamebase/GameBase.hpp @@ -48,4 +48,10 @@ std::shared_ptr OpenDatabase(const std::string &dbpath, bool createIfN * @return std::shared_ptr */ std::shared_ptr OpenGameX(const std::string &dbpath, long id); +/** + * @brief Save a given game in a database file (append to existing games in the db) + * + * @param dbpath path of the dadabase + * @param g shared pointer to a game + */ void SaveGame(const std::string &dbpath, std::shared_ptr g); \ No newline at end of file diff --git a/src/engine_tab/EngineTab.hpp b/src/engine_tab/EngineTab.hpp index 1858a49..ecbc25d 100644 --- a/src/engine_tab/EngineTab.hpp +++ b/src/engine_tab/EngineTab.hpp @@ -17,6 +17,9 @@ class EngineTab : public TabEngine, public TabInfos { void InitConfiguration(); void LoadConfiguration(); void RefreshItemList(); + void OnSave(wxCommandEvent &event); + void OnDelete(wxCommandEvent &event); + public: EngineTab(wxWindow *parent, uciadapter::UCI *engine, std::string engine_path); @@ -26,6 +29,4 @@ public: std::shared_ptr GetGame() { return nullptr; } std::shared_ptr GetBase() { return nullptr; } std::uint32_t GetEngineId() { return engine_id; }; - void OnSave(wxCommandEvent &event); - void OnDelete(wxCommandEvent &event); }; \ No newline at end of file diff --git a/src/game_tab/GameTab.hpp b/src/game_tab/GameTab.hpp index 28e9d27..5e7149f 100644 --- a/src/game_tab/GameTab.hpp +++ b/src/game_tab/GameTab.hpp @@ -28,12 +28,12 @@ class GameTab : public wxPanel, public TabInfos { void RefreshLabel(); void RefreshTabTitle(); void OnGameChange(wxCommandEvent &event); + void OnToolClick(wxCommandEvent &event); public: GameTab(wxFrame *parent, std::shared_ptr game); void ApplyPreferences(); std::shared_ptr GetGame() { return (std::shared_ptr(game)); } std::shared_ptr GetBase() { return nullptr; }; - void OnToolClick(wxCommandEvent &event); void OnLink(){board_panel->SetSaveToolEnable(false);}; };