mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-03 20:35:36 -04:00
[finished] Tidy up notification-at-end (and allow failed notifications)
This commit is contained in:
parent
5af614daf7
commit
a4682db987
2 changed files with 9 additions and 8 deletions
|
@ -96,6 +96,11 @@ Config::doRestart()
|
|||
void
|
||||
Config::doNotify( bool hasFailed )
|
||||
{
|
||||
if ( !notifyOnFinished() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusInterface notify(
|
||||
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
|
||||
if ( notify.isValid() )
|
||||
|
|
|
@ -25,7 +25,6 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
|
|||
, m_installFailed( false )
|
||||
{
|
||||
auto jq = Calamares::JobQueue::instance();
|
||||
connect( jq, &Calamares::JobQueue::failed, m_widget, &FinishedPage::onInstallationFailed );
|
||||
connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
|
||||
|
||||
emit nextStatusChanged( true );
|
||||
|
@ -86,11 +85,8 @@ FinishedViewStep::isAtEnd() const
|
|||
void
|
||||
FinishedViewStep::onActivate()
|
||||
{
|
||||
if ( !m_installFailed )
|
||||
{
|
||||
m_config->doNotify();
|
||||
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
||||
}
|
||||
m_config->doNotify( m_installFailed );
|
||||
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,9 +99,9 @@ FinishedViewStep::jobs() const
|
|||
void
|
||||
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
||||
{
|
||||
Q_UNUSED( message )
|
||||
Q_UNUSED( details )
|
||||
m_installFailed = true;
|
||||
m_config->setRestartNowMode( Config::RestartMode::Never );
|
||||
m_widget->onInstallationFailed( message, details );
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue