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,6 +164,7 @@ class FilmOut {
}); });
} }
useFile() { useFile() {
return __awaiter(this, void 0, void 0, function* () {
const elem = $('#digital'); const elem = $('#digital');
const filePath = elem.attr('data-file'); const filePath = elem.attr('data-file');
const fileName = elem.val(); const fileName = elem.val();
@ -173,7 +174,7 @@ class FilmOut {
fileName fileName
}; };
if (filePath && filePath !== '') { if (filePath && filePath !== '') {
proceed = confirm(`Are you sure you want to use ${fileName}?`); proceed = yield gui.confirm(`Are you sure you want to use ${fileName}?`);
} }
else { else {
this.selectFile(); this.selectFile();
@ -188,6 +189,7 @@ class FilmOut {
$('#digital').removeClass('active'); $('#digital').removeClass('active');
} }
//cancel video //cancel video
});
} }
//callback after //callback after
onFilmout(evt, args) { onFilmout(evt, args) {
@ -240,15 +242,17 @@ class FilmOut {
elem.addClass('on'); elem.addClass('on');
} }
preExport() { preExport() {
return __awaiter(this, void 0, void 0, function* () {
let proceed = false; let proceed = false;
if (this.state.path && this.state.path !== '') { 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 = 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) { if (proceed) {
gui.overlay(true); gui.overlay(true);
gui.spinner(true, `Exporting frames for ${this.state.name}`); gui.spinner(true, `Exporting frames for ${this.state.name}`);
ipcRenderer.send('pre_export', {}); ipcRenderer.send('pre_export', {});
} }
});
} }
onPreExport(evt, args) { onPreExport(evt, args) {
log.info('onPreExport'); log.info('onPreExport');

File diff suppressed because one or more lines are too long

View File

@ -167,7 +167,7 @@ class FilmOut {
this.useFile(); this.useFile();
} }
} }
useFile () { async useFile () {
const elem : any = $('#digital'); const elem : any = $('#digital');
const filePath : string = elem.attr('data-file'); const filePath : string = elem.attr('data-file');
const fileName : string = elem.val(); const fileName : string = elem.val();
@ -178,7 +178,7 @@ class FilmOut {
}; };
if (filePath && filePath !== '') { 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 { } else {
this.selectFile(); this.selectFile();
} }
@ -249,11 +249,11 @@ class FilmOut {
elem[0].style.backgroundImage = `url('${args.path}')`; elem[0].style.backgroundImage = `url('${args.path}')`;
elem.addClass('on'); elem.addClass('on');
} }
preExport () { async preExport () {
let proceed = false; let proceed = false;
if (this.state.path && this.state.path !== '') { 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) { if (proceed) {