201: Notification group was rewritten to Kotlin (no sam conversion)

This commit is contained in:
Nikolay Krasko
2020-01-29 17:37:36 +03:00
parent 034243b5e7
commit c9d97ae555
2 changed files with 30 additions and 26 deletions
@@ -13,6 +13,7 @@ import com.intellij.ide.plugins.*
import com.intellij.ide.util.PropertiesComponent import com.intellij.ide.util.PropertiesComponent
import com.intellij.notification.NotificationDisplayType import com.intellij.notification.NotificationDisplayType
import com.intellij.notification.NotificationGroup import com.intellij.notification.NotificationGroup
import com.intellij.notification.NotificationListener
import com.intellij.notification.NotificationType import com.intellij.notification.NotificationType
import com.intellij.openapi.Disposable import com.intellij.openapi.Disposable
import com.intellij.openapi.application.* import com.intellij.openapi.application.*
@@ -242,13 +243,13 @@ class KotlinPluginUpdater : Disposable {
val notification = notificationGroup.createNotification( val notification = notificationGroup.createNotification(
"Kotlin", "Kotlin",
"A new version ${update.pluginDescriptor.version} of the Kotlin plugin is available. <b><a href=\"#\">Install</a></b>", "A new version ${update.pluginDescriptor.version} of the Kotlin plugin is available. <b><a href=\"#\">Install</a></b>",
NotificationType.INFORMATION NotificationType.INFORMATION,
) { notification, _ -> NotificationListener { notification, _ ->
notification.expire() notification.expire()
installPluginUpdate(update) { installPluginUpdate(update) {
notifyPluginUpdateAvailable(update) notifyPluginUpdateAvailable(update)
} }
} })
notification.notify(null) notification.notify(null)
} }
@@ -303,13 +304,14 @@ class KotlinPluginUpdater : Disposable {
val notification = notificationGroup.createNotification( val notification = notificationGroup.createNotification(
"Kotlin", "Kotlin",
"Plugin update was not installed$fullMessage. <a href=\"#\">See the log for more information</a>", "Plugin update was not installed$fullMessage. <a href=\"#\">See the log for more information</a>",
NotificationType.INFORMATION NotificationType.INFORMATION,
) { notification, _ -> NotificationListener { notification, _ ->
val logFile = File(PathManager.getLogPath(), "idea.log") val logFile = File(PathManager.getLogPath(), "idea.log")
RevealFileAction.openFile(logFile) RevealFileAction.openFile(logFile)
notification.expire() notification.expire()
} }
)
notification.notify(null) notification.notify(null)
} }
@@ -13,6 +13,7 @@ import com.intellij.ide.plugins.*
import com.intellij.ide.util.PropertiesComponent import com.intellij.ide.util.PropertiesComponent
import com.intellij.notification.NotificationDisplayType import com.intellij.notification.NotificationDisplayType
import com.intellij.notification.NotificationGroup import com.intellij.notification.NotificationGroup
import com.intellij.notification.NotificationListener
import com.intellij.notification.NotificationType import com.intellij.notification.NotificationType
import com.intellij.openapi.Disposable import com.intellij.openapi.Disposable
import com.intellij.openapi.application.* import com.intellij.openapi.application.*
@@ -242,13 +243,13 @@ class KotlinPluginUpdater : Disposable {
val notification = notificationGroup.createNotification( val notification = notificationGroup.createNotification(
"Kotlin", "Kotlin",
"A new version ${update.pluginDescriptor.version} of the Kotlin plugin is available. <b><a href=\"#\">Install</a></b>", "A new version ${update.pluginDescriptor.version} of the Kotlin plugin is available. <b><a href=\"#\">Install</a></b>",
NotificationType.INFORMATION NotificationType.INFORMATION,
) { notification, _ -> NotificationListener { notification, _ ->
notification.expire() notification.expire()
installPluginUpdate(update) { installPluginUpdate(update) {
notifyPluginUpdateAvailable(update) notifyPluginUpdateAvailable(update)
} }
} })
notification.notify(null) notification.notify(null)
} }
@@ -303,13 +304,14 @@ class KotlinPluginUpdater : Disposable {
val notification = notificationGroup.createNotification( val notification = notificationGroup.createNotification(
"Kotlin", "Kotlin",
"Plugin update was not installed$fullMessage. <a href=\"#\">See the log for more information</a>", "Plugin update was not installed$fullMessage. <a href=\"#\">See the log for more information</a>",
NotificationType.INFORMATION NotificationType.INFORMATION,
) { notification, _ -> NotificationListener { notification, _ ->
val logFile = File(PathManager.getLogPath(), "idea.log") val logFile = File(PathManager.getLogPath(), "idea.log")
ShowFilePathAction.openFile(logFile) ShowFilePathAction.openFile(logFile)
notification.expire() notification.expire()
} }
)
notification.notify(null) notification.notify(null)
} }