From 08c00e7abf147384d1a30bb8224b212d231845e1 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Sat, 28 Sep 2013 14:02:13 +0100 Subject: [PATCH] Game settings must now include a path or a registry key. --- src/gui/settings.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 8f067451..2374ec01 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -296,6 +296,14 @@ void SettingsFrame::OnAddGame(wxCommandEvent& event) { wxOK | wxICON_ERROR, this); return; + } else if (rowDialog->GetPath().empty() && rowDialog->GetRegistryKey().empty()) { + BOOST_LOG_TRIVIAL(error) << "Tried to add a new game with no path or registry key given."; + wxMessageBox( + translate("Error: A path and/or registry key is required. Row will not be added."), + translate("BOSS: Error"), + wxOK | wxICON_ERROR, + this); + return; } //Also check that name and folder name don't already exist in the list. @@ -367,6 +375,14 @@ void SettingsFrame::OnEditGame(wxCommandEvent& event) { wxOK | wxICON_ERROR, this); return; + } else if (rowDialog->GetPath().empty() && rowDialog->GetRegistryKey().empty()) { + BOOST_LOG_TRIVIAL(error) << "Tried to edit a game with no path or registry key given."; + wxMessageBox( + translate("Error: A path and/or registry key is required. Row will not be added."), + translate("BOSS: Error"), + wxOK | wxICON_ERROR, + this); + return; } gamesList->SetItem(i, 0, rowDialog->GetName());