From 0a51c86afbe3b73eca082f944d4a9985fec3e7a0 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 11 May 2018 00:09:35 +0200 Subject: [PATCH] SW Configure APS button --- .../androidaps/startupwizard/SWDefinition.java | 11 +++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java b/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java index 4307983d32..b6ccc27b2f 100644 --- a/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java @@ -224,6 +224,17 @@ public class SWDefinition { .add(new SWPlugin() .option(PluginType.APS) .label(R.string.configbuilder_aps)) + .add(new SWButton() + .text(R.string.apssetup) + .action(() -> { + final PluginBase plugin = (PluginBase) MainApp.getConfigBuilder().getActiveAPS(); + PasswordProtection.QueryPassword(activity, R.string.settings_password, "settings_password", () -> { + Intent i = new Intent(activity, PreferencesActivity.class); + i.putExtra("id", plugin.getPreferencesId()); + activity.startActivity(i); + }, null); + }) + .visibility(() -> MainApp.getConfigBuilder().getActiveAPS() != null && ((PluginBase) MainApp.getConfigBuilder().getActiveAPS()).getPreferencesId() > 0)) .validator(() -> MainApp.getConfigBuilder().getActiveAPS() != null) ) .add(new SWScreen(R.string.configbuilder_loop) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9ed55e6b42..c9459cafe2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1068,5 +1068,6 @@ Press the button below to enable AndroidAPS to suggest/make basal changes Press the button below to enable Objectives. Look in the Objectives tab, after you finish this wizard, to make AndroidAPS completely functional. Enable Objectives + Configure APS plugin