Skip to content
Snippets Groups Projects
Commit bfde71c1 authored by Torsten Grote's avatar Torsten Grote
Browse files

Merge branch '1307-readable-log' into 'master'

Display log file in a reader-friendly way

Closes #1307

See merge request briar/briar!845
parents 55918a88 ee59b9b3
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,6 @@ public class DevReportActivity extends BaseCrashReportDialog ...@@ -190,7 +190,6 @@ public class DevReportActivity extends BaseCrashReportDialog
MenuInflater inflater = getDelegate().getMenuInflater(); MenuInflater inflater = getDelegate().getMenuInflater();
inflater.inflate(R.menu.dev_report_actions, menu); inflater.inflate(R.menu.dev_report_actions, menu);
sendReport = menu.findItem(R.id.action_send_report); sendReport = menu.findItem(R.id.action_send_report);
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }
...@@ -283,27 +282,27 @@ public class DevReportActivity extends BaseCrashReportDialog ...@@ -283,27 +282,27 @@ public class DevReportActivity extends BaseCrashReportDialog
if (crashData != null) { if (crashData != null) {
for (Entry<ReportField, String> e : crashData.entrySet()) { for (Entry<ReportField, String> e : crashData.entrySet()) {
ReportField field = e.getKey(); ReportField field = e.getKey();
String value = e.getValue().replaceAll("\\\\n", "\n");
boolean required = requiredFields.contains(field); boolean required = requiredFields.contains(field);
boolean excluded = excludedFields.contains(field); boolean excluded = excludedFields.contains(field);
View v = inflater.inflate(R.layout.list_item_crash, View v = inflater.inflate(R.layout.list_item_crash,
report, false); report, false);
CheckBox cb = v CheckBox cb = v.findViewById(R.id.include_in_report);
.findViewById(R.id.include_in_report);
cb.setTag(field); cb.setTag(field);
cb.setChecked(required || !excluded); cb.setChecked(required || !excluded);
cb.setEnabled(!required); cb.setEnabled(!required);
cb.setOnCheckedChangeListener(DevReportActivity.this); cb.setOnCheckedChangeListener(DevReportActivity.this);
((TextView) v.findViewById(R.id.title)) TextView title = v.findViewById(R.id.title);
.setText(e.getKey().toString()); title.setText(field.toString());
((TextView) v.findViewById(R.id.content)) TextView content = v.findViewById(R.id.content);
.setText(e.getValue()); content.setText(value);
report.addView(v); report.addView(v);
} }
} else { } else {
View v = inflater.inflate( View v = inflater.inflate(
android.R.layout.simple_list_item_1, report, false); android.R.layout.simple_list_item_1, report, false);
((TextView) v.findViewById(android.R.id.text1)) TextView error = v.findViewById(android.R.id.text1);
.setText(R.string.could_not_load_report_data); error.setText(R.string.could_not_load_report_data);
report.addView(v); report.addView(v);
} }
report.setVisibility(VISIBLE); report.setVisibility(VISIBLE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment