diff --git a/src/main/kotlin/main/Main.kt b/src/main/kotlin/main/Main.kt index 73c653d..75ee2ae 100644 --- a/src/main/kotlin/main/Main.kt +++ b/src/main/kotlin/main/Main.kt @@ -134,9 +134,9 @@ fun app() { formulairePage(onAnnulerClick = { currentPage.value = "glossaire" }) } "choixLangage" -> { - val jsExtensions = setOf("js", "html") - val javaExtensions = setOf("java") val pythonExtensions = setOf("py") + val javaExtensions = setOf("java") + val jsExtensions = setOf("js", "html") choixLangagePage( onRetourClick = { currentPage.value = "accueil" }, onPythonClick = { @@ -160,7 +160,7 @@ fun app() { } } -fun selectFile(allowedExtensions: Set, onFileSelected: (String) -> Unit) { +fun selectFile(extensions: Set, onFileSelected: (String) -> Unit) { val fileDialog = FileDialog(Frame(), "Select a file", FileDialog.LOAD) fileDialog.isMultipleMode = false // To enable selecting only one file fileDialog.isVisible = true @@ -173,7 +173,7 @@ fun selectFile(allowedExtensions: Set, onFileSelected: (String) -> Unit) // Vérifier si l'extension est autorisée val fileExtension = File(filePath).extension.lowercase() - if (allowedExtensions.contains(fileExtension)) { + if (extensions.contains(fileExtension)) { println("Opening: $filePath") onFileSelected(filePath) } else {