mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:35:17 +02:00
don't make the dialogs synchronous
This commit is contained in:
parent
54c13efe6a
commit
278ab0fa8f
1 changed files with 17 additions and 17 deletions
|
@ -330,27 +330,27 @@ function isStackManagerContentPresent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function promptToMigrateContent() {
|
function promptToMigrateContent() {
|
||||||
var idx = dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
type: 'question',
|
type: 'question',
|
||||||
buttons: ['Yes', 'No'],
|
buttons: ['Yes', 'No'],
|
||||||
title: 'Migrate Content',
|
title: 'Migrate Content',
|
||||||
message: 'Are you sure?\n\nThis will stop your home server and replace everything in your home with your content from Stack Manager.'
|
message: 'Are you sure?\n\nThis will stop your home server and replace everything in your home with your content from Stack Manager.'
|
||||||
});
|
}, function(index) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (homeServer.state != ProcessGroupStates.STOPPED) {
|
||||||
|
homeServer.on('state-update', function(processGroup) {
|
||||||
|
if (processGroup.state == ProcessGroupStates.STOPPED) {
|
||||||
|
performContentMigration();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (idx == 0) {
|
homeServer.stop();
|
||||||
if (homeServer.state != ProcessGroupStates.STOPPED) {
|
|
||||||
homeServer.on('state-update', function(processGroup) {
|
|
||||||
if (processGroup.state == ProcessGroupStates.STOPPED) {
|
|
||||||
performContentMigration();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
homeServer.stop();
|
} else {
|
||||||
|
performContentMigration();
|
||||||
} else {
|
}
|
||||||
performContentMigration();
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function performContentMigration() {
|
function performContentMigration() {
|
||||||
|
@ -366,7 +366,7 @@ function performContentMigration() {
|
||||||
buttons: ['OK'],
|
buttons: ['OK'],
|
||||||
title: 'Models File Not Found',
|
title: 'Models File Not Found',
|
||||||
message: 'There is no models file at ' + modelsPath + '\n\nStack Manager content migration can not proceed.'
|
message: 'There is no models file at ' + modelsPath + '\n\nStack Manager content migration can not proceed.'
|
||||||
});
|
}, null);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ function performContentMigration() {
|
||||||
buttons: ['OK'],
|
buttons: ['OK'],
|
||||||
title: 'Migration Complete',
|
title: 'Migration Complete',
|
||||||
message: 'Your Stack Manager content has been migrated.\n\nYour home server will now be restarted.'
|
message: 'Your Stack Manager content has been migrated.\n\nYour home server will now be restarted.'
|
||||||
});
|
}, null);
|
||||||
} else {
|
} else {
|
||||||
// show error message for copy fail
|
// show error message for copy fail
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
|
@ -389,7 +389,7 @@ function performContentMigration() {
|
||||||
buttons: ['OK'],
|
buttons: ['OK'],
|
||||||
title: 'Migration Failed',
|
title: 'Migration Failed',
|
||||||
message: 'There was an error copying your Stack Manager content: ' + copyError + '\n\nPlease try again.'
|
message: 'There was an error copying your Stack Manager content: ' + copyError + '\n\nPlease try again.'
|
||||||
});
|
}, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue