Use the gui.confirm dialog and not the native confirm function.

This commit is contained in:
sixteenmillimeter 2020-02-21 16:58:35 -05:00
parent d70de98256
commit e25a8bbc7c
3 changed files with 42 additions and 38 deletions

View File

@ -164,30 +164,32 @@ class FilmOut {
});
}
useFile() {
const elem = $('#digital');
const filePath = elem.attr('data-file');
const fileName = elem.val();
let proceed = false;
let obj = {
path: filePath,
fileName
};
if (filePath && filePath !== '') {
proceed = confirm(`Are you sure you want to use ${fileName}?`);
}
else {
this.selectFile();
}
if (proceed) {
gui.overlay(true);
gui.spinner(true, `Getting info about ${fileName}`);
ipcRenderer.send('filmout', obj);
}
else {
$('#projector_type_digital').prop('checked', 'checked');
$('#digital').removeClass('active');
}
//cancel video
return __awaiter(this, void 0, void 0, function* () {
const elem = $('#digital');
const filePath = elem.attr('data-file');
const fileName = elem.val();
let proceed = false;
let obj = {
path: filePath,
fileName
};
if (filePath && filePath !== '') {
proceed = yield gui.confirm(`Are you sure you want to use ${fileName}?`);
}
else {
this.selectFile();
}
if (proceed) {
gui.overlay(true);
gui.spinner(true, `Getting info about ${fileName}`);
ipcRenderer.send('filmout', obj);
}
else {
$('#projector_type_digital').prop('checked', 'checked');
$('#digital').removeClass('active');
}
//cancel video
});
}
//callback after
onFilmout(evt, args) {
@ -240,15 +242,17 @@ class FilmOut {
elem.addClass('on');
}
preExport() {
let proceed = false;
if (this.state.path && this.state.path !== '') {
proceed = confirm(`Export all frames for ${this.state.name}? This may take a while, but will allow filmout sequences to run faster.`);
}
if (proceed) {
gui.overlay(true);
gui.spinner(true, `Exporting frames for ${this.state.name}`);
ipcRenderer.send('pre_export', {});
}
return __awaiter(this, void 0, void 0, function* () {
let proceed = false;
if (this.state.path && this.state.path !== '') {
proceed = yield gui.confirm(`Export all frames for ${this.state.name}? This may take a while, but will allow filmout sequences to run faster.`);
}
if (proceed) {
gui.overlay(true);
gui.spinner(true, `Exporting frames for ${this.state.name}`);
ipcRenderer.send('pre_export', {});
}
});
}
onPreExport(evt, args) {
log.info('onPreExport');

File diff suppressed because one or more lines are too long

View File

@ -167,7 +167,7 @@ class FilmOut {
this.useFile();
}
}
useFile () {
async useFile () {
const elem : any = $('#digital');
const filePath : string = elem.attr('data-file');
const fileName : string = elem.val();
@ -178,7 +178,7 @@ class FilmOut {
};
if (filePath && filePath !== '') {
proceed = confirm(`Are you sure you want to use ${fileName}?`);
proceed = await gui.confirm(`Are you sure you want to use ${fileName}?`);
} else {
this.selectFile();
}
@ -249,11 +249,11 @@ class FilmOut {
elem[0].style.backgroundImage = `url('${args.path}')`;
elem.addClass('on');
}
preExport () {
async preExport () {
let proceed = false;
if (this.state.path && this.state.path !== '') {
proceed = confirm(`Export all frames for ${this.state.name}? This may take a while, but will allow filmout sequences to run faster.`);
proceed = await gui.confirm(`Export all frames for ${this.state.name}? This may take a while, but will allow filmout sequences to run faster.`);
}
if (proceed) {