Skip to content

Commit 925dcb9

Browse files
committed
impl: ability to configure useAppNameAsTitle from UI settings
This is an option that more users would probably like to use.
1 parent a34d1dd commit 925dcb9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/main/kotlin/com/coder/toolbox/views/CoderSettingsPage.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
4141
TextField(context.i18n.ptrl("Data directory"), settings.dataDirectory ?: "", TextType.General)
4242
private val enableDownloadsField =
4343
CheckboxField(settings.enableDownloads, context.i18n.ptrl("Enable downloads"))
44+
private val useAppNameField =
45+
CheckboxField(settings.useAppNameAsTitle, context.i18n.ptrl("Use app name as main page title instead of URL"))
4446

4547
private val disableSignatureVerificationField = CheckboxField(
4648
settings.disableSignatureVerification,
@@ -95,6 +97,7 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
9597
listOf(
9698
binarySourceField,
9799
enableDownloadsField,
100+
useAppNameField,
98101
binaryDirectoryField,
99102
enableBinaryDirectoryFallbackField,
100103
disableSignatureVerificationField,
@@ -121,6 +124,7 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
121124
context.settingsStore.updateBinaryDirectory(binaryDirectoryField.contentState.value)
122125
context.settingsStore.updateDataDirectory(dataDirectoryField.contentState.value)
123126
context.settingsStore.updateEnableDownloads(enableDownloadsField.checkedState.value)
127+
context.settingsStore.updateUseAppNameAsTitle(useAppNameField.checkedState.value)
124128
context.settingsStore.updateDisableSignatureVerification(disableSignatureVerificationField.checkedState.value)
125129
context.settingsStore.updateSignatureFallbackStrategy(signatureFallbackStrategyField.checkedState.value)
126130
context.settingsStore.updateHttpClientLogLevel(httpLoggingField.selectedValueState.value)
@@ -164,6 +168,9 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
164168
enableDownloadsField.checkedState.update {
165169
settings.enableDownloads
166170
}
171+
useAppNameField.checkedState.update {
172+
settings.useAppNameAsTitle
173+
}
167174
signatureFallbackStrategyField.checkedState.update {
168175
settings.fallbackOnCoderForSignatures.isAllowed()
169176
}

src/main/resources/localization/defaultMessages.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,6 @@ msgstr ""
189189

190190
msgid "Workspace name"
191191
msgstr ""
192+
193+
msgid "Use app name as main page title instead of URL"
194+
msgstr ""

0 commit comments

Comments
 (0)