Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ronove
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kaj Koivunen
Ronove
Commits
82d1ed91
Commit
82d1ed91
authored
2 years ago
by
Kaj Koivunen
Browse files
Options
Downloads
Patches
Plain Diff
loogisempi nimi luokalle
parent
a0a72ffb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/TranslationSettings.kt
+4
-4
4 additions, 4 deletions
src/main/kotlin/TranslationSettings.kt
with
4 additions
and
4 deletions
src/main/kotlin/Settings
View
.kt
→
src/main/kotlin/
Translation
Settings.kt
+
4
−
4
View file @
82d1ed91
...
@@ -8,7 +8,7 @@ import tornadofx.*
...
@@ -8,7 +8,7 @@ import tornadofx.*
/**
/**
* Window for selecting MTL service provider and setting its API key
* Window for selecting MTL service provider and setting its API key
*/
*/
class
Settings
View
:
View
(
"Settings"
)
{
class
Translation
Settings
:
View
(
"Settings"
)
{
private
lateinit
var
applyButton
:
Button
private
lateinit
var
applyButton
:
Button
val
toggleGroup
=
ToggleGroup
()
val
toggleGroup
=
ToggleGroup
()
private
var
backends
:
MutableList
<
MTLSettingsMenu
<
TranslationService
>>
=
mutableListOf
()
private
var
backends
:
MutableList
<
MTLSettingsMenu
<
TranslationService
>>
=
mutableListOf
()
...
@@ -27,8 +27,8 @@ class SettingsView : View("Settings") {
...
@@ -27,8 +27,8 @@ class SettingsView : View("Settings") {
this
@form
+=
this
this
@form
+=
this
}
}
MTLSettingsMenu
(
this
@Settings
View
,
"DeepL"
)
{
DeepLTranslator
(
it
)
}.
add
()
MTLSettingsMenu
(
this
@
Translation
Settings
,
"DeepL"
)
{
DeepLTranslator
(
it
)
}.
add
()
MTLSettingsMenu
(
this
@Settings
View
,
"Google Translate API v2"
)
{
GoogleTranslator
(
it
)
}.
add
()
MTLSettingsMenu
(
this
@
Translation
Settings
,
"Google Translate API v2"
)
{
GoogleTranslator
(
it
)
}.
add
()
hbox
{
hbox
{
applyButton
=
button
(
"Apply"
)
{
applyButton
=
button
(
"Apply"
)
{
...
@@ -61,7 +61,7 @@ class SettingsView : View("Settings") {
...
@@ -61,7 +61,7 @@ class SettingsView : View("Settings") {
/**
/**
* UI Fragment to implement a settings menu for a translation backend requiring one API key as string
* UI Fragment to implement a settings menu for a translation backend requiring one API key as string
*/
*/
private
class
MTLSettingsMenu
<
T
:
TranslationService
>(
private
val
parent
:
Settings
View
,
val
name
:
String
,
val
constructor
:
(
String
)
->
T
)
private
class
MTLSettingsMenu
<
T
:
TranslationService
>(
private
val
parent
:
Translation
Settings
,
val
name
:
String
,
val
constructor
:
(
String
)
->
T
)
:
Fragment
(
name
)
{
:
Fragment
(
name
)
{
private
lateinit
var
statusLabel
:
Label
private
lateinit
var
statusLabel
:
Label
private
lateinit
var
keyField
:
PasswordField
private
lateinit
var
keyField
:
PasswordField
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment