|
1 | 1 | <script lang="ts"> |
2 | | - import CopyDialog from '../../file-operations/copy/CopyDialog.svelte' |
3 | | - import CopyProgressDialog from '../../file-operations/copy/CopyProgressDialog.svelte' |
4 | | - import CopyErrorDialog from '../../file-operations/copy/CopyErrorDialog.svelte' |
| 2 | + import TransferDialog from '../../file-operations/transfer/TransferDialog.svelte' |
| 3 | + import TransferProgressDialog from '../../file-operations/transfer/TransferProgressDialog.svelte' |
| 4 | + import TransferErrorDialog from '../../file-operations/transfer/TransferErrorDialog.svelte' |
5 | 5 | import NewFolderDialog from '$lib/file-operations/mkdir/NewFolderDialog.svelte' |
6 | 6 | import AlertDialog from '$lib/ui/AlertDialog.svelte' |
7 | | - import type { CopyDialogPropsData } from './copy-operations' |
8 | | - import type { SortColumn, SortOrder, VolumeInfo, ConflictResolution, WriteOperationError } from '../types' |
| 7 | + import type { TransferDialogPropsData } from './transfer-operations' |
| 8 | + import type { |
| 9 | + TransferOperationType, |
| 10 | + SortColumn, |
| 11 | + SortOrder, |
| 12 | + VolumeInfo, |
| 13 | + ConflictResolution, |
| 14 | + WriteOperationError, |
| 15 | + } from '../types' |
9 | 16 |
|
10 | 17 | const { |
11 | | - showCopyDialog, |
12 | | - copyDialogProps, |
| 18 | + showTransferDialog, |
| 19 | + transferDialogProps, |
13 | 20 | volumes, |
14 | | - showCopyProgressDialog, |
15 | | - copyProgressProps, |
| 21 | + showTransferProgressDialog, |
| 22 | + transferProgressProps, |
16 | 23 | showNewFolderDialog, |
17 | 24 | newFolderDialogProps, |
18 | 25 | showAlertDialog, |
19 | 26 | alertDialogProps, |
20 | | - showCopyErrorDialog, |
21 | | - copyErrorProps, |
22 | | - onCopyConfirm, |
23 | | - onCopyCancel, |
24 | | - onCopyComplete, |
25 | | - onCopyCancelled, |
26 | | - onCopyError, |
27 | | - onCopyErrorClose, |
| 27 | + showTransferErrorDialog, |
| 28 | + transferErrorProps, |
| 29 | + onTransferConfirm, |
| 30 | + onTransferCancel, |
| 31 | + onTransferComplete, |
| 32 | + onTransferCancelled, |
| 33 | + onTransferError, |
| 34 | + onTransferErrorClose, |
28 | 35 | onNewFolderCreated, |
29 | 36 | onNewFolderCancel, |
30 | 37 | onAlertClose, |
31 | 38 | }: { |
32 | | - showCopyDialog: boolean |
33 | | - copyDialogProps: CopyDialogPropsData | null |
| 39 | + showTransferDialog: boolean |
| 40 | + transferDialogProps: TransferDialogPropsData | null |
34 | 41 | volumes: VolumeInfo[] |
35 | | - showCopyProgressDialog: boolean |
36 | | - copyProgressProps: { |
| 42 | + showTransferProgressDialog: boolean |
| 43 | + transferProgressProps: { |
| 44 | + operationType: TransferOperationType |
37 | 45 | sourcePaths: string[] |
38 | 46 | sourceFolderPath: string |
39 | 47 | destinationPath: string |
|
55 | 63 | } | null |
56 | 64 | showAlertDialog: boolean |
57 | 65 | alertDialogProps: { title: string; message: string } | null |
58 | | - showCopyErrorDialog: boolean |
59 | | - copyErrorProps: { error: WriteOperationError } | null |
60 | | - onCopyConfirm: ( |
| 66 | + showTransferErrorDialog: boolean |
| 67 | + transferErrorProps: { operationType: TransferOperationType; error: WriteOperationError } | null |
| 68 | + onTransferConfirm: ( |
61 | 69 | destination: string, |
62 | 70 | volumeId: string, |
63 | 71 | previewId: string | null, |
64 | 72 | conflictResolution: ConflictResolution, |
65 | 73 | ) => void |
66 | | - onCopyCancel: () => void |
67 | | - onCopyComplete: (filesProcessed: number, bytesProcessed: number) => void |
68 | | - onCopyCancelled: (filesProcessed: number) => void |
69 | | - onCopyError: (error: WriteOperationError) => void |
70 | | - onCopyErrorClose: () => void |
| 74 | + onTransferCancel: () => void |
| 75 | + onTransferComplete: (filesProcessed: number, bytesProcessed: number) => void |
| 76 | + onTransferCancelled: (filesProcessed: number) => void |
| 77 | + onTransferError: (error: WriteOperationError) => void |
| 78 | + onTransferErrorClose: () => void |
71 | 79 | onNewFolderCreated: (folderName: string) => void |
72 | 80 | onNewFolderCancel: () => void |
73 | 81 | onAlertClose: () => void |
74 | 82 | } = $props() |
75 | 83 | </script> |
76 | 84 |
|
77 | | -{#if showCopyDialog && copyDialogProps} |
78 | | - <CopyDialog |
79 | | - sourcePaths={copyDialogProps.sourcePaths} |
80 | | - destinationPath={copyDialogProps.destinationPath} |
81 | | - direction={copyDialogProps.direction} |
| 85 | +{#if showTransferDialog && transferDialogProps} |
| 86 | + <TransferDialog |
| 87 | + operationType={transferDialogProps.operationType} |
| 88 | + sourcePaths={transferDialogProps.sourcePaths} |
| 89 | + destinationPath={transferDialogProps.destinationPath} |
| 90 | + direction={transferDialogProps.direction} |
82 | 91 | {volumes} |
83 | | - currentVolumeId={copyDialogProps.currentVolumeId} |
84 | | - fileCount={copyDialogProps.fileCount} |
85 | | - folderCount={copyDialogProps.folderCount} |
86 | | - sourceFolderPath={copyDialogProps.sourceFolderPath} |
87 | | - sortColumn={copyDialogProps.sortColumn} |
88 | | - sortOrder={copyDialogProps.sortOrder} |
89 | | - sourceVolumeId={copyDialogProps.sourceVolumeId} |
90 | | - destVolumeId={copyDialogProps.destVolumeId} |
91 | | - onConfirm={onCopyConfirm} |
92 | | - onCancel={onCopyCancel} |
| 92 | + currentVolumeId={transferDialogProps.currentVolumeId} |
| 93 | + fileCount={transferDialogProps.fileCount} |
| 94 | + folderCount={transferDialogProps.folderCount} |
| 95 | + sourceFolderPath={transferDialogProps.sourceFolderPath} |
| 96 | + sortColumn={transferDialogProps.sortColumn} |
| 97 | + sortOrder={transferDialogProps.sortOrder} |
| 98 | + sourceVolumeId={transferDialogProps.sourceVolumeId} |
| 99 | + destVolumeId={transferDialogProps.destVolumeId} |
| 100 | + onConfirm={onTransferConfirm} |
| 101 | + onCancel={onTransferCancel} |
93 | 102 | /> |
94 | 103 | {/if} |
95 | 104 |
|
96 | | -{#if showCopyProgressDialog && copyProgressProps} |
97 | | - <CopyProgressDialog |
98 | | - sourcePaths={copyProgressProps.sourcePaths} |
99 | | - sourceFolderPath={copyProgressProps.sourceFolderPath} |
100 | | - destinationPath={copyProgressProps.destinationPath} |
101 | | - direction={copyProgressProps.direction} |
102 | | - sortColumn={copyProgressProps.sortColumn} |
103 | | - sortOrder={copyProgressProps.sortOrder} |
104 | | - previewId={copyProgressProps.previewId} |
105 | | - sourceVolumeId={copyProgressProps.sourceVolumeId} |
106 | | - destVolumeId={copyProgressProps.destVolumeId} |
107 | | - conflictResolution={copyProgressProps.conflictResolution} |
108 | | - onComplete={onCopyComplete} |
109 | | - onCancelled={onCopyCancelled} |
110 | | - onError={onCopyError} |
| 105 | +{#if showTransferProgressDialog && transferProgressProps} |
| 106 | + <TransferProgressDialog |
| 107 | + operationType={transferProgressProps.operationType} |
| 108 | + sourcePaths={transferProgressProps.sourcePaths} |
| 109 | + sourceFolderPath={transferProgressProps.sourceFolderPath} |
| 110 | + destinationPath={transferProgressProps.destinationPath} |
| 111 | + direction={transferProgressProps.direction} |
| 112 | + sortColumn={transferProgressProps.sortColumn} |
| 113 | + sortOrder={transferProgressProps.sortOrder} |
| 114 | + previewId={transferProgressProps.previewId} |
| 115 | + sourceVolumeId={transferProgressProps.sourceVolumeId} |
| 116 | + destVolumeId={transferProgressProps.destVolumeId} |
| 117 | + conflictResolution={transferProgressProps.conflictResolution} |
| 118 | + onComplete={onTransferComplete} |
| 119 | + onCancelled={onTransferCancelled} |
| 120 | + onError={onTransferError} |
111 | 121 | /> |
112 | 122 | {/if} |
113 | 123 |
|
|
127 | 137 | <AlertDialog title={alertDialogProps.title} message={alertDialogProps.message} onClose={onAlertClose} /> |
128 | 138 | {/if} |
129 | 139 |
|
130 | | -{#if showCopyErrorDialog && copyErrorProps} |
131 | | - <CopyErrorDialog error={copyErrorProps.error} onClose={onCopyErrorClose} /> |
| 140 | +{#if showTransferErrorDialog && transferErrorProps} |
| 141 | + <TransferErrorDialog |
| 142 | + operationType={transferErrorProps.operationType} |
| 143 | + error={transferErrorProps.error} |
| 144 | + onClose={onTransferErrorClose} |
| 145 | + /> |
132 | 146 | {/if} |
0 commit comments