some clean up
This commit is contained in:
		@ -1,8 +0,0 @@
 | 
			
		||||
package org.hso.texturesyncclient.controller
 | 
			
		||||
 | 
			
		||||
class NetworkController {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -241,10 +241,10 @@ class Connection(val address: InetAddress, val port: Int = 10796) : Closeable {
 | 
			
		||||
 | 
			
		||||
        when (val pkg = Package.read(io.first)) {
 | 
			
		||||
            is JsonPackage -> {
 | 
			
		||||
                if (pkg.content == JsonPrimitive(true)) {
 | 
			
		||||
                    // everthing is fine!
 | 
			
		||||
                when {
 | 
			
		||||
                    pkg.content == JsonPrimitive(true) -> // everthing is fine!
 | 
			
		||||
                        return
 | 
			
		||||
                } else if (image != null) {
 | 
			
		||||
                    image != null -> {
 | 
			
		||||
                        // should be  { "get_texture_file": { texture_hash : <Hash> }}
 | 
			
		||||
                        // we don't check, since there is no good way to handle it.
 | 
			
		||||
 | 
			
		||||
@ -260,12 +260,14 @@ class Connection(val address: InetAddress, val port: Int = 10796) : Closeable {
 | 
			
		||||
                            is ErrorPackage -> throw ConnectionErrorException(ipkg)
 | 
			
		||||
                            else -> throw RuntimeException("Unreachable")
 | 
			
		||||
                        }
 | 
			
		||||
                } else {
 | 
			
		||||
                    }
 | 
			
		||||
                    else -> {
 | 
			
		||||
                        ErrorPackage(404, "Texture not found!").write(io.second)
 | 
			
		||||
                        close() // gets re-opened on next request.
 | 
			
		||||
                        throw IllegalArgumentException("Image Argument was needed.")
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            is BinaryPackage -> throw ConnectionUnexpectedPacketException()
 | 
			
		||||
            is ErrorPackage -> throw ConnectionErrorException(pkg)
 | 
			
		||||
            else -> throw RuntimeException("Unreachable")
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,6 @@ package org.hso.texturesyncclient.view.importView
 | 
			
		||||
import com.jfoenix.controls.JFXButton
 | 
			
		||||
import com.jfoenix.controls.JFXChipView
 | 
			
		||||
import com.jfoenix.controls.JFXTextField
 | 
			
		||||
import javafx.collections.ListChangeListener
 | 
			
		||||
import javafx.geometry.Pos
 | 
			
		||||
import javafx.scene.layout.Background
 | 
			
		||||
import javafx.geometry.Insets
 | 
			
		||||
@ -93,7 +92,7 @@ class ImportView : View() {
 | 
			
		||||
        tfFilePath.textProperty().addListener{ _, _, _ -> ivc.validateImport() }
 | 
			
		||||
        tfName.textProperty().addListener{ _, _, _ -> ivc.validateImport() }
 | 
			
		||||
 | 
			
		||||
        cvTags.chips.addListener { change: ListChangeListener.Change<out String>? ->
 | 
			
		||||
        cvTags.chips.onChange {
 | 
			
		||||
            ivc.validateImport()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,5 @@
 | 
			
		||||
package org.hso.texturesyncclient.view.importView
 | 
			
		||||
 | 
			
		||||
import javafx.stage.FileChooser.ExtensionFilter
 | 
			
		||||
import org.hso.texturesyncclient.controller.RootController
 | 
			
		||||
import tornadofx.Controller
 | 
			
		||||
import javafx.stage.FileChooser
 | 
			
		||||
 | 
			
		||||
@ -26,7 +26,6 @@ class MainViewController : Controller() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun addAllElements(elementList: ArrayList<GUIModel>) {
 | 
			
		||||
        elementList.get(0).data
 | 
			
		||||
        folderView.children.addAll(elementList)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,6 @@ package org.hso.texturesyncclient.view.startupView
 | 
			
		||||
 | 
			
		||||
import org.hso.texturesyncclient.controller.RootController
 | 
			
		||||
import org.hso.texturesyncclient.controller.SettingsController
 | 
			
		||||
import org.hso.texturesyncclient.view.mainView.MainView
 | 
			
		||||
import tornadofx.ConfigProperties
 | 
			
		||||
import tornadofx.Controller
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -42,7 +40,7 @@ class StartupViewController : Controller() {
 | 
			
		||||
    /**
 | 
			
		||||
     * show spinner and block textfied + button and set label
 | 
			
		||||
     */
 | 
			
		||||
    fun startConnectionUI() {
 | 
			
		||||
    private fun startConnectionUI() {
 | 
			
		||||
        sv.labelStatus.text = "Verbinden ..."
 | 
			
		||||
        sv.tfServerIP.isEditable = false
 | 
			
		||||
        sv.btnConnect.isDisable = true
 | 
			
		||||
@ -52,7 +50,7 @@ class StartupViewController : Controller() {
 | 
			
		||||
    /**
 | 
			
		||||
     * remove spinner and unblock textfied + button and set label
 | 
			
		||||
     */
 | 
			
		||||
    fun endConnectionUI() {
 | 
			
		||||
    private fun endConnectionUI() {
 | 
			
		||||
        sv.spinnerStatus.isVisible = false
 | 
			
		||||
        sv.labelStatus.text = "Verbindung zum Server einrichten"
 | 
			
		||||
        sv.tfServerIP.isEditable = true
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user