feat: Add boot behavior to AppSettings

This commit is contained in:
Myzel394 2023-10-27 12:18:15 +02:00
parent dd58ce23a9
commit d89e918996
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B

View File

@ -19,6 +19,7 @@ data class AppSettings(
val showAdvancedSettings: Boolean = false, val showAdvancedSettings: Boolean = false,
val theme: Theme = Theme.SYSTEM, val theme: Theme = Theme.SYSTEM,
val lastRecording: RecordingInformation? = null, val lastRecording: RecordingInformation? = null,
val bootBehavior: BootBehavior? = BootBehavior.START_RECORDING,
) { ) {
fun setShowAdvancedSettings(showAdvancedSettings: Boolean): AppSettings { fun setShowAdvancedSettings(showAdvancedSettings: Boolean): AppSettings {
return copy(showAdvancedSettings = showAdvancedSettings) return copy(showAdvancedSettings = showAdvancedSettings)
@ -44,12 +45,21 @@ data class AppSettings(
return copy(lastRecording = lastRecording) return copy(lastRecording = lastRecording)
} }
fun setBootBehavior(bootBehavior: BootBehavior?): AppSettings {
return copy(bootBehavior = bootBehavior)
}
enum class Theme { enum class Theme {
SYSTEM, SYSTEM,
LIGHT, LIGHT,
DARK, DARK,
} }
enum class BootBehavior {
START_RECORDING,
SHOW_NOTIFICATION,
}
fun exportToString(): String { fun exportToString(): String {
return Json.encodeToString(serializer(), this) return Json.encodeToString(serializer(), this)
} }