<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, dfaure.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D24486">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The inhibition handling (e.g. combining time-based, screen mirrored, etc) is done inside the applet.<br />
The <tt style="background: #ebebeb; font-size: 13px;">Server</tt> knows nothing about it and only reports <tt style="background: #ebebeb; font-size: 13px;">Inhibited</tt> as <tt style="background: #ebebeb; font-size: 13px;">true</tt> when an external application requested one, not when the user enabled it in the applet.<br />
This patch exposes the <tt style="background: #ebebeb; font-size: 13px;">NotificationManager.Server</tt> as singleton QML type and adds a way for the applet to tell it the effective inhibition state.<br />
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)</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Would be lovely to get that into 5.17 still<br />
<a href="https://phabricator.kde.org/p/dfaure/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@dfaure</a> asked how apps can check do not disturb mode, turns out it was a bit broken</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Requested external inhibition, applet went into dnd mode, checked dbus to see that change signal was emitted and property returned <tt style="background: #ebebeb; font-size: 13px;">true</tt></li>
<li class="remarkup-list-item">Killed external app, applet went normal, checked dbus to see that change signal was emitted and property returned <tt style="background: #ebebeb; font-size: 13px;">false</tt></li>
<li class="remarkup-list-item">Chose "1 hour" in applet, checked dbus to see that change signal was emitted and property</li>
<li class="remarkup-list-item">Started external app, nothing changed because there was already an inhibition</li>
<li class="remarkup-list-item">Unchecked dnd checkbox (which will force dnd off no matter what), checked dbus to see that change signal was emitted and property returned <tt style="background: #ebebeb; font-size: 13px;">false</tt></li>
</ul>

<p>(didn't we have a way to put unit tests into plasmoids? would be nice to test this stuff a bit better)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D24486">https://phabricator.kde.org/D24486</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applets/notifications/package/contents/ui/global/Globals.qml<br />
libnotificationmanager/declarative/notificationmanagerplugin.cpp<br />
libnotificationmanager/server.cpp<br />
libnotificationmanager/server.h<br />
libnotificationmanager/server_p.cpp<br />
libnotificationmanager/server_p.h<br />
libnotificationmanager/settings.cpp</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, dfaure<br /><strong>Cc: </strong>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<br /></div>