1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 10:22:31 +01:00

add setting for export confirm

in settings page
This commit is contained in:
Mikael Finstad 2023-09-23 11:46:44 +08:00
parent 877bcdbdf2
commit 5f7d66b547
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -49,7 +49,7 @@ const Settings = memo(({
const { t } = useTranslation(); const { t } = useTranslation();
const [showAdvanced, setShowAdvanced] = useState(!simpleMode); const [showAdvanced, setShowAdvanced] = useState(!simpleMode);
const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, ffmpegExperimental, setFfmpegExperimental, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat, enableNativeHevc, setEnableNativeHevc, enableUpdateCheck, setEnableUpdateCheck, allowMultipleInstances, setAllowMultipleInstances, preferStrongColors, setPreferStrongColors, treatInputFileModifiedTimeAsStart, setTreatInputFileModifiedTimeAsStart, treatOutputFileModifiedTimeAsStart, setTreatOutputFileModifiedTimeAsStart } = useUserSettings(); const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, ffmpegExperimental, setFfmpegExperimental, hideNotifications, setHideNotifications, autoLoadTimecode, setAutoLoadTimecode, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat, enableNativeHevc, setEnableNativeHevc, enableUpdateCheck, setEnableUpdateCheck, allowMultipleInstances, setAllowMultipleInstances, preferStrongColors, setPreferStrongColors, treatInputFileModifiedTimeAsStart, setTreatInputFileModifiedTimeAsStart, treatOutputFileModifiedTimeAsStart, setTreatOutputFileModifiedTimeAsStart, exportConfirmEnabled, toggleExportConfirmEnabled } = useUserSettings();
const onLangChange = useCallback((e) => { const onLangChange = useCallback((e) => {
const { value } = e.target; const { value } = e.target;
@ -414,16 +414,16 @@ const Settings = memo(({
<Header title={t('Prompts and dialogs')} /> <Header title={t('Prompts and dialogs')} />
<Row> <Row>
<KeyCell>{t('Show informational notifications')}</KeyCell> <KeyCell>{t('Show export options screen before exporting?')}</KeyCell>
<td> <td>
<Switch checked={!hideNotifications} onCheckedChange={(v) => setHideNotifications(v ? undefined : 'all')} /> <Switch checked={exportConfirmEnabled} onCheckedChange={toggleExportConfirmEnabled} />
</td> </td>
</Row> </Row>
<Row> <Row>
<KeyCell>{t('Ask about what to do when opening a new file when another file is already already open?')}</KeyCell> <KeyCell>{t('Show informational notifications')}</KeyCell>
<td> <td>
<Switch checked={enableAskForFileOpenAction} onCheckedChange={setEnableAskForFileOpenAction} /> <Switch checked={!hideNotifications} onCheckedChange={(v) => setHideNotifications(v ? undefined : 'all')} />
</td> </td>
</Row> </Row>
@ -434,12 +434,23 @@ const Settings = memo(({
</td> </td>
</Row> </Row>
{showAdvanced && (
<Row>
<KeyCell>{t('Ask about what to do when opening a new file when another file is already already open?')}</KeyCell>
<td>
<Switch checked={enableAskForFileOpenAction} onCheckedChange={setEnableAskForFileOpenAction} />
</td>
</Row>
)}
{showAdvanced && (
<Row> <Row>
<KeyCell>{t('Ask about importing chapters from opened file?')}</KeyCell> <KeyCell>{t('Ask about importing chapters from opened file?')}</KeyCell>
<td> <td>
<Switch checked={enableAskForImportChapters} onCheckedChange={setEnableAskForImportChapters} /> <Switch checked={enableAskForImportChapters} onCheckedChange={setEnableAskForImportChapters} />
</td> </td>
</Row> </Row>
)}
</tbody> </tbody>
</table> </table>
</> </>