aboutsummaryrefslogtreecommitdiff
path: root/src/MainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r--src/MainWindow.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 62b17e1..0602110 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -35,7 +35,8 @@ MainWindow::MainWindow()
menu_game->Append(3, "New from FEN", "Create new game using FEN");
// Game base menu
- menu_db->Append(5, "Open", "Open a database");
+ menu_db->Append(7, "New", "Create database");
+ menu_db->Append(5, "Open", "Open database");
// Engine menu
menu_engine->Append(6, "New", "Create a new engine configuration");
@@ -129,6 +130,16 @@ void MainWindow::OnMenuItemClick(wxCommandEvent &event) {
OpenFile();
} else if (id == 6) {
NewEngine();
+ } else if (id == 7) {
+ wxFileDialog
+ newFileDialog(this, _("Create database file"), "", "",
+ "PGN files (*.pgn)|*.pgn", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
+ if (newFileDialog.ShowModal() == wxID_CANCEL)
+ return;
+ // Create and open new db
+ std::string path = newFileDialog.GetPath().ToStdString();
+ BaseTab *bt = new BaseTab((wxFrame *)notebook, path);
+ AddPage(bt,bt);
}
}