Corrected a UI issue with selecting directories of non-supported images. Works on macOS now with videos, images and image sequences. Testing on linux again before resolving.
This commit is contained in:
parent
fb7b1e2fb6
commit
31c701734a
|
@ -169,9 +169,11 @@ class FilmOut {
|
||||||
}
|
}
|
||||||
else if (this.stillExtensions.indexOf(ext) !== -1) {
|
else if (this.stillExtensions.indexOf(ext) !== -1) {
|
||||||
this.state.still = true;
|
this.state.still = true;
|
||||||
|
this.state.directory = false;
|
||||||
}
|
}
|
||||||
else if (this.videoExtensions.indexOf(ext) !== -1) {
|
else if (this.videoExtensions.indexOf(ext) !== -1) {
|
||||||
this.state.still = false;
|
this.state.still = false;
|
||||||
|
this.state.directory = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.log.error(`File is not of a valid file type`, 'FILMOUT', true, true);
|
this.log.error(`File is not of a valid file type`, 'FILMOUT', true, true);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -150,7 +150,6 @@ class FilmOut {
|
||||||
let linuxChoice = 0;
|
let linuxChoice = 0;
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
linuxChoice = yield gui.choice(linuxMessage, linuxChoices);
|
linuxChoice = yield gui.choice(linuxMessage, linuxChoices);
|
||||||
console.log(linuxChoice);
|
|
||||||
if (linuxChoice === 0) {
|
if (linuxChoice === 0) {
|
||||||
options.properties = ['openFile'];
|
options.properties = ['openFile'];
|
||||||
}
|
}
|
||||||
|
@ -174,11 +173,13 @@ class FilmOut {
|
||||||
pathStr = files.filePaths[0];
|
pathStr = files.filePaths[0];
|
||||||
displayName = path.basename(pathStr);
|
displayName = path.basename(pathStr);
|
||||||
valid = this.validateSelection(files);
|
valid = this.validateSelection(files);
|
||||||
log.info(`Selected "${displayName}"`, 'FILMOUT', true);
|
if (valid) {
|
||||||
elem.attr('data-file', pathStr);
|
log.info(`Selected "${displayName}"`, 'FILMOUT', true);
|
||||||
elem.val(displayName);
|
elem.attr('data-file', pathStr);
|
||||||
$('#filmout_file').val(displayName);
|
elem.val(displayName);
|
||||||
this.useFile();
|
$('#filmout_file').val(displayName);
|
||||||
|
this.useFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
gui.warn('Invalid selection', `The selection "${displayName}" is not an accepted video, image or folder containing an image sequence.`);
|
gui.warn('Invalid selection', `The selection "${displayName}" is not an accepted video, image or folder containing an image sequence.`);
|
||||||
|
@ -208,7 +209,7 @@ class FilmOut {
|
||||||
fileList = fs.readdirSync(pathStr);
|
fileList = fs.readdirSync(pathStr);
|
||||||
fileList = fileList.filter((file) => {
|
fileList = fileList.filter((file) => {
|
||||||
let ext = path.extname(file).toLowerCase();
|
let ext = path.extname(file).toLowerCase();
|
||||||
if (this.sequenceExtensions.indexOf(ext)) {
|
if (this.sequenceExtensions.indexOf(ext) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -216,11 +217,16 @@ class FilmOut {
|
||||||
if (fileList.length > 0) {
|
if (fileList.length > 0) {
|
||||||
valid = true;
|
valid = true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ext = path.extname(pathStr.toLowerCase());
|
else {
|
||||||
valid = this.videoExtensions.indexOf(ext) === -1;
|
ext = path.extname(pathStr.toLowerCase());
|
||||||
if (!valid) {
|
valid = this.videoExtensions.indexOf(ext) === -1;
|
||||||
valid = this.stillExtensions.indexOf(ext) === -1;
|
if (!valid) {
|
||||||
|
valid = this.stillExtensions.indexOf(ext) === -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
|
@ -288,6 +294,7 @@ class FilmOut {
|
||||||
$('#filmout_stats_video_name').text(state.fileName);
|
$('#filmout_stats_video_name').text(state.fileName);
|
||||||
$('#filmout_stats_video_size').text(`${state.info.width} x ${state.info.height}`);
|
$('#filmout_stats_video_size').text(`${state.info.width} x ${state.info.height}`);
|
||||||
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
||||||
|
this.reset();
|
||||||
gui.updateState();
|
gui.updateState();
|
||||||
this.previewFrame();
|
this.previewFrame();
|
||||||
if (!this.state.directory) {
|
if (!this.state.directory) {
|
||||||
|
@ -359,6 +366,10 @@ class FilmOut {
|
||||||
}
|
}
|
||||||
$('#filmout_position').val(this.state.frame).trigger('change');
|
$('#filmout_position').val(this.state.frame).trigger('change');
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
this.state.frame = 0;
|
||||||
|
$('#filmout_position').val(this.state.frame).trigger('change');
|
||||||
|
}
|
||||||
preview() {
|
preview() {
|
||||||
const frame = this.state.frame;
|
const frame = this.state.frame;
|
||||||
ipcRenderer.send('preview', { frame });
|
ipcRenderer.send('preview', { frame });
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -176,11 +176,13 @@ class FilmOut {
|
||||||
pathStr = files.filePaths[0];
|
pathStr = files.filePaths[0];
|
||||||
displayName = path.basename(pathStr);
|
displayName = path.basename(pathStr);
|
||||||
valid = this.validateSelection(files);
|
valid = this.validateSelection(files);
|
||||||
log.info(`Selected "${displayName}"`, 'FILMOUT', true);
|
if (valid) {
|
||||||
elem.attr('data-file', pathStr);
|
log.info(`Selected "${displayName}"`, 'FILMOUT', true);
|
||||||
elem.val(displayName);
|
elem.attr('data-file', pathStr);
|
||||||
$('#filmout_file').val(displayName);
|
elem.val(displayName);
|
||||||
this.useFile();
|
$('#filmout_file').val(displayName);
|
||||||
|
this.useFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
|
@ -211,19 +213,22 @@ class FilmOut {
|
||||||
fileList = fs.readdirSync(pathStr);
|
fileList = fs.readdirSync(pathStr);
|
||||||
fileList = fileList.filter((file : string) => {
|
fileList = fileList.filter((file : string) => {
|
||||||
let ext : string = path.extname(file).toLowerCase();
|
let ext : string = path.extname(file).toLowerCase();
|
||||||
if (this.sequenceExtensions.indexOf(ext)) {
|
if (this.sequenceExtensions.indexOf(ext) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
if (fileList.length > 0) {
|
if (fileList.length > 0) {
|
||||||
valid = true;
|
valid = true;
|
||||||
|
} else {
|
||||||
|
valid = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ext = path.extname(pathStr.toLowerCase());
|
||||||
|
valid = this.videoExtensions.indexOf(ext) === -1;
|
||||||
|
if (!valid) {
|
||||||
|
valid = this.stillExtensions.indexOf(ext) === -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ext = path.extname(pathStr.toLowerCase());
|
|
||||||
valid = this.videoExtensions.indexOf(ext) === -1;
|
|
||||||
if (!valid) {
|
|
||||||
valid = this.stillExtensions.indexOf(ext) === -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
|
@ -297,6 +302,7 @@ class FilmOut {
|
||||||
$('#filmout_stats_video_size').text(`${state.info.width} x ${state.info.height}`);
|
$('#filmout_stats_video_size').text(`${state.info.width} x ${state.info.height}`);
|
||||||
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
||||||
|
|
||||||
|
this.reset();
|
||||||
gui.updateState();
|
gui.updateState();
|
||||||
this.previewFrame();
|
this.previewFrame();
|
||||||
if (!this.state.directory) {
|
if (!this.state.directory) {
|
||||||
|
@ -375,6 +381,11 @@ class FilmOut {
|
||||||
$('#filmout_position').val(this.state.frame).trigger('change');
|
$('#filmout_position').val(this.state.frame).trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset () {
|
||||||
|
this.state.frame = 0;
|
||||||
|
$('#filmout_position').val(this.state.frame).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
preview () {
|
preview () {
|
||||||
const frame : number = this.state.frame;
|
const frame : number = this.state.frame;
|
||||||
ipcRenderer.send('preview', { frame });
|
ipcRenderer.send('preview', { frame });
|
||||||
|
|
|
@ -178,8 +178,10 @@ class FilmOut {
|
||||||
this.state.still = !isAnimated;
|
this.state.still = !isAnimated;
|
||||||
} else if (this.stillExtensions.indexOf(ext) !== -1) {
|
} else if (this.stillExtensions.indexOf(ext) !== -1) {
|
||||||
this.state.still = true;
|
this.state.still = true;
|
||||||
|
this.state.directory = false;
|
||||||
} else if (this.videoExtensions.indexOf(ext) !== -1) {
|
} else if (this.videoExtensions.indexOf(ext) !== -1) {
|
||||||
this.state.still = false;
|
this.state.still = false;
|
||||||
|
this.state.directory = false;
|
||||||
} else {
|
} else {
|
||||||
this.log.error(`File is not of a valid file type`, 'FILMOUT', true, true);
|
this.log.error(`File is not of a valid file type`, 'FILMOUT', true, true);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue