D24486: [Notifications] Report effective Inhibited state on DBus

Kai Uwe Broulik noreply at phabricator.kde.org
Tue Oct 8 09:46:12 BST 2019


broulik created this revision.
broulik added reviewers: Plasma, dfaure.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  The inhibition handling (e.g. combining time-based, screen mirrored, etc) is done inside the applet.
  The `Server` knows nothing about it and only reports `Inhibited` as `true` when an external application requested one, not when the user enabled it in the applet.
  This patch exposes the `NotificationManager.Server` as singleton QML type and adds a way for the applet to tell it the effective inhibition state.
  Exposing the server to QML could also be used in the future to provide better error reporting to the user when the service isn't running and/or owned by someone else (e.g. Dunst)

TEST PLAN
  Would be lovely to get that into 5.17 still
  @dfaure asked how apps can check do not disturb mode, turns out it was a bit broken
  
  - Requested external inhibition, applet went into dnd mode, checked dbus to see that change signal was emitted and property returned `true`
  - Killed external app, applet went normal, checked dbus to see that change signal was emitted and property returned `false`
  - Chose "1 hour" in applet, checked dbus to see that change signal was emitted and property
  - Started external app, nothing changed because there was already an inhibition
  - Unchecked dnd checkbox (which will force dnd off no matter what), checked dbus to see that change signal was emitted and property returned `false`
  
  (didn't we have a way to put unit tests into plasmoids? would be nice to test this stuff a bit better)

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D24486

AFFECTED FILES
  applets/notifications/package/contents/ui/global/Globals.qml
  libnotificationmanager/declarative/notificationmanagerplugin.cpp
  libnotificationmanager/server.cpp
  libnotificationmanager/server.h
  libnotificationmanager/server_p.cpp
  libnotificationmanager/server_p.h
  libnotificationmanager/settings.cpp

To: broulik, #plasma, dfaure
Cc: dfaure, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191008/b7a4ede8/attachment.html>


More information about the Plasma-devel mailing list