diff --git a/src/locales/en.json b/src/locales/en.json index deb78e3..b958bd9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -434,6 +434,10 @@ "string": "Preview", "context": "Button to preview the project" }, + "resetAll": { + "string": "Reset All", + "context": "Button that resets all settings" + }, "download": { "string": "Download {filename} ({size}MB)", "context": "Download link" @@ -476,7 +480,11 @@ }, "confirm": { "string": "Are you sure you want to reset these settings? This cannot be undone.", - "context": "Prompt to confirm user wants to reset settings" + "context": "Prompt to confirm user wants to reset a specific subsection's settings" + }, + "confirmAll": { + "string": "Are you sure you want to reset ALL settings? This cannot be undone.", + "context": "Prompt to confirm user wants to reset ALL settings for the current project" } }, "preview": { diff --git a/src/p4/Button.svelte b/src/p4/Button.svelte index 5533dc9..7c3e8ad 100644 --- a/src/p4/Button.svelte +++ b/src/p4/Button.svelte @@ -1,8 +1,14 @@ - diff --git a/src/p4/PackagerOptions.svelte b/src/p4/PackagerOptions.svelte index 85f2dd4..3dae456 100644 --- a/src/p4/PackagerOptions.svelte +++ b/src/p4/PackagerOptions.svelte @@ -160,6 +160,15 @@ $options = $options; }; + const resetAll = () => { + if (confirm($_('reset.confirmAll'))) { + resetOptions(Object.keys($options)); + $icon = null; + $customCursorIcon = null; + $loadingScreenImage = null; + } + }; + onDestroy(() => { if (result) { URL.revokeObjectURL(result.url); @@ -206,6 +215,15 @@ padding: 10px; border-radius: 10px; } + .buttons { + display: flex; + } + .button { + margin-right: 4px; + } + .reset-button { + margin-left: auto; + }
-
{#if result}