summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-19 16:39:33 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-19 16:39:33 +0000
commita313a2cd38efda34402faaa45b2dc210f9953844 (patch)
treea9d999c8fb7aa81e7409cfd56b5314a295c4040d
parent03829e5e391366781b133c225b4885d21303e634 (diff)
parent0668043a87e2f18fe4058812af4a20c5441be71a (diff)
downloadintellij-kotlin-a313a2cd38efda34402faaa45b2dc210f9953844.tar.gz
Snap for 8613677 from 0668043a87e2f18fe4058812af4a20c5441be71a to studio-dolphin-release
Change-Id: I83b7b02c7c49def9a221c09abd1d3a7870d121f7
-rw-r--r--plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/configuration/KotlinLanguageConfiguration.kt25
1 files changed, 21 insertions, 4 deletions
diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/configuration/KotlinLanguageConfiguration.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/configuration/KotlinLanguageConfiguration.kt
index 8ef39c401120..6ace4b13e1c3 100644
--- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/configuration/KotlinLanguageConfiguration.kt
+++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/configuration/KotlinLanguageConfiguration.kt
@@ -5,6 +5,7 @@ package org.jetbrains.kotlin.idea.configuration
import com.intellij.ide.IdeBundle
import com.intellij.openapi.options.Configurable
import com.intellij.openapi.options.SearchableConfigurable
+import com.intellij.openapi.ui.MessageDialogBuilder
import com.intellij.openapi.updateSettings.impl.UpdateSettings
import com.intellij.openapi.util.NlsSafe
import org.jetbrains.annotations.Nls
@@ -126,10 +127,26 @@ class KotlinLanguageConfiguration : SearchableConfigurable, Configurable.NoScrol
form.channelCombo.selectedIndex = savedChannel
form.channelCombo.addActionListener {
- val newChannel = form.channelCombo.selectedIndex
- if (newChannel != savedChannel) {
- savedChannel = newChannel
- checkForUpdates()
+ val selectedIndex = form.channelCombo.selectedIndex
+ if (selectedIndex != savedChannel) {
+ if (selectedIndex == UpdateChannel.EAP.ordinal) {
+ // Android Studio: if switching to the EAP channel, we require explicit confirmation from
+ // the user that they want to download Kotlin builds from JetBrains. This is putatively
+ // temporary until we have a broader solution for third-party plugins in general.
+ val legalese = "EAP Kotlin builds are provided by JetBrains and receive no support from Google. " +
+ "EAP builds are experimental and can potentially break Android Studio, requiring reinstallation. " +
+ "Would you like to continue?"
+ val confirmation = MessageDialogBuilder.okCancel("Switching to EAP Builds From JetBrains", legalese)
+ if (confirmation.ask(parentComponent = form.mainPanel)) {
+ savedChannel = selectedIndex
+ checkForUpdates()
+ } else {
+ form.channelCombo.selectedIndex = savedChannel
+ }
+ } else {
+ savedChannel = selectedIndex
+ checkForUpdates()
+ }
}
}