-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notification about not availability on Windows (#234)
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/com/vk/admstorm/startup/WindowsAvailabilityStartup.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} | ||
} |