Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class DigidocConf final: public digidoc::XmlConfCurrent
dispatchToMain([] {
WarningDialog::create()
->withTitle(Application::tr("The renewal of Trust Service status List has failed"))
->withText(Application::tr(
->withRichText(Application::tr(
"Trust Service status List is used for digital signature validation. "
"Please check your internet connection and make sure you have the latest ID-software version "
"installed. An expired Trust Service List (TSL) will be used for signature validation. "
Expand Down Expand Up @@ -372,7 +372,7 @@ Application::Application( int &argc, char **argv )
{
dlg = WarningDialog::create()
->withTitle(tr("This version of ID-software on your computer is unsupported"))
->withText(tr("DigiDoc4 Client cannot be used until you update ID-software. "
->withRichText(tr("DigiDoc4 Client cannot be used until you update ID-software. "
"Install new ID-software from <a href=\"https://www.id.ee/en/article/install-id-software/\">www.id.ee</a>. "
"macOS users can download the latest ID-software version from the "
"<a href=\"https://itunes.apple.com/ee/developer/ria/id556524921?mt=12\">Mac App Store</a>."));
Expand All @@ -382,7 +382,7 @@ Application::Application( int &argc, char **argv )
{
dlg = WarningDialog::create()
->withTitle(tr("Your ID-software has expired"))
->withText(tr("To download the latest software version, go to the "
->withRichText(tr("To download the latest software version, go to the "
"<a href=\"https://www.id.ee/en/article/install-id-software/\">id.ee</a> website. "
"macOS users can download the latest ID-software version from the "
"<a href=\"https://itunes.apple.com/ee/developer/ria/id556524921?mt=12\">Mac App Store</a>."));
Expand All @@ -392,7 +392,7 @@ Application::Application( int &argc, char **argv )
{
auto *dlg = WarningDialog::create(activeWindow())
->withTitle(tr("An ID-software update has been found"))
->withText(tr("To download the update, go to the "
->withRichText(tr("To download the update, go to the "
"<a href=\"https://www.id.ee/en/article/install-id-software/\">id.ee</a> website. "
"macOS users can download the update from the "
"<a href=\"https://itunes.apple.com/ee/developer/ria/id556524921?mt=12\">Mac App Store</a>."));
Expand Down
2 changes: 1 addition & 1 deletion client/CryptoDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool CDocumentModel::addFile(const QString &file, const QString &mime)
{
WarningDialog::create()
->withTitle(DocumentModel::tr("Failed to add file"))
->withText(tr("Added file(s) exceeds the maximum size limit of the container (∼120MB). "
->withRichText(tr("Added file(s) exceeds the maximum size limit of the container (∼120MB). "
"<a href='https://www.id.ee/en/article/encrypting-large-120-mb-files/'>Read more about it</a>"))
->open();
return false;
Expand Down
6 changes: 3 additions & 3 deletions client/DigiDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct ServiceConfirmation final: public ContainerOpenCB
return dispatchToMain([this] {
return WarningDialog::create(parent)
->withTitle(DigiDoc::tr("Send document to SiVa"))
->withText(DigiDoc::tr(
->withRichText(DigiDoc::tr(
"This type of signed document will be transmitted to the "
"Digital Signature Validation Service SiVa to verify the validity of the digital signature. "
"Read more information about transmitted data to Digital Signature Validation service from "
Expand Down Expand Up @@ -735,14 +735,14 @@ void DigiDoc::setLastError(const QString &title, const Exception &e)
case Exception::CertificateUnknown:
dlg->withText(tr("Certificate status unknown")); break;
case Exception::OCSPTimeSlot:
dlg->withText(tr("Please check your computer time. <a href='https://www.id.ee/en/article/digidoc4-client-error-please-check-your-computer-time-2/'>Additional information</a>")); break;
dlg->withRichText(tr("Please check your computer time. <a href='https://www.id.ee/en/article/digidoc4-client-error-please-check-your-computer-time-2/'>Additional information</a>")); break;
case Exception::OCSPRequestUnauthorized:
dlg->withText(tr("You have not granted IP-based access. "
"Check your validity confirmation service access settings.")); break;
case Exception::TSForbidden:
dlg->withText(tr("Check your Time-Stamping service access settings.")); break;
case Exception::TSTooManyRequests:
dlg->withText(tr("The limit for digital signatures per month has been reached for this IP address. "
dlg->withRichText(tr("The limit for digital signatures per month has been reached for this IP address. "
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>")); break;
case Exception::PINCanceled:
dlg->deleteLater();
Expand Down
4 changes: 2 additions & 2 deletions client/dialogs/AddRecipients.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void AddRecipients::addRecipientToRightPane(Item *item, bool update)
->open();
return;
}
auto *dlg = WarningDialog::create(this)->withText(tr(
auto *dlg = WarningDialog::create(this)->withRichText(tr(
"Are you sure that you want use certificate for encrypting, which expired on %1?<br />"
"When decrypter has updated certificates then decrypting is impossible.")
.arg(expiryDate.toString(QStringLiteral("dd.MM.yyyy hh:mm:ss"))))
Expand Down Expand Up @@ -403,7 +403,7 @@ void AddRecipients::showResult(const QList<QSslCertificate> &result, int resultC
else if(--multiSearch <= 0 && ui->leftPane->items.isEmpty())
WarningDialog::create(this)
->withTitle(tr("Person or company does not own a valid certificate"))
->withText(tr("It is necessary to have a valid certificate for encryption.<br />"
->withRichText(tr("It is necessary to have a valid certificate for encryption.<br />"
"<a href='https://www.id.ee/en/article/encryption-and-decryption-of-documents/'>Read more about it</a>."))
->open();
QApplication::restoreOverrideCursor();
Expand Down
12 changes: 8 additions & 4 deletions client/dialogs/MobileProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ background-color: #007aff;
d->manager->setParent(d);
QObject::connect(d->manager, &QNetworkAccessManager::finished, d, [=, this](QNetworkReply *reply) {
QScopedPointer<QNetworkReply,QScopedPointerDeleteLater> scope(reply);
auto returnError = [=, this](const QString &err, const QString &details = {}) {
auto returnError = [=, this](const QString &err, const QString &details = {}, bool richText = false) {
qCWarning(MIDLog) << err;
d->statusTimer->stop();
d->hide();
auto *dlg = WarningDialog::create(d->parentWidget())->withText(err)->withDetails(details)
->withTitle(QCoreApplication::translate("DigiDoc", "Failed to sign container"));
auto *dlg = WarningDialog::create(d->parentWidget());
if(richText)
dlg->withRichText(err);
else
dlg->withText(err);
dlg->withDetails(details)->withTitle(QCoreApplication::translate("DigiDoc", "Failed to sign container"));
QObject::connect(dlg, &WarningDialog::finished, &d->l, &QEventLoop::exit);
dlg->open();
};
Expand Down Expand Up @@ -137,7 +141,7 @@ background-color: #007aff;
return returnError(tr("Failed to send request. The number of unsuccesful request from this IP address has been exceeded. Please try again later."));
case 429:
return returnError(tr("The limit for %1 digital signatures per month has been reached. "
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("mobile-ID")));
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("mobile-ID")), {}, true);
case 580:
return returnError(tr("Failed to send request. A valid session is associated with this personal code. "
"It is not possible to start a new signing before the current session expires. Please try again later."));
Expand Down
4 changes: 2 additions & 2 deletions client/dialogs/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent)
#ifdef Q_OS_MACOS
WarningDialog::create(this)
->withTitle(tr("Restart DigiDoc4 Client to activate logging"))
->withText(tr("Read more <a href=\"https://www.id.ee/en/article/log-file-generation-in-digidoc4-client/\">here</a>."))
->withRichText(tr("Read more <a href=\"https://www.id.ee/en/article/log-file-generation-in-digidoc4-client/\">here</a>."))
->open();
#else
auto *dlg = WarningDialog::create(this)
->withTitle(tr("Restart DigiDoc4 Client to activate logging"))
->withText(tr("Read more <a href=\"https://www.id.ee/en/article/log-file-generation-in-digidoc4-client/\">here</a>. Restart now?"))
->withRichText(tr("Read more <a href=\"https://www.id.ee/en/article/log-file-generation-in-digidoc4-client/\">here</a>. Restart now?"))
->setCancelText(WarningDialog::NO)
->addButton(WarningDialog::YES, QMessageBox::Yes);
connect(dlg, &WarningDialog::finished, qApp, [](int result) {
Expand Down
16 changes: 10 additions & 6 deletions client/dialogs/SmartIDProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ background-color: #007aff;
d->manager->setParent(d);
QNetworkAccessManager::connect(d->manager, &QNetworkAccessManager::finished, d, [&, this](QNetworkReply *reply){
QScopedPointer<QNetworkReply,QScopedPointerDeleteLater> scope(reply);
auto returnError = [=, this](const QString &err, const QString &details = {}) {
auto returnError = [=, this](const QString &err, const QString &details = {}, bool richText = false) {
qCWarning(SIDLog) << err;
d->statusTimer->stop();
delete d->timer;
d->timer = nullptr;
d->hide();
auto *dlg = WarningDialog::create(d->parentWidget())->withText(err)->withDetails(details)
->withTitle(QCoreApplication::translate("DigiDoc", "Failed to sign container"));
auto *dlg = WarningDialog::create(d->parentWidget());
if(richText)
dlg->withRichText(err);
else
dlg->withText(err);
dlg->withDetails(details)->withTitle(QCoreApplication::translate("DigiDoc", "Failed to sign container"));
QObject::connect(dlg, &WarningDialog::finished, &d->l, &QEventLoop::exit);
dlg->open();
};
Expand Down Expand Up @@ -147,17 +151,17 @@ background-color: #007aff;
{
case 403:
return returnError(tr("Check your %1 service access settings. "
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("Smart-ID")));
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("Smart-ID")), {}, true);
case 409:
return returnError(tr("Failed to send request. The number of unsuccesful request from this IP address has been exceeded. Please try again later."));
case 429:
return returnError(tr("The limit for %1 digital signatures per month has been reached. "
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("Smart-ID")));
"<a href=\"https://www.id.ee/en/article/for-organisations-that-sign-large-quantities-of-documents-using-digidoc4-client/\">Additional information</a>").arg(tr("Smart-ID")), {}, true);
case 471:
return returnError(tr("Your Smart-ID certificate level must be qualified to sign documents in DigiDoc4 Client."));
case 480:
return returnError(tr("Your signing software needs an upgrade. Please update your ID software, which you can get from "
"<a href=\"https://www.id.ee/en/\">www.id.ee</a>. Additional info is available ID-helpline (+372) 666 8888."));
"<a href=\"https://www.id.ee/en/\">www.id.ee</a>. Additional info is available ID-helpline (+372) 666 8888."), {}, true);
case 580:
return returnError(tr("Failed to send request. A valid session is associated with this personal code. "
"It is not possible to start a new signing before the current session expires. Please try again later."));
Expand Down
16 changes: 16 additions & 0 deletions client/dialogs/WarningDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,35 @@ WarningDialog* WarningDialog::create(QWidget *parent)

WarningDialog* WarningDialog::withText(const QString &text)
{
ui->text->setTextFormat(Qt::PlainText);
ui->text->setOpenExternalLinks(false);
ui->text->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
ui->text->setText(text);
ui->text->setHidden(text.isEmpty());
return this;
}
WarningDialog* WarningDialog::withRichText(const QString &text)
{
ui->text->setTextFormat(Qt::RichText);
ui->text->setOpenExternalLinks(true);
ui->text->setTextInteractionFlags(Qt::TextBrowserInteraction);
ui->text->setText(text);
ui->text->setHidden(text.isEmpty());
return this;
}
WarningDialog* WarningDialog::withTitle(const QString &title)
{
ui->title->setTextFormat(Qt::PlainText);
ui->title->setText(title);
ui->title->setHidden(title.isEmpty());
return this;
}

WarningDialog* WarningDialog::withDetails(const QString &details)
{
ui->details->setTextFormat(Qt::PlainText);
ui->details->setOpenExternalLinks(false);
ui->details->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
ui->details->setText(details);
ui->details->hide();
ui->showDetails->setHidden(details.isEmpty());
Expand Down
1 change: 1 addition & 0 deletions client/dialogs/WarningDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class WarningDialog final: public QDialog
WarningDialog *resetCancelStyle(bool warning);
WarningDialog *withTitle(const QString &text);
WarningDialog *withText(const QString &text);
WarningDialog *withRichText(const QString &text);
WarningDialog *withDetails(const QString &details);

static WarningDialog *create(QWidget *parent = {});
Expand Down
16 changes: 11 additions & 5 deletions client/dialogs/WarningDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ background-color: #E1C1C6;
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -99,16 +102,16 @@ background-color: #E1C1C6;
<enum>Qt::TabFocus</enum>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
Expand Down Expand Up @@ -153,14 +156,17 @@ margin: 0px 15px 0px 15px;
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion client/widgets/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void FileList::saveAll()
}
b = WarningDialog::create(this)
->withTitle(FileDialog::tr("Failed to save files"))
->withText(tr("%1 already exists.<br />Do you want replace it?").arg(dest))
->withRichText(tr("%1 already exists.<br />Do you want replace it?").arg(dest.toHtmlEscaped()))
->setCancelText(WarningDialog::Cancel)
->addButton(WarningDialog::YES, QMessageBox::Yes)
->addButton(WarningDialog::NO, QMessageBox::No)
Expand Down
12 changes: 6 additions & 6 deletions client/widgets/VerifyCert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ VerifyCert::VerifyCert(QWidget *parent)
case SslCertificate::Revoked:
if(SslCertificate::CertType::TempelType == c.type())
dlg->withTitle(tr("Certificate is not valid"))
->withText(tr("A valid certificate is required for electronic use. ") + readMore);
->withRichText(tr("A valid certificate is required for electronic use. ") + readMore);
else if(c.keyUsage().contains(SslCertificate::NonRepudiation))
dlg->withTitle(tr("Your ID-card signing certificate is not valid"))
->withText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
->withRichText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
else
dlg->withTitle(tr("Your ID-card authentication certificate is not valid"))
->withText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
->withRichText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
break;
case SslCertificate::Unknown:
if(SslCertificate::CertType::TempelType == c.type())
dlg->withTitle(tr("Certificate status is unknown"))
->withText(tr("A valid certificate is required for electronic use. ") + readMore);
->withRichText(tr("A valid certificate is required for electronic use. ") + readMore);
else if(c.keyUsage().contains(SslCertificate::NonRepudiation))
dlg->withTitle(tr("Your ID-card signing certificate status is unknown"))
->withText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
->withRichText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
else
dlg->withTitle(tr("Your ID-card authentication certificate status is unknown"))
->withText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
->withRichText(tr("You need valid certificates to use your ID-card electronically. ") + readMore);
break;
default:
dlg->withTitle(tr("Certificate status check failed"))
Expand Down
Loading