Skip to content

Commit 58e833c

Browse files
committed
Remove local or wsl checkbox in settings
1 parent e9d1b7f commit 58e833c

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/settings/UTBotConfigurable.kt

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ import com.intellij.ui.dsl.builder.bindSelected
2020
import com.intellij.ui.dsl.builder.bindText
2121
import com.intellij.ui.dsl.builder.columns
2222
import com.intellij.ui.dsl.builder.panel
23-
import com.intellij.ui.layout.ComponentPredicate
2423
import kotlin.reflect.KMutableProperty0
2524
import org.utbot.cpp.clion.plugin.UTBot
2625
import org.utbot.cpp.clion.plugin.listeners.UTBotSettingsChangedListener
27-
import org.utbot.cpp.clion.plugin.ui.ObservableValue
2826
import org.utbot.cpp.clion.plugin.ui.sourceFoldersView.UTBotProjectViewPaneForSettings
2927
import org.utbot.cpp.clion.plugin.utils.commandLineEditor
30-
import org.utbot.cpp.clion.plugin.utils.isWindows
31-
import org.utbot.cpp.clion.plugin.utils.path
32-
import org.utbot.cpp.clion.plugin.utils.toWslFormatIfNeeded
3328
import java.awt.Dimension
3429

3530
class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
@@ -39,10 +34,9 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
3934
private val panel by lazy { createMainPanel() }
4035

4136
private val settings: UTBotProjectStoredSettings = myProject.service()
42-
private lateinit var portTextfield: JBTextField
37+
private lateinit var portTextField: JBTextField
4338
private lateinit var serverNameTextField: JBTextField
4439

45-
private val isLocalOrWsl = ObservableValue(settings.isLocalOrWslScenario)
4640

4741
init {
4842
myProject.messageBus.connect()
@@ -76,45 +70,19 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
7670
private fun Panel.createConnectionSettings() {
7771
row(UTBot.message("settings.project.port")) {
7872
intTextField().bindIntText(projectIndependentSettings::port).applyToComponent {
79-
portTextfield = this
73+
portTextField = this
8074
maximumSize = TEXT_FIELD_MAX_SIZE
8175
}
8276
}.rowComment(UTBot.message("deployment.utbotPort.description"))
8377

84-
row {
85-
checkBox("Local or WSL scenario")
86-
.bindSelected(settings::isLocalOrWslScenario)
87-
.applyToComponent {
88-
this.addActionListener {
89-
isLocalOrWsl.value = !isLocalOrWsl.value
90-
}
91-
}
92-
}
93-
94-
val enabledIfNotLocalOrWslScenario = object : ComponentPredicate() {
95-
override fun invoke(): Boolean = !isLocalOrWsl.value
96-
override fun addListener(listener: (Boolean) -> Unit) =
97-
isLocalOrWsl.addOnChangeListener { value -> listener(!value) }
98-
}
99-
10078
row(UTBot.message("settings.project.serverName")) {
10179
textField().bindText(projectIndependentSettings::serverName).applyToComponent {
10280
serverNameTextField = this
103-
isLocalOrWsl.addOnChangeListener { newValue ->
104-
if (newValue)
105-
this.text = "localhost"
106-
}
107-
}.enabledIf(enabledIfNotLocalOrWslScenario)
81+
}
10882
}.rowComment(UTBot.message("deployment.utbotHost.description"))
10983

11084
row(UTBot.message("settings.project.remotePath")) {
11185
textField().bindText(settings::remotePath).columns(COLUMNS_LARGE)
112-
.applyToComponent {
113-
isLocalOrWsl.addOnChangeListener { newValue ->
114-
if (newValue)
115-
this.text = if (isWindows) myProject.path.toWslFormatIfNeeded() else ""
116-
}
117-
}.enabledIf(enabledIfNotLocalOrWslScenario)
11886
}.rowComment(UTBot.message("deployment.remotePath.description"))
11987
}
12088

@@ -223,7 +191,7 @@ class UTBotConfigurable(private val myProject: Project) : BoundConfigurable(
223191

224192
override fun apply() {
225193
val wereConnectionSettingsModified =
226-
portTextfield.text != projectIndependentSettings.port.toString() || serverNameTextField.text != projectIndependentSettings.serverName
194+
portTextField.text != projectIndependentSettings.port.toString() || serverNameTextField.text != projectIndependentSettings.serverName
227195
panel.apply()
228196
myProject.settings.fireUTBotSettingsChanged()
229197
if (wereConnectionSettingsModified)

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/settings/UTBotProjectStoredSettings.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class UTBotProjectStoredSettings(val project: Project) : PersistentStateComponen
3333
var generateForStaticFunctions: Boolean = true,
3434
var useStubs: Boolean = true,
3535
var useDeterministicSearcher: Boolean = true,
36-
var isLocalOrWslScenario: Boolean = false,
3736
var verbose: Boolean = false,
3837
var timeoutPerFunction: Int = 0,
3938
var timeoutPerTest: Int = 30
@@ -78,12 +77,6 @@ class UTBotProjectStoredSettings(val project: Project) : PersistentStateComponen
7877
myState.useDeterministicSearcher = value
7978
}
8079

81-
var isLocalOrWslScenario: Boolean
82-
get() = myState.isLocalOrWslScenario
83-
set(value) {
84-
myState.isLocalOrWslScenario = value
85-
}
86-
8780
var verbose: Boolean
8881
get() = myState.verbose
8982
set(value) {

0 commit comments

Comments
 (0)