Modify csv export and remove duplication from auto completion
parent
708cbd9522
commit
01fcd8690b
|
@ -107,6 +107,7 @@ fun formPage(glossary: Glossary, onCancelClick: () -> Unit) {
|
||||||
glossaryWords.forEach { word: Word ->
|
glossaryWords.forEach { word: Word ->
|
||||||
contextList = contextList + word.mainContext
|
contextList = contextList + word.mainContext
|
||||||
}
|
}
|
||||||
|
contextList = contextList.distinct()
|
||||||
|
|
||||||
var listToShow by remember(mainContext.value) {
|
var listToShow by remember(mainContext.value) {
|
||||||
mutableStateOf(contextList.filter { it.startsWith(mainContext.value, ignoreCase = true) })
|
mutableStateOf(contextList.filter { it.startsWith(mainContext.value, ignoreCase = true) })
|
||||||
|
|
|
@ -224,7 +224,7 @@ fun exportToCSV(glossary: Glossary, csvFilePath: String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
FileWriter(csvFilePath).use { fileWriter ->
|
FileWriter(csvFilePath + ".csv").use { fileWriter ->
|
||||||
fileWriter.write(csvContent)
|
fileWriter.write(csvContent)
|
||||||
}
|
}
|
||||||
exportedSuccessfully.value = true
|
exportedSuccessfully.value = true
|
||||||
|
|
|
@ -182,7 +182,7 @@ fun glossaryList(glossaries: List<Glossary>, onGlossarySelected: (Glossary) -> U
|
||||||
val scrollState = rememberLazyListState()
|
val scrollState = rememberLazyListState()
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
state = scrollState,
|
state = scrollState,
|
||||||
modifier = Modifier.padding(10.dp).width(250.dp).border(1.dp, Color.Black),
|
modifier = Modifier.padding(10.dp).width(250.dp).height(300.dp).border(1.dp, Color.Black),
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||||
) {
|
) {
|
||||||
if (glossaries.isEmpty()) {
|
if (glossaries.isEmpty()) {
|
||||||
|
|
|
@ -283,7 +283,7 @@ fun app() {
|
||||||
},
|
},
|
||||||
onExportClick = {
|
onExportClick = {
|
||||||
val fileDialog = FileDialog(Frame(), "Save as CSV", FileDialog.SAVE)
|
val fileDialog = FileDialog(Frame(), "Save as CSV", FileDialog.SAVE)
|
||||||
fileDialog.file = "glossaire_exporte.csv" // Initial file name
|
fileDialog.file = selectedGlossary?.name // Initial file name
|
||||||
fileDialog.isVisible = true
|
fileDialog.isVisible = true
|
||||||
val selectedFile = fileDialog.file
|
val selectedFile = fileDialog.file
|
||||||
val selectedDirectory = fileDialog.directory
|
val selectedDirectory = fileDialog.directory
|
||||||
|
|
|
@ -102,7 +102,7 @@ fun projectsPage(
|
||||||
contentColor = Color.White
|
contentColor = Color.White
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Text("Créer un nouveau project")
|
Text("Créer un nouveau projet")
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
|
|
Loading…
Reference in New Issue