The swiss army knife of lossless video/audio editing
i18n "All Files"
Mikael Finstad14b63787c4f3
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.jsonindex 00192d8d..847cd995 100644--- a/public/locales/en/translation.json+++ b/public/locales/en/translation.json@@ -18,6 +18,7 @@"Advanced view has been enabled. You will now also see non-essential buttons and functions": "Advanced view has been enabled. You will now also see non-essential buttons and functions.","Align segment times to keyframes": "Align segment times to keyframes","Aligning segments to keyframes": "Aligning segments to keyframes",+ "All Files": "All Files","All formats:": "All formats:","All streams have been extracted as separate files": "All streams have been extracted as separate files","Allow multiple instances": "Allow multiple instances",@@ -243,6 +244,7 @@"Fastest: Low playback speed (no audio)": "Fastest: Low playback speed (no audio)","FCPXML files": "FCPXML files","FFmpeg": "FFmpeg",+ "FFmpeg capture method might sometimes capture more correct colors, but the captured snapshot might be off by one or more frames, relative to the preview.": "FFmpeg capture method might sometimes capture more correct colors, but the captured snapshot might be off by one or more frames, relative to the preview.","File": "File","File compatibility check is not enabled, so the merge operation might not produce a valid output. Enable \"Check compatibility\" below to check file compatibility before merging.": "File compatibility check is not enabled, so the merge operation might not produce a valid output. Enable \"Check compatibility\" below to check file compatibility before merging.","File info": "File info",diff --git a/src/App.jsx b/src/App.jsxindex ee330de2..d7b5820a 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -73,7 +73,7 @@ import { formatDuration } from './util/duration';import { adjustRate } from './util/rate-calculator';import { askExtractFramesAsImages } from './dialogs/extractFrames';import { askForHtml5ifySpeed } from './dialogs/html5ify';-import { askForOutDir, askForImportChapters, promptTimeOffset, askForFileOpenAction, confirmExtractAllStreamsDialog, showCleanupFilesDialog, showDiskFull, showExportFailedDialog, showConcatFailedDialog, openYouTubeChaptersDialog, openAbout, showRefuseToOverwrite, openDirToast, openCutFinishedToast, openConcatFinishedToast } from './dialogs';+import { askForOutDir, askForImportChapters, promptTimeOffset, askForFileOpenAction, confirmExtractAllStreamsDialog, showCleanupFilesDialog, showDiskFull, showExportFailedDialog, showConcatFailedDialog, openYouTubeChaptersDialog, openAbout, showRefuseToOverwrite, openDirToast, openCutFinishedToast, openConcatFinishedToast, showOpenDialog } from './dialogs';import { openSendReportDialog } from './reporting';import { fallbackLng } from './i18n';import { createSegment, getCleanCutSegments, findSegmentsAtCursor, sortSegments, getSegmentTags, convertSegmentsToChapters, hasAnySegmentOverlap, isDurationValid, playOnlyCurrentSegment } from './segments';@@ -88,9 +88,6 @@ const filePathToUrl = window.require('file-url');const { parse: parsePath, join: pathJoin, basename, dirname } = window.require('path');const remote = window.require('@electron/remote');--const { dialog } = remote;-const { focusWindow, hasDisabledNetworking } = remote.require('./electron');@@ -1778,7 +1775,7 @@ const App = memo(() => {}, [alwaysConcatMultipleFiles, batchLoadPaths, setWorking, isFileOpened, batchFiles.length, userOpenSingleFile, checkFileOpened, loadEdlFile, enableAskForFileOpenAction, addStreamSourceFile, filePath]);const openFilesDialog = useCallback(async () => {- const { canceled, filePaths } = await dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'], defaultPath: lastOpenedPath });+ const { canceled, filePaths } = await showOpenDialog({ properties: ['openFile', 'multiSelections'], defaultPath: lastOpenedPath });if (canceled) return;userOpenFiles(filePaths);}, [userOpenFiles]);@@ -2094,7 +2091,7 @@ const App = memo(() => {const showAddStreamSourceDialog = useCallback(async () => {try {- const { canceled, filePaths } = await dialog.showOpenDialog({ properties: ['openFile'] });+ const { canceled, filePaths } = await showOpenDialog({ properties: ['openFile'] });if (canceled || filePaths.length < 1) return;await addStreamSourceFile(filePaths[0]);} catch (err) {diff --git a/src/dialogs/index.jsx b/src/dialogs/index.jsxindex 47ed0772..969fcfad 100644--- a/src/dialogs/index.jsx+++ b/src/dialogs/index.jsx@@ -11,6 +11,7 @@ import { parseDuration, formatDuration } from '../util/duration';import Swal, { swalToastOptions, toast } from '../swal';import { parseYouTube } from '../edlFormats';import CopyClipboardButton from '../components/CopyClipboardButton';+import { isWindows } from '../util';const { dialog, app } = window.require('@electron/remote');const { shell } = window.require('electron');@@ -38,6 +39,12 @@ export async function promptTimeOffset({ initialValue, title, text }) {return duration;}+// https://github.com/mifi/lossless-cut/issues/1495+export const showOpenDialog = async ({+ filters = isWindows ? [{ name: i18n.t('All Files'), extensions: ['*'] }] : undefined,+ ...props+}) => dialog.showOpenDialog({ ...props, filters });+export async function askForYouTubeInput() {const example = i18n.t('YouTube video description\n00:00 Intro\n00:01 Chapter 2\n00:00:02.123 Chapter 3');const { value } = await Swal.fire({@@ -59,7 +66,7 @@ export async function askForYouTubeInput() {}export async function askForInputDir(defaultPath) {- const { filePaths } = await dialog.showOpenDialog({+ const { filePaths } = await showOpenDialog({properties: ['openDirectory', 'createDirectory'],defaultPath,title: i18n.t('Please confirm folder'),@@ -70,7 +77,7 @@ export async function askForInputDir(defaultPath) {}export async function askForOutDir(defaultPath) {- const { filePaths } = await dialog.showOpenDialog({+ const { filePaths } = await showOpenDialog({properties: ['openDirectory', 'createDirectory'],defaultPath,title: i18n.t('Where do you want to save output files?'),@@ -81,7 +88,7 @@ export async function askForOutDir(defaultPath) {}export async function askForFfPath(defaultPath) {- const { filePaths } = await dialog.showOpenDialog({+ const { filePaths } = await showOpenDialog({properties: ['openDirectory'],defaultPath,title: i18n.t('Select custom FFmpeg directory'),diff --git a/src/edlStore.js b/src/edlStore.jsindex 5c9b08e3..57a90d01 100644--- a/src/edlStore.js+++ b/src/edlStore.js@@ -2,7 +2,7 @@ import JSON5 from 'json5';import i18n from 'i18next';import { parseCuesheet, parseXmeml, parseFcpXml, parseCsv, parsePbf, parseMplayerEdl, formatCsvHuman, formatTsv, formatCsvFrames, formatCsvSeconds, getTimeFromFrameNum } from './edlFormats';-import { askForYouTubeInput } from './dialogs';+import { askForYouTubeInput, showOpenDialog } from './dialogs';import { getOutPath } from './util';const fs = window.require('fs-extra');@@ -97,7 +97,7 @@ export async function askForEdlImport({ type, fps }) {else if (type === 'mplayer') filters = [{ name: i18n.t('MPlayer EDL'), extensions: ['*'] }];else if (type === 'llc') filters = [{ name: i18n.t('LosslessCut project'), extensions: ['llc'] }];- const { canceled, filePaths } = await dialog.showOpenDialog({ properties: ['openFile'], filters });+ const { canceled, filePaths } = await showOpenDialog({ properties: ['openFile'], filters });if (canceled || filePaths.length < 1) return [];return readEdlFile({ type, path: filePaths[0], fps });}