From 0a1cb4c9b20ca2b95e076961c51e0a4108f38d7e Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 10 Aug 2022 11:05:07 +0200 Subject: fix error dialogs in initial config load --- .../src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java | 2 +- .../pdfover/gui/workflow/config/ConfigurationDataInMemory.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java index f60393a8..28f3a599 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java @@ -166,7 +166,7 @@ public class StateMachine implements GUIProvider { this.shell.open(); this.shell.layout(); } catch (Exception e) { - log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); + log.warn("Main-Window creation FAILED.", e); this.display = null; this.mainWindow = null; this.shell = null; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java index 9fda1f1f..31b351f8 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java @@ -157,8 +157,11 @@ public class ConfigurationDataInMemory { /** Whether to automatically check for updates */ public boolean updateCheck = true; - /** Holds the main window size */ - public Point mainWindowSize = null; + /** Holds the main window size + * + * @IMPORTANT this must always be valid and non-null, even if configuration failed to load for whatever reason (it is used by error handlers!) + */ + public Point mainWindowSize = new Point(Constants.DEFAULT_MAINWINDOW_WIDTH, Constants.DEFAULT_MAINWINDOW_HEIGHT); /** Whether to skip the output state */ public boolean skipFinish = false; -- cgit v1.2.3