From 580e05e8ebb140934816cc66e06eb19f5ad269c5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 3 Aug 2018 11:02:46 +0200 Subject: [PATCH] close progress dialog when stop was pressed prior connection --- .../java/info/nightscout/androidaps/queue/CommandQueue.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java index f98f86d8fb..83f7e9b4a9 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java @@ -25,6 +25,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ProfileFunctions; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressHelperActivity; +import info.nightscout.androidaps.plugins.Overview.events.EventDismissBolusprogressIfRunning; import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.Overview.notifications.Notification; @@ -237,6 +238,9 @@ public class CommandQueue { } public synchronized void cancelAllBoluses() { + if (!isRunning(Command.CommandType.BOLUS)) { + MainApp.bus().post(new EventDismissBolusprogressIfRunning(new PumpEnactResult().success(true).enacted(false))); + } removeAll(Command.CommandType.BOLUS); removeAll(Command.CommandType.SMB_BOLUS); ConfigBuilderPlugin.getActivePump().stopBolusDelivering();