From e93727fd80af2098b350176b18275e365a6794f3 Mon Sep 17 00:00:00 2001 From: Naveen Date: Sun, 15 Jan 2023 18:38:48 +0530 Subject: [PATCH] Show toast and disable exporting when nothing is selected --- .../calendar/pro/dialogs/ExportEventsDialog.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ExportEventsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ExportEventsDialog.kt index f2bf625b8..692791fb6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ExportEventsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ExportEventsDialog.kt @@ -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 }