diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-05-09 18:09:24 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-05-09 18:09:24 +0300 |
| commit | 9b9c0f0594209b8c4ecdb7901293734ccf567437 (patch) | |
| tree | 0843cb07aa00ce80418f01a1ad083f72e45d7d93 /src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt | |
| parent | 1e30fa7ded9939fa45a45f82f84c1e8cd95d68aa (diff) | |
Finished implementing all the settings, mapping menu, trident list menu, and fixed all the bugs/issues.
Added more index actions for a total of 10 actions (compared to the original 4).
Updated README.md and TODO.md.
Changed version to 2.0.0.
Versions now follow the semver standard. which means that for each major version there will be backwards incompatible changes. for minor versions there will be new features and bug fixes. and for patch versions there will be bug fixes only.
Diffstat (limited to 'src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt')
| -rw-r--r-- | src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt b/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt index 6283a29..79c4fdc 100644 --- a/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt +++ b/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt @@ -4,7 +4,7 @@ package me.kyren223.trident.ui import com.intellij.openapi.options.Configurable import com.intellij.openapi.util.NlsContexts.ConfigurableName import me.kyren223.trident.data.SettingsData -import me.kyren223.trident.data.SettingsState +import me.kyren223.trident.data.Settings import javax.swing.JComponent class SettingsConfigurable : Configurable { @@ -21,7 +21,7 @@ class SettingsConfigurable : Configurable { } override fun isModified(): Boolean { - val settings = SettingsState.instance + val settings = Settings.state if (settings.width != this.settings!!.getWidth()) return true if (settings.height != this.settings!!.getHeight()) return true if (settings.fontSize != this.settings!!.getFontSize()) return true @@ -29,11 +29,12 @@ class SettingsConfigurable : Configurable { if (settings.automaticMapping != this.settings!!.getAutomaticMapping()) return true if (settings.recursiveMapping != this.settings!!.getRecursiveMapping()) return true if (settings.rememberLine != this.settings!!.getRememberLine()) return true + if (settings.indexCycling != this.settings!!.getIndexCycling()) return true return false } override fun apply() { - val settings = SettingsState.instance + val settings = Settings.state settings.width = this.settings!!.getWidth() settings.height = this.settings!!.getHeight() settings.fontSize = this.settings!!.getFontSize() @@ -41,10 +42,11 @@ class SettingsConfigurable : Configurable { settings.automaticMapping = this.settings!!.getAutomaticMapping() settings.recursiveMapping = this.settings!!.getRecursiveMapping() settings.rememberLine = this.settings!!.getRememberLine() + settings.indexCycling = this.settings!!.getIndexCycling() } override fun reset() { - val settings = SettingsState.instance + val settings = Settings.state if (this.settings == null) { this.settings = SettingsData() } @@ -55,6 +57,7 @@ class SettingsConfigurable : Configurable { this.settings!!.setAutomaticMapping(settings.automaticMapping) this.settings!!.setRecursiveMapping(settings.recursiveMapping) this.settings!!.setRememberLine(settings.rememberLine) + this.settings!!.setIndexCycling(settings.indexCycling) } override fun disposeUIResources() { |
