From 13940341604144fe17dc71643919d2aab270da10 Mon Sep 17 00:00:00 2001 From: huangyuhui Date: Wed, 16 Aug 2017 12:02:04 +0800 Subject: [PATCH] Settings page refined --- .../main/kotlin/org/jackhuang/hmcl/Main.kt | 4 +- .../org/jackhuang/hmcl/game/LauncherHelper.kt | 2 +- .../org/jackhuang/hmcl/setting/Config.kt | 2 +- .../org/jackhuang/hmcl/setting/Profile.kt | 4 +- .../org/jackhuang/hmcl/setting/Settings.kt | 68 +++++++++-------- .../hmcl/setting/SettingsConstants.kt | 2 +- .../jackhuang/hmcl/setting/VersionSetting.kt | 8 +- .../org/jackhuang/hmcl/ui/AccountsPage.kt | 2 +- .../jackhuang/hmcl/ui/LeftPaneController.kt | 12 +-- .../kotlin/org/jackhuang/hmcl/ui/MainPage.kt | 6 +- .../main/kotlin/org/jackhuang/hmcl/ui/SVG.kt | 8 +- .../org/jackhuang/hmcl/ui/SettingsPage.kt | 36 +++++---- .../hmcl/ui/VersionSettingsController.kt | 1 + .../jackhuang/hmcl/ui/construct/FileItem.kt | 73 +++++++++++++++++++ .../hmcl/ui/{ => construct}/IconedItem.kt | 2 +- .../ui/{ => construct}/NumberValidator.kt | 2 +- .../{ => construct}/RenderedPartlyTexture.kt | 2 +- .../ui/{ => construct}/RipplerContainer.kt | 6 +- .../hmcl/ui/{ => construct}/UTF8Control.kt | 2 +- .../main/resources/assets/fxml/setting.fxml | 5 +- .../assets/fxml/version-settings.fxml | 11 +-- 21 files changed, 161 insertions(+), 97 deletions(-) create mode 100644 HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/construct/FileItem.kt rename HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/{ => construct}/IconedItem.kt (96%) rename HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/{ => construct}/NumberValidator.kt (97%) rename HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/{ => construct}/RenderedPartlyTexture.kt (98%) rename HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/{ => construct}/RipplerContainer.kt (98%) rename HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/{ => construct}/UTF8Control.kt (98%) diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/Main.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/Main.kt index 4625070e1..c771be57f 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/Main.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/Main.kt @@ -22,12 +22,10 @@ import javafx.stage.Stage import org.jackhuang.hmcl.setting.Settings import org.jackhuang.hmcl.task.Scheduler import org.jackhuang.hmcl.ui.Controllers -import org.jackhuang.hmcl.ui.UTF8Control import org.jackhuang.hmcl.util.DEFAULT_USER_AGENT import org.jackhuang.hmcl.util.LOG import org.jackhuang.hmcl.util.OS import java.io.File -import java.util.* import java.util.logging.Level fun i18n(key: String): String { @@ -83,6 +81,6 @@ class Main : Application() { Scheduler.shutdown() } - val RESOURCE_BUNDLE = Settings.LANG.resourceBundle + val RESOURCE_BUNDLE = Settings.locale.resourceBundle } } \ No newline at end of file diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/game/LauncherHelper.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/game/LauncherHelper.kt index adbca095c..3fbae0544 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/game/LauncherHelper.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/game/LauncherHelper.kt @@ -31,7 +31,7 @@ object LauncherHelper { repository = repository, versionId = profile.selectedVersion, options = profile.getVersionSetting(profile.selectedVersion).toLaunchOptions(profile.gameDir), - account = account.logIn(Settings.PROXY) + account = account.logIn(Settings.proxy) ) profile.dependency.checkGameCompletionAsync(version) diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Config.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Config.kt index 3dab5d06d..6d0c6d496 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Config.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Config.kt @@ -37,7 +37,7 @@ class Config { Settings.save() } @SerializedName("commonpath") - var commonpath: File = Main.getMinecraftDirectory() + var commonpath: String = Main.getMinecraftDirectory().absolutePath set(value) { field = value Settings.save() diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Profile.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Profile.kt index 18bd61f60..860a6b31b 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Profile.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Profile.kt @@ -19,12 +19,10 @@ package org.jackhuang.hmcl.setting import com.google.gson.* import javafx.beans.InvalidationListener -import org.jackhuang.hmcl.download.BMCLAPIDownloadProvider import org.jackhuang.hmcl.download.DefaultDependencyManager import org.jackhuang.hmcl.game.HMCLGameRepository import org.jackhuang.hmcl.mod.ModManager import org.jackhuang.hmcl.util.* -import org.jackhuang.hmcl.util.property.ImmediateBooleanProperty import org.jackhuang.hmcl.util.property.ImmediateObjectProperty import org.jackhuang.hmcl.util.property.ImmediateStringProperty import java.io.File @@ -41,7 +39,7 @@ class Profile(var name: String = "Default", initialGameDir: File = File(".minecr var gameDir: File by gameDirProperty var repository = HMCLGameRepository(initialGameDir) - val dependency: DefaultDependencyManager get() = DefaultDependencyManager(repository, Settings.DOWNLOAD_PROVIDER, Settings.PROXY) + val dependency: DefaultDependencyManager get() = DefaultDependencyManager(repository, Settings.downloadProvider, Settings.proxy) var modManager = ModManager(repository) init { diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Settings.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Settings.kt index f804d4231..4736de5f6 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Settings.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/Settings.kt @@ -33,6 +33,7 @@ import org.jackhuang.hmcl.auth.Account import org.jackhuang.hmcl.util.* import org.jackhuang.hmcl.event.EVENT_BUS import org.jackhuang.hmcl.util.property.ImmediateObjectProperty +import org.jackhuang.hmcl.util.property.ImmediateStringProperty import java.net.Authenticator import java.net.InetSocketAddress import java.net.PasswordAuthentication @@ -46,14 +47,14 @@ object Settings { .registerTypeAdapter(File::class.java, FileTypeAdapter) .setPrettyPrinting().create() - val DEFAULT_PROFILE = "Default" - val HOME_PROFILE = "Home" + const val DEFAULT_PROFILE = "Default" + const val HOME_PROFILE = "Home" - val SETTINGS_FILE = File("hmcl.json").absoluteFile + val SETTINGS_FILE: File = File("hmcl.json").absoluteFile private val SETTINGS: Config - private val ACCOUNTS = mutableMapOf() + private val accounts = mutableMapOf() init { SETTINGS = initSettings(); @@ -72,7 +73,7 @@ object Settings { continue } - ACCOUNTS[name] = account + accounts[name] = account } save() @@ -117,7 +118,7 @@ object Settings { fun save() { try { SETTINGS.accounts.clear() - for ((name, account) in ACCOUNTS) { + for ((name, account) in accounts) { val storage = account.toStorage() storage["type"] = Accounts.getAccountType(account) SETTINGS.accounts[name] = storage @@ -129,37 +130,46 @@ object Settings { } } - var LANG: Locales.SupportedLocale = Locales.getLocaleByName(SETTINGS.localization) + val commonPathProperty = object : ImmediateStringProperty(this, "commonPath", SETTINGS.commonpath) { + override fun invalidated() { + super.invalidated() + + SETTINGS.commonpath = get() + } + } + var commonPath: String by commonPathProperty + + var locale: Locales.SupportedLocale = Locales.getLocaleByName(SETTINGS.localization) set(value) { field = value SETTINGS.localization = Locales.getNameByLocal(value) } - var PROXY: Proxy = Proxy.NO_PROXY - var PROXY_TYPE: Proxy.Type? = Proxies.getProxyType(SETTINGS.proxyType) + var proxy: Proxy = Proxy.NO_PROXY + var proxyType: Proxy.Type? = Proxies.getProxyType(SETTINGS.proxyType) set(value) { field = value SETTINGS.proxyType = Proxies.PROXIES.indexOf(value) loadProxy() } - var PROXY_HOST: String? get() = SETTINGS.proxyHost; set(value) { SETTINGS.proxyHost = value } - var PROXY_PORT: String? get() = SETTINGS.proxyPort; set(value) { SETTINGS.proxyPort = value } - var PROXY_USER: String? get() = SETTINGS.proxyUserName; set(value) { SETTINGS.proxyUserName = value } - var PROXY_PASS: String? get() = SETTINGS.proxyPassword; set(value) { SETTINGS.proxyPassword = value } + var proxyHost: String? get() = SETTINGS.proxyHost; set(value) { SETTINGS.proxyHost = value } + var proxyPort: String? get() = SETTINGS.proxyPort; set(value) { SETTINGS.proxyPort = value } + var proxyUser: String? get() = SETTINGS.proxyUserName; set(value) { SETTINGS.proxyUserName = value } + var proxyPass: String? get() = SETTINGS.proxyPassword; set(value) { SETTINGS.proxyPassword = value } private fun loadProxy() { - val host = PROXY_HOST - val port = PROXY_PORT?.toIntOrNull() + val host = proxyHost + val port = proxyPort?.toIntOrNull() if (host == null || host.isBlank() || port == null) - PROXY = Proxy.NO_PROXY + proxy = Proxy.NO_PROXY else { - System.setProperty("http.proxyHost", PROXY_HOST) - System.setProperty("http.proxyPort", PROXY_PORT) - PROXY = Proxy(PROXY_TYPE, InetSocketAddress(host, port)) + System.setProperty("http.proxyHost", proxyHost) + System.setProperty("http.proxyPort", proxyPort) + proxy = Proxy(proxyType, InetSocketAddress(host, port)) - val user = PROXY_USER - val pass = PROXY_PASS + val user = proxyUser + val pass = proxyPass if (user != null && user.isNotBlank() && pass != null && pass.isNotBlank()) { System.setProperty("http.proxyUser", user) System.setProperty("http.proxyPassword", pass) @@ -175,7 +185,7 @@ object Settings { init { loadProxy() } - var DOWNLOAD_PROVIDER: DownloadProvider + var downloadProvider: DownloadProvider get() = when (SETTINGS.downloadtype) { 0 -> MojangDownloadProvider 1 -> BMCLAPIDownloadProvider @@ -196,15 +206,15 @@ object Settings { val selectedAccountProperty = object : ImmediateObjectProperty(this, "selectedAccount", getAccount(SETTINGS.selectedAccount)) { override fun get(): Account? { val a = super.get() - if (a == null || !ACCOUNTS.containsKey(a.username)) { - val acc = if (ACCOUNTS.isEmpty()) null else ACCOUNTS.values.first() + if (a == null || !accounts.containsKey(a.username)) { + val acc = if (accounts.isEmpty()) null else accounts.values.first() set(acc) return acc } else return a } override fun set(newValue: Account?) { - if (newValue == null || ACCOUNTS.containsKey(newValue.username)) { + if (newValue == null || accounts.containsKey(newValue.username)) { super.set(newValue) } } @@ -218,19 +228,19 @@ object Settings { var selectedAccount: Account? by selectedAccountProperty fun addAccount(account: Account) { - ACCOUNTS[account.username] = account + accounts[account.username] = account } fun getAccount(name: String): Account? { - return ACCOUNTS[name] + return accounts[name] } fun getAccounts(): Map { - return Collections.unmodifiableMap(ACCOUNTS) + return Collections.unmodifiableMap(accounts) } fun deleteAccount(name: String) { - ACCOUNTS.remove(name) + accounts.remove(name) selectedAccountProperty.get() } diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/SettingsConstants.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/SettingsConstants.kt index 93cd52ae6..159190724 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/SettingsConstants.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/SettingsConstants.kt @@ -23,7 +23,7 @@ import org.jackhuang.hmcl.auth.OfflineAccount import org.jackhuang.hmcl.auth.yggdrasil.YggdrasilAccount import org.jackhuang.hmcl.download.BMCLAPIDownloadProvider import org.jackhuang.hmcl.download.MojangDownloadProvider -import org.jackhuang.hmcl.ui.UTF8Control +import org.jackhuang.hmcl.ui.construct.UTF8Control import java.net.Proxy import java.util.* diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/VersionSetting.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/VersionSetting.kt index f7b4b669c..d9c2dab87 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/VersionSetting.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/setting/VersionSetting.kt @@ -207,10 +207,10 @@ class VersionSetting() { fullscreen = fullscreen, serverIp = serverIp, wrapper = wrapper, - proxyHost = Settings.PROXY_HOST, - proxyPort = Settings.PROXY_PORT, - proxyUser = Settings.PROXY_USER, - proxyPass = Settings.PROXY_PASS, + proxyHost = Settings.proxyHost, + proxyPort = Settings.proxyPort, + proxyUser = Settings.proxyUser, + proxyPass = Settings.proxyPass, precalledCommand = precalledCommand, noGeneratedJVMArgs = noJVMArgs ) diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/AccountsPage.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/AccountsPage.kt index ed89c30a5..c642ad20e 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/AccountsPage.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/AccountsPage.kt @@ -143,7 +143,7 @@ class AccountsPage() : StackPane(), DecoratorPage { else -> throw UnsupportedOperationException() } - account.logIn(Settings.PROXY) + account.logIn(Settings.proxy) account } catch (e: Exception) { e diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/LeftPaneController.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/LeftPaneController.kt index 88bb031ca..f82748491 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/LeftPaneController.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/LeftPaneController.kt @@ -18,19 +18,11 @@ package org.jackhuang.hmcl.ui import com.jfoenix.controls.JFXComboBox -import javafx.beans.value.ChangeListener import javafx.scene.layout.* -import javafx.scene.paint.Paint -import org.jackhuang.hmcl.ProfileChangedEvent -import org.jackhuang.hmcl.ProfileLoadingEvent -import org.jackhuang.hmcl.auth.Account -import org.jackhuang.hmcl.event.EVENT_BUS -import org.jackhuang.hmcl.event.RefreshedVersionsEvent -import org.jackhuang.hmcl.game.LauncherHelper -import org.jackhuang.hmcl.game.minecraftVersion import org.jackhuang.hmcl.i18n import org.jackhuang.hmcl.setting.Settings -import org.jackhuang.hmcl.ui.download.DownloadWizardProvider +import org.jackhuang.hmcl.ui.construct.IconedItem +import org.jackhuang.hmcl.ui.construct.RipplerContainer class LeftPaneController(private val leftPane: AdvancedListBox) { val versionsPane = VBox() diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/MainPage.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/MainPage.kt index c5fb7f47c..566bd5726 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/MainPage.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/MainPage.kt @@ -22,24 +22,20 @@ import com.jfoenix.controls.JFXMasonryPane import javafx.application.Platform import javafx.beans.property.SimpleStringProperty import javafx.beans.property.StringProperty -import javafx.beans.value.ChangeListener import javafx.fxml.FXML import javafx.scene.Node import javafx.scene.control.ToggleGroup import javafx.scene.layout.StackPane -import javafx.scene.paint.Paint import org.jackhuang.hmcl.ProfileChangedEvent import org.jackhuang.hmcl.ProfileLoadingEvent -import org.jackhuang.hmcl.auth.Account import org.jackhuang.hmcl.event.EVENT_BUS import org.jackhuang.hmcl.event.RefreshedVersionsEvent import org.jackhuang.hmcl.game.LauncherHelper -import org.jackhuang.hmcl.game.Version import org.jackhuang.hmcl.game.minecraftVersion import org.jackhuang.hmcl.i18n import org.jackhuang.hmcl.setting.Profile import org.jackhuang.hmcl.setting.Settings -import org.jackhuang.hmcl.ui.download.DownloadWizardProvider +import org.jackhuang.hmcl.ui.construct.RipplerContainer import org.jackhuang.hmcl.ui.wizard.DecoratorPage /** diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SVG.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SVG.kt index 00ff04a2e..3056b19b3 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SVG.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SVG.kt @@ -59,9 +59,7 @@ object SVG { fun expand(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z", fill, width, height) fun collapse(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z", fill, width, height) fun navigate(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z", fill, width, height) - fun launch(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M1008 6.286q18.857 13.714 15.429 36.571l-146.286 877.714q-2.857 16.571-18.286 25.714-8 4.571-17.714 4.571-6.286 " - + "0-13.714-2.857l-258.857-105.714-138.286 168.571q-10.286 13.143-28 13.143-7.429 " - + "0-12.571-2.286-10.857-4-17.429-13.429t-6.571-20.857v-199.429l493.714-605.143-610.857 " - + "528.571-225.714-92.571q-21.143-8-22.857-31.429-1.143-22.857 18.286-33.714l950.857-548.571q8.571-5.143 18.286-5.143" - + " 11.429 0 20.571 6.286z", fill, width, height) + fun launch(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M1008 6.286q18.857 13.714 15.429 36.571l-146.286 877.714q-2.857 16.571-18.286 25.714-8 4.571-17.714 4.571-6.286 0-13.714-2.857l-258.857-105.714-138.286 168.571q-10.286 13.143-28 13.143-7.429 0-12.571-2.286-10.857-4-17.429-13.429t-6.571-20.857v-199.429l493.714-605.143-610.857 528.571-225.714-92.571q-21.143-8-22.857-31.429-1.143-22.857 18.286-33.714l950.857-548.571q8.571-5.143 18.286-5.14311.429 0 20.571 6.286z", fill, width, height) + fun pencil(fill: String = "white", width: Double = 20.0, height: Double = 20.0) = createSVGPath("M20.71,4.04C21.1,3.65 21.1,3 20.71,2.63L18.37,0.29C18,-0.1 17.35,-0.1 16.96,0.29L15,2.25L18.75,6M17.75,7L14,3.25L4,13.25V17H7.75L17.75,7Z", fill, width, height) + } \ No newline at end of file diff --git a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SettingsPage.kt b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SettingsPage.kt index 643d51ba1..6a2d49882 100644 --- a/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SettingsPage.kt +++ b/HMCL/src/main/kotlin/org/jackhuang/hmcl/ui/SettingsPage.kt @@ -19,7 +19,6 @@ package org.jackhuang.hmcl.ui import com.jfoenix.controls.JFXComboBox import com.jfoenix.controls.JFXTextField -import javafx.beans.binding.Bindings import javafx.beans.property.SimpleStringProperty import javafx.beans.property.StringProperty import javafx.collections.FXCollections @@ -31,6 +30,7 @@ import org.jackhuang.hmcl.setting.DownloadProviders import org.jackhuang.hmcl.setting.Locales import org.jackhuang.hmcl.setting.Proxies import org.jackhuang.hmcl.setting.Settings +import org.jackhuang.hmcl.ui.construct.FileItem import org.jackhuang.hmcl.ui.wizard.DecoratorPage class SettingsPage : StackPane(), DecoratorPage { @@ -43,6 +43,8 @@ class SettingsPage : StackPane(), DecoratorPage { @FXML lateinit var cboProxyType: JFXComboBox<*> @FXML lateinit var cboLanguage: JFXComboBox<*> @FXML lateinit var cboDownloadSource: JFXComboBox<*> + @FXML lateinit var fileCommonLocation: FileItem + @FXML lateinit var fileBackgroundLocation: FileItem init { loadFXML("/assets/fxml/setting.fxml") @@ -50,45 +52,47 @@ class SettingsPage : StackPane(), DecoratorPage { cboLanguage.limitWidth(400.0) cboDownloadSource.limitWidth(400.0) - txtProxyHost.text = Settings.PROXY_HOST + txtProxyHost.text = Settings.proxyHost txtProxyHost.textProperty().addListener { _, _, newValue -> - Settings.PROXY_HOST = newValue + Settings.proxyHost = newValue } - txtProxyPort.text = Settings.PROXY_PORT + txtProxyPort.text = Settings.proxyPort txtProxyPort.textProperty().addListener { _, _, newValue -> - Settings.PROXY_PORT = newValue + Settings.proxyPort = newValue } - txtProxyUsername.text = Settings.PROXY_USER + txtProxyUsername.text = Settings.proxyUser txtProxyUsername.textProperty().addListener { _, _, newValue -> - Settings.PROXY_USER = newValue + Settings.proxyUser = newValue } - txtProxyPassword.text = Settings.PROXY_PASS + txtProxyPassword.text = Settings.proxyPass txtProxyPassword.textProperty().addListener { _, _, newValue -> - Settings.PROXY_PASS = newValue + Settings.proxyPass = newValue } - cboDownloadSource.selectionModel.select(DownloadProviders.DOWNLOAD_PROVIDERS.indexOf(Settings.DOWNLOAD_PROVIDER)) + cboDownloadSource.selectionModel.select(DownloadProviders.DOWNLOAD_PROVIDERS.indexOf(Settings.downloadProvider)) cboDownloadSource.selectionModel.selectedIndexProperty().addListener { _, _, newValue -> - Settings.DOWNLOAD_PROVIDER = DownloadProviders.getDownloadProvider(newValue.toInt()) + Settings.downloadProvider = DownloadProviders.getDownloadProvider(newValue.toInt()) } val list = FXCollections.observableArrayList