Add Maintenance source
This commit is contained in:
parent
b375ae45ae
commit
2bd2510bd8
4 changed files with 7 additions and 5 deletions
|
@ -56,13 +56,12 @@ class MaintenanceFragment : DaggerFragment() {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
binding.logSend.setOnClickListener { maintenancePlugin.sendLogs() }
|
binding.logSend.setOnClickListener { maintenancePlugin.sendLogs() }
|
||||||
binding.logDelete.setOnClickListener {
|
binding.logDelete.setOnClickListener {
|
||||||
uel.log(Action.DELETE_LOGS)
|
uel.log(Action.DELETE_LOGS, ValueWithUnit(Sources.Maintenance))
|
||||||
maintenancePlugin.deleteLogs()
|
maintenancePlugin.deleteLogs()
|
||||||
}
|
}
|
||||||
binding.navResetdb.setOnClickListener {
|
binding.navResetdb.setOnClickListener {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.maintenance), resourceHelper.gs(R.string.reset_db_confirm), Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.maintenance), resourceHelper.gs(R.string.reset_db_confirm), Runnable {
|
||||||
uel.log(Action.RESET_DATABASES)
|
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
fromAction {
|
fromAction {
|
||||||
databaseHelper.resetDatabases()
|
databaseHelper.resetDatabases()
|
||||||
|
@ -78,18 +77,19 @@ class MaintenanceFragment : DaggerFragment() {
|
||||||
onComplete = { rxBus.send(EventNewBG(null)) }
|
onComplete = { rxBus.send(EventNewBG(null)) }
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
uel.log(Action.RESET_DATABASES, ValueWithUnit(Sources.Maintenance))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.navExport.setOnClickListener {
|
binding.navExport.setOnClickListener {
|
||||||
uel.log(Action.EXPORT_SETTINGS)
|
uel.log(Action.EXPORT_SETTINGS, ValueWithUnit(Sources.Maintenance))
|
||||||
// start activity for checking permissions...
|
// start activity for checking permissions...
|
||||||
importExportPrefs.verifyStoragePermissions(this) {
|
importExportPrefs.verifyStoragePermissions(this) {
|
||||||
importExportPrefs.exportSharedPreferences(this)
|
importExportPrefs.exportSharedPreferences(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.navImport.setOnClickListener {
|
binding.navImport.setOnClickListener {
|
||||||
uel.log(Action.IMPORT_SETTINGS)
|
uel.log(Action.IMPORT_SETTINGS, ValueWithUnit(Sources.Maintenance))
|
||||||
// start activity for checking permissions...
|
// start activity for checking permissions...
|
||||||
importExportPrefs.verifyStoragePermissions(this) {
|
importExportPrefs.verifyStoragePermissions(this) {
|
||||||
importExportPrefs.importSharedPreferences(this)
|
importExportPrefs.importSharedPreferences(this)
|
||||||
|
@ -99,7 +99,7 @@ class MaintenanceFragment : DaggerFragment() {
|
||||||
binding.exportCsv.setOnClickListener {
|
binding.exportCsv.setOnClickListener {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.ue_export_to_csv) + "?") {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.ue_export_to_csv) + "?") {
|
||||||
uel.log(Action.EXPORT_CSV)
|
uel.log(Action.EXPORT_CSV, ValueWithUnit(Sources.Maintenance))
|
||||||
importExportPrefs.exportUserEntriesCsv(activity, repository.getAllUserEntries())
|
importExportPrefs.exportUserEntriesCsv(activity, repository.getAllUserEntries())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ fun Sources.iconId(): Int {
|
||||||
Sources.Exercise -> R.drawable.ic_cp_exercise
|
Sources.Exercise -> R.drawable.ic_cp_exercise
|
||||||
Sources.Question -> R.drawable.ic_cp_question
|
Sources.Question -> R.drawable.ic_cp_question
|
||||||
Sources.Announcement -> R.drawable.ic_cp_announcement
|
Sources.Announcement -> R.drawable.ic_cp_announcement
|
||||||
|
Sources.Maintenance -> R.drawable.ic_maintenance
|
||||||
Sources.Actions -> R.drawable.ic_action
|
Sources.Actions -> R.drawable.ic_action
|
||||||
Sources.Automation -> R.drawable.ic_automation
|
Sources.Automation -> R.drawable.ic_automation
|
||||||
Sources.Loop -> R.drawable.ic_loop_closed_white
|
Sources.Loop -> R.drawable.ic_loop_closed_white
|
||||||
|
|
|
@ -156,6 +156,7 @@ data class UserEntry(
|
||||||
@SerializedName("Actions") Actions ("Actions"), //From Actions plugin
|
@SerializedName("Actions") Actions ("Actions"), //From Actions plugin
|
||||||
@SerializedName("Automation") Automation ("Automation"), //From Automation plugin
|
@SerializedName("Automation") Automation ("Automation"), //From Automation plugin
|
||||||
@SerializedName("Loop") Loop ("Loop"), //From Loop plugin
|
@SerializedName("Loop") Loop ("Loop"), //From Loop plugin
|
||||||
|
@SerializedName("Maintenance") Maintenance ("Maintenance"), //From Maintenance plugin
|
||||||
@SerializedName("NSClient") NSClient ("NSClient"), //From NSClient plugin
|
@SerializedName("NSClient") NSClient ("NSClient"), //From NSClient plugin
|
||||||
@SerializedName("Pump") Pump ("Pump"), //From Pump plugin (for example from pump history)
|
@SerializedName("Pump") Pump ("Pump"), //From Pump plugin (for example from pump history)
|
||||||
@SerializedName("SMS") SMS ("SMS"), //From SMS plugin
|
@SerializedName("SMS") SMS ("SMS"), //From SMS plugin
|
||||||
|
|
Loading…
Reference in a new issue