aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/BaseTab.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-26 12:30:07 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-26 12:30:07 +0100
commite0a1894928abb8361f959a147066e94e2cda996b (patch)
tree1ce31d0dda368d6b1c5527aa28d11543e620ee1e /src/base_tab/BaseTab.cpp
parent3b6e7d39cf2d03f2e43c249ece6da32f1f8030a7 (diff)
Improve database game import
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
-rw-r--r--src/base_tab/BaseTab.cpp12
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
+}