diff options
author | Simon Rettberg | 2019-04-26 14:03:12 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-04-26 14:03:12 +0200 |
commit | 8f0cca3b2a2cb5bd4bdb49f768a2b97f7c12ffe7 (patch) | |
tree | 953ce78f763421b32e7a59968af18b7b9e6bf95f /src | |
parent | Add caps lock warning (diff) | |
download | slxgreeter-8f0cca3b2a2cb5bd4bdb49f768a2b97f7c12ffe7.tar.gz slxgreeter-8f0cca3b2a2cb5bd4bdb49f768a2b97f7c12ffe7.tar.xz slxgreeter-8f0cca3b2a2cb5bd4bdb49f768a2b97f7c12ffe7.zip |
Use Qt5 QObject::connect(), fix caplock message after failed login
Diffstat (limited to 'src')
-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()) { |