[finished] Tidy up notification-at-end (and allow failed notifications)
This commit is contained in:
parent
5af614daf7
commit
a4682db987
@ -96,6 +96,11 @@ Config::doRestart()
|
|||||||
void
|
void
|
||||||
Config::doNotify( bool hasFailed )
|
Config::doNotify( bool hasFailed )
|
||||||
{
|
{
|
||||||
|
if ( !notifyOnFinished() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QDBusInterface notify(
|
QDBusInterface notify(
|
||||||
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
|
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
|
||||||
if ( notify.isValid() )
|
if ( notify.isValid() )
|
||||||
|
@ -25,7 +25,6 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
|
|||||||
, m_installFailed( false )
|
, m_installFailed( false )
|
||||||
{
|
{
|
||||||
auto jq = Calamares::JobQueue::instance();
|
auto jq = Calamares::JobQueue::instance();
|
||||||
connect( jq, &Calamares::JobQueue::failed, m_widget, &FinishedPage::onInstallationFailed );
|
|
||||||
connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
|
connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
|
||||||
|
|
||||||
emit nextStatusChanged( true );
|
emit nextStatusChanged( true );
|
||||||
@ -86,11 +85,8 @@ FinishedViewStep::isAtEnd() const
|
|||||||
void
|
void
|
||||||
FinishedViewStep::onActivate()
|
FinishedViewStep::onActivate()
|
||||||
{
|
{
|
||||||
if ( !m_installFailed )
|
m_config->doNotify( m_installFailed );
|
||||||
{
|
|
||||||
m_config->doNotify();
|
|
||||||
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,9 +99,9 @@ FinishedViewStep::jobs() const
|
|||||||
void
|
void
|
||||||
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
||||||
{
|
{
|
||||||
Q_UNUSED( message )
|
|
||||||
Q_UNUSED( details )
|
|
||||||
m_installFailed = true;
|
m_installFailed = true;
|
||||||
|
m_config->setRestartNowMode( Config::RestartMode::Never );
|
||||||
|
m_widget->onInstallationFailed( message, details );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user