feat(zns-import): DAT-Dateisupport hinzugefügt, Fehlerbehebung und UI-Anpassungen

Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
2026-04-16 16:12:49 +02:00
parent 29c35c524b
commit 3b7abc55a4
4 changed files with 31 additions and 12 deletions
@@ -1587,7 +1587,11 @@ fun ZnsImportWizardSection(
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Icon(Icons.Default.CloudUpload, contentDescription = null, tint = MaterialTheme.colorScheme.primary)
Text("ZNS-Stammdaten Import (ZIP)", style = MaterialTheme.typography.titleMedium, fontWeight = FontWeight.Bold)
Text(
"ZNS-Stammdaten Import (ZIP/DAT)",
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold
)
Spacer(Modifier.weight(1f))
if (state.isFinished || state.errorMessage != null) {
TextButton(onClick = onReset) {
@@ -1609,14 +1613,14 @@ fun ZnsImportWizardSection(
value = state.selectedFilePath ?: "",
onValueChange = {},
readOnly = true,
placeholder = { Text("ZNS.zip auswählen...") },
placeholder = { Text("ZNS-Datei auswählen (.zip, .dat)...") },
modifier = Modifier.weight(1f),
singleLine = true,
textStyle = MaterialTheme.typography.bodySmall
)
Button(
onClick = {
val path = pickZipFile()
val path = pickZnsFile()
if (path != null) onFileSelect(path)
},
enabled = !state.isUploading
@@ -1714,10 +1718,10 @@ fun ZnsImportWizardSection(
}
}
private fun pickZipFile(): String? {
private fun pickZnsFile(): String? {
val chooser = JFileChooser()
chooser.dialogTitle = "ZNS.zip auswählen"
chooser.fileFilter = FileNameExtensionFilter("ZIP-Archiv (*.zip)", "zip")
chooser.dialogTitle = "ZNS-Datei auswählen"
chooser.fileFilter = FileNameExtensionFilter("ZNS Dateien (*.zip, *.dat)", "zip", "dat")
chooser.isAcceptAllFileFilterUsed = false
val result = chooser.showOpenDialog(null)
return if (result == JFileChooser.APPROVE_OPTION) chooser.selectedFile.absolutePath else null