Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification about not availability on Windows #234

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactoring
  • Loading branch information
Hidanio committed Jun 20, 2024
commit 5af5b1bea25bb23cdd5c42bc19c46b0839041a6b
20 changes: 2 additions & 18 deletions src/main/kotlin/com/vk/admstorm/AdmStormStartupActivity.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package com.vk.admstorm

import com.intellij.ide.util.PropertiesComponent
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.fileTypes.ex.FileTypeChooser
import com.intellij.openapi.fileTypes.impl.AbstractFileType
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.registry.Registry
import com.vk.admstorm.diagnostic.AdmStormLoggerFactory
import com.vk.admstorm.highlight.CppTypeHighlightPatcher
import com.vk.admstorm.notifications.AdmErrorNotification
import com.vk.admstorm.notifications.AdmNotification
import com.vk.admstorm.services.SentryService
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

@@ -42,20 +39,7 @@ class AdmStormStartupActivity : ProjectActivity {
return
}

//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()
}
}

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

measureTime(LOG, "patch cpp highlight") {
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()
}
}
}
}
Loading