mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-06 01:56:28 +02:00
Debug database
This commit is contained in:
parent
bd71371bed
commit
2a167cd107
2 changed files with 8 additions and 4 deletions
|
@ -186,7 +186,7 @@ void MainWindow::NewGame(bool useFen) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
NewGame(new Game());
|
||||
NewGame(std::shared_ptr<Game>(new Game()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,16 @@ void BaseTab::OnImport(wxCommandEvent &event) {
|
|||
dia->ShowModal();
|
||||
game_list->DeleteAllItems();
|
||||
deleted.clear();
|
||||
edited.clear();
|
||||
LoadFile();
|
||||
}
|
||||
|
||||
void BaseTab::OnDelete(wxCommandEvent &event) {
|
||||
long selected =
|
||||
game_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||
if (selected >= 0) {
|
||||
long selected = -1;
|
||||
|
||||
while ((selected = game_list->GetNextItem(selected, wxLIST_NEXT_ALL,
|
||||
wxLIST_STATE_SELECTED)) !=
|
||||
wxNOT_FOUND) {
|
||||
wxListItem listItem;
|
||||
listItem.m_itemId = selected; // sets row
|
||||
listItem.m_col = 0; // sets column
|
||||
|
@ -56,6 +59,7 @@ void BaseTab::OnSave(wxCommandEvent &event) {
|
|||
edited.end()); // Add edited game (since they are also deleted)
|
||||
base->Save(deleted, new_games_bases, new_games);
|
||||
game_list->DeleteAllItems();
|
||||
edited.clear();
|
||||
deleted.clear();
|
||||
LoadFile();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue