one button

This commit is contained in:
Avently
2024-12-10 18:48:37 +07:00
parent 9b5e650af0
commit 63406bd806
2 changed files with 2 additions and 4 deletions
@@ -484,7 +484,6 @@
<string name="temporary_file_error">Temporary file error</string>
<string name="file_already_exists">File already exists</string>
<string name="what_would_you_like_to_do_with_file">What would you like to do?</string>
<string name="save_file_as">Save as %s</string>
<string name="overwrite_file">Overwrite file</string>
<!-- Voice messages -->
@@ -93,7 +93,6 @@ actual class FileChooserLauncher actual constructor() {
}
private fun showSaveRenameFileAlert(file: File, onResult: (URI?) -> Unit) {
val newFileName = uniqueCombine(file.name, file.parentFile.absoluteFile)
AlertManager.shared.showAlertDialogButtonsColumn(
title = generalGetString(MR.strings.file_already_exists),
text = generalGetString(MR.strings.what_would_you_like_to_do_with_file),
@@ -107,9 +106,9 @@ private fun showSaveRenameFileAlert(file: File, onResult: (URI?) -> Unit) {
}
SectionItemView({
AlertManager.shared.hideAlert()
onResult(File(file.parentFile, newFileName).toURI())
onResult(null)
}) {
Text(generalGetString(MR.strings.save_file_as).format(newFileName), Modifier.fillMaxWidth(), textAlign = TextAlign.Center, color = MaterialTheme.colors.primary)
Text(generalGetString(MR.strings.cancel_verb), Modifier.fillMaxWidth(), textAlign = TextAlign.Center, color = MaterialTheme.colors.primary)
}
}
},