route - track conversion

This commit is contained in:
vcoppe committed 2026-10-26 19:06:19 +01:00
1 parent b6c0f5190a
commit 764d0b233a
15 files changed
+268 -3

No files matched your search

+14
View File
@@ -48,6 +48,7 @@
Maximize2,
Minimize2,
FolderX,
ArrowRightLeft,
} from '@lucide/svelte';
import { map } from '$lib/components/map/map';
import { editMetadata } from '$lib/components/file-list/metadata/utils.svelte';
@@ -327,6 +328,19 @@
{i18n._('menu.new_segment')}
</Menubar.Item>
{/if}
{#if $selection.type === 'route' || $selection.type === 'track' || $selection.type === 'segment'}
{#if $selection.type !== 'track'}
<Menubar.Separator />
{/if}
<Menubar.Item onclick={() => engine.convert()}>
<ArrowRightLeft size="16" />
{i18n._(
$selection.type === 'route'
? 'menu.convert_to_track'
: 'menu.convert_to_route'
)}
</Menubar.Item>
{/if}
{/if}
<Menubar.Separator />
<Menubar.Item onclick={() => engine.selectAll()} disabled={noFiles}>
@@ -19,6 +19,7 @@
FileStack,
FileX,
Route,
ArrowRightLeft,
} from '@lucide/svelte';
import { getContext, untrack } from 'svelte';
import { i18n } from '$lib/i18n/i18n.svelte';
@@ -289,6 +290,14 @@
<Plus size="16" />
{i18n._('menu.new_segment')}
</ContextMenu.Item>
{/if}
{#if isPath || node.type === 'segment'}
<ContextMenu.Item onclick={() => engine.convert()}>
<ArrowRightLeft size="16" />
{i18n._(
node.type === 'route' ? 'menu.convert_to_track' : 'menu.convert_to_route'
)}
</ContextMenu.Item>
<ContextMenu.Separator />
{/if}
{/if}