Skip to content

Commit

Permalink
Notification about not availability on Windows (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio authored Jun 24, 2024
1 parent 6520d60 commit 1aa04eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/com/vk/admstorm/AdmStormStartupActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.vk.admstorm.settings.AdmStormSettingsState
import com.vk.admstorm.ssh.SshConnectionService
import com.vk.admstorm.startup.ChangeSshBackendStartup
import com.vk.admstorm.startup.PluginsUpdateStartup
import com.vk.admstorm.startup.WindowsAvailabilityStartup
import com.vk.admstorm.utils.MyUtils.measureTime
import com.vk.admstorm.utils.extensions.pluginEnabled

Expand All @@ -38,6 +39,7 @@ class AdmStormStartupActivity : ProjectActivity {
return
}

WindowsAvailabilityStartup.checkAvailability(project)
ChangeSshBackendStartup.changeConfigurationProcess(project)

measureTime(LOG, "patch cpp highlight") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.vk.admstorm.startup

import com.intellij.ide.util.PropertiesComponent
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.SystemInfo
import com.vk.admstorm.notifications.AdmErrorNotification
import com.vk.admstorm.notifications.AdmNotification

object WindowsAvailabilityStartup {
fun checkAvailability(project: Project) {
//TODO: remove it after release AdmStorm on Windows
if (SystemInfo.isWindows) {
val properties = PropertiesComponent.getInstance(project)

if (!properties.getBoolean("windowsSupportNotification")) {
AdmErrorNotification("AdmStorm is not available on Windows yet").withActions(
AdmNotification.Action("Turn off this notification") { _, notification ->
properties.setValue("windowsSupportNotification", true)
notification.expire()
}
).show()
}
}
}
}

0 comments on commit 1aa04eb

Please sign in to comment.