INNER CODE UNIT · Kotlin

showPopUpMessage

Shabinder/SpotiFlyer · desktop/src/jvmMain/kotlin/Main.kt:128

                override fun showPopUpMessage(string: String, long: Boolean) {
                    if (::showToast.isInitialized) {
                        showToast(string)
                    }
                }

                override fun setDownloadDirectoryAction(callBack: (String) -> Unit) {
                    val fileChooser = JFileChooser().apply {
                        fileSelectionMode = JFileChooser.DIRECTORIES_ONLY
                    }
                    when (fileChooser.showOpenDialog(appWindow)) {
                        APPROVE_OPTION -> {
                            val directory = fileChooser.selectedFile
                            if (directory.canWrite()) {
                                preferenceManager.setDownloadDirectory(directory.absolutePath)
                                callBack(directory.absolutePath)
                                showPopUpMessage("${Strings.setDownloadDirectory()} \n${fileManager.defaultDir()}")
                            } else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…