34 lines
903 B
Kotlin
34 lines
903 B
Kotlin
package org.hso.texturesyncclient.view.startupView
|
|
|
|
import kotlinx.coroutines.withTimeout
|
|
import org.hso.texturesyncclient.controller.RootController
|
|
import tornadofx.Controller
|
|
|
|
|
|
class StartupViewController : Controller() {
|
|
|
|
private val sv = find(StartupView::class)
|
|
private val rootc = find(RootController::class)
|
|
|
|
fun btnConnectAction(name: String) {
|
|
sv.labelStatus.text = "Verbinden ..."
|
|
sv.tfServerIP.isEditable = false
|
|
sv.btnConnect.isDisable = true
|
|
sv.spinnerStatus.isVisible = true
|
|
|
|
runAsync() {
|
|
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()
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|