superbolus must be explicitly enabled

This commit is contained in:
Milos Kozak 2017-04-22 11:08:57 +02:00
parent 3b34e55fda
commit 1f2967e866
6 changed files with 30 additions and 7 deletions

View file

@ -69,6 +69,7 @@ import info.nightscout.utils.BolusWizard;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SP;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils;
@ -246,6 +247,8 @@ public class WizardDialog extends DialogFragment {
carbsInput.addTextChangedListener(textWatcher);
bgInput.addTextChangedListener(textWatcher);
superbolusCheckbox.setVisibility(SP.getBoolean(R.string.key_usesuperbolus, false) ? View.VISIBLE : View.GONE);
Integer maxCarbs = MainApp.getConfigBuilder().applyCarbsConstraints(Constants.carbsOnlyForCheckLimit);
Double maxCorrection = MainApp.getConfigBuilder().applyBolusConstraints(Constants.bolusOnlyForCheckLimit);
@ -368,8 +371,8 @@ public class WizardDialog extends DialogFragment {
ArrayList<CharSequence> profileList;
profileList = profile.getProfileList();
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(),
android.R.layout.simple_spinner_item, profileList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, profileList);
profileSpinner.setAdapter(adapter);
// set selected to actual profile
for (int p = 0; p < profileList.size(); p++) {

View file

@ -261,7 +261,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="120dp"
android:padding="10dp"
android:text="@string/careportal_newnstreatment_profile_label"
android:textAppearance="?android:attr/textAppearanceMedium" />
@ -270,7 +269,7 @@
android:id="@+id/treatments_wizard_profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="0.5" />
@ -537,7 +536,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="80dp"
android:text="@string/treatments_wizard_sb_label"
android:text="@string/superbolus"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:textColor="#FFFFFF"></TextView>

View file

@ -540,5 +540,7 @@
<string name="loopsuperbolusfor">Superbolus (%d m)</string>
<string name="treatments_wizard_bgtrend_label">15min trend</string>
<string name="treatments_wizard_cob_label">COB</string>
<string name="treatments_wizard_sb_label">Superbolus</string>
<string name="superbolus">Superbolus</string>
<string name="enablesuperbolus">Povolit superbolus</string>
<string name="enablesuperbolus_summary">Povolení superbolusu v kalkulátoru. Nepovolujte, dokud se nenaučíte, co to opravdu dělá. MŮŽE ZPŮSOBIT PŘEDÁVKOVÁNÍ INZULÍNEM PŘI NESPRÁVNÉM POUŽITÍ!</string>
</resources>

View file

@ -580,7 +580,7 @@
<string name="smscommunicator_loopresumed">Loop resumed</string>
<string name="treatments_wizard_bgtrend_label">15min trend</string>
<string name="treatments_wizard_cob_label">COB</string>
<string name="treatments_wizard_sb_label">Superbolus</string>
<string name="superbolus">Superbolus</string>
<string name="ns_logappstartedevent">Log app start to NS</string>
<string name="key_ns_logappstartedevent" translatable="false">ns_logappstartedevent</string>
<string name="restartingapp">Exiting application to apply settings.</string>
@ -589,4 +589,7 @@
<string name="fastactinginsulincomment">Novorapid, Novolog, Humalog</string>
<string name="insulin_shortname">INS</string>
<string name="fastactinginsulinprolonged">Fast Acting Insuin Prolonged</string>
<string name="key_usesuperbolus" translatable="false">key_usersuperbolus</string>
<string name="enablesuperbolus">Enable superbolus in wizard</string>
<string name="enablesuperbolus_summary">Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY!</string>
</resources>

View file

@ -18,6 +18,14 @@
android:key="ns_sync_use_absolute"
android:title="@string/ns_sync_use_absolute_title" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/superbolus">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_usesuperbolus"
android:title="@string/enablesuperbolus"
android:summary="@string/enablesuperbolus_summary"/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/openapsma">
<SwitchPreference