@@ -12,12 +12,14 @@ import com.intellij.ide.plugins.PluginManagerCore
12
12
import com.intellij.ide.ui.LafManager
13
13
import com.intellij.notification.Notification
14
14
import com.intellij.notification.NotificationGroupManager
15
+ import com.intellij.notification.NotificationListener
15
16
import com.intellij.notification.NotificationType
16
17
import com.intellij.openapi.actionSystem.DefaultActionGroup
17
18
import com.intellij.openapi.extensions.PluginId
18
19
import com.intellij.openapi.project.Project
19
20
import com.intellij.openapi.startup.StartupActivity
20
-
21
+ import java.awt.Desktop
22
+ import java.net.URI
21
23
22
24
23
25
class VSCodeStartupNotifyActivity : StartupActivity {
@@ -31,7 +33,7 @@ class VSCodeStartupNotifyActivity : StartupActivity {
31
33
private val updateContent: String by lazy {
32
34
// language=HTML
33
35
"""
34
- If you find this plugin useful consider sponsoring its development to ensure that the project is actively maintained and improved .
36
+ <a href='https://github.com/dinbtechit/vscode-theme/blob/main/CHANGELOG.md'>Click Here</a> to see the change logs .
35
37
""" .trimIndent()
36
38
}
37
39
@@ -65,7 +67,9 @@ class VSCodeStartupNotifyActivity : StartupActivity {
65
67
if (isReady && getPlugin()?.version != VSCodeThemeSettingsStore .instance.version) {
66
68
settings.version = getPlugin()!! .version
67
69
if (settings.alwaysApply) {
68
- VSCodeThemeManager .getInstance().switchToVSCodeTheme(selectedVSCodeTheme = settings.themeName)
70
+ if (settings.themeName != VSCodeTheme .UNKNOWN ) {
71
+ VSCodeThemeManager .getInstance().switchToVSCodeTheme(selectedVSCodeTheme = settings.themeName)
72
+ }
69
73
showNotificationPopup(project)
70
74
} else if (settings.showNotificationOnUpdate) {
71
75
showNotificationPopup(project)
@@ -114,7 +118,7 @@ class VSCodeStartupNotifyActivity : StartupActivity {
114
118
private fun createNotification (
115
119
title : String , content : String , type : NotificationType
116
120
): Notification {
117
- return NotificationGroupManager .getInstance()
121
+ val notification = NotificationGroupManager .getInstance()
118
122
.getNotificationGroup(" VSCode Theme Notification Group" )
119
123
.createNotification(content, type)
120
124
.setTitle(title)
@@ -131,6 +135,20 @@ class VSCodeStartupNotifyActivity : StartupActivity {
131
135
.addAction(DonateAction ())
132
136
.addAction(StarGithubRepoAction ())
133
137
// .addAction(DismissNotification(isVSCodeThemeSelected()))
138
+
139
+ notification.setListener(object : NotificationListener .Adapter () {
140
+ override fun hyperlinkActivated (notification : Notification , hyperlinkEvent : javax.swing.event.HyperlinkEvent ) {
141
+ // Open URL in default browser
142
+ if (Desktop .isDesktopSupported()) {
143
+ try {
144
+ Desktop .getDesktop().browse(URI (hyperlinkEvent.description))
145
+ } catch (e: Exception ) {
146
+ throw (Error (" Unable to view the change logs." , e))
147
+ }
148
+ }
149
+ }
150
+ })
151
+ return notification
134
152
}
135
153
136
154
private fun showFullNotification (project : Project , notification : Notification ) {
0 commit comments