Refactor logshipper to maintenance
This commit is contained in:
parent
f70909d6c6
commit
93e0c72b17
3 changed files with 17 additions and 16 deletions
|
@ -39,10 +39,24 @@ public class MaintenanceFragment extends Fragment {
|
|||
view.findViewById(R.id.nav_resetdb).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(R.string.nav_resetdb)
|
||||
.setMessage(R.string.reset_db_confirm)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
MainApp.getDbHelper().resetDatabases();
|
||||
// should be handled by Plugin-Interface and
|
||||
// additional service interface and plugin registry
|
||||
FoodPlugin.getPlugin().getService().resetFood();
|
||||
TreatmentsPlugin.getPlugin().getService().resetTreatments();
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,21 +146,6 @@ public class MaintenancePlugin extends PluginBase {
|
|||
}
|
||||
}
|
||||
|
||||
public void resetDb() {
|
||||
// new AlertDialog.Builder(this)
|
||||
// .setTitle(R.string.nav_resetdb)
|
||||
// .setMessage(R.string.reset_db_confirm)
|
||||
// .setNegativeButton(android.R.string.cancel, null)
|
||||
// .setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
// MainApp.getDbHelper().resetDatabases();
|
||||
// // should be handled by Plugin-Interface and
|
||||
// // additional service interface and plugin registry
|
||||
// FoodPlugin.getPlugin().getService().resetFood();
|
||||
// TreatmentsPlugin.getPlugin().getService().resetTreatments();
|
||||
// })
|
||||
// .create()
|
||||
// .show();
|
||||
}
|
||||
|
||||
public void exportSettings() {
|
||||
// ImportExportPrefs.verifyStoragePermissions(this);
|
||||
|
|
|
@ -3,12 +3,14 @@ package info.nightscout.utils;
|
|||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
Loading…
Reference in a new issue