Disable game operations while no game is detected

This commit is contained in:
Oliver Hamlet
2017-01-05 21:15:53 +00:00
parent 2a32890054
commit be9f871443
3 changed files with 12 additions and 0 deletions
+8
View File
@@ -253,5 +253,13 @@
static setUIState(state) {
document.body.setAttribute('data-state', state);
}
static enableGameOperations(enable) {
document.getElementById('sortButton').disabled = !enable;
document.getElementById('updateMasterlistButton').disabled = !enable;
document.getElementById('wipeUserlistButton').disabled = !enable;
document.getElementById('copyLoadOrderButton').disabled = !enable;
document.getElementById('refreshContentButton').disabled = !enable;
}
};
}));
+3
View File
@@ -315,6 +315,9 @@ function onCloseSettingsDialog(evt) {
loot.query('closeSettings', settings).then(JSON.parse).then((installedGames) => {
loot.installedGames = installedGames;
loot.DOM.updateEnabledGames(installedGames);
if (installedGames.length > 0) {
loot.DOM.enableGameOperations(true);
}
}).catch(loot.handlePromiseError)
.then(() => {
loot.settings = settings;
+1
View File
@@ -151,6 +151,7 @@
function handleInitErrors(error) {
dom.listInitErrors(getErrorMessages(error.message));
Dialog.closeProgress();
dom.enableGameOperations(false);
dom.openDialog('settingsDialog');
}