Skip to content

feat(ui): create permanent notifications and "channeled" notifications

Description

Many modifications, improvement and bug fixes:

  • The API has been updated, the code is no more part of IService, but has been moved to a new interface INotifier. The services that need to send notifications should now inherit from that new interface. The name of the notification method and the corresponding signal has not changed (notify() and notified), but the signature now uses a Notification structure, instead of only the type and the message string.

    This is a breaking change ! For compatibility and for convenience, a notify() with the same parameters as before is available

  • Notifications can now have individual duration, that can be "infinite". The notification will then be "permanent" and will only be closed by a double click. The duration can be set within the Notification structure, a parameter of the new notify()
  • Notifications can now be "channeled", meaning they can be reused, shared and even closed by several services who share the same "channel" keys. The channel name is also passed in the Notification structure, but can also be mapped from XML configuration:
    <service uid="testNotifierSrv" type="ExNotifications::SDisplayTestNotifications">
      <notification>
        <channel key="CHANNEL1" uid="a_channel" />
        <channel key="CHANNEL2" uid="${ERROR_CHANNEL}" />
      </notification>
    </service>
  • Many bug fixes / small enhancement:
    • Changing position can now be done dynamically (useful for channels), without waiting that all previous notification to be closed to have a correct placement
    • Use a button to display long text instead of single click (which disallowed closing them !)
    • Fixed long text truncation
    • Race conditions / various crashes fixes.

Closes #466 (closed) Closes #1100 (closed)

One application: ExNotifications. Everything can be tested from there.

You can try to change duration, channel, close a previous notification with the "close channel", mix position change, long text, ...

Edited by Didier WECKMANN

Merge request reports