This commit is contained in:
Anthony Stirling 2024-12-11 23:13:23 +00:00
parent 11273b1589
commit 1c5dfc46a0
3 changed files with 20 additions and 15 deletions

View File

@ -91,6 +91,7 @@ launch4j {
icon = "${projectDir}/src/main/resources/static/favicon.ico" icon = "${projectDir}/src/main/resources/static/favicon.ico"
outfile="Stirling-PDF.exe" outfile="Stirling-PDF.exe"
if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') { if(System.getenv("STIRLING_PDF_DESKTOP_UI") == 'true') {
headerType = "gui" headerType = "gui"
} else { } else {

View File

@ -75,17 +75,15 @@ public class SPdfApplication {
public static void main(String[] args) throws IOException, InterruptedException { public static void main(String[] args) throws IOException, InterruptedException {
SpringApplication app = new SpringApplication(SPdfApplication.class); SpringApplication app = new SpringApplication(SPdfApplication.class);
Properties props = new Properties(); Properties props = new Properties();
if("true".equals(System.getenv("STIRLING_PDF_DESKTOP_UI"))) { if ("true".equals(System.getenv("STIRLING_PDF_DESKTOP_UI"))) {
System.setProperty("java.awt.headless", "false"); System.setProperty("java.awt.headless", "false");
app.setHeadless(false); app.setHeadless(false);
props.put("java.awt.headless", "false"); // props.put("java.awt.headless", "false");
props.put("spring.main.web-application-type", "servlet"); // props.put("spring.main.web-application-type", "servlet");
} }
app.setAdditionalProfiles("default"); app.setAdditionalProfiles("default");
@ -112,10 +110,17 @@ public class SPdfApplication {
logger.warn("Custom configuration file 'configs/custom_settings.yml' does not exist."); logger.warn("Custom configuration file 'configs/custom_settings.yml' does not exist.");
} }
Properties finalProps = new Properties(); Properties finalProps = new Properties();
finalProps.putAll(Collections.singletonMap(
if (!propertyFiles.isEmpty()) {
finalProps.putAll(
Collections.singletonMap(
"spring.config.additional-location", "spring.config.additional-location",
propertyFiles.get("spring.config.additional-location"))); propertyFiles.get("spring.config.additional-location")));
}
if (props.isEmpty()) {
finalProps.putAll(props); finalProps.putAll(props);
}
app.setDefaultProperties(finalProps); app.setDefaultProperties(finalProps);
app.run(args); app.run(args);

View File

@ -90,7 +90,6 @@ public class LoadingWindow extends JDialog {
try { try {
progressBar.setValue(Math.min(Math.max(progress, 0), 100)); progressBar.setValue(Math.min(Math.max(progress, 0), 100));
progressBar.setString(progress + "%"); progressBar.setString(progress + "%");
log.info(progress + "%");
mainPanel.revalidate(); mainPanel.revalidate();
mainPanel.repaint(); mainPanel.repaint();
} catch (Exception e) { } catch (Exception e) {