diff options
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
| -rw-r--r-- | src/base_tab/BaseTab.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp index f7cf48f..3816b59 100644 --- a/src/base_tab/BaseTab.cpp +++ b/src/base_tab/BaseTab.cpp @@ -1,5 +1,6 @@ #include "BaseTab.hpp" #include <wx/filename.h> +#include "AppendGameDialog.hpp" BaseTab::BaseTab(wxFrame *parent, std::string base_file) : BasePanelBF(parent), base_file(base_file), TabInfos(TabInfos::BASE), @@ -17,10 +18,17 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file) this->Bind(wxEVT_BUTTON, &BaseTab::OnSave, this, ID_SAVE_BUTTON); this->Bind(wxEVT_BUTTON, &BaseTab::OnExport, this, ID_EXPORT_BUTTON); this->Bind(wxEVT_LIST_ITEM_ACTIVATED, &BaseTab::OnOpenGame, this, wxID_ANY); + this->Bind(wxEVT_BUTTON, &BaseTab::OnImport, this, ID_IMPORT_BUTTON); + current_base->SetLabel(base_file); LoadFile(); } +void BaseTab::OnImport(wxCommandEvent &event) { + AppendGameDialog *dia=new AppendGameDialog(this,base); + dia->ShowModal(); +} + void BaseTab::OnDelete(wxCommandEvent &event) { long selected = game_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); @@ -77,7 +85,7 @@ void BaseTab::OnExport(wxCommandEvent &event) { GameBase *base; if (ext == "pgn") { base = new PGNGameBase(path); - base->Save(this->base); + base->Export(this->base); delete base; } } @@ -109,4 +117,4 @@ void BaseTab::LoadFile() { wxCommandEvent event(REFRESH_TAB_TITLE, GetId()); event.SetEventObject(this); ProcessEvent(event); -}
\ No newline at end of file +} |
