mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[plugins] IJPL-173011 FUS: no download events for opening download page of suggested IDE
(cherry picked from commit 2506805c5995b4401be327b07143d9c2647ef7cf) IJ-CR-151331 GitOrigin-RevId: 477a992c91ec7eee47f8c0b0099911216a3a3bb3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
604b412918
commit
19d6ad45a2
@@ -664,7 +664,7 @@ fun tryUltimate(
|
||||
val eventSource = fusEventSource ?: FUSEventSource.EDITOR
|
||||
if (Registry.`is`("ide.try.ultimate.automatic.installation") && project != null) {
|
||||
eventSource.logTryUltimate(project, pluginId)
|
||||
project.service<UltimateInstallationService>().install(pluginId, suggestedIde)
|
||||
project.service<UltimateInstallationService>().install(pluginId, suggestedIde, eventSource)
|
||||
}
|
||||
else {
|
||||
fallback?.invoke() ?: eventSource.openDownloadPageAndLog(project = project,
|
||||
|
||||
@@ -61,16 +61,19 @@ class UltimateInstallationService(
|
||||
}
|
||||
}
|
||||
|
||||
fun install(pluginId: PluginId? = null, suggestedIde: SuggestedIde) {
|
||||
fun install(pluginId: PluginId? = null, suggestedIde: SuggestedIde, eventSource: FUSEventSource) {
|
||||
if (!canBeAutoInstalled(suggestedIde)) {
|
||||
eventSource.openDownloadPageAndLog(project = project,
|
||||
url = suggestedIde.defaultDownloadUrl,
|
||||
suggestedIde = suggestedIde,
|
||||
pluginId = pluginId)
|
||||
return
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
installerLock.withLock {
|
||||
withBackgroundProgress(project, IdeBundle.message("plugins.advertiser.try.ultimate.upgrade", suggestedIde.name), true) {
|
||||
if (!canBeAutoInstalled(suggestedIde)) {
|
||||
useFallback(pluginId, suggestedIde.defaultDownloadUrl)
|
||||
return@withBackgroundProgress
|
||||
}
|
||||
|
||||
val productData = UpdateChecker.loadProductData(null)
|
||||
val status = if (Registry.`is`("ide.try.ultimate.use.eap")) ChannelStatus.EAP else ChannelStatus.RELEASE
|
||||
val build = productData?.channels?.firstOrNull { it.status == status }?.builds?.first() ?: return@withBackgroundProgress
|
||||
|
||||
Reference in New Issue
Block a user