@@ -49,12 +49,12 @@ WebEidDialog::Page commandToPage(const CommandType command)
4949 using Page = WebEidDialog::Page;
5050 switch (command) {
5151 case CommandType::INSERT_CARD:
52- return Page::MESSAGE ;
52+ return Page::ALERT ;
5353 case CommandType::GET_CERTIFICATE:
5454 return Page::SELECT_CERTIFICATE;
5555 case CommandType::AUTHENTICATE:
5656 case CommandType::SIGN:
57- return Page::PININPUT ;
57+ return Page::PIN_INPUT ;
5858 default :
5959 THROW (ProgrammingError, " No page exists for command " + std::string (command));
6060 }
@@ -120,8 +120,7 @@ void WebEidDialog::showWaitingForCardPage(const CommandType commandType)
120120 // Don't show OK button while waiting for card operation or connect card.
121121 ui->okButton ->hide ();
122122
123- ui->pageStack ->setCurrentIndex (
124- int (commandType == CommandType::INSERT_CARD ? Page::MESSAGE : Page::WAITING));
123+ ui->pageStack ->setCurrentIndex (int (Page::WAITING));
125124}
126125
127126QString WebEidDialog::getPin ()
@@ -133,6 +132,8 @@ QString WebEidDialog::getPin()
133132
134133void WebEidDialog::onSmartCardStatusUpdate (const RetriableError status)
135134{
135+ currentCommand = CommandType::INSERT_CARD;
136+
136137 const auto [errorText, title, icon] = retriableErrorToTextTitleAndIcon (status);
137138
138139 ui->connectCardLabel ->setText (errorText);
@@ -143,7 +144,7 @@ void WebEidDialog::onSmartCardStatusUpdate(const RetriableError status)
143144 ui->helpButton ->show ();
144145 ui->cancelButton ->show ();
145146 ui->okButton ->hide ();
146- ui->pageStack ->setCurrentIndex (int (Page::MESSAGE ));
147+ ui->pageStack ->setCurrentIndex (int (Page::ALERT ));
147148}
148149
149150/* * This slot is used by the get certificate and authenticate commands in case there are multiple
@@ -201,7 +202,7 @@ void WebEidDialog::onSingleCertificateReady(const QUrl& origin,
201202{
202203 try {
203204 const auto page = commandToPage (currentCommand);
204- if (page == Page::MESSAGE ) {
205+ if (page == Page::ALERT ) {
205206 THROW (ProgrammingError, " Insert card commmand not allowed here" );
206207 }
207208 switch (currentCommand) {
@@ -258,8 +259,8 @@ void WebEidDialog::onRetry(const RetriableError error)
258259
259260void WebEidDialog::onCertificateNotFound (const QString& certificateSubject)
260261{
261- onRetryImpl (tr (" No electronic ID card is inserted that has the signing certificate provided as "
262- " argument . Please insert the electronic ID card that belongs to %1" )
262+ onRetryImpl (tr (" None of the inserted electronic ID cards has the requested signing "
263+ " certificate . Please insert the electronic ID card that belongs to %1. " )
263264 .arg (certificateSubject));
264265}
265266
@@ -357,7 +358,7 @@ void WebEidDialog::onRetryImpl(const QString& error)
357358 ui->messagePageTitleLabel ->setText (tr (" Error occurred" ));
358359 ui->cardChipIcon ->setPixmap (QStringLiteral (" :/images/id-card.svg" ));
359360 setupOK ([this ] { emit retry (); }, tr (" Retry" ), true );
360- ui->pageStack ->setCurrentIndex (int (Page::MESSAGE ));
361+ ui->pageStack ->setCurrentIndex (int (Page::ALERT ));
361362}
362363
363364void WebEidDialog::setupPinPadProgressBarAndEmitWait (const CardCertificateAndPinInfo& certAndPin)
0 commit comments