close progress dialog when stop was pressed prior connection

This commit is contained in:
Milos Kozak 2018-08-03 11:02:46 +02:00
parent a2ed5561e5
commit 580e05e8eb

View file

@ -25,6 +25,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.ConfigBuilder.ProfileFunctions; import info.nightscout.androidaps.plugins.ConfigBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog;
import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressHelperActivity; 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.EventDismissNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.notifications.Notification; import info.nightscout.androidaps.plugins.Overview.notifications.Notification;
@ -237,6 +238,9 @@ public class CommandQueue {
} }
public synchronized void cancelAllBoluses() { 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.BOLUS);
removeAll(Command.CommandType.SMB_BOLUS); removeAll(Command.CommandType.SMB_BOLUS);
ConfigBuilderPlugin.getActivePump().stopBolusDelivering(); ConfigBuilderPlugin.getActivePump().stopBolusDelivering();