From 55d75f413cd07e66c036f3461faf5d4cba61d6f9 Mon Sep 17 00:00:00 2001 From: leca Date: Wed, 11 Jun 2025 01:39:40 +0300 Subject: [PATCH] notify user if email parsing failed --- mainwindow.cpp | 9 +++++++++ translations/en_US.ts | 26 ++++++++++++++++++-------- translations/ru_RU.ts | 26 ++++++++++++++++++-------- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index e9a4b2b..ddabcee 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -175,6 +175,15 @@ void MainWindow::on_parse_email_button_clicked() { EmailParser email_parser; std::map paramsMap = email_parser.parse_file(filename.toStdString()); + if (paramsMap.empty()) { + QMessageBox infoDialog; + infoDialog.setText(tr("QR code in this E-Mail was not found. If you are sure that the e-mail you supplied has qr code, please, contact the developer and send him the .eml file.")); + infoDialog.setIcon(QMessageBox::Critical); + infoDialog.setWindowTitle(tr("QR code was not found in E-Mail")); + infoDialog.exec(); + return; + } + set_check_params(paramsMap); // QMessageBox infoDialog; // infoDialog.setText(tr("This feature is under development. Wait it to appear in next updates.")); diff --git a/translations/en_US.ts b/translations/en_US.ts index 4d8fecd..cc915f7 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -296,42 +296,52 @@ - + + QR code in this E-Mail was not found. If you are sure that the e-mail you supplied has qr code, please, contact the developer and send him the .eml file. + + + + + QR code was not found in E-Mail + + + + Please, add check(s) to parse Please, add check(s) to parse - + No checks to parse No checks to parse - + Captcha was not solved correctly! Captcha was not solved correctly! - + Captcha is incorrect Captcha is incorrect - + Internal server error. Please, try again later. Internal server error. Please, try again later. - + Internal server error Internal server error - + Check not found. Please, ensure correctness of entered data. Check not found. Please, ensure correctness of entered data. - + Check was not found Check was not found diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index fc96d0c..7d180c3 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -276,42 +276,52 @@ - + + QR code in this E-Mail was not found. If you are sure that the e-mail you supplied has qr code, please, contact the developer and send him the .eml file. + + + + + QR code was not found in E-Mail + + + + Please, add check(s) to parse - + No checks to parse - + Captcha was not solved correctly! Капча была решена неверно! - + Captcha is incorrect Капча введена неверно - + Internal server error. Please, try again later. Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже. - + Internal server error Внутренняя ошибка сервера - + Check not found. Please, ensure correctness of entered data. Чек не найден. Пожалуйста, убедитесь в правильности введённых данных. - + Check was not found Чек не найден