diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/util/FileImportComponent.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/util/FileImportComponent.java index 0bf902cc705..9c9ad5ed4f9 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/util/FileImportComponent.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/util/FileImportComponent.java @@ -1088,7 +1088,29 @@ public boolean isCancelled() } return false; } - + + /** + * Returns true if the component has imports to cancel, + * false otherwise. + * + * @return See above. + */ + public boolean hasImportToCancel() + { + boolean b = statusLabel.isMarkedAsCancel(); + if (b) return false; + if (getFile().isFile() && !hasImportStarted()) return true; + if (components == null) return false; + Iterator i = components.values().iterator(); + FileImportComponent fc; + while (i.hasNext()) { + fc = i.next(); + if (!fc.isCancelled() && !fc.hasImportStarted()) + return true; + } + return false; + } + /** * Returns true if the file can be re-imported, * false otherwise. @@ -1142,7 +1164,7 @@ public boolean hasImportStarted() } return count == components.size(); } - + /** * Returns true the error can be submitted, false * otherwise. diff --git a/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUIElement.java b/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUIElement.java index 7e17fbcbd43..6bd812c92ba 100644 --- a/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUIElement.java +++ b/components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUIElement.java @@ -899,7 +899,7 @@ void setUploadStarted(boolean uploadStarted) { boolean hasImportToCancel() { for (final FileImportComponent fic : components.values()) { - if (!(fic.hasImportStarted() || fic.isCancelled())) { + if (fic.hasImportToCancel()) { return true; } }