maintenance strings cleanup

This commit is contained in:
Milos Kozak 2018-10-04 23:19:29 +02:00
parent 97cc9a6370
commit c68783afd3
2 changed files with 10 additions and 5 deletions

View file

@ -73,8 +73,8 @@ public class MaintenancePlugin extends PluginBase {
} }
public void sendLogs() { public void sendLogs() {
String recipient = SP.getString("key_maintenance_logs_email", "logs@androidaps.org"); String recipient = SP.getString(R.string.key_maintenance_logs_email, "logs@androidaps.org");
int amount = SP.getInt("key_maintenance_logs_amount", 2); int amount = SP.getInt(R.string.key_maintenance_logs_amount, 2);
String logDirectory = LoggerUtils.getLogDirectory(); String logDirectory = LoggerUtils.getLogDirectory();
List<File> logs = this.getLogfiles(logDirectory, amount); List<File> logs = this.getLogfiles(logDirectory, amount);
@ -103,7 +103,7 @@ public class MaintenancePlugin extends PluginBase {
Arrays.sort(files, (f1, f2) -> f1.getName().compareTo(f2.getName())); Arrays.sort(files, (f1, f2) -> f1.getName().compareTo(f2.getName()));
List<File> delFiles = Arrays.asList(files); List<File> delFiles = Arrays.asList(files);
int amount = SP.getInt("key_logshipper_amount", 2); int amount = SP.getInt(R.string.key_logshipper_amount, 2);
int keepIndex = amount - 1; int keepIndex = amount - 1;
if (keepIndex < delFiles.size()) { if (keepIndex < delFiles.size()) {
@ -213,6 +213,10 @@ public class MaintenancePlugin extends PluginBase {
builder.append("ADD TIME OF EVENT HERE: " + System.lineSeparator()); builder.append("ADD TIME OF EVENT HERE: " + System.lineSeparator());
builder.append("ADD ISSUE DESCRIPTION OR GITHUB ISSUE REFERENCE NUMBER: " + System.lineSeparator()); builder.append("ADD ISSUE DESCRIPTION OR GITHUB ISSUE REFERENCE NUMBER: " + System.lineSeparator());
builder.append("-------------------------------------------------------" + System.lineSeparator()); builder.append("-------------------------------------------------------" + System.lineSeparator());
builder.append("(Please remember this will send only very recent logs." + System.lineSeparator());
builder.append("If you want to provide logs for event older than a few hours," + System.lineSeparator());
builder.append("you have to do it manually)" + System.lineSeparator());
builder.append("-------------------------------------------------------" + System.lineSeparator());
builder.append(MainApp.gs(R.string.app_name) + " " + BuildConfig.VERSION + System.lineSeparator()); builder.append(MainApp.gs(R.string.app_name) + " " + BuildConfig.VERSION + System.lineSeparator());
if (Config.NSCLIENT) if (Config.NSCLIENT)
builder.append("NSCLIENT" + System.lineSeparator()); builder.append("NSCLIENT" + System.lineSeparator());

View file

@ -1172,9 +1172,10 @@
<string name="error_adding_treatment_title">Treatment data incomplete</string> <string name="error_adding_treatment_title">Treatment data incomplete</string>
<string name="maintenance_settings">Maintenance Settings</string> <string name="maintenance_settings">Maintenance Settings</string>
<string name="maintenance_email">Email</string> <string name="maintenance_email">Email</string>
<string name="key_maintenance_logs_email" translatable="false">email</string> <string name="key_maintenance_logs_email" translatable="false">maintenance_logs_email</string>
<string name="invalid_email_message">Invalid Email</string> <string name="invalid_email_message">Invalid Email</string>
<string name="key_maintenance_logs_amount" translatable="false">amount of logs to send</string> <string name="key_maintenance_logs_amount" translatable="false">maintenance_logs_amount</string>
<string name="key_logshipper_amount" translatable="false">logshipper_amount</string>
<string name="maintenance_amount">No of Logs to send</string> <string name="maintenance_amount">No of Logs to send</string>
<string name="maintenance">Maintenance</string> <string name="maintenance">Maintenance</string>
<string name="maintenance_shortname">MAINT</string> <string name="maintenance_shortname">MAINT</string>