X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fmain%2FSonePlugin.java;h=a24802b39a8f84f567a23dea64a71797e3b67859;hb=a7289fbfa428ebc9c1facb48be08587feb0ee489;hp=03ff1168debbe3ee05dbd540e27012dcdd7e9115;hpb=33ee4110ee7dd62fd104b4ae552c404937c8b41b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 03ff116..a24802b 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -79,7 +79,7 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 } /** The version. */ - public static final Version VERSION = new Version(0, 3); + public static final Version VERSION = new Version(0, 3, 2); /** The logger. */ private static final Logger logger = Logging.getLogger(SonePlugin.class); @@ -147,21 +147,25 @@ 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) { - logger.log(Level.INFO, "Could not load configuration file, trying plugin store…"); + 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)); + logger.log(Level.INFO, "Created new configuration file."); } catch (ConfigurationException ce2) { - logger.log(Level.SEVERE, "Could not create configuration file, using Plugin Store!"); + logger.log(Level.SEVERE, "Could not create configuration file, using Plugin Store!", ce2); } try { oldConfiguration = new Configuration(new PluginStoreConfigurationBackend(pluginRespirator)); logger.log(Level.INFO, "Plugin store loaded."); } catch (DatabaseDisabledException dde1) { - logger.log(Level.SEVERE, "Could not load any configuration, using in-memory configuration!"); + logger.log(Level.SEVERE, "Could not load any configuration, using empty configuration!"); oldConfiguration = new Configuration(new MapConfigurationBackend()); } } @@ -180,6 +184,8 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 /* create the web interface. */ webInterface = new WebInterface(this); + webInterface.setFirstStart(firstStart); + webInterface.setNewConfig(newConfig); core.addCoreListener(webInterface); /* create the identity manager. */