From c741520fd561e26410a43ff2182c5e1f97c0a719 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 22 Dec 2023 13:50:09 +0800 Subject: [PATCH] rename action and remove dupe --- public/menu.js | 4 ++-- src/App.jsx | 11 +++++------ src/components/KeyboardShortcuts.jsx | 6 +----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/public/menu.js b/public/menu.js index 6b4b8c01..57a5050e 100644 --- a/public/menu.js +++ b/public/menu.js @@ -138,7 +138,7 @@ module.exports = ({ app, mainWindow, newVersion, isStoreBuild }) => { { label: esc(t('Start times as YouTube Chapters')), click() { - mainWindow.webContents.send('exportEdlYouTube'); + mainWindow.webContents.send('exportYouTube'); }, }, ], @@ -337,7 +337,7 @@ module.exports = ({ app, mainWindow, newVersion, isStoreBuild }) => { { label: esc(t('Set custom start offset/timecode')), click() { - mainWindow.webContents.send('askSetStartTimeOffset'); + mainWindow.webContents.send('setStartTimeOffset'); }, }, { diff --git a/src/App.jsx b/src/App.jsx index 5f94e540..8489e391 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1693,7 +1693,7 @@ const App = memo(() => { } }, [customOutDir, filePath, html5ifyAndLoad, hasVideo, hasAudio, rememberConvertToSupportedFormat, setWorking]); - const askSetStartTimeOffset = useCallback(async () => { + const askStartTimeOffset = useCallback(async () => { const newStartTimeOffset = await promptTimeOffset({ initialValue: startTimeOffset !== undefined ? formatDuration({ seconds: startTimeOffset }) : undefined, title: i18n.t('Set custom start time offset'), @@ -1900,7 +1900,7 @@ const App = memo(() => { }, [isFileOpened, selectedSegments]); const mainActions = useMemo(() => { - async function exportEdlYouTube() { + async function exportYouTube() { if (!checkFileOpened()) return; await openYouTubeChaptersDialog(formatYouTube(apparentCutSegments)); @@ -1998,7 +1998,7 @@ const App = memo(() => { toggleKeyframeCutMode: () => toggleKeyframeCut(true), toggleCaptureFormat, toggleStripAudio, - setStartTimeOffset: askSetStartTimeOffset, + setStartTimeOffset: askStartTimeOffset, deselectAllSegments, selectAllSegments, selectOnlyCurrentSegment, @@ -2013,9 +2013,8 @@ const App = memo(() => { reloadFile: () => setCacheBuster((v) => v + 1), quit: () => quitApp(), closeCurrentFile: () => { closeFileWithConfirm(); }, - exportEdlYouTube, + exportYouTube, showStreamsSelector: handleShowStreamsSelectorClick, - askSetStartTimeOffset, html5ify: () => userHtml5ifyCurrentFile({ ignoreRememberedValue: true }), openFilesDialog, toggleKeyboardShortcuts, @@ -2026,7 +2025,7 @@ const App = memo(() => { detectSceneChanges, createSegmentsFromKeyframes, }; - }, [addSegment, alignSegmentTimesToKeyframes, apparentCutSegments, askSetStartTimeOffset, batchFileJump, batchOpenSelectedFile, captureSnapshot, captureSnapshotAsCoverArt, changePlaybackRate, checkFileOpened, cleanupFilesDialog, clearSegments, closeBatch, closeFileWithConfirm, combineOverlappingSegments, combineSelectedSegments, concatBatch, convertFormatBatch, copySegmentsToClipboard, createFixedDurationSegments, createNumSegments, createRandomSegments, createSegmentsFromKeyframes, currentSegIndexSafe, cutSegmentsHistory, deselectAllSegments, detectBlackScenes, detectSceneChanges, detectSilentScenes, duplicateCurrentSegment, extractAllStreams, extractCurrentSegmentFramesAsImages, extractSelectedSegmentsFramesAsImages, fillSegmentsGaps, goToTimecode, handleShowStreamsSelectorClick, increaseRotation, invertAllSegments, invertSelectedSegments, jumpCutEnd, jumpCutStart, jumpSeg, jumpTimelineEnd, jumpTimelineStart, keyboardNormalSeekSpeed, keyboardSeekAccFactor, onExportPress, onLabelSegment, openFilesDialog, openSendReportDialogWithState, pause, play, removeCutSegment, removeSelectedSegments, reorderSegsByStartTime, seekClosestKeyframe, seekRel, seekRelPercent, selectAllSegments, selectOnlyCurrentSegment, setCutEnd, setCutStart, setPlaybackVolume, shiftAllSegmentTimes, shortStep, shuffleSegments, splitCurrentSegment, timelineToggleComfortZoom, toggleCaptureFormat, toggleCurrentSegmentSelected, toggleKeyboardShortcuts, toggleKeyframeCut, toggleLastCommands, toggleLoopSelectedSegments, togglePlay, toggleSegmentsList, toggleSettings, toggleStreamsSelector, toggleStripAudio, tryFixInvalidDuration, userHtml5ifyCurrentFile, zoomRel]); + }, [addSegment, alignSegmentTimesToKeyframes, apparentCutSegments, askStartTimeOffset, batchFileJump, batchOpenSelectedFile, captureSnapshot, captureSnapshotAsCoverArt, changePlaybackRate, checkFileOpened, cleanupFilesDialog, clearSegments, closeBatch, closeFileWithConfirm, combineOverlappingSegments, combineSelectedSegments, concatBatch, convertFormatBatch, copySegmentsToClipboard, createFixedDurationSegments, createNumSegments, createRandomSegments, createSegmentsFromKeyframes, currentSegIndexSafe, cutSegmentsHistory, deselectAllSegments, detectBlackScenes, detectSceneChanges, detectSilentScenes, duplicateCurrentSegment, extractAllStreams, extractCurrentSegmentFramesAsImages, extractSelectedSegmentsFramesAsImages, fillSegmentsGaps, goToTimecode, handleShowStreamsSelectorClick, increaseRotation, invertAllSegments, invertSelectedSegments, jumpCutEnd, jumpCutStart, jumpSeg, jumpTimelineEnd, jumpTimelineStart, keyboardNormalSeekSpeed, keyboardSeekAccFactor, onExportPress, onLabelSegment, openFilesDialog, openSendReportDialogWithState, pause, play, removeCutSegment, removeSelectedSegments, reorderSegsByStartTime, seekClosestKeyframe, seekRel, seekRelPercent, selectAllSegments, selectOnlyCurrentSegment, setCutEnd, setCutStart, setPlaybackVolume, shiftAllSegmentTimes, shortStep, shuffleSegments, splitCurrentSegment, timelineToggleComfortZoom, toggleCaptureFormat, toggleCurrentSegmentSelected, toggleKeyboardShortcuts, toggleKeyframeCut, toggleLastCommands, toggleLoopSelectedSegments, togglePlay, toggleSegmentsList, toggleSettings, toggleStreamsSelector, toggleStripAudio, tryFixInvalidDuration, userHtml5ifyCurrentFile, zoomRel]); const getKeyboardAction = useCallback((action) => mainActions[action], [mainActions]); diff --git a/src/components/KeyboardShortcuts.jsx b/src/components/KeyboardShortcuts.jsx index 133a43db..1ef3097f 100644 --- a/src/components/KeyboardShortcuts.jsx +++ b/src/components/KeyboardShortcuts.jsx @@ -524,10 +524,6 @@ const KeyboardShortcuts = memo(({ name: t('Copy selected segments times to clipboard'), category: otherCategory, }, - askSetStartTimeOffset: { - name: t('Set custom start offset/timecode'), - category: otherCategory, - }, toggleSettings: { name: t('Settings'), category: otherCategory, @@ -540,7 +536,7 @@ const KeyboardShortcuts = memo(({ name: t('Open'), category: otherCategory, }, - exportEdlYouTube: { + exportYouTube: { name: t('Start times as YouTube Chapters'), category: otherCategory, },