This PR:
- moves warnings from common to the node library and into the node namespace (as suggested in #29845 (review))
- generalizes the warnings interface to
Warnings::Set()
andWarnings::Unset()
methods, instead of having a separate function and globals for each warning. As a result, this simplifies thekernel::Notifications
interface. - removes warnings.cpp from the kernel library
- removes warning globals
- adds testing for the warning logic
Behaviour change introduced:
- the
-alertnotify
command is executed for allKernelNotifications::warningSet
calls, which now also covers theLARGE_WORK_INVALID_CHAIN
warning - the GUI is updated automatically whenever a warning is (un)set, covering some code paths where it previously wouldn’t be, e.g. when
node::AbortNode()
is called, or for theLARGE_WORK_INVALID_CHAIN
warning
Some discussion points:
isedit: updated approach to useconst std::string& id
the best way to refer to warnings? Enums are an obvious alternative, but since we need to define warnings across libraries, strings seem like a straightforward solution.node::Warning
andkernel::Warning
enums.