Notification: refactor settings

Simplify the code, because the bit trickery was fairly nasty to follow.
KISS: flip one value at a time, either in or out.

Actually allow flipping *all* of the things via the UI, to help track
what the hell is actually happening when you touch a button.

Make some of 'em radio to make it clear when flipping one might affect
the other(s).

Brought on by https://www.mobileread.com/forums/showthread.php?t=358166
This commit is contained in:
NiLuJe
2023-12-31 20:54:13 +01:00
parent ccbfbabb25
commit 3131475e39
2 changed files with 94 additions and 39 deletions

View File

@@ -39,11 +39,12 @@ local SOURCE_BOTTOM_MENU = SOURCE_BOTTOM_MENU_ICON +
SOURCE_BOTTOM_MENU_PROGRESS
-- these values can be changed here
local SOURCE_SOME = SOURCE_BOTTOM_MENU_FINE +
SOURCE_DISPATCHER
local SOURCE_DEFAULT = SOURCE_SOME +
SOURCE_BOTTOM_MENU_MORE +
SOURCE_BOTTOM_MENU_PROGRESS
local SOURCE_SOME = SOURCE_BOTTOM_MENU_FINE
local SOURCE_MORE = SOURCE_SOME +
SOURCE_BOTTOM_MENU_MORE +
SOURCE_BOTTOM_MENU_PROGRESS
local SOURCE_DEFAULT = SOURCE_MORE +
SOURCE_DISPATCHER
local SOURCE_ALL = SOURCE_BOTTOM_MENU +
SOURCE_DISPATCHER +
SOURCE_OTHER
@@ -75,6 +76,7 @@ local Notification = InputContainer:extend{
SOURCE_NONE = 0,
SOURCE_SOME = SOURCE_SOME,
SOURCE_MORE = SOURCE_MORE,
SOURCE_DEFAULT = SOURCE_DEFAULT,
SOURCE_ALL = SOURCE_ALL,
_past_messages = {}, -- a static class member to store the N last messages text