TextureSync/client/src/main/kotlin/org/hso/texturesyncclient/view/startupView/StartupViewController.kt

39 lines
1.0 KiB
Kotlin
Raw Normal View History

package org.hso.texturesyncclient.view.startupView
2019-06-04 16:05:47 +02:00
import org.hso.texturesyncclient.controller.RootController
2019-06-04 18:20:09 +02:00
import org.hso.texturesyncclient.view.mainView.MainView
import tornadofx.Controller
2019-05-01 22:57:03 +02:00
class StartupViewController : Controller() {
2019-04-30 18:50:41 +02:00
2019-06-04 16:05:47 +02:00
private val sv = find(StartupView::class)
private val rootc = find(RootController::class)
2019-06-05 16:05:10 +02:00
fun setServerAddress(address: String){
sv.tfServerIP.text = address
sv.tfServerIP.isFocusTraversable = false
}
2019-06-04 16:05:47 +02:00
fun btnConnectAction(name: String) {
sv.labelStatus.text = "Verbinden ..."
sv.tfServerIP.isEditable = false
sv.btnConnect.isDisable = true
sv.spinnerStatus.isVisible = true
2019-06-04 18:20:09 +02:00
runAsync {
2019-06-04 16:05:47 +02:00
rootc.initConnection(name)
} ui {
// reset for later use
sv.spinnerStatus.isVisible = false
sv.labelStatus.text = "Verbindung zum Server einrichten"
sv.tfServerIP.isEditable = true
sv.btnConnect.isDisable = false
sv.tfServerIP.clear()
}
}
2019-05-01 22:57:03 +02:00
}