added shortcut ctrl+e for exporting a texture

This commit is contained in:
Jannik 2019-06-10 12:41:11 +02:00
parent 36c4805061
commit b1052fa894
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
3 changed files with 13 additions and 1 deletions

View File

@ -37,8 +37,9 @@ class RootController : Controller() {
private lateinit var con: Connection
private lateinit var selectedTexture: Texture
private var lastExportDir: String = System.getProperty("user.home")
lateinit var selectedTexture: Texture
fun isSelectedTextureInitialized() = ::selectedTexture.isInitialized
/**
* calculate the resolution, get today's date -> upload to server

View File

@ -86,6 +86,10 @@ class MainView : View("TextureSync") {
shortcut("Ctrl+I") {
mvc.btnImportAction()
}
shortcut("Ctrl+E") {
mvc.scExport()
}
}
}

View File

@ -60,6 +60,7 @@ class MainViewController : Controller() {
folderView.children.clear()
mv.cvSearch.isDisable = true
setPreview3DTexture(Image("icons/TextureSync_Icon_256x256.jpeg")) // reset the 3DPreview to the logo
// TODO should we clear the selectedTexture?
runAsync {
rootc.queryElements(tags)
@ -89,4 +90,10 @@ class MainViewController : Controller() {
}
}
fun scExport() {
if (rootc.isSelectedTextureInitialized()) {
rootc.exportTexture(rootc.selectedTexture)
}
}
}