From 5df054a9995f4d21b280f16506eb50513162cbf7 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 1 Jul 2018 18:32:52 +0200 Subject: [PATCH] more fixes --- .../nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java | 2 +- .../androidaps/plugins/Treatments/TreatmentsPlugin.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 8567a0f64f..a16ffbda05 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -1185,7 +1185,7 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint dbi.source = Source.PUMP; dbi.insulin = pumpBolus.amount; dbi.eventType = CareportalEvent.CORRECTIONBOLUS; - if (TreatmentsPlugin.getPlugin().getService().getPumpRecordById(dbi.pumpId) != null) { + if (TreatmentsPlugin.getPlugin().getService().getPumpRecordById(dbi.pumpId) == null) { TreatmentsPlugin.getPlugin().addToHistoryTreatment(dbi, false); updated = true; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index b6b53eed86..410af5b2c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -498,7 +498,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface Intent i = new Intent(MainApp.instance(), ErrorHelperActivity.class); i.putExtra("soundid", R.raw.error); i.putExtra("status", MainApp.gs(R.string.error_adding_treatment_message)); - i.putExtra("title", MainApp.gs(R.string.error_adding_treatment_title)); + i.putExtra("title", String.format(MainApp.gs(R.string.error_adding_treatment_title), treatment.insulin, treatment.carbs)); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); MainApp.instance().startActivity(i); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9f8225c3cc..27b55e0b1f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1180,7 +1180,7 @@ Stored settings found Attention: If you activate and connect to a hardware pump, AndroidAPS will copy the basal settings from the profile to the pump, overwriting the existing basal rate stored on the pump. Make sure you have the correct basal setting in AndroidAPS. If you are not sure or don\'t want to overwrite the basal settings on your pump, press cancel and repeat switching to the pump at a later time. Treatment data incomplete - A treatment (insulin:%0.2f, carbs: %2) couldn\'t not be added to treatments. Please check and manually add a record as appropriate. + A treatment (insulin:%0.2f, carbs: %d) could not be added to treatments. Please check and manually add a record as appropriate. %d day