Show toast and disable exporting when nothing is selected

This commit is contained in:
Naveen 2023-01-15 18:38:48 +05:30
parent 5d9661f0da
commit e93727fd80
1 changed files with 9 additions and 2 deletions

View File

@ -78,11 +78,18 @@ class ExportEventsDialog(
return@setOnClickListener
}
val exportEventsChecked = view.export_events_checkbox.isChecked
val exportTasksChecked = view.export_tasks_checkbox.isChecked
if (!exportEventsChecked && !exportTasksChecked) {
activity.toast(R.string.no_entries_for_exporting)
return@setOnClickListener
}
ensureBackgroundThread {
config.apply {
lastExportPath = file.absolutePath.getParentPath()
exportEvents = view.export_events_checkbox.isChecked
exportTasks = view.export_tasks_checkbox.isChecked
exportEvents = exportEventsChecked
exportTasks = exportTasksChecked
exportPastEntries = view.export_past_events_checkbox.isChecked
}