Desktop: drop per-row Delete; selection bar's Delete is the one path
Every row had a Delete button that duplicated the bulk bar (check a box -> Delete N). Removed it plus its now-dead single-file confirm dialog; deletion is checkbox + bar from now on. Detail screen keeps its own delete.
This commit is contained in:
parent
71b55715b4
commit
0b778e179d
1 changed files with 3 additions and 38 deletions
|
|
@ -193,7 +193,6 @@ fun LibraryScreen(state: DesktopState) {
|
||||||
val hits by state.searchResults.collectAsState()
|
val hits by state.searchResults.collectAsState()
|
||||||
val connected by state.connected.collectAsState()
|
val connected by state.connected.collectAsState()
|
||||||
var renaming by remember { mutableStateOf<File?>(null) }
|
var renaming by remember { mutableStateOf<File?>(null) }
|
||||||
var deleting by remember { mutableStateOf<File?>(null) }
|
|
||||||
var deletingMany by remember { mutableStateOf(false) }
|
var deletingMany by remember { mutableStateOf(false) }
|
||||||
var deleteNotice by remember { mutableStateOf<String?>(null) }
|
var deleteNotice by remember { mutableStateOf<String?>(null) }
|
||||||
val deleteWarning by state.deleteWarning.collectAsState()
|
val deleteWarning by state.deleteWarning.collectAsState()
|
||||||
|
|
@ -428,21 +427,9 @@ fun LibraryScreen(state: DesktopState) {
|
||||||
Text("Rename")
|
Text("Rename")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No "Open" button: clicking the card opens the
|
// No per-row Delete: select the checkbox and the
|
||||||
// recording (the button was redundant).
|
// bulk bar's Delete button does the same thing.
|
||||||
if (e.status != FileStatus.RUNNING) {
|
// No "Open" button either (clicking the card opens).
|
||||||
TextButton(
|
|
||||||
{ deleting = e.file },
|
|
||||||
content = {
|
|
||||||
Icon(Icons.Filled.Delete, contentDescription = null,
|
|
||||||
modifier = Modifier.size(18.dp),
|
|
||||||
tint = MaterialTheme.colorScheme.error)
|
|
||||||
Spacer(Modifier.width(4.dp))
|
|
||||||
Text("Delete",
|
|
||||||
color = MaterialTheme.colorScheme.error)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -490,28 +477,6 @@ fun LibraryScreen(state: DesktopState) {
|
||||||
style = MaterialTheme.typography.bodySmall)
|
style = MaterialTheme.typography.bodySmall)
|
||||||
}
|
}
|
||||||
|
|
||||||
deleting?.let { target ->
|
|
||||||
AlertDialog(
|
|
||||||
onDismissRequest = { deleting = null },
|
|
||||||
title = { Text("Delete recording?") },
|
|
||||||
text = {
|
|
||||||
Text("\"${target.nameWithoutExtension}\" and its saved " +
|
|
||||||
"transcript will be removed from this folder. If it " +
|
|
||||||
"was transcribed, the engine's copy is deleted too. " +
|
|
||||||
"This can't be undone from the app.")
|
|
||||||
},
|
|
||||||
confirmButton = {
|
|
||||||
TextButton({
|
|
||||||
deleteNotice = state.deleteFile(target)
|
|
||||||
deleting = null
|
|
||||||
}) { Text("Delete", color = MaterialTheme.colorScheme.error) }
|
|
||||||
},
|
|
||||||
dismissButton = {
|
|
||||||
TextButton({ deleting = null }) { Text("Cancel") }
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deletingMany) {
|
if (deletingMany) {
|
||||||
val victims = state.selectedFiles()
|
val victims = state.selectedFiles()
|
||||||
val names = victims.take(8).joinToString("\n") {
|
val names = victims.take(8).joinToString("\n") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue