bugfix: if display != ALL and scanning finds no alive hosts, statistics dialog is still shown properly

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@392 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2008-04-12 21:04:11 +00:00
parent a836c1a2fe
commit f597e582f0
2 changed files with 9 additions and 3 deletions

View File

@ -72,6 +72,13 @@ public class ScanningResultList implements Iterable<ScanningResult> {
return !resultList.isEmpty();
}
/**
* @return true if scanning info is available and can be used
*/
public boolean isInfoAvailable() {
return info != null;
}
/**
* @return feeder configuration information that was used for the last scan
*/

View File

@ -41,7 +41,7 @@ public class StatisticsDialog extends AbstractModalDialog {
@Override
public void open() {
if (scanningResults.areResultsAvailable()) {
if (scanningResults.isInfoAvailable()) {
createShell();
super.open();
}
@ -104,8 +104,7 @@ public class StatisticsDialog extends AbstractModalDialog {
.append(scanningResults.getFeederInfo()).append(ln).append(ln);
text.append(Labels.getLabel("text.scan.hosts.total")).append(scanInfo.getHostCount()).append(ln);
if (scanInfo.getAliveCount() > 0)
text.append(Labels.getLabel("text.scan.hosts.alive")).append(scanInfo.getAliveCount()).append(ln);
text.append(Labels.getLabel("text.scan.hosts.alive")).append(scanInfo.getAliveCount()).append(ln);
if (scanInfo.getWithPortsCount() > 0)
text.append(Labels.getLabel("text.scan.hosts.ports")).append(scanInfo.getWithPortsCount()).append(ln);
return text.toString();