Rethink the widgets notification system
Current way of event notifications is very complicated and can hardly be understood as a whole. This is partly due to the recent refactoring devoted to unrooting SessionItem
and the related notification machinery.
Many signals of different objects have the same or similar names and serve only to further redirect the signal.
It is difficult both to understand which object is needed for emitting/connecting to its signals and how to provide access to this object.
A possible solution to this is to use "courier" or "notifier" semi-global objects, full of signals for each individual situation. The "courier" itself can me initialized in the top widget of the corresponding view (e.g. in JobView
, InstrumentView
or SampleView
). An example of such approach is the current way of notifying ProjectDocument
of any changes made by the user. Every widget anywhere can depend on ProjectDocument
and easily call gProjectDocument.value()->setModified()
without having to pass such a notification through the hierarchy. Currently GUI data objects partly serve as such "couriers", but they should not be involved in such things with accordance to #466 (closed).