Skip to content

Commit

Permalink
Merge pull request #3413 from jburel/cancel-all
Browse files Browse the repository at this point in the history
Cancel all
  • Loading branch information
sbesson committed Jan 31, 2015
2 parents 024714a + 1fcb649 commit 361fec9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Expand Up @@ -1088,7 +1088,29 @@ public boolean isCancelled()
}
return false;
}


/**
* Returns <code>true</code> if the component has imports to cancel,
* <code>false</code> 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<FileImportComponent> i = components.values().iterator();
FileImportComponent fc;
while (i.hasNext()) {
fc = i.next();
if (!fc.isCancelled() && !fc.hasImportStarted())
return true;
}
return false;
}

/**
* Returns <code>true</code> if the file can be re-imported,
* <code>false</code> otherwise.
Expand Down Expand Up @@ -1142,7 +1164,7 @@ public boolean hasImportStarted()
}
return count == components.size();
}

/**
* Returns <code>true</code> the error can be submitted, <code>false</code>
* otherwise.
Expand Down
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 361fec9

Please sign in to comment.