nucleus-ffm / foss_warn

An unofficial open source application to get emergency alerts from https://warnung.bund.de/meldungen.
GNU General Public License v3.0
98 stars 6 forks source link

Add more notification settings #105

Closed nucleus-ffm closed 8 months ago

nucleus-ffm commented 8 months ago
MatsG23 commented 8 months ago

I think we should only show the AlertSwiss source in the notification settings if it has been turned on in the general settings. Now that we have a settings page for the notifications, would it not make sense to also move the "show status notification" settings there?

MatsG23 commented 8 months ago

It would be also a cool addition if we could hide (collapse) the frequency of background updates setting when background updates are disabled in general.

MatsG23 commented 8 months ago

Let me explain my quite big changes to the code for the notification source settings:

Instead of the NotificationLevel enum that had values like "upToMinor" (specified a range), the app now checks the enum index value of the stored notification level (a Severity) and the warning. This is a much simpler approach.

MatsG23 commented 8 months ago

TODO: Also replace convertSourceToInt (services/sortWarnings.dart) with a method in the related enum class (use a for-loop as seen in enums/Severity.dart in the getIndexFromSeverity method for simplicity) => check the order of the enum values (especially LHP, AlertSwiss and Other) as they had no unique integer before (convert function returned 0 for everything except Mowas, Katwarn, Biwapp and DWD - although this likely aims for a stable order for all providers - see sortWarnings function)