diff --git a/src/main/kotlin/main/Main.kt b/src/main/kotlin/main/Main.kt index 8268642..e28bbab 100644 --- a/src/main/kotlin/main/Main.kt +++ b/src/main/kotlin/main/Main.kt @@ -93,24 +93,9 @@ fun app() { glossairePage( onAjouterMotClick = { currentPage.value = "formulaire" }, onImporterClick = { - val fileDialog = FileDialog(Frame(), "Select a file", FileDialog.LOAD) - fileDialog.file = "Untitled.csv" // Initial file name - fileDialog.isMultipleMode = false // To enable selecting only one file - - fileDialog.setFile("*.csv") - fileDialog.isVisible = true - - val selectedFile = fileDialog.file - val selectedDirectory = fileDialog.directory - - if (selectedFile != null) { - val filePath = selectedDirectory + selectedFile - println("Opening: $filePath") - + selectFile(setOf("csv")) { filePath -> + println("Importing file: $filePath") importCSV(filePath) - - } else { - println("Open command cancelled by user.") } }, onExporterClick = {