From c8ac8552195b3ae48bc780a75ff9c548b9933c9f Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sat, 10 Dec 2016 23:51:11 +0100 Subject: [PATCH] also switch profiles --- .../plugins/DanaR/comm/MsgInitConnStatusTime.java | 7 +++++++ .../plugins/DanaRKorean/comm/MsgInitConnStatusTime.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgInitConnStatusTime.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgInitConnStatusTime.java index 8f5ef43c41..d1d5652f4d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgInitConnStatusTime.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgInitConnStatusTime.java @@ -32,6 +32,13 @@ public class MsgInitConnStatusTime extends MessageBase { ((DanaRKoreanPlugin)MainApp.getSpecificPlugin(DanaRKoreanPlugin.class)).setFragmentVisible(PluginBase.PUMP, true); ((DanaRPlugin)MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentEnabled(PluginBase.PUMP, false); ((DanaRPlugin)MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentVisible(PluginBase.PUMP, false); + + //If profile coming from pump, switch it as well + if(MainApp.getSpecificPlugin(DanaRPlugin.class).isEnabled(PluginBase.PROFILE)){ + (MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentEnabled(PluginBase.PROFILE, false); + (MainApp.getSpecificPlugin(DanaRKoreanPlugin.class)).setFragmentEnabled(PluginBase.PROFILE, true); + } + MainApp.getConfigBuilder().storeSettings(); MainApp.bus().post(new EventRefreshGui(false)); return; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgInitConnStatusTime.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgInitConnStatusTime.java index ee12e1688e..5e904a493b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgInitConnStatusTime.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgInitConnStatusTime.java @@ -33,6 +33,13 @@ public class MsgInitConnStatusTime extends MessageBase { ((DanaRKoreanPlugin)MainApp.getSpecificPlugin(DanaRKoreanPlugin.class)).setFragmentVisible(PluginBase.PUMP, false); ((DanaRPlugin)MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentEnabled(PluginBase.PUMP, true); ((DanaRPlugin)MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentVisible(PluginBase.PUMP, true); + + //If profile coming from pump, switch it as well + if(MainApp.getSpecificPlugin(DanaRKoreanPlugin.class).isEnabled(PluginBase.PROFILE)){ + (MainApp.getSpecificPlugin(DanaRKoreanPlugin.class)).setFragmentEnabled(PluginBase.PROFILE, false); + (MainApp.getSpecificPlugin(DanaRPlugin.class)).setFragmentEnabled(PluginBase.PROFILE, true); + } + MainApp.getConfigBuilder().storeSettings(); MainApp.bus().post(new EventRefreshGui(false)); return;