The Core is not a Service anymore, stop() really stops it.
[Sone.git] / src / main / java / net / pterodactylus / sone / main / SonePlugin.java
index a0e967e..37fdb54 100644 (file)
@@ -79,7 +79,7 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10
        }
 
        /** The version. */
-       public static final Version VERSION = new Version("RC5", 0, 3, 2);
+       public static final Version VERSION = new Version(0, 3, 4);
 
        /** The logger. */
        private static final Logger logger = Logging.getLogger(SonePlugin.class);
@@ -147,10 +147,13 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10
                /* create a configuration. */
                Configuration oldConfiguration;
                Configuration newConfiguration = null;
+               boolean firstStart = !new File("sone.properties").exists();
+               boolean newConfig = false;
                try {
                        oldConfiguration = new Configuration(new MapConfigurationBackend(new File("sone.properties"), false));
                        newConfiguration = oldConfiguration;
                } catch (ConfigurationException ce1) {
+                       newConfig = true;
                        logger.log(Level.INFO, "Could not load configuration file, trying plugin store…", ce1);
                        try {
                                newConfiguration = new Configuration(new MapConfigurationBackend(new File("sone.properties"), true));
@@ -195,6 +198,8 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10
                                core.setConfiguration(newConfiguration);
                        }
                        webInterface.start();
+                       webInterface.setFirstStart(firstStart);
+                       webInterface.setNewConfig(newConfig);
                        identityManager.start();
                        startupFailed = false;
                } finally {
@@ -224,7 +229,6 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10
                        /* stop the identity manager. */
                        identityManager.stop();
 
-                       /* TODO wait for core to stop? */
                        try {
                                pluginRespirator.putStore(pluginStore);
                        } catch (DatabaseDisabledException dde1) {