diff --git a/src/lib/components/Dialog.svelte b/src/lib/components/Dialog.svelte
new file mode 100644
index 0000000..c45c5e1
--- /dev/null
+++ b/src/lib/components/Dialog.svelte
@@ -0,0 +1,324 @@
+
+
+
+
+{#if currentOpen}
+
diff --git a/src/lib/components/Settings.svelte b/src/lib/components/Settings.svelte
index bb91e95..090c97b 100644
--- a/src/lib/components/Settings.svelte
+++ b/src/lib/components/Settings.svelte
@@ -6,6 +6,7 @@
import { confirm } from '@tauri-apps/plugin-dialog';
import { getInstalledVersions, removeAllDesktopFilesForVersions } from '$lib/library.js';
import Button from '$lib/components/Button.svelte';
+ import { show } from '$lib/components/Dialog.svelte';
let { settings } = $props();
let changing = $state(false);
@@ -41,16 +42,19 @@
const newExists = await directoryExists(newLibraryPath);
let moveLibrary = false;
-
if (currentExists) {
let message = `Move existing library from\n${currentLibraryPath}\nto\n${newLibraryPath}?`;
if (newExists) {
message = `Library already exists at new location:\n${newLibraryPath}\n\nMoving will replace it. Continue?`;
}
- moveLibrary = await confirm(message, {
- title: 'Move Library',
- kind: 'warning'
+
+ const prompt = await show({
+ title: 'Move library ',
+ message: message,
+ buttons: ['Cancel', 'Continue'],
+ type: 'info'
});
+ moveLibrary = prompt === 'Continue';
}
if (moveLibrary) {
diff --git a/src/lib/components/VersionCard.svelte b/src/lib/components/VersionCard.svelte
index 6f5982b..b3e32fd 100644
--- a/src/lib/components/VersionCard.svelte
+++ b/src/lib/components/VersionCard.svelte
@@ -1,4 +1,5 @@
+
{version.version}
@@ -34,24 +65,18 @@
{
+ await handleDelete();
+ close();
+ }}>Delete
- {
+ await handleDefault();
+ close();
+ }}>Default
{/snippet}
diff --git a/src/lib/library.js b/src/lib/library.js
index f5144b8..ea7b5ea 100644
--- a/src/lib/library.js
+++ b/src/lib/library.js
@@ -219,14 +219,6 @@ export async function toggleFavourite(version) {
*/
export async function deleteVersion(version) {
try {
- const confirmation = await confirm(
- `This will remove the blender ${version.version} from your system. Are you sure?`,
- {
- title: 'Delete',
- kind: 'warning'
- }
- );
- if (!confirmation) return;
// Remove the version directory from disk
await removeVersion(version);
updateDownloadProgress(version.version, { loaded: 0, total: 0, percent: 0 });
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 6b1544e..347ec8e 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -9,6 +9,8 @@
import Library from '$lib/components/Library.svelte';
import Download from '$lib/components/Download.svelte';
import Settings from '$lib/components/Settings.svelte';
+ import Popup from '$lib/components/Popup.svelte';
+ import Dialog from '$lib/components/Dialog.svelte';
let fadeInSettings = { duration: 100 };
let fadeOutSettings = { duration: 100, delay: fadeInSettings.duration };
@@ -61,6 +63,9 @@
});
+
+
+