diff --git a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPageController.kt b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPageController.kt index dcd6280..a3c8cf4 100644 --- a/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPageController.kt +++ b/img-ui/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPageController.kt @@ -67,6 +67,9 @@ class MainPageController { @FXML private lateinit var cancelButton: Button + @FXML + lateinit var tagImagesButton: Button + /** * Initializes the controller. Needs to be called after the dependencies have been injected. */ @@ -83,7 +86,10 @@ class MainPageController { synchronized(this) { val fileChooser = FileChooser().apply { title = "Choose images" } val filePaths = fileChooser.showOpenMultipleDialog(null) ?: return - + if (tagImagesButton.isDisable) { + return + } + tagImagesButton.isDisable = true isCurrentTagsOperationCancelled = false progressBar.isVisible = true cancelButton.isVisible = true @@ -167,6 +173,7 @@ class MainPageController { if (processedImageFilesCount.get() == imageFilesTotal) { progressBar.isVisible = false cancelButton.isVisible = false + tagImagesButton.isDisable = false logger.info("Finished processing images.") } } diff --git a/img-ui/src/main/resources/dev/nuculabs/imagetagger/ui/main-window-view.fxml b/img-ui/src/main/resources/dev/nuculabs/imagetagger/ui/main-window-view.fxml index 74b1975..6e451a8 100644 --- a/img-ui/src/main/resources/dev/nuculabs/imagetagger/ui/main-window-view.fxml +++ b/img-ui/src/main/resources/dev/nuculabs/imagetagger/ui/main-window-view.fxml @@ -19,7 +19,7 @@ -