mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 12:25:12 -04:00
profile list: enable edit button (opens system editor)
This commit is contained in:
parent
fd4e55e552
commit
a218082a37
@ -13,6 +13,7 @@
|
||||
|
||||
package de.bixilon.minosoft.gui.eros.main.profiles
|
||||
|
||||
import de.bixilon.kutil.concurrent.pool.DefaultThreadPool
|
||||
import de.bixilon.kutil.primitive.BooleanUtil.decide
|
||||
import de.bixilon.kutil.watcher.map.MapChange.Companion.values
|
||||
import de.bixilon.minosoft.Minosoft
|
||||
@ -28,6 +29,7 @@ import de.bixilon.minosoft.gui.eros.dialog.SimpleErosConfirmationDialog
|
||||
import de.bixilon.minosoft.gui.eros.dialog.profiles.ProfileCreateDialog
|
||||
import de.bixilon.minosoft.gui.eros.util.JavaFXUtil
|
||||
import de.bixilon.minosoft.gui.eros.util.JavaFXUtil.ctext
|
||||
import de.bixilon.minosoft.util.DesktopUtil
|
||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||
import de.bixilon.minosoft.util.delegate.JavaFXDelegate.observeBiMapFX
|
||||
import javafx.fxml.FXML
|
||||
@ -169,8 +171,8 @@ class ProfilesListController : EmbeddedJavaFXController<Pane>() {
|
||||
ctext = TranslatableComponents.GENERAL_DELETE
|
||||
}, 0, 0)
|
||||
it.add(Button("Edit").apply {
|
||||
// ToDo: Profile editing
|
||||
isDisable = true
|
||||
// ToDo: proper profile editing
|
||||
setOnAction { DefaultThreadPool += { DesktopUtil.openFile(profile.manager.getPath(profile.name)) } }
|
||||
ctext = EDIT
|
||||
}, 1, 0)
|
||||
|
||||
|
@ -36,7 +36,10 @@ object DesktopUtil {
|
||||
}
|
||||
|
||||
fun openFile(path: String) {
|
||||
val file = File(path)
|
||||
openFile(File(path))
|
||||
}
|
||||
|
||||
fun openFile(file: File) {
|
||||
if (!file.exists()) {
|
||||
Log.log(LogMessageType.GENERAL, LogLevels.WARN) { "Can not open file $file: File does not exist!" }
|
||||
return
|
||||
@ -49,7 +52,7 @@ object DesktopUtil {
|
||||
// Desktop.getDesktop().open(File(path))
|
||||
|
||||
try {
|
||||
JavaFXUtil.HOST_SERVICES.showDocument(File(path).absolutePath)
|
||||
JavaFXUtil.HOST_SERVICES.showDocument(file.absolutePath)
|
||||
} catch (exception: Throwable) {
|
||||
exception.printStackTrace()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user