diff --git a/src/main/java/org/myrobotlab/service/Runtime.java b/src/main/java/org/myrobotlab/service/Runtime.java index 9def8ddf30..3f5641ba90 100644 --- a/src/main/java/org/myrobotlab/service/Runtime.java +++ b/src/main/java/org/myrobotlab/service/Runtime.java @@ -582,7 +582,7 @@ public final static void createAndStartServices(List services) { */ @Override public boolean setVirtual(boolean b) { - boolean changed = isVirtual != b; + boolean changed = config.virtual != b; setAllVirtual(b); if (changed) { broadcastState(); @@ -605,7 +605,7 @@ static public boolean setAllVirtual(boolean b) { si.setVirtual(b); } } - Runtime.getInstance().isVirtual = b; + Runtime.getInstance().config.virtual = b; Runtime.getInstance().broadcastState(); return b; } @@ -5284,13 +5284,6 @@ public String getConfigPath() { return ROOT_CONFIG_DIR + fs + configName; } - @Override - public RuntimeConfig getConfig() { - config = super.getConfig(); - config.locale = getLocaleTag(); - config.virtual = isVirtual; - return config; - } /** * Gets a {serviceName}.yml file config from configName directory diff --git a/src/main/java/org/myrobotlab/service/config/RuntimeConfig.java b/src/main/java/org/myrobotlab/service/config/RuntimeConfig.java index 87b9e4a1d1..3e989aaea3 100644 --- a/src/main/java/org/myrobotlab/service/config/RuntimeConfig.java +++ b/src/main/java/org/myrobotlab/service/config/RuntimeConfig.java @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.List; +import org.myrobotlab.service.data.Locale; + public class RuntimeConfig extends ServiceConfig { /** @@ -26,6 +28,14 @@ public class RuntimeConfig extends ServiceConfig { * Root of resource location */ public String resource = "resource"; + + + public RuntimeConfig() { + if (locale == null) { + locale = Locale.getDefault().getTag(); + } + } + /** * add and remove a service using these methods and the uniqueness will be