From 34c6329b6fc35df3eb88062b5073a54eb7875b2d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 6 Oct 2016 20:57:12 +0200 Subject: [PATCH 1/3] fix context in newextendedbolusdialog --- .idea/misc.xml | 2 +- .../plugins/Overview/Dialogs/NewExtendedBolusDialog.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f4..5d19981032 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java index 41afa4c357..e3be3b7225 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java @@ -92,7 +92,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli final Context context = getContext(); AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(this.getContext().getString(R.string.confirmation)); + builder.setTitle(context.getString(R.string.confirmation)); builder.setMessage(confirmMessage); builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { @@ -103,9 +103,9 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli PumpEnactResult result = pump.setExtendedBolus(finalInsulin, finalDurationInMinutes); if (!result.success) { AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(getContext().getString(R.string.treatmentdeliveryerror)); + builder.setTitle(context.getString(R.string.treatmentdeliveryerror)); builder.setMessage(result.comment); - builder.setPositiveButton(getContext().getString(R.string.ok), null); + builder.setPositiveButton(context.getString(R.string.ok), null); builder.show(); } } From 960cde06cfb8e2c3ea6e43f6e3aa1202803349f4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 6 Oct 2016 20:57:57 +0200 Subject: [PATCH 2/3] version bump 1.0.15 --- .idea/misc.xml | 2 +- app/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981032..fbb68289f4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index f19c75574d..8dd4d45f26 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,8 +23,8 @@ android { applicationId "info.nightscout.androidaps" minSdkVersion 21 targetSdkVersion 23 - versionCode 1014 - versionName "1.0.14" + versionCode 1015 + versionName "1.0.15" } buildTypes { release { From cbb316b599de0fd78e36662805f41c9aaeb834f2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 7 Oct 2016 22:35:17 +0200 Subject: [PATCH 3/3] check for null in NS treatment dialog --- .idea/misc.xml | 2 +- .../plugins/Careportal/Dialogs/NewNSTreatmentDialog.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f4..5d19981032 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java index 5c8270e23a..a25720d0b2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java @@ -408,7 +408,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick data.put("percent", SafeParse.stringToDouble(percentEdit.getText().toString())); if (layoutAbsolute.getVisibility() != View.GONE) data.put("absolute", SafeParse.stringToDouble(absoluteEdit.getText().toString())); - if (options.profile) data.put("profile", profileSpinner.getSelectedItem().toString()); + if (options.profile && profileSpinner.getSelectedItem() != null) data.put("profile", profileSpinner.getSelectedItem().toString()); if (SafeParse.stringToDouble(carbTimeEdit.getText().toString()) != 0d) data.put("preBolus", SafeParse.stringToDouble(carbTimeEdit.getText().toString())); if (!notesEdit.getText().toString().equals(""))