also cancel temp on disable loop plugin
This commit is contained in:
parent
448a420fad
commit
6d90f79521
2 changed files with 13 additions and 1 deletions
|
@ -366,6 +366,15 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
||||||
activeloop.setFragmentVisible(PluginBase.LOOP, false);
|
activeloop.setFragmentVisible(PluginBase.LOOP, false);
|
||||||
MainApp.getConfigBuilder().storeSettings();
|
MainApp.getConfigBuilder().storeSettings();
|
||||||
scheduleUpdateGUI("suspendmenu");
|
scheduleUpdateGUI("suspendmenu");
|
||||||
|
sHandler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
PumpEnactResult result = MainApp.getConfigBuilder().cancelTempBasal();
|
||||||
|
if (!result.success) {
|
||||||
|
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.tempbasaldeliveryerror));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
ConfigBuilderPlugin.uploadOpenAPSOffline(60); // upload 60 min, we don;t know real duration
|
ConfigBuilderPlugin.uploadOpenAPSOffline(60); // upload 60 min, we don;t know real duration
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.enableloop))) {
|
} else if (item.getTitle().equals(MainApp.sResources.getString(R.string.enableloop))) {
|
||||||
|
|
|
@ -277,7 +277,10 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
||||||
LoopPlugin loopPlugin = (LoopPlugin) MainApp.getSpecificPlugin(LoopPlugin.class);
|
LoopPlugin loopPlugin = (LoopPlugin) MainApp.getSpecificPlugin(LoopPlugin.class);
|
||||||
if (loopPlugin != null && loopPlugin.isEnabled(PluginBase.LOOP)) {
|
if (loopPlugin != null && loopPlugin.isEnabled(PluginBase.LOOP)) {
|
||||||
loopPlugin.setFragmentEnabled(PluginBase.LOOP, false);
|
loopPlugin.setFragmentEnabled(PluginBase.LOOP, false);
|
||||||
reply = MainApp.sResources.getString(R.string.smscommunicator_loophasbeendisabled);
|
PumpEnactResult result = MainApp.getConfigBuilder().cancelTempBasal();
|
||||||
|
MainApp.bus().post(new EventRefreshGui(false));
|
||||||
|
reply = MainApp.sResources.getString(R.string.smscommunicator_loophasbeendisabled)+ " " +
|
||||||
|
MainApp.sResources.getString(result.success?R.string.smscommunicator_tempbasalcanceled:R.string.smscommunicator_tempbasalcancelfailed);
|
||||||
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||||
}
|
}
|
||||||
receivedSms.processed = true;
|
receivedSms.processed = true;
|
||||||
|
|
Loading…
Reference in a new issue