Finished: make notification optional

FIXES #811
main
Adriaan de Groot 7 years ago
parent 94e7735ee4
commit 74c19fc02d

@ -34,6 +34,7 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new FinishedPage() )
, installFailed( false )
, m_notifyOnFinished( false )
{
auto jq = Calamares::JobQueue::instance();
connect( jq, &Calamares::JobQueue::failed,
@ -139,7 +140,8 @@ FinishedViewStep::onActivate()
{
m_widget->setUpRestart();
sendNotification();
if ( m_notifyOnFinished )
sendNotification();
}
@ -179,6 +181,9 @@ FinishedViewStep::setConfigurationMap( const QVariantMap& configurationMap )
m_widget->setRestartNowCommand( "systemctl -i reboot" );
}
}
if ( configurationMap.contains( "notifyOnFinished" ) &&
configurationMap.value( "notifyOnFinished" ).type() == QVariant::Bool )
m_notifyOnFinished = configurationMap.value( "notifyOnFinished" ).toBool();
}
CALAMARES_PLUGIN_FACTORY_DEFINITION( FinishedViewStepFactory, registerPlugin<FinishedViewStep>(); )

@ -68,6 +68,7 @@ private:
void sendNotification();
bool installFailed;
bool m_notifyOnFinished;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( FinishedViewStepFactory )

@ -1,4 +1,17 @@
Configuration for the "finished" page, which is usually shown only at
the end of the installation (successful or not).
---
# The finished page can hold a "restart system now" checkbox.
# If this is false, no checkbox is show and the system is not restarted
# when Calamares exits.
restartNowEnabled: true
# Initial state of the checkbox "restart now".
restartNowChecked: false
# If the checkbox is shown, and the checkbox is checked, then when
# Calamares exits from the finished-page it will run this command.
restartNowCommand: "systemctl -i reboot"
# When the last page is (successfully) reached, send a DBus notification
# to the desktop that the installation is done. This works only if the
# user as whom Calamares is run, can reach the regular desktop session bus.
notifyOnFinished: false

Loading…
Cancel
Save