fix bus register

This commit is contained in:
Milos Kozak 2016-08-07 15:10:08 +02:00
parent ff2e9a82bc
commit 6f1bb28600
3 changed files with 5 additions and 6 deletions

View file

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" /> <ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View file

@ -16,7 +16,6 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.ConstraintsInterface; import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.utils.SafeParse;
/** /**
* Created by mike on 05.08.2016. * Created by mike on 05.08.2016.
@ -197,12 +196,12 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
for (int num = 0; num < objectives.size(); num++) { for (int num = 0; num < objectives.size(); num++) {
Objective o = objectives.get(num); Objective o = objectives.get(num);
o.started = new Date(SafeParse.stringToLong(settings.getString("Objectives" + num + "started", "0"))); o.started = new Date(settings.getLong("Objectives" + num + "started", 0));
o.accomplished = new Date(SafeParse.stringToLong(settings.getString("Objectives" + num + "accomplished", "0"))); o.accomplished = new Date(settings.getLong("Objectives" + num + "accomplished", 0));
} }
bgIsAvailableInNS = settings.getBoolean("Objectives" + "bgIsAvailableInNS", false); bgIsAvailableInNS = settings.getBoolean("Objectives" + "bgIsAvailableInNS", false);
pumpStatusIsAvailableInNS = settings.getBoolean("Objectives" + "pumpStatusIsAvailableInNS", false); pumpStatusIsAvailableInNS = settings.getBoolean("Objectives" + "pumpStatusIsAvailableInNS", false);
manualEnacts = SafeParse.stringToInt(settings.getString("Objectives" + "manualEnacts", "0")); manualEnacts = settings.getInt("Objectives" + "manualEnacts", 0);
if (Config.logPrefsChange) if (Config.logPrefsChange)
log.debug("Objectives loaded"); log.debug("Objectives loaded");
} }

View file

@ -52,7 +52,7 @@ public class TempBasalsPlugin implements PluginBase, TempBasalsInterface {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false);
initializeData(); initializeData();
MainApp.bus().post(new EventTempBasalsUpdateGui()); MainApp.bus().register(this);
} }
@Override @Override