mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-19 04:09:41 +00:00
Improve database management
This commit is contained in:
parent
5c8334af1d
commit
5691b7b30f
5 changed files with 26 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue