Skip to content

Commit f24cc6a

Browse files
committed
feat: init recording local param for #54
1 parent 1575343 commit f24cc6a

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/main/kotlin/cc/unitmesh/devti/settings/custom/TeamPromptsConfigurable.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import com.intellij.openapi.options.BoundConfigurable
77
import com.intellij.openapi.project.Project
88
import com.intellij.openapi.ui.DialogPanel
99
import com.intellij.ui.dsl.builder.*
10+
import javax.swing.JCheckBox
1011
import javax.swing.JTextField
1112

1213
class PromptLibraryConfigurable(project: Project) : BoundConfigurable(AutoDevBundle.message("settings.external.team.prompts.name")) {
1314

1415
private val teamPromptsField = JTextField()
16+
private val recordingInLocalField = JCheckBox()
1517

1618
val settings = project.service<TeamPromptsProjectSettingsService>()
1719
val state = settings.state.copy()
@@ -26,10 +28,19 @@ class PromptLibraryConfigurable(project: Project) : BoundConfigurable(AutoDevBun
2628
prop = state::teamPromptsDir.toMutableProperty()
2729
)
2830
}
31+
row(AutoDevBundle.message("settings.external.team.prompts.recordingInLocal")) {
32+
fullWidthCell(recordingInLocalField)
33+
.bind(
34+
componentGet = { it.isSelected },
35+
componentSet = { component, value -> component.isSelected = value },
36+
prop = state::recordingInLocal.toMutableProperty()
37+
)
38+
}
2939

3040
onApply {
3141
settings.modify {
3242
it.teamPromptsDir = state.teamPromptsDir
43+
it.recordingInLocal = state.recordingInLocal
3344
}
3445
}
3546
}

src/main/kotlin/cc/unitmesh/devti/settings/custom/TeamPromptsSettingService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class TeamPromptsProjectSettingsService(
2020

2121
class TeamPromptsSettings : AdProjectSettingsBase<TeamPromptsSettings>() {
2222
var teamPromptsDir by property("prompts") { it.isEmpty() }
23+
var recordingInLocal by property(false)
2324

2425
override fun copy(): TeamPromptsSettings {
2526
val state = TeamPromptsSettings()

src/main/resources/messages/AutoDevBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ action.new.genius.cicd.github=Generate GitHub Actions
8686

8787
settings.external.team.prompts.path=Team Prompts Path
8888
settings.external.team.prompts.name=Team Prompts
89+
settings.external.team.prompts.recordingInLocal=Recording Instruction In Local

0 commit comments

Comments
 (0)