Partial fix for crash on settings application.

LOOT won't crash anymore, but the problem was that invalid paper-inputs
have an "invalid" class added, which breaks the games settings keys.
That'll need to be implemented differently, but for now I've switched
back to using normal input elements.
This commit is contained in:
Oliver Hamlet
2014-11-09 17:07:28 +00:00
parent 6a074d1c9d
commit 1af1d4bb3b
3 changed files with 25 additions and 18 deletions
+7 -7
View File
@@ -57,18 +57,18 @@
</template>
<template id="gameRow">
<tr>
<td><paper-input class="name" type="text" required></paper-input></td>
<td><input class="name" type="text" required></td>
<td>
<select class="type">
<!-- Game <option> elements go here. -->
</select>
</td>
<td><paper-input class="folder" type="text" required></paper-input></td>
<td><paper-input class="master" type="text"></paper-input></td>
<td><paper-input class="repo" type="text"></paper-input></td>
<td><paper-input class="branch" type="text"></paper-input></td>
<td><paper-input class="path" type="text"></paper-input></td>
<td><paper-input class="registry" type="text"></paper-input></td>
<td><input class="folder" type="text" required></td>
<td><input class="master" type="text"></td>
<td><input class="repo" type="text"></td>
<td><input class="branch" type="text"></td>
<td><input class="path" type="text"></td>
<td><input class="registry" type="text"></td>
<td class="fa fa-trash-o fa-fw"></td>
</tr>
</template>
+1 -1
View File
@@ -1032,7 +1032,7 @@ function closeSettingsDialog(evt) {
return;
}
var dialog = evt.target.parentElement.parentElement;
var dialog = evt.target.parentElement;
if (evt.target.classList.contains('accept')) {
/* Update the JS variable values. */
var settings = {
+17 -10
View File
@@ -263,18 +263,25 @@ namespace loot {
g_app_state.UpdateSettings(request["args"][0]);
// If the user has deleted a default game, we don't want to restore it now.
// It will be restored when LOOT is next loaded.
vector<Game> games(request["args"][0]["games"].as< vector<Game> >());
try {
BOOST_LOG_TRIVIAL(trace) << "Updating games object.";
vector<Game> games(request["args"][0]["games"].as< vector<Game> >());
g_app_state.UpdateGames(games);
g_app_state.UpdateGames(games);
// Also enable/disable debug logging as required.
if (request["args"][0]["enableDebugLogging"] && request["args"][0]["enableDebugLogging"].as<bool>())
boost::log::core::get()->set_logging_enabled(true);
else
boost::log::core::get()->set_logging_enabled(false);
// Also enable/disable debug logging as required.
if (request["args"][0]["enableDebugLogging"].as<bool>())
boost::log::core::get()->set_logging_enabled(true);
else
boost::log::core::get()->set_logging_enabled(false);
// Now send back the new list of installed games to the UI.
callback->Success(GetInstalledGames());
// Now send back the new list of installed games to the UI.
BOOST_LOG_TRIVIAL(trace) << "Getting new list of installed games.";
callback->Success(GetInstalledGames());
}
catch (exception &e) {
BOOST_LOG_TRIVIAL(error) << e.what();
callback->Failure(-1, e.what());
}
return true;
}
else if (requestName == "applySort") {