diff --git a/src/main/kotlin/MainView.kt b/src/main/kotlin/MainView.kt index 2ae09d90064a0c78a4a7f5de1bab3c79e67ee973..5aa057d8838ba993023aa5882f66b8165c9e083b 100644 --- a/src/main/kotlin/MainView.kt +++ b/src/main/kotlin/MainView.kt @@ -20,7 +20,7 @@ class MainView : View("Ronove") { item("New project...") { action { TODO() } } item("New empty project") { action { (app as Ronove).project.new() } } separator() - item("Open...") { action { (app as Ronove).project.open() }} + item("Open...","Shortcut+O") { action { (app as Ronove).project.open() }} menu("Open recent") { item("Recent 1") item("Recent 2") @@ -29,11 +29,11 @@ class MainView : View("Ronove") { item("Recent 5") } separator() - item("Save") { + item("Save","Shortcut+S") { action { (app as Ronove).project.save() } enableWhen {(app as Ronove).project.projectFileSet} } - item("Save as...") { action { (app as Ronove).project.saveAs() }} + item("Save as...","Shortcut+Shift+S") { action { (app as Ronove).project.saveAs() }} item("Export...") { action { TODO() } } separator() item("Exit") { @@ -47,7 +47,7 @@ class MainView : View("Ronove") { item("Add page") { action { (app as Ronove).addPage() } } item("Remove page") { action { (app as Ronove).removePage() } } separator() - item("Add line") { action { (app as Ronove).addLine() } } + item("Add line","Shortcut+N") { action { (app as Ronove).addLine() } } //item("Remove line") { action { TODO() } } separator() item("Project settings...") { action { TODO() } } diff --git a/src/main/kotlin/Project.kt b/src/main/kotlin/Project.kt index ea04903b1d1eeb1092e29de12729e9ce2d98bde9..0d91a6514e1b1c0eacc819f9ef67ec7023c6a5e8 100644 --- a/src/main/kotlin/Project.kt +++ b/src/main/kotlin/Project.kt @@ -30,7 +30,8 @@ class Project { ), mode=FileChooserMode.Single ) - if (file.isNotEmpty()) loadFile(file[0]) + if (file.isEmpty()) return + loadFile(file[0]) projectFile = file[0] projectFileSet.value = true } @@ -44,6 +45,7 @@ class Project { ), mode=FileChooserMode.Save ) + if (file.isEmpty()) return saveFile(file[0]) projectFile = file[0] projectFileSet.value = true diff --git a/src/main/kotlin/TranslationPageView.kt b/src/main/kotlin/TranslationPageView.kt index d681ab78f421cb15f57664840a0ff60b59b54201..523198e0fe90a4545b1cbafddea1e0569261cb39 100644 --- a/src/main/kotlin/TranslationPageView.kt +++ b/src/main/kotlin/TranslationPageView.kt @@ -1,9 +1,6 @@ package guru.kake.ronove -import javafx.application.Platform -import javafx.event.EventHandler -import javafx.scene.control.* -import javafx.scene.input.KeyEvent +import javafx.scene.control.TableView import tornadofx.* /** @@ -33,7 +30,7 @@ class TranslationPageView(val ronove: Ronove) : View() { } ronove.table = tableView tableView.selectionModel.isCellSelectionEnabled = true - tableView.selectionModel.selectedItemProperty().addListener(fun(_, _, newSelection) { + /*tableView.selectionModel.selectedItemProperty().addListener(fun(_, _, newSelection) { if (newSelection != null) { val row: Int = tableView.selectionModel.selectedCells[0].row @@ -47,7 +44,7 @@ class TranslationPageView(val ronove: Ronove) : View() { @Suppress("UNCHECKED_CAST") tableView.edit(pos.row, pos.tableColumn as TableColumn<Line, *>?) } - } + }*/ center = tableView pageJumps = PageJumpMenu()