#827 "Error occurred: Width (0) and height (0) cannot be <= 0" (have to Ignore 100's of times) fixed

This commit is contained in:
2015-03-12 18:57:58 +01:00
parent 35548292c7
commit 5709415a58
6 changed files with 31 additions and 7 deletions
@@ -25,11 +25,29 @@ import javax.swing.JOptionPane;
*/
public class GuiAbortRetryIgnoreHandler implements AbortRetryIgnoreHandler {
private boolean ignoreAll = false;
@Override
public int handle(Throwable thrown) {
synchronized (GuiAbortRetryIgnoreHandler.class) {
String[] options = new String[]{AppStrings.translate("button.abort"), AppStrings.translate("button.retry"), AppStrings.translate("button.ignore")};
return View.showOptionDialog(null, AppStrings.translate("error.occured").replace("%error%", thrown.getLocalizedMessage()), AppStrings.translate("error"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, "");
String[] options = new String[]{
AppStrings.translate("button.abort"),
AppStrings.translate("button.retry"),
AppStrings.translate("button.ignore"),
AppStrings.translate("button.ignoreAll")
};
if (ignoreAll) {
return AbortRetryIgnoreHandler.IGNORE;
}
int result = View.showOptionDialog(null, AppStrings.translate("error.occured").replace("%error%", thrown.getLocalizedMessage()), AppStrings.translate("error"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, "");
if (result == AbortRetryIgnoreHandler.IGNORE_ALL) {
ignoreAll = true;
result = AbortRetryIgnoreHandler.IGNORE;
}
return result;
}
}