Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Jun 20, 2024
1 parent 8079b46 commit 5af5b1b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
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

Expand All @@ -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") {
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 5af5b1b

Please sign in to comment.