@@ -79,7 +79,7 @@ import {
7979import { toast , errorToast , showPlaybackFailedMessage } from './swal' ;
8080import { adjustRate } from './util/rate-calculator' ;
8181import { askExtractFramesAsImages } from './dialogs/extractFrames' ;
82- import { askForOutDir , askForImportChapters , askForFileOpenAction , showCleanupFilesDialog , showDiskFull , showExportFailedDialog , showConcatFailedDialog , openYouTubeChaptersDialog , showRefuseToOverwrite , openDirToast , openExportFinishedToast , openConcatFinishedToast , showOpenDialog , showMuxNotSupported , promptDownloadMediaUrl , CleanupChoicesType , showOutputNotWritable } from './dialogs' ;
82+ import { askForOutDir , askForImportChapters , askForFileOpenAction , showCleanupFilesDialog , showDiskFull , showExportFailedDialog , showConcatFailedDialog , openYouTubeChaptersDialog , showRefuseToOverwrite , showOpenDialog , showMuxNotSupported , promptDownloadMediaUrl , CleanupChoicesType , showOutputNotWritable } from './dialogs' ;
8383import { openSendReportDialog } from './reporting' ;
8484import { fallbackLng } from './i18n' ;
8585import { sortSegments , convertSegmentsToChaptersWithGaps , hasAnySegmentOverlap , isDurationValid , getPlaybackAction , getSegmentTags , filterNonMarkers } from './segments' ;
@@ -178,7 +178,7 @@ function App() {
178178
179179 const { withErrorHandling, handleError, genericError, setGenericError } = useErrorHandling ( ) ;
180180
181- const { showGenericDialog, genericDialog, closeGenericDialog, confirmDialog } = useDialog ( ) ;
181+ const { showGenericDialog, genericDialog, closeGenericDialog, confirmDialog, openExportFinishedDialog , openCutFinishedDialog , openConcatFinishedDialog } = useDialog ( ) ;
182182
183183 // Note that each action may be multiple key bindings and this will only be the first binding for each action
184184 const keyBindingByAction = useMemo ( ( ) => Object . fromEntries ( keyBindings . map ( ( binding ) => [ binding . action , binding ] ) ) , [ keyBindings ] ) ;
@@ -894,7 +894,7 @@ function App() {
894894
895895 if ( ! hideAllNotifications ) {
896896 showOsNotification ( i18n . t ( 'Merge finished' ) ) ;
897- openConcatFinishedToast ( { filePath : outPath , notices, warnings } ) ;
897+ openConcatFinishedDialog ( { filePath : outPath , notices, warnings } ) ;
898898 }
899899 } catch ( err ) {
900900 if ( err instanceof DirectoryAccessDeclinedError || isAbortedError ( err ) ) return ;
@@ -926,7 +926,7 @@ function App() {
926926 setWorking ( undefined ) ;
927927 setProgress ( undefined ) ;
928928 }
929- } , [ workingRef , setWorking , ensureWritableOutDir , customOutDir , segmentsToChapters , concatFiles , ffmpegExperimental , preserveMovData , movFastStart , preserveMetadataOnMerge , closeBatch , hideAllNotifications , showOsNotification , handleConcatFailed ] ) ;
929+ } , [ workingRef , setWorking , ensureWritableOutDir , customOutDir , segmentsToChapters , concatFiles , ffmpegExperimental , preserveMovData , movFastStart , preserveMetadataOnMerge , closeBatch , hideAllNotifications , showOsNotification , openConcatFinishedDialog , handleConcatFailed ] ) ;
930930
931931 const cleanupFiles = useCallback ( async ( cleanupChoices2 : CleanupChoicesType ) => {
932932 // Store paths before we reset state
@@ -1133,7 +1133,7 @@ function App() {
11331133 const revealPath = willMerge && mergedOutFilePath != null ? mergedOutFilePath : outFiles [ 0 ] ! . path ;
11341134 if ( ! hideAllNotifications ) {
11351135 showOsNotification ( i18n . t ( 'Export finished' ) ) ;
1136- openExportFinishedToast ( { filePath : revealPath , warnings, notices } ) ;
1136+ openCutFinishedDialog ( { filePath : revealPath , warnings, notices } ) ;
11371137 }
11381138
11391139 shootConfetti ( { ticks : 50 } ) ;
@@ -1171,7 +1171,7 @@ function App() {
11711171 setWorking ( undefined ) ;
11721172 setProgress ( undefined ) ;
11731173 }
1174- } , [ filePath , numStreamsToCopy , haveInvalidSegs , workingRef , setWorking , segmentsToChaptersOnly , outSegTemplateOrDefault , generateOutSegFileNames , cutMultiple , outputDir , customOutDir , fileFormat , fileDuration , isRotationSet , effectiveRotation , copyFileStreams , allFilesMeta , keyframeCut , segmentsToExport , shortestFlag , ffmpegExperimental , preserveMetadata , preserveMetadataOnMerge , preserveMovData , preserveChapters , movFastStart , avoidNegativeTs , customTagsByFile , paramsByStreamId , detectedFps , willMerge , enableOverwriteOutput , exportConfirmEnabled , mainFileFormatData , mainStreams , exportExtraStreams , areWeCutting , hideAllNotifications , cleanupChoices . cleanupAfterExport , cleanupFilesWithDialog , segmentsOrInverse . selected , t , mergedFileTemplateOrDefault , segmentsToChapters , invertCutSegments , generateMergedFileNames , concatCutSegments , autoDeleteMergedSegments , tryDeleteFiles , nonCopiedExtraStreams , extractStreams , showOsNotification , handleExportFailed ] ) ;
1174+ } , [ filePath , numStreamsToCopy , haveInvalidSegs , workingRef , setWorking , segmentsToChaptersOnly , outSegTemplateOrDefault , generateOutSegFileNames , cutMultiple , outputDir , customOutDir , fileFormat , fileDuration , isRotationSet , effectiveRotation , copyFileStreams , allFilesMeta , keyframeCut , segmentsToExport , shortestFlag , ffmpegExperimental , preserveMetadata , preserveMetadataOnMerge , preserveMovData , preserveChapters , movFastStart , avoidNegativeTs , customTagsByFile , paramsByStreamId , detectedFps , willMerge , enableOverwriteOutput , exportConfirmEnabled , mainFileFormatData , mainStreams , exportExtraStreams , areWeCutting , hideAllNotifications , cleanupChoices . cleanupAfterExport , cleanupFilesWithDialog , segmentsOrInverse . selected , t , mergedFileTemplateOrDefault , segmentsToChapters , invertCutSegments , generateMergedFileNames , concatCutSegments , autoDeleteMergedSegments , tryDeleteFiles , nonCopiedExtraStreams , extractStreams , showOsNotification , openCutFinishedDialog , handleExportFailed ] ) ;
11751175
11761176 const onExportPress = useCallback ( async ( ) => {
11771177 if ( ! filePath ) return ;
@@ -1200,12 +1200,12 @@ function App() {
12001200 : await captureFrameFromTag ( { customOutDir, filePath, time : currentTime , captureFormat, quality : captureFrameQuality , video } ) ;
12011201
12021202 shootConfetti ( ) ;
1203- if ( ! hideAllNotifications ) openDirToast ( { icon : 'success' , filePath : outPath , text : `${ i18n . t ( 'Screenshot captured to:' ) } ${ outPath } ` } ) ;
1203+ if ( ! hideAllNotifications ) openExportFinishedDialog ( { filePath : outPath , children : `${ i18n . t ( 'Screenshot captured to:' ) } ${ outPath } ` } ) ;
12041204 } , i18n . t ( 'Failed to capture frame' ) ) ;
12051205 } finally {
12061206 setWorking ( undefined ) ;
12071207 }
1208- } , [ filePath , workingRef , setWorking , withErrorHandling , getRelevantTime , videoRef , usingPreviewFile , captureFrameMethod , captureFrameFromFfmpeg , customOutDir , captureFormat , captureFrameQuality , captureFrameFromTag , hideAllNotifications ] ) ;
1208+ } , [ filePath , workingRef , setWorking , withErrorHandling , getRelevantTime , videoRef , usingPreviewFile , captureFrameMethod , captureFrameFromFfmpeg , customOutDir , captureFormat , captureFrameQuality , captureFrameFromTag , hideAllNotifications , openExportFinishedDialog ] ) ;
12091209
12101210 const extractSegmentsFramesAsImages = useCallback ( async ( segments : SegmentBase [ ] ) => {
12111211 if ( ! filePath || detectedFps == null || workingRef . current || segments . length === 0 ) return ;
@@ -1242,7 +1242,7 @@ function App() {
12421242 }
12431243 if ( ! hideAllNotifications && lastOutPath != null ) {
12441244 showOsNotification ( i18n . t ( 'Frames have been extracted' ) ) ;
1245- openDirToast ( { icon : 'success' , filePath : lastOutPath , text : i18n . t ( 'Frames extracted to: {{path}}' , { path : outputDir } ) } ) ;
1245+ openExportFinishedDialog ( { filePath : lastOutPath , children : i18n . t ( 'Frames extracted to: {{path}}' , { path : outputDir } ) } ) ;
12461246 }
12471247 } catch ( err ) {
12481248 showOsNotification ( i18n . t ( 'Failed to extract frames' ) ) ;
@@ -1251,7 +1251,7 @@ function App() {
12511251 setWorking ( undefined ) ;
12521252 setProgress ( undefined ) ;
12531253 }
1254- } , [ filePath , detectedFps , workingRef , getFrameCount , setWorking , hideAllNotifications , captureFramesRange , customOutDir , captureFormat , captureFrameQuality , captureFrameFileNameFormat , showOsNotification , outputDir , handleError ] ) ;
1254+ } , [ filePath , detectedFps , workingRef , getFrameCount , setWorking , hideAllNotifications , captureFramesRange , customOutDir , captureFormat , captureFrameQuality , captureFrameFileNameFormat , showOsNotification , openExportFinishedDialog , outputDir , handleError ] ) ;
12551255
12561256 const extractCurrentSegmentFramesAsImages = useCallback ( ( ) => {
12571257 if ( currentCutSeg != null ) extractSegmentsFramesAsImages ( [ currentCutSeg ] ) ;
@@ -1579,7 +1579,7 @@ function App() {
15791579 const [ firstExtractedPath ] = await extractStreams ( { customOutDir, streams : mainCopiedStreams } ) ;
15801580 if ( ! hideAllNotifications && firstExtractedPath != null ) {
15811581 showOsNotification ( i18n . t ( 'All tracks have been extracted' ) ) ;
1582- openDirToast ( { icon : 'success' , filePath : firstExtractedPath , text : i18n . t ( 'All streams have been extracted as separate files' ) } ) ;
1582+ openExportFinishedDialog ( { filePath : firstExtractedPath , children : i18n . t ( 'All streams have been extracted as separate files' ) } ) ;
15831583 }
15841584 } catch ( err ) {
15851585 showOsNotification ( i18n . t ( 'Failed to extract tracks' ) ) ;
@@ -1593,7 +1593,7 @@ function App() {
15931593 } finally {
15941594 setWorking ( undefined ) ;
15951595 }
1596- } , [ confirmDialog , customOutDir , extractStreams , filePath , hideAllNotifications , mainCopiedStreams , setWorking , showOsNotification , t , workingRef ] ) ;
1596+ } , [ confirmDialog , customOutDir , extractStreams , filePath , hideAllNotifications , mainCopiedStreams , openExportFinishedDialog , setWorking , showOsNotification , t , workingRef ] ) ;
15971597
15981598
15991599 const askStartTimeOffset = useCallback ( async ( ) => {
@@ -2125,7 +2125,7 @@ function App() {
21252125 const [ firstExtractedPath ] = await extractStreams ( { customOutDir, streams : mainStreams . filter ( ( s ) => s . index === index ) } ) ;
21262126 if ( ! hideAllNotifications && firstExtractedPath != null ) {
21272127 showOsNotification ( i18n . t ( 'Track has been extracted' ) ) ;
2128- openDirToast ( { icon : 'success' , filePath : firstExtractedPath , text : i18n . t ( 'Track has been extracted' ) } ) ;
2128+ openExportFinishedDialog ( { filePath : firstExtractedPath , children : i18n . t ( 'Track has been extracted' ) } ) ;
21292129 }
21302130 } catch ( err ) {
21312131 showOsNotification ( i18n . t ( 'Failed to extract track' ) ) ;
@@ -2139,7 +2139,7 @@ function App() {
21392139 } finally {
21402140 setWorking ( undefined ) ;
21412141 }
2142- } , [ customOutDir , extractStreams , filePath , hideAllNotifications , mainStreams , setWorking , showOsNotification , workingRef ] ) ;
2142+ } , [ customOutDir , extractStreams , filePath , hideAllNotifications , mainStreams , openExportFinishedDialog , setWorking , showOsNotification , workingRef ] ) ;
21432143
21442144 const batchFilePaths = useMemo ( ( ) => batchFiles . map ( ( f ) => f . path ) , [ batchFiles ] ) ;
21452145
0 commit comments