diff options
-rw-r--r-- | src/loginform.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/loginform.cpp b/src/loginform.cpp index 5faa617..a47767a 100644 --- a/src/loginform.cpp +++ b/src/loginform.cpp @@ -82,11 +82,15 @@ void LoginForm::initialize() cancelLoginTimer.setInterval(10000); cancelLoginTimer.setSingleShot(true); - connect(&cancelLoginTimer, SIGNAL(timeout()), this, SLOT(cancelLogin())); + connect(&cancelLoginTimer, &QTimer::timeout, this, &LoginForm::cancelLogin); hideMessageTimer.setInterval(10000); hideMessageTimer.setSingleShot(true); - connect(&hideMessageTimer, SIGNAL(timeout()), this, SLOT(hideMessage())); + connect(&hideMessageTimer, &QTimer::timeout, this, [this]() { + this->hideMessage(); + this->capsOn = -1; + this->checkCaps(); + }); if (!Global::testMode()) { ui->hostnameLabel->setText(Global::greeter()->hostname()); @@ -97,10 +101,10 @@ void LoginForm::initialize() addLeaveEntry(Global::power()->canShutdown(), "system-shutdown", tr("Shutdown"), "shutdown"); addLeaveEntry(Global::power()->canRestart(), "system-reboot", tr("Restart"), "restart"); - connect(ui->leaveComboBox, SIGNAL(activated(int)), this, SLOT(leaveDropDownActivated(int))); - connect(Global::greeter(), SIGNAL(showPrompt(QString, QLightDM::Greeter::PromptType)), this, SLOT(onPrompt(QString, QLightDM::Greeter::PromptType))); - connect(Global::greeter(), SIGNAL(showMessage(QString, QLightDM::Greeter::MessageType)), this, SLOT(onMessage(QString, QLightDM::Greeter::MessageType))); - connect(Global::greeter(), SIGNAL(authenticationComplete()), this, SLOT(onAuthenticationComplete())); + connect(ui->leaveComboBox, QOverload<int>::of(&QComboBox::activated), this, &LoginForm::leaveDropDownActivated); + connect(Global::greeter(), &QLightDM::Greeter::showPrompt, this, &LoginForm::onPrompt); + connect(Global::greeter(), &QLightDM::Greeter::showMessage, this, &LoginForm::onMessage); + connect(Global::greeter(), &QLightDM::Greeter::authenticationComplete, this, &LoginForm::onAuthenticationComplete); } // Load regexp for name substitution @@ -136,6 +140,7 @@ void LoginForm::startAuthentication() std::cerr << "Logging in as " << username.toStdString() << std::endl; if (Global::testMode()) { + showMessage(QLatin1String("Test mode..."), true); return; } if (Global::greeter()->inAuthentication()) { |