|
|
@ -14,17 +14,9 @@
|
|
|
|
#include "Config.h"
|
|
|
|
#include "Config.h"
|
|
|
|
#include "FinishedPage.h"
|
|
|
|
#include "FinishedPage.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "Branding.h"
|
|
|
|
|
|
|
|
#include "JobQueue.h"
|
|
|
|
#include "JobQueue.h"
|
|
|
|
#include "Settings.h"
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
#include "utils/NamedEnum.h"
|
|
|
|
|
|
|
|
#include "utils/Variant.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QtDBus/QDBusConnection>
|
|
|
|
|
|
|
|
#include <QtDBus/QDBusInterface>
|
|
|
|
|
|
|
|
#include <QtDBus/QDBusReply>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinishedViewStep::FinishedViewStep( QObject* parent )
|
|
|
|
FinishedViewStep::FinishedViewStep( QObject* parent )
|
|
|
|
: Calamares::ViewStep( parent )
|
|
|
|
: Calamares::ViewStep( parent )
|
|
|
@ -90,53 +82,15 @@ FinishedViewStep::isAtEnd() const
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
FinishedViewStep::sendNotification()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If the installation failed, don't send notification popup;
|
|
|
|
|
|
|
|
// there's a (modal) dialog popped up with the failure notice.
|
|
|
|
|
|
|
|
if ( m_installFailed )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QDBusInterface notify(
|
|
|
|
|
|
|
|
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
|
|
|
|
|
|
|
|
if ( notify.isValid() )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const auto* branding = Calamares::Branding::instance();
|
|
|
|
|
|
|
|
QDBusReply< uint > r = notify.call(
|
|
|
|
|
|
|
|
"Notify",
|
|
|
|
|
|
|
|
QString( "Calamares" ),
|
|
|
|
|
|
|
|
QVariant( 0U ),
|
|
|
|
|
|
|
|
QString( "calamares" ),
|
|
|
|
|
|
|
|
Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete" ) : tr( "Installation Complete" ),
|
|
|
|
|
|
|
|
Calamares::Settings::instance()->isSetupMode()
|
|
|
|
|
|
|
|
? tr( "The setup of %1 is complete." ).arg( branding->versionedName() )
|
|
|
|
|
|
|
|
: tr( "The installation of %1 is complete." ).arg( branding->versionedName() ),
|
|
|
|
|
|
|
|
QStringList(),
|
|
|
|
|
|
|
|
QVariantMap(),
|
|
|
|
|
|
|
|
QVariant( 0 ) );
|
|
|
|
|
|
|
|
if ( !r.isValid() )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cWarning() << "Could not call org.freedesktop.Notifications.Notify at end of installation." << r.error();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cWarning() << "Could not get dbus interface for notifications at end of installation." << notify.lastError();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
FinishedViewStep::onActivate()
|
|
|
|
FinishedViewStep::onActivate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( m_config->notifyOnFinished() )
|
|
|
|
if ( !m_installFailed )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sendNotification();
|
|
|
|
m_config->doNotify();
|
|
|
|
|
|
|
|
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|