diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt index 5e5175047..ea5776bcc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt @@ -40,6 +40,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal } else { config.lastUsedLocalEventTypeId } + binding.importEventsCheckbox.isChecked = config.lastUsedIgnoreEventTypesState activity.runOnUiThread { initDialog() @@ -85,6 +86,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal activity.toast(com.simplemobiletools.commons.R.string.importing) ensureBackgroundThread { val overrideFileEventTypes = binding.importEventsCheckbox.isChecked + config.lastUsedIgnoreEventTypesState = overrideFileEventTypes val result = IcsImporter(activity).importEvents(path, currEventTypeId, currEventTypeCalDAVCalendarId, overrideFileEventTypes) handleParseResult(result) alertDialog.dismiss() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt index a5e260ffd..42bc185ea 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt @@ -121,6 +121,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getLong(LAST_USED_LOCAL_EVENT_TYPE_ID, REGULAR_EVENT_TYPE_ID) set(lastUsedLocalEventTypeId) = prefs.edit().putLong(LAST_USED_LOCAL_EVENT_TYPE_ID, lastUsedLocalEventTypeId).apply() + var lastUsedIgnoreEventTypesState: Boolean + get() = prefs.getBoolean(LAST_USED_IGNORE_EVENT_TYPES_STATE, false) + set(lastUsedIgnoreEventTypesState) = prefs.edit().putBoolean(LAST_USED_IGNORE_EVENT_TYPES_STATE, lastUsedIgnoreEventTypesState).apply() + var reminderAudioStream: Int get() = prefs.getInt(REMINDER_AUDIO_STREAM, AudioManager.STREAM_NOTIFICATION) set(reminderAudioStream) = prefs.edit().putInt(REMINDER_AUDIO_STREAM, reminderAudioStream).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt index 8463bdd97..66735de70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt @@ -101,6 +101,7 @@ const val CALDAV_SYNC = "caldav_sync" const val CALDAV_SYNCED_CALENDAR_IDS = "caldav_synced_calendar_ids" const val LAST_USED_CALDAV_CALENDAR = "last_used_caldav_calendar" const val LAST_USED_LOCAL_EVENT_TYPE_ID = "last_used_local_event_type_id" +const val LAST_USED_IGNORE_EVENT_TYPES_STATE = "last_used_ignore_event_types_state" const val DISPLAY_PAST_EVENTS = "display_past_events" const val DISPLAY_DESCRIPTION = "display_description" const val REPLACE_DESCRIPTION = "replace_description"