make Objectives visible

This commit is contained in:
Roumen Georgiev 2018-05-10 14:36:05 +03:00
parent 61afdd6e4c
commit 91c0b1a2ec
2 changed files with 25 additions and 0 deletions

View file

@ -23,6 +23,7 @@ import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialo
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderFragment;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.ConstraintsObjectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.NSClientInternal.NSClientPlugin;
import info.nightscout.androidaps.plugins.ProfileLocal.LocalProfileFragment;
@ -126,6 +127,8 @@ public class SWDefinition {
)
.add(new SWScreen(R.string.configbuilder_bgsource)
.skippable(false)
.add(new SWInfotext()
.label(R.string.setupwizard_bgsource_description))
.add(new SWPlugin()
.option(PluginType.BGSOURCE)
.label(R.string.configbuilder_bgsource))
@ -216,6 +219,8 @@ public class SWDefinition {
)
.add(new SWScreen(R.string.configbuilder_loop)
.skippable(false)
.add(new SWInfotext()
.label(R.string.setupwizard_loop_description))
.add(new SWButton()
.text(R.string.enableloop)
.action(() -> {
@ -229,6 +234,23 @@ public class SWDefinition {
.validator(() -> LoopPlugin.getPlugin().isEnabled(PluginType.LOOP))
.visibility(() -> !LoopPlugin.getPlugin().isEnabled(PluginType.LOOP))
)
.add(new SWScreen(R.string.objectives)
.skippable(false)
.add(new SWInfotext()
.label(R.string.setupwizard_objectives_description))
.add(new SWButton()
.text(R.string.objectives_button_start)
.action(() -> {
ObjectivesPlugin.getPlugin().setPluginEnabled(PluginType.CONSTRAINTS, true);
ObjectivesPlugin.getPlugin().setFragmentVisible(PluginType.CONSTRAINTS, true);
ConfigBuilderFragment.processOnEnabledCategoryChanged(ObjectivesPlugin.getPlugin(), PluginType.CONSTRAINTS);
ConfigBuilderPlugin.getPlugin().storeSettings("SetupWizard");
MainApp.bus().post(new EventConfigBuilderChange());
MainApp.bus().post(new EventSWUpdate(true));
}))
.validator(() -> ObjectivesPlugin.getPlugin().isEnabled(PluginType.CONSTRAINTS))
.visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible())
)
;
}

View file

@ -1064,5 +1064,8 @@
<string name="readstatus">Read status</string>
<string name="adjustprofileinns">Changes must be done in NS</string>
<string name="exitwizard">Exit setup wizard?</string>
<string name="setupwizard_bgsource_description">Where should blood glucose(BG) data be comming from ?</string>
<string name="setupwizard_loop_description">Press the button below to enable AndroidAPS to suggest/make basal changes</string>
<string name="setupwizard_objectives_description">Press the button below to enable Objectives. Look in the Objectives tab, after you finish this wizard, to make AndroidAPS completely functional.</string>
</resources>