From: David ‘Bombe’ Roden Date: Mon, 7 Apr 2008 17:39:06 +0000 (+0000) Subject: fix interface config persistence X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=379f437ed53a4ca64185c9f213b92b57200144c2;p=jSite2.git fix interface config persistence git-svn-id: http://trooper/svn/projects/jSite/trunk@645 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index 02142a9..544f408 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -48,9 +48,9 @@ public class SwingInterface implements CoreListener { /** The application core. */ private final Core core; - + /** The configuration directory. */ - private String configDirectory; + private final String configDirectory; /** The main window. */ private MainWindow mainWindow; @@ -106,9 +106,12 @@ public class SwingInterface implements CoreListener { * * @param core * The core to operate on + * @param configDirectory + * The directory the configuration is stored in */ - public SwingInterface(Core core) { + public SwingInterface(Core core, String configDirectory) { this.core = core; + this.configDirectory = configDirectory; I18n.setLocale(Locale.ENGLISH); /* TODO - load config */ loadConfig(); if (beautify) { @@ -223,16 +226,6 @@ public class SwingInterface implements CoreListener { return addProjectAction; } - /** - * Sets the configuration directory. - * - * @param configDirectory - * The directory the configuration is stored in - */ - public void setConfigDirectory(String configDirectory) { - this.configDirectory = configDirectory; - } - // // ACTIONS // @@ -259,6 +252,7 @@ public class SwingInterface implements CoreListener { /* initialize default stuff. */ beautify = false; /* now read config. */ + System.out.println("configDirectory: “" + configDirectory + "”"); File configFile = new File(configDirectory, "swing-interface.properties"); if (!configFile.exists() || !configFile.canRead() || !configFile.isFile()) { System.err.println("could not find “" + configFile.getAbsolutePath() + "”!"); diff --git a/src/net/pterodactylus/jsite/main/Main.java b/src/net/pterodactylus/jsite/main/Main.java index 871db5f..bf6f5a6 100644 --- a/src/net/pterodactylus/jsite/main/Main.java +++ b/src/net/pterodactylus/jsite/main/Main.java @@ -54,9 +54,8 @@ public class Main { ProjectManager projectManager = new ProjectManager(configDirectory); core.setProjectManager(projectManager); - SwingInterface swingInterface = new SwingInterface(core); + SwingInterface swingInterface = new SwingInterface(core, configDirectory); core.addCoreListener(swingInterface); - swingInterface.setConfigDirectory(configDirectory); swingInterface.start(); core.start();