Reversion-related fixes.

To the settings window handling changes in
a189a4670f, so that the fix for #199 can
still function without the code refactoring.
This commit is contained in:
Oliver Hamlet
2014-12-20 20:07:22 +00:00
parent 40b98e3ae0
commit be0ca56016
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -628,7 +628,7 @@ void Launcher::OnOpenSettings(wxCommandEvent& event) {
GetWindowSizePos(_settings["windows"]["settings"], pos, size);
}
SettingsFrame settings = SettingsFrame(this, translate("LOOT: Settings"), _settings, _games, _currentGame, pos, size);
SettingsFrame settings = SettingsFrame(this, translate("LOOT: Settings"), _settings, _games, _game, pos, size);
BOOST_LOG_TRIVIAL(debug) << "Settings window opened.";
settings.ShowModal();
@@ -648,7 +648,7 @@ void Launcher::OnOpenSettings(wxCommandEvent& event) {
// Fill games list again.
for (size_t i = 0, max = _games.size(); i < max; ++i) {
wxMenuItem * item = GameMenu->AppendRadioItem(MENU_LowestDynamicGameID + i, FromUTF8(_games[i].Name()));
if (_games[_currentGame] == _games[i])
if (*_game == _games[i])
item->Check();
if (_games[i].IsInstalled())
+2 -2
View File
@@ -34,7 +34,7 @@
using namespace std;
SettingsFrame::SettingsFrame(wxWindow *parent, const wxString& title, YAML::Node& settings, std::vector<loot::Game>& games, size_t currentGameIndex, wxPoint pos, wxSize size) : wxDialog(parent, wxID_ANY, title, pos, size, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), _settings(settings), _games(games), _currentGameIndex(currentGameIndex) {
SettingsFrame::SettingsFrame(wxWindow *parent, const wxString& title, YAML::Node& settings, std::vector<loot::Game>& games, loot::Game * currentGame, wxPoint pos, wxSize size) : wxDialog(parent, wxID_ANY, title, pos, size, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), _settings(settings), _games(games), _currentGame(currentGame) {
//Initialise drop-down list contents.
wxString DebugVerbosity[] = {
@@ -281,7 +281,7 @@ void SettingsFrame::OnGameSelect(wxListEvent& event) {
|| name == loot::Game(loot::Game::tes5).Name()
|| name == loot::Game(loot::Game::fo3).Name()
|| name == loot::Game(loot::Game::fonv).Name()
|| event.GetIndex() == _currentGameIndex) {
|| name == _currentGame->Name()) {
removeBtn->Enable(false);
} else {
removeBtn->Enable(true);
+2 -2
View File
@@ -33,7 +33,7 @@
class SettingsFrame : public wxDialog {
public:
SettingsFrame(wxWindow *parent, const wxString& title, YAML::Node& settings, std::vector<loot::Game>& games, size_t currentGameIndex, wxPoint pos, wxSize size);
SettingsFrame(wxWindow *parent, const wxString& title, YAML::Node& settings, std::vector<loot::Game>& games, loot::Game * currentGame, wxPoint pos, wxSize size);
void OnQuit(wxCommandEvent& event);
void OnGameSelect(wxListEvent& event);
@@ -55,7 +55,7 @@ private:
YAML::Node& _settings;
std::vector<loot::Game>& _games;
size_t _currentGameIndex;
loot::Game * _currentGame;
};
class GameEditDialog : public wxDialog {