ComboFragment: move forced history read to long-pressing the TDD button.

To avoid accidentally doing this when a short press on Refresh was
intended.
This commit is contained in:
Johannes Mockenhaupt 2017-12-04 19:16:44 +01:00
parent fe40ebd4a5
commit 141c116db6
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 5 additions and 6 deletions

View file

@ -20,7 +20,7 @@ public class ComboAlertHistoryDialog extends DialogFragment {
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
List<PumpAlert> errors = ComboPlugin.getPlugin().getPump().errorHistory;
if (errors.isEmpty()) {
text.setText(R.string.combo_empty_alert_history_note);
text.setText(R.string.combo_empty_history_note);
} else {
StringBuilder sb = new StringBuilder();
DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

View file

@ -78,7 +78,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
@Override
public boolean onLongClick(View view) {
switch (view.getId()) {
case R.id.combo_refresh:
case R.id.combo_tdd_history:
new Thread(() -> ComboPlugin.getPlugin().readAllPumpData()).start();
return true;
}
@ -155,7 +155,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
lastConnectionView.setTextColor(Color.WHITE);
}
/* triggers pump bug
/* reading the data that would be displayed here triggers pump bug
// last bolus
Bolus bolus = plugin.getPump().lastBolus;
if (bolus != null && bolus.timestamp + 6 * 60 * 60 * 1000 >= System.currentTimeMillis()) {

View file

@ -21,7 +21,7 @@ public class ComboTddHistoryDialog extends DialogFragment {
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().tddHistory;
if (tdds.isEmpty()) {
text.setText(R.string.combo_empty_tdd_history_note);
text.setText(R.string.combo_empty_history_note);
} else {
StringBuilder sb = new StringBuilder();
DateFormat dateFormatter = DateFormat.getDateInstance();

View file

@ -814,8 +814,7 @@
<string name="key_missed_bg_readings_threshold" translatable="false">missed_bg_readings_threshold</string>
<string name="urgent_alarm">Urgent Alarm</string>
<string name="info">INFO</string>
<string name="combo_empty_alert_history_note">To retrieve the alert history from the pump, long press the Refresh button. NOTE: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
<string name="combo_empty_tdd_history_note">To retrieve the TDD history from the pump, long press the Refresh button. NOTE: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
<string name="combo_empty_history_note">To read all data from the pump, long press the Stats button.\n\nWARNING: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
<string name="key_sync_profile_to_pump">sync_profile_to_pump</string>
<string name="combo_tdd_minimum">Minimum: %3.1f U</string>
<string name="combo_tdd_average">Average: %3.1f U</string>