From bcf403aefd8445a32f8f94aad3114fc6b98f42a0 Mon Sep 17 00:00:00 2001 From: Kaj Koivunen <kalakoiv@jyu.fi> Date: Fri, 14 Apr 2023 10:38:16 +0300 Subject: [PATCH] =?UTF-8?q?pikan=C3=A4pp=C3=A4imi=C3=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/MainView.kt | 8 ++++---- src/main/kotlin/Project.kt | 4 +++- src/main/kotlin/TranslationPageView.kt | 9 +++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/MainView.kt b/src/main/kotlin/MainView.kt index 2ae09d9..5aa057d 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 ea04903..0d91a65 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 d681ab7..523198e 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() -- GitLab