Notifications: Sort the settings appropriately in the FM (#7734)

Otherwise it's flagged as orphaned ;).

(Also tweak indenting of said settings to be more in line with how we
usually do these).

Overlooked in #7718
pull/7736/head
NiLuJe 3 years ago committed by GitHub
parent bee2a605f1
commit dac6fb4008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,6 +84,8 @@ local order = {
"----------------------------", "----------------------------",
"screen_timeout", "screen_timeout",
"fullscreen", "fullscreen",
"----------------------------",
"screen_notification",
}, },
taps_and_gestures = { taps_and_gestures = {
"gesture_manager", "gesture_manager",

@ -22,62 +22,62 @@ This allows selecting which to show or hide.]]),
end, end,
sub_item_table = { sub_item_table = {
{ {
text = _("No notifications"), text = _("No notifications"),
help_text = _("No notification popups will be shown."), help_text = _("No notification popups will be shown."),
checked_func = function() checked_func = function()
return getMask() == Notification.SOURCE_NONE return getMask() == Notification.SOURCE_NONE
end, end,
callback = function() callback = function()
setMask(Notification.SOURCE_NONE) setMask(Notification.SOURCE_NONE)
end, end,
separator = true, separator = true,
}, },
{ {
text = _("Some notifications from bottom menu"), text = _("Some notifications from bottom menu"),
help_text = _("Show notification popups for bottom menu settings with no visual feedback."), help_text = _("Show notification popups for bottom menu settings with no visual feedback."),
checked_func = function() checked_func = function()
return band(getMask(), Notification.SOURCE_BOTTOM_MENU) == band(Notification.SOURCE_SOME, Notification.SOURCE_BOTTOM_MENU) return band(getMask(), Notification.SOURCE_BOTTOM_MENU) == band(Notification.SOURCE_SOME, Notification.SOURCE_BOTTOM_MENU)
end, end,
callback = function() callback = function()
if getMask() == Notification.SOURCE_ALL then if getMask() == Notification.SOURCE_ALL then
setMask(Notification.SOURCE_NONE) setMask(Notification.SOURCE_NONE)
end end
setMask(bor( setMask(bor(
band(Notification.SOURCE_SOME, Notification.SOURCE_BOTTOM_MENU), band(Notification.SOURCE_SOME, Notification.SOURCE_BOTTOM_MENU),
band(getMask(), Notification.SOURCE_DISPATCHER))) band(getMask(), Notification.SOURCE_DISPATCHER)))
end, end,
}, },
{ {
text = _("More notifications from bottom menu"), text = _("More notifications from bottom menu"),
help_text = _("Show notification popups for more bottom menu settings."), help_text = _("Show notification popups for more bottom menu settings."),
checked_func = function() checked_func = function()
return band(getMask(), Notification.SOURCE_BOTTOM_MENU) == band(Notification.SOURCE_DEFAULT, Notification.SOURCE_BOTTOM_MENU) return band(getMask(), Notification.SOURCE_BOTTOM_MENU) == band(Notification.SOURCE_DEFAULT, Notification.SOURCE_BOTTOM_MENU)
end, end,
callback = function() callback = function()
if getMask() == Notification.SOURCE_ALL then if getMask() == Notification.SOURCE_ALL then
setMask(Notification.SOURCE_NONE) setMask(Notification.SOURCE_NONE)
end end
setMask(bor( setMask(bor(
band(Notification.SOURCE_DEFAULT, Notification.SOURCE_BOTTOM_MENU), band(Notification.SOURCE_DEFAULT, Notification.SOURCE_BOTTOM_MENU),
band(getMask(), Notification.SOURCE_DISPATCHER))) band(getMask(), Notification.SOURCE_DISPATCHER)))
end, end,
}, },
{ {
text = _("Notifications from gestures and profiles"), text = _("Notifications from gestures and profiles"),
help_text = _("Show notification popups for changes from gestures and the profiles plugin."), help_text = _("Show notification popups for changes from gestures and the profiles plugin."),
checked_func = function() checked_func = function()
return band(getMask(), Notification.SOURCE_DISPATCHER) ~= 0 and getMask() ~= Notification.SOURCE_ALL return band(getMask(), Notification.SOURCE_DISPATCHER) ~= 0 and getMask() ~= Notification.SOURCE_ALL
end, end,
callback = function() callback = function()
if getMask() == Notification.SOURCE_ALL then if getMask() == Notification.SOURCE_ALL then
setMask(Notification.SOURCE_NONE) setMask(Notification.SOURCE_NONE)
end end
setMask(bor( setMask(bor(
Notification.SOURCE_DISPATCHER, Notification.SOURCE_DISPATCHER,
band(getMask(), Notification.SOURCE_BOTTOM_MENU))) band(getMask(), Notification.SOURCE_BOTTOM_MENU)))
end, end,
separator = true, separator = true,
}, },
} }
} }

Loading…
Cancel
Save