Disable Tag Images button when prediction is ongoing
This commit is contained in:
parent
470491d9ac
commit
cc62cc9fce
2 changed files with 9 additions and 2 deletions
|
@ -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.")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<padding>
|
||||
<Insets bottom="5" left="5" right="5"/>
|
||||
</padding>
|
||||
<Button onAction="#onTagImagesButtonClick" text="Tag Images">
|
||||
<Button fx:id="tagImagesButton" onAction="#onTagImagesButtonClick" text="Tag Images">
|
||||
<graphic>
|
||||
<FontIcon iconLiteral="far-images" iconSize="16"/>
|
||||
</graphic>
|
||||
|
|
Loading…
Reference in a new issue