| 1 |
package org.iwakura.larcjb |
| 2 |
|
| 3 |
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory |
| 4 |
import com.intellij.openapi.options.BoundConfigurable |
| 5 |
import com.intellij.openapi.project.Project |
| 6 |
import com.intellij.openapi.ui.DialogPanel |
| 7 |
import com.intellij.ui.dsl.builder.* |
| 8 |
|
| 9 |
/** |
| 10 |
* Settings UI for Larc VCS configuration. |
| 11 |
* Accessible via Settings -> Version Control -> Larc |
| 12 |
*/ |
| 13 |
class LarcVcsConfigurable(private val project: Project) : BoundConfigurable("Larc") { |
| 14 |
|
| 15 |
private val settings = LarcVcsSettings.getInstance(project) |
| 16 |
|
| 17 |
override fun createPanel(): DialogPanel { |
| 18 |
return panel { |
| 19 |
group("Larc Executable") { |
| 20 |
row("Path to larc:") { |
| 21 |
val descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor() |
| 22 |
.withTitle("Select Larc Executable") |
| 23 |
textFieldWithBrowseButton(fileChooserDescriptor = descriptor, project = project) |
| 24 |
.bindText(settings::executablePath) |
| 25 |
.comment("Leave empty to use 'larc' from PATH") |
| 26 |
.align(AlignX.FILL) |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
group("Commit Settings") { |
| 31 |
row("Default author:") { |
| 32 |
textField() |
| 33 |
.bindText(settings::defaultAuthor) |
| 34 |
.comment("Used as default author for commits") |
| 35 |
.align(AlignX.FILL) |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|