[finished] Expand Config object's repertoire of notification-API

main
Adriaan de Groot 4 years ago
parent f8258f671b
commit aa004503c5

@ -121,10 +121,11 @@ Config::doRestart()
void void
Config::doNotify( bool hasFailed ) Config::doNotify( bool hasFailed, bool sendAnyway )
{ {
if ( !notifyOnFinished() ) if ( !sendAnyway )
{ {
cDebug() << "Notification failed?" << hasFailed << "not sent.";
return; return;
} }

@ -76,14 +76,21 @@ public Q_SLOTS:
*/ */
void doRestart(); void doRestart();
/** @brief Send DBus notification, if desired. /** @brief Send DBus notification
*
* This takes notifyOnFinished() into account.
* *
* At the end of installation (when the FinishedViewStep is activated), * At the end of installation (when the FinishedViewStep is activated),
* send a desktop notification via DBus that the install is done. * send a desktop notification via DBus that the install is done.
*
* - The two-argument form sends success or failure, and can be
* forced to send by setting @p sendAnyway to @c true.
* - The one-argument form sends success or failure and takes
* the notifyOnFinished() configuration into account.
* - The no-argument form checks if a failure was signalled previously
* and uses that to decide if it was a failure.
*
*/ */
void doNotify( bool hasFailed ); void doNotify( bool hasFailed, bool sendAnyway );
void doNotify( bool hasFailed ) { doNotify( hasFailed, notifyOnFinished() ); }
void doNotify() { doNotify( hasFailed() ); } void doNotify() { doNotify( hasFailed() ); }
/** @brief Tell the config the install failed /** @brief Tell the config the install failed

Loading…
Cancel
Save