Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
b8ca5dc498
|
|||
dbdba120c3 | |||
33a46c4cbf
|
|||
d81aa56e49 | |||
95496536db | |||
8f3b61462a | |||
cff5ec76bf | |||
1bbfe800e1 | |||
c722a39116
|
|||
911983bff4
|
|||
6feb1c3dad | |||
7da58c7dbe | |||
86c05c0363
|
|||
a3c03c4bc7 | |||
9444e8198f | |||
730a0ab383 | |||
a10e2aceb6 | |||
f0fe4bb981 | |||
32883a2639 | |||
0e293768d7 | |||
6a5b2f555c | |||
8d210d756d |
@ -27,7 +27,7 @@ compileTestKotlin {
|
||||
}
|
||||
|
||||
group 'org.hso'
|
||||
version '1.0'
|
||||
version '1.0.1'
|
||||
archivesBaseName = 'TextureSync'
|
||||
mainClassName = 'org.hso.texturesyncclient.app.Main'
|
||||
|
||||
|
@ -18,9 +18,7 @@ import org.hso.texturesyncclient.view.mainView.MainView
|
||||
import org.hso.texturesyncclient.view.mainView.MainViewController
|
||||
import org.hso.texturesyncclient.view.startupView.StartupView
|
||||
import org.hso.texturesyncclient.view.startupView.StartupViewController
|
||||
import tornadofx.Controller
|
||||
import tornadofx.find
|
||||
import tornadofx.observable
|
||||
import tornadofx.*
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
@ -51,7 +49,7 @@ class RootController : Controller() {
|
||||
val uuid = UUID.randomUUID()
|
||||
val format = if (File(path).extension.toLowerCase() == "png") TextureFormat.PNG else TextureFormat.JPEG
|
||||
val bimg = ImageIO.read(File(path)) //image for obtaining resolution
|
||||
val resolution = Pair(bimg.height, bimg.width)
|
||||
val resolution = Pair(bimg.width, bimg.height)
|
||||
val cal = Calendar.getInstance() //calendar obj with current time
|
||||
val hash = Sha256(data)
|
||||
|
||||
@ -103,6 +101,8 @@ class RootController : Controller() {
|
||||
println("[auto] Connection to Server successful")
|
||||
switchStartupToMain()
|
||||
showAll()
|
||||
|
||||
return // abort
|
||||
} else {
|
||||
println("[auto] no server found")
|
||||
}
|
||||
@ -119,6 +119,8 @@ class RootController : Controller() {
|
||||
println("[file] Connection to Server successful")
|
||||
switchStartupToMain()
|
||||
showAll()
|
||||
|
||||
return // abort
|
||||
} catch (e: Exception) {
|
||||
println(e)
|
||||
println("[file] Connection to Server NOT successful")
|
||||
@ -137,6 +139,8 @@ class RootController : Controller() {
|
||||
switchStartupToMain()
|
||||
showAll()
|
||||
println("swithing to MainView @ initCon")
|
||||
|
||||
return // abort
|
||||
} catch (e: Exception) {
|
||||
println(e)
|
||||
println("Connection to Server NOT successful")
|
||||
@ -183,7 +187,7 @@ class RootController : Controller() {
|
||||
fun exportTexture(data: Texture) {
|
||||
val directoryChooser = DirectoryChooser()
|
||||
directoryChooser.title = "Export Verzeichnis wählen"
|
||||
directoryChooser.initialDirectory = File(lastExportDir)
|
||||
directoryChooser.initialDirectory = if(File(lastExportDir).exists()) File(lastExportDir) else File(System.getProperty("user.home"))
|
||||
|
||||
|
||||
val alertExport = JFXInfoAlert(
|
||||
@ -295,20 +299,20 @@ class RootController : Controller() {
|
||||
|
||||
fun switchStartupToMain() {
|
||||
Platform.runLater {
|
||||
find(StartupView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
|
||||
find(StartupView::class).replaceWith(MainView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||
}
|
||||
}
|
||||
|
||||
// These runLater calls should be unnecessary
|
||||
fun switchMainToImport() {
|
||||
Platform.runLater {
|
||||
find(MainView::class).replaceWith(ImportView::class, sizeToScene = true, centerOnScreen = true)
|
||||
find(MainView::class).replaceWith(ImportView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||
}
|
||||
}
|
||||
|
||||
fun switchImportToMain() {
|
||||
Platform.runLater {
|
||||
find(ImportView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
|
||||
find(ImportView::class).replaceWith(MainView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,7 @@ class ImportViewController : Controller() {
|
||||
fun btnImportAction() {
|
||||
rootc.importTexture(iv.tfFilePath.text, iv.tfName.text, iv.cvTags.chips)
|
||||
RootController.switchImportToMain()
|
||||
iv.tfFilePath.clear()
|
||||
iv.tfName.clear()
|
||||
iv.cvTags.chips.clear()
|
||||
reset()
|
||||
}
|
||||
|
||||
fun validateImport() {
|
||||
@ -61,8 +59,13 @@ class ImportViewController : Controller() {
|
||||
|
||||
fun btnBackAction() {
|
||||
RootController.switchImportToMain()
|
||||
reset()
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
iv.tfFilePath.clear()
|
||||
iv.tfName.clear()
|
||||
iv.cvTags.chips.clear()
|
||||
iv.preview.root.isVisible = false
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class MainViewController : Controller() {
|
||||
}
|
||||
}
|
||||
|
||||
// DetailView actions
|
||||
// MainView actions
|
||||
|
||||
fun cvSearchAction(tags: ObservableList<String>) {
|
||||
// show spinner, block ui
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "texture-sync-server"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
authors = ["CodeSteak <codesteak@shellf.art>"]
|
||||
edition = "2018"
|
||||
|
||||
@ -10,4 +10,4 @@ serde = { version = "1.0.90", features = ["derive"] }
|
||||
serde_json = "1.0.39"
|
||||
sha2 = "0.8.0"
|
||||
lovecraft = "0.2.0"
|
||||
num_cpus = "1.0"
|
||||
num_cpus = "1.0"
|
||||
|
@ -66,7 +66,7 @@ impl QueryFilter {
|
||||
|
||||
SpecialInName(name) => Score::RequiredMatch(
|
||||
//
|
||||
texture.name.contains(name),
|
||||
texture.name.to_lowercase().contains(&name.to_lowercase()),
|
||||
),
|
||||
|
||||
SpecialBeforeDate(date) => Score::RequiredMatch(texture.added_on <= *date),
|
||||
|
Reference in New Issue
Block a user