diff --git a/src/ui/webeiddialog.cpp b/src/ui/webeiddialog.cpp index 76f7ab75..41dbb0c5 100644 --- a/src/ui/webeiddialog.cpp +++ b/src/ui/webeiddialog.cpp @@ -682,14 +682,15 @@ void WebEidDialog::displayPinBlockedError() displayFatalError([] { return tr("PIN is locked. Unblock and try again."); }); } -void WebEidDialog::displayFatalError(std::function message) +template +void WebEidDialog::displayFatalError(Text message) { ui->pinTitleLabel->hide(); ui->pinInput->hide(); ui->pinTimeoutTimer->stop(); ui->pinTimeRemaining->hide(); ui->pinEntryTimeoutProgressBar->hide(); - setTrText(ui->pinErrorLabel, message); + setTrText(ui->pinErrorLabel, std::forward(message)); ui->pinErrorLabel->show(); ui->okButton->hide(); ui->cancelButton->setEnabled(true); diff --git a/src/ui/webeiddialog.hpp b/src/ui/webeiddialog.hpp index bf60a98a..308632a7 100644 --- a/src/ui/webeiddialog.hpp +++ b/src/ui/webeiddialog.hpp @@ -104,7 +104,8 @@ class WebEidDialog final : public WebEidUI template void setupOK(Func func, const char* text = {}, bool enabled = false); void displayPinBlockedError(); - void displayFatalError(std::function message); + template + void displayFatalError(Text message); void showPinInputWarning(bool show); void resizeHeight();