From e3153230e073449371ab8e8fa276b1a4c5a53501 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Wed, 9 May 2018 17:11:07 +0300 Subject: [PATCH] added NSClient followup --- .../androidaps/startupwizard/SWDefinition.java | 18 +++++++++++++++++- app/src/main/res/values/strings.xml | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) 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 a3f9ee4b82..5411f92cad 100644 --- a/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/startupwizard/SWDefinition.java @@ -89,6 +89,22 @@ public class SWDefinition { .visibility(() -> !NSClientPlugin.getPlugin().isEnabled(PluginType.GENERAL))) .validator(() -> NSClientPlugin.getPlugin().nsClientService != null && NSClientPlugin.getPlugin().nsClientService.isConnected && NSClientPlugin.getPlugin().nsClientService.hasWriteAuth) ) + .add(NSClientPlugin.getPlugin().nsClientService != null ? new SWScreen(R.string.nsclientinternal_title) + .skippable(true) + .add(new SWButton() + .text(R.string.nsclient_prefs) + .action(() -> { + final PluginBase plugin = (PluginBase) NSClientPlugin.getPlugin(); + PasswordProtection.QueryPassword(context, R.string.settings_password, "settings_password", () -> { + Intent i = new Intent(context, PreferencesActivity.class); + i.putExtra("id", plugin.getPreferencesId()); + context.startActivity(i); + }, null); + }) + .visibility(() -> ((PluginBase) MainApp.getConfigBuilder().getActivePump()).getPreferencesId() > 0)): new SWScreen(R.string.nav_setupwizard) + .add(new SWInfotext() + .label(R.string.settings_incorrect) ) + ) .add(new SWScreen(R.string.patientage) .skippable(false) .add(new SWRadioButton() @@ -139,7 +155,7 @@ public class SWDefinition { .add(new SWPlugin() .option(PluginType.APS) .label(R.string.configbuilder_aps)) - .validator(() -> MainApp.getSpecificPluginsList(PluginType.APS) != null) + .validator(() -> MainApp.getSpecificPluginsList(PluginType.APS) != null ) ) ; } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 58293191af..9cd3e4ca58 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1061,9 +1061,11 @@ General Settings DUMMY\nCONTENT - Enable NSClient + Connect to NightScout + Additional NSClient options Welcome to setup wizard. It will guide you through the setup process Pump setup Read status + Incorrect settings! Press \'BACK\' and try again