override fun doOKAction()

in plugin/src/main/kotlin/org/jetbrains/downloadThis/ui/DownloadAnyLinkDialog.kt [102:117]


    override fun doOKAction() {
        super.doOKAction()

        val destinationDir = when (downloadInProjectRoot.isSelected) {
            true -> defaultDestinationDir
            false -> {
                val folderDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
                val chosenFolder = FileChooser.chooseFile(folderDescriptor, project, null)
                chosenFolder?.canonicalPath ?: defaultDestinationDir
            }
        }

        extractLinks().forEach { link ->
            DownloadLauncher.runDownloadInBackground(project, link, destinationDir)
        }
    }