From d607b855b0cb6384731460fff0980b27ac4ef3b2 Mon Sep 17 00:00:00 2001 From: Philoul Date: Mon, 29 Mar 2021 23:03:53 +0200 Subject: [PATCH] Add QuickWizard Source (not sure if it's the best solution...) --- .../info/nightscout/androidaps/dialogs/TreatmentDialog.kt | 2 +- .../info/nightscout/androidaps/utils/wizard/BolusWizard.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index b9f02c1740..86b3256515 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -154,7 +154,7 @@ class TreatmentDialog : DialogFragmentWithDate() { uel.log(action, ValueWithUnit(Sources.TreatmentDialog), ValueWithUnit(detailedBolusInfo.timestamp, Units.Timestamp, eventTimeChanged), - ValueWithUnit(R.string.record, Units.R_String), + ValueWithUnit(R.string.record, Units.R_String, insulin != 0.0), ValueWithUnit(insulinAfterConstraints, Units.U, insulin != 0.0), ValueWithUnit(carbsAfterConstraints, Units.G, carbs != 0)) if (detailedBolusInfo.insulin > 0) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index e30a2dde36..cfe7cac4b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -63,6 +63,7 @@ class BolusWizard @Inject constructor( @Inject lateinit var carbTimer: CarbTimer @Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider @Inject lateinit var repository: AppRepository + @Inject lateinit var quickWizard: QuickWizard @Inject lateinit var nsUpload: NSUpload private val disposable = CompositeDisposable() @@ -415,8 +416,8 @@ class BolusWizard @Inject constructor( carbs.equals(0.0) -> Action.BOLUS else -> Action.TREATMENT } - uel.log(action, notes, - ValueWithUnit(Sources.WizardDialog), + uel.log(action, if (notes == resourceHelper.gs(R.string.key_quickwizard)) quickWizard.getActive()?.buttonText() else notes, + ValueWithUnit(if (notes == resourceHelper.gs(R.string.key_quickwizard)) Sources.QuickWizard else Sources.WizardDialog), ValueWithUnit(eventType.toDBbEventType().text, Units.TherapyEvent), ValueWithUnit(insulinAfterConstraints, Units.U, insulinAfterConstraints != 0.0), ValueWithUnit(this@BolusWizard.carbs, Units.G, this@BolusWizard.carbs != 0),