UserErrorExceptions are now displayed in a bit more polite way

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@150 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2007-07-12 19:30:30 +00:00
parent a7454ba4e9
commit cffb456654
2 changed files with 6 additions and 3 deletions

View File

@ -49,6 +49,7 @@ state.searching=Searching...
state.opening=Opening
state.retrievingVersion=Retrieving the latest version...
title.about=About
title.statistics=Last Scan Statistics
title.options=Options
title.options.scanning=Scanning
title.options.display=Display
@ -63,6 +64,8 @@ title.favorite.edit=Edit favorites
title.openers.edit=Edit Openers
title.fetchers.select=Select Fetchers
title.find=Find
text.error=Error
text.userError=Problem
text.ip=IP
text.threads=Threads:
text.display.ALL=Display: All
@ -209,7 +212,7 @@ exception.UserErrorException.opener.unknownFetcher=The referenced fetcher cannot
exception.UserErrorException.opener.nullFetcherValue=The replacement value of the fetcher is empty in the scanning results. Cannot execute the opener with parameter:
exception.UserErrorException.opener.edit.noSelection=Please select the position where do you want to save your opener and or the Insert button to add a new one.
exception.UserErrorException.commands.noSelection=No IP address selected
exception.UserErrorException.commands.noResults=No scanning results available yet, please perform a scan first
exception.UserErrorException.commands.noResults=No scanning results are available, please perform a scan first
exception.UserErrorException.favorite.alreadyExists=A favorite with the same name already exists, please try a different one
exception.UserErrorException.version.latestFailed=Failed to retrieve the latest version. Please visit the website manually.
exception.OutOfMemoryError=Out Of Memory. The amount of available to the program heap memory has been exceeded.\nPlease increase the maximum heap size for this program.

View File

@ -66,8 +66,8 @@ public class Main {
// display a nice error message
String localizedMessage = getLocalizedMessage(e);
Shell parent = display.getActiveShell();
MessageBox messageBox = new MessageBox(parent != null ? parent : mainWindow.getShell(), SWT.OK | SWT.ICON_ERROR);
messageBox.setText("Error");
MessageBox messageBox = new MessageBox(parent != null ? parent : mainWindow.getShell(), SWT.OK | (e instanceof UserErrorException ? SWT.ICON_WARNING : SWT.ICON_ERROR));
messageBox.setText(Labels.getLabel(e instanceof UserErrorException ? "text.userError" : "text.error"));
messageBox.setMessage(localizedMessage);
messageBox.open();
}