[go: nahoru, domu]

Skip to content

Commit

Permalink
remove deprecated API usages & bump to 2020.3 & should fix #40
Browse files Browse the repository at this point in the history
  • Loading branch information
izhangzhihao committed Aug 27, 2021
1 parent 3c0284d commit c63536b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 312 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {
}
implementation('io.timeandspace:cron-scheduler:0.1')
implementation('javazoom:jlayer:1.0.1')
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.10.+") {
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.+") {
exclude module: "kotlin-stdlib"
exclude module: "kotlin-reflect"
}
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
group="com.github.izhangzhihao"
name="Rainbow Fart"
org.gradle.parallel=true
ideaVersion=IU-201.6668.121
javaVersion=1.8
kotlinVersion=1.3.71
kotlinLanguageVersion=1.3
kotlinTargetVersion=1.3
version=1.3.3
ideaVersion=IU-203.5981.155
javaVersion=11
kotlinVersion=1.4.21
kotlinLanguageVersion=1.4
kotlinTargetVersion=1.4
version=1.3.4
publishChannels=Stable

This file was deleted.

10 changes: 3 additions & 7 deletions src/main/kotlin/com/github/izhangzhihao/rainbow/fart/Notify.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ import com.intellij.ui.BalloonLayoutData
import com.intellij.ui.awt.RelativePoint
import java.awt.Point

fun createNotification(title: String, content: String, displayId: String,
fun createNotification(title: String, content: String,
type: NotificationType, listener: NotificationListener): Notification {
val group = NotificationGroup(
displayId,
NotificationDisplayType.STICKY_BALLOON,
true
)
return group.createNotification(title, content, type, listener)
return NotificationGroupManager.getInstance().getNotificationGroup("Rainbow Farts Notification Group")
.createNotification(title, content, type).setListener(listener)
}

fun showFullNotification(project: Project, notification: Notification) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.github.izhangzhihao.rainbow.fart.settings.RainbowFartSettings
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.startup.StartupActionScriptManager
import com.intellij.ide.startup.StartupActionScriptManager.DeleteCommand
import com.intellij.notification.NotificationListener
import com.intellij.notification.NotificationType
import com.intellij.openapi.extensions.PluginId
Expand All @@ -27,7 +28,7 @@ class RainbowFartUpdateNotifyActivity : StartupActivity {
if (isInstalled) {
val pluginDescriptor = PluginManagerCore.getPlugin(pluginId)
if (pluginDescriptor != null) {
StartupActionScriptManager.addActionCommand(StartupActionScriptManager.DeleteCommand(pluginDescriptor.pluginPath.toFile()))
StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath))
}
}
}
Expand Down Expand Up @@ -74,7 +75,6 @@ class RainbowFartUpdateNotifyActivity : StartupActivity {
val notification = createNotification(
updateMsg(),
updateContent,
pluginId,
NotificationType.INFORMATION,
NotificationListener.UrlOpeningListener(false)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.izhangzhihao.rainbow.fart

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
Expand Down Expand Up @@ -38,7 +39,9 @@ class ResourcesLoader : StartupActivity {

val mapper = jacksonObjectMapper()

mapper.registerModule(KotlinModule(nullisSameAsDefault = true))
mapper.registerModule(KotlinModule(nullIsSameAsDefault = true))

mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)

val manifest: Manifest = mapper.readValue(current)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.izhangzhihao.rainbow.fart.settings

import com.intellij.openapi.components.ServiceManager.getService
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
Expand All @@ -23,7 +23,7 @@ class RainbowFartSettings : PersistentStateComponent<RainbowFartSettings> {

companion object {
val instance: RainbowFartSettings
get() = getService(RainbowFartSettings::class.java)
get() = ApplicationManager.getApplication().getService(RainbowFartSettings::class.java)

var isAppliedApplicationLevel = false
}
Expand Down
Loading

0 comments on commit c63536b

Please sign in to comment.