Hide update plugin popup right after Intall was clicked to prevent multiple downloads
This commit is contained in:
committed by
Nikolay Krasko
parent
114d19e6d9
commit
4a361ebe60
@@ -155,12 +155,14 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
|
|||||||
NotificationType.INFORMATION) { notification, event ->
|
NotificationType.INFORMATION) { notification, event ->
|
||||||
val descriptor = descriptorToInstall ?: PluginManager.getPlugin(PluginId.getId("org.jetbrains.kotlin"))
|
val descriptor = descriptorToInstall ?: PluginManager.getPlugin(PluginId.getId("org.jetbrains.kotlin"))
|
||||||
if (descriptor != null) {
|
if (descriptor != null) {
|
||||||
|
notification.expire()
|
||||||
|
|
||||||
val pluginDownloader = PluginDownloader.createDownloader(descriptor, hostToInstallFrom, null)
|
val pluginDownloader = PluginDownloader.createDownloader(descriptor, hostToInstallFrom, null)
|
||||||
ProgressManager.getInstance().run(object : Task.Backgroundable(null, "Downloading plugins", true) {
|
ProgressManager.getInstance().run(object : Task.Backgroundable(null, "Downloading plugins", true) {
|
||||||
override fun run(indicator: ProgressIndicator) {
|
override fun run(indicator: ProgressIndicator) {
|
||||||
if (pluginDownloader.prepareToInstall(indicator)) {
|
if (pluginDownloader.prepareToInstall(indicator)) {
|
||||||
val descriptor = pluginDownloader.getDescriptor()
|
val pluginDescriptor = pluginDownloader.getDescriptor()
|
||||||
if (descriptor != null) {
|
if (pluginDescriptor != null) {
|
||||||
pluginDownloader.install()
|
pluginDownloader.install()
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater {
|
ApplicationManager.getApplication().invokeLater {
|
||||||
@@ -169,7 +171,10 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCancel() {
|
||||||
|
notifyPluginUpdateAvailable(newVersion, descriptorToInstall, hostToInstallFrom)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user