1
1
package com.vk.admstorm.utils
2
2
3
- import com.intellij.ide.util.PropertiesComponent
4
3
import com.intellij.openapi.application.ApplicationManager
5
4
import com.intellij.openapi.application.PathManager
6
5
import com.intellij.openapi.application.invokeAndWaitIfNeeded
7
- import com.intellij.openapi.application.invokeLater
8
6
import com.intellij.openapi.diagnostic.Logger
9
7
import com.intellij.openapi.diagnostic.logger
10
- import com.intellij.openapi.options.advanced.AdvancedSettings
11
8
import com.intellij.openapi.progress.PerformInBackgroundOption
12
9
import com.intellij.openapi.progress.ProgressIndicator
13
10
import com.intellij.openapi.progress.ProgressManager
@@ -20,8 +17,6 @@ import com.intellij.openapi.vfs.LocalFileSystem
20
17
import com.intellij.openapi.vfs.VirtualFile
21
18
import com.intellij.psi.PsiFile
22
19
import com.intellij.psi.PsiManager
23
- import com.intellij.ssh.config.SshConnectionConfigService
24
- import com.vk.admstorm.notifications.AdmNotification
25
20
import com.vk.admstorm.utils.extensions.toHex
26
21
import org.apache.commons.io.input.ReversedLinesFileReader
27
22
import java.awt.Toolkit
@@ -234,47 +229,4 @@ object MyUtils {
234
229
}
235
230
}, delay)
236
231
}
237
-
238
- fun changeSshConfiguration (configValue : Enum <SshConnectionConfigService .Kind >) {
239
- AdvancedSettings .setEnum(" ssh.config.backend" , configValue)
240
- }
241
-
242
- fun changeConfigurationProcess (project : Project ) {
243
- val sshSettingValue =
244
- AdvancedSettings .getEnum(" ssh.config.backend" , SshConnectionConfigService .Kind ::class .java)
245
- if (sshSettingValue == SshConnectionConfigService .Kind .LEGACY ) {
246
- return
247
- }
248
-
249
- val dntShow = PropertiesComponent .getInstance(project).getBoolean(" dntShowSshLegacy" )
250
- if (dntShow) {
251
- return
252
- } else {
253
- val isSshLegacy = PropertiesComponent .getInstance(project).getBoolean(" isSshLegacy" )
254
- if (isSshLegacy) {
255
- return
256
- }
257
-
258
- changeSshConfiguration(SshConnectionConfigService .Kind .LEGACY )
259
-
260
- AdmNotification (" We changed your ssh type to LEGACY" )
261
- .withActions(
262
- AdmNotification .Action (" Don`t show it again" ) { _, notification ->
263
- invokeLater {
264
- PropertiesComponent .getInstance(project).setValue(" dntShowSshLegacy" , true )
265
- notification.expire()
266
- }
267
- }
268
- ).withActions(
269
- AdmNotification .Action (" Rollback and turn off this notification" ) { _, notification ->
270
- invokeLater {
271
- changeSshConfiguration(SshConnectionConfigService .Kind .OPENSSH )
272
- PropertiesComponent .getInstance(project).setValue(" dntShowSshLegacy" , true )
273
- notification.expire()
274
- }
275
- }
276
- )
277
- .show(project)
278
- }
279
- }
280
232
}
0 commit comments