From ac191b777a47ff670abe0ded0e4fe9b7d3195291 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Fri, 25 Oct 2024 09:28:39 +0300 Subject: [PATCH] Update dialogs to new UI guidlines * AddRecipients * CertificateDetails * CertificateHistory * KeyDialog IB-7969 Signed-off-by: Raul Metsma --- client/CMakeLists.txt | 2 +- client/dialogs/AddRecipients.cpp | 212 +++----- client/dialogs/AddRecipients.h | 12 +- client/dialogs/AddRecipients.ui | 194 +++---- client/dialogs/CertificateDetails.cpp | 64 +-- client/dialogs/CertificateDetails.h | 8 +- client/dialogs/CertificateDetails.ui | 631 +++++++++-------------- client/dialogs/CertificateDetails_mac.mm | 54 +- client/dialogs/CertificateHistory.cpp | 42 +- client/dialogs/CertificateHistory.h | 2 +- client/dialogs/CertificateHistory.ui | 366 +++++++------ client/dialogs/KeyDialog.cpp | 34 +- client/dialogs/KeyDialog.ui | 189 +++---- client/dialogs/MobileDialog.ui | 5 +- client/dialogs/MobileProgress.ui | 5 +- client/dialogs/PinPopup.ui | 5 +- client/dialogs/PinUnblock.ui | 5 +- client/dialogs/RoleAddressDialog.ui | 5 +- client/dialogs/SettingsDialog.ui | 2 +- client/dialogs/SmartIDDialog.ui | 5 +- client/translations/en.ts | 68 +-- client/translations/et.ts | 68 +-- client/translations/ru.ts | 70 +-- 23 files changed, 786 insertions(+), 1262 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index b2251bcb4..bed01b7c7 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -162,7 +162,7 @@ if( APPLE ) target_sources(${PROJECT_NAME} PRIVATE ${RESOURCE_FILES} Application_mac.mm MacMenuBar.cpp MacMenuBar.h dialogs/CertificateDetails_mac.mm Diagnostics_unix.cpp) set_source_files_properties( Application_mac.mm dialogs/CertificateDetails_mac.mm PROPERTIES COMPILE_FLAGS "-fobjc-arc" ) set_source_files_properties( LdapSearch.cpp PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" ) - target_link_libraries(${PROJECT_NAME} "-framework Quartz" "-fobjc-arc") + target_link_libraries(${PROJECT_NAME} "-framework QuickLookUI" "-fobjc-arc") find_library(PKCS11_MODULE NAMES opensc-pkcs11.so HINTS /Library/OpenSC/lib) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND cp -a ${PKCS11_MODULE} $ diff --git a/client/dialogs/AddRecipients.cpp b/client/dialogs/AddRecipients.cpp index 24675aa7b..5da28c718 100644 --- a/client/dialogs/AddRecipients.cpp +++ b/client/dialogs/AddRecipients.cpp @@ -29,13 +29,11 @@ #include "LdapSearch.h" #include "QSigner.h" #include "Settings.h" -#include "Styles.h" #include "TokenData.h" #include "dialogs/WarningDialog.h" #include "effects/Overlay.h" #include -#include #include #include #include @@ -56,22 +54,11 @@ AddRecipients::AddRecipients(ItemList* itemList, QWidget *parent) new Overlay(this); ui->leftPane->init(ria::qdigidoc4::ToAddAdresses, QT_TRANSLATE_NOOP("ItemList", "Add recipients")); - ui->leftPane->setFont(Styles::font(Styles::Regular, 20)); ui->rightPane->init(ria::qdigidoc4::AddedAdresses, QT_TRANSLATE_NOOP("ItemList", "Added recipients")); - ui->rightPane->setFont(Styles::font(Styles::Regular, 20)); - ui->fromCard->setFont(Styles::font(Styles::Condensed, 12)); - ui->fromFile->setFont(Styles::font(Styles::Condensed, 12)); - ui->fromHistory->setFont(Styles::font(Styles::Condensed, 12)); - - ui->cancel->setFont(Styles::font(Styles::Condensed, 14)); - ui->confirm->setFont(Styles::font(Styles::Condensed, 14)); - - ui->confirm->setDisabled(rightList.isEmpty()); connect(ui->confirm, &QPushButton::clicked, this, &AddRecipients::accept); connect(ui->cancel, &QPushButton::clicked, this, &AddRecipients::reject); connect(ui->leftPane, &ItemList::search, this, [&](const QString &term) { - leftList.clear(); ui->leftPane->clear(); search(term); }); @@ -81,18 +68,26 @@ AddRecipients::AddRecipients(ItemList* itemList, QWidget *parent) connect(ldap_corp, &LdapSearch::error, this, &AddRecipients::showError); connect(this, &AddRecipients::finished, this, &AddRecipients::close); - connect(ui->leftPane, &ItemList::addAll, this, &AddRecipients::addAllRecipientToRightPane ); + connect(ui->leftPane, &ItemList::addAll, this, [this] { + for(Item *item: ui->leftPane->items) + addRecipientToRightPane(item); + }); connect(ui->rightPane, &ItemList::removed, ui->rightPane, &ItemList::removeItem ); - connect(ui->fromCard, &QPushButton::clicked, this, &AddRecipients::addRecipientFromCard); - connect( qApp->signer(), &QSigner::authDataChanged, this, &AddRecipients::enableRecipientFromCard ); + connect(ui->fromCard, &QPushButton::clicked, this, [this] { + addRecipient(qApp->signer()->tokenauth().cert()); + }); + auto enableRecipientFromCard = [this] { + ui->fromCard->setDisabled(qApp->signer()->tokenauth().cert().isNull()); + }; enableRecipientFromCard(); + connect(qApp->signer(), &QSigner::authDataChanged, this, std::move(enableRecipientFromCard)); connect(ui->fromFile, &QPushButton::clicked, this, &AddRecipients::addRecipientFromFile); connect(ui->fromHistory, &QPushButton::clicked, this, &AddRecipients::addRecipientFromHistory); for(Item *item: itemList->items) - addRecipientToRightPane((qobject_cast(item))->getKey(), false); + addRecipientToRightPane(item, false); } AddRecipients::~AddRecipients() @@ -101,25 +96,6 @@ AddRecipients::~AddRecipients() delete ui; } -void AddRecipients::addAllRecipientToRightPane() -{ - QList history; - for(AddressItem *value: leftList) - { - if(rightList.contains(value->getKey())) - continue; - addRecipientToRightPane(value); - history.append(value->getKey().cert); - } - ui->confirm->setDisabled(rightList.isEmpty()); - historyCertData.addAndSave(history); -} - -void AddRecipients::addRecipientFromCard() -{ - if(auto *item = addRecipientToLeftPane(qApp->signer()->tokenauth().cert())) - addRecipientToRightPane(item, true); -} void AddRecipients::addRecipientFromFile() { @@ -150,47 +126,52 @@ void AddRecipients::addRecipientFromFile() { WarningDialog::show(this, tr("This certificate cannot be used for encryption")); } - else if(auto *item = addRecipientToLeftPane(cert)) - { - addRecipientToRightPane(item, true); - } + else + addRecipient(cert); } void AddRecipients::addRecipientFromHistory() { auto *dlg = new CertificateHistory(historyCertData, this); - connect(dlg, &CertificateHistory::addSelectedCerts, this, &AddRecipients::addSelectedCerts); + connect(dlg, &CertificateHistory::addSelectedCerts, this, [this](const QList &selectedCertData) { + if(selectedCertData.isEmpty()) + return; + + ui->leftPane->clear(); + for(const HistoryCertData &certData: selectedCertData) { + QString term = (certData.type == QStringLiteral("1") || certData.type == QStringLiteral("3")) ? certData.CN : certData.CN.split(',').value(2); + search(term, true, certData.type); + } + }); dlg->open(); } -AddressItem * AddRecipients::addRecipientToLeftPane(const QSslCertificate& cert) +void AddRecipients::addRecipient(const QSslCertificate& cert, bool select) { - AddressItem *leftItem = leftList.value(cert); - if(leftItem) - return leftItem; - - leftItem = new AddressItem(CKey(cert), ui->leftPane); - leftList.insert(cert, leftItem); - ui->leftPane->addWidget(leftItem); - bool contains = rightList.contains(cert); - leftItem->setDisabled(contains); - leftItem->showButton(contains ? AddressItem::Added : AddressItem::Add); - - connect(leftItem, &AddressItem::add, this, [this](Item *item) { - addRecipientToRightPane(qobject_cast(item), true); - }); - - if(auto *add = ui->leftPane->findChild(QStringLiteral("add"))) - add->setVisible(true); + AddressItem *leftItem = itemListValue(ui->leftPane, cert); + if(!leftItem) + { + leftItem = new AddressItem(cert, ui->leftPane); + ui->leftPane->addWidget(leftItem); + bool contains = rightList.contains(cert); + leftItem->setDisabled(contains); + leftItem->showButton(contains ? AddressItem::Added : AddressItem::Add); + connect(leftItem, &AddressItem::add, this, [this](Item *item) { addRecipientToRightPane(item); }); + if(auto *add = ui->leftPane->findChild(QStringLiteral("add"))) + add->setVisible(true); + } - return leftItem; + if(select) + addRecipientToRightPane(leftItem); } -bool AddRecipients::addRecipientToRightPane(const CKey &key, bool update) +void AddRecipients::addRecipientToRightPane(Item *item, bool update) { - if (rightList.contains(key)) - return false; + auto *address = qobject_cast(item); + if(!address || rightList.contains(address->getKey())) + return; + const auto &key = address->getKey(); if(update) { if(auto expiryDate = key.cert.expiryDate(); expiryDate <= QDateTime::currentDateTime()) @@ -198,7 +179,7 @@ bool AddRecipients::addRecipientToRightPane(const CKey &key, bool update) if(Settings::CDOC2_DEFAULT && Settings::CDOC2_USE_KEYSERVER) { WarningDialog::show(this, tr("Failed to add certificate. An expired certificate cannot be used for encryption.")); - return false; + return; } auto *dlg = new WarningDialog(tr("Are you sure that you want use certificate for encrypting, which expired on %1?
" "When decrypter has updated certificates then decrypting is impossible.") @@ -206,7 +187,7 @@ bool AddRecipients::addRecipientToRightPane(const CKey &key, bool update) dlg->setCancelText(WarningDialog::NO); dlg->addButton(WarningDialog::YES, QMessageBox::Yes); if(dlg->exec() != QMessageBox::Yes) - return false; + return; } QSslConfiguration backup = QSslConfiguration::defaultConfiguration(); QSslConfiguration::setDefaultConfiguration(CheckConnection::sslConfiguration()); @@ -219,7 +200,7 @@ bool AddRecipients::addRecipientToRightPane(const CKey &key, bool update) dlg->setCancelText(WarningDialog::NO); dlg->addButton(WarningDialog::YES, QMessageBox::Yes); if(dlg->exec() != QMessageBox::Yes) - return false; + return; } } updated = update; @@ -227,47 +208,45 @@ bool AddRecipients::addRecipientToRightPane(const CKey &key, bool update) rightList.append(key); auto *rightItem = new AddressItem(key, ui->rightPane); - connect(rightItem, &AddressItem::remove, this, &AddRecipients::removeRecipientFromRightPane); + connect(rightItem, &AddressItem::remove, this, [this](Item *item) { + auto *rightItem = qobject_cast(item); + if(auto *leftItem = itemListValue(ui->leftPane, rightItem->getKey().cert)) + { + leftItem->setDisabled(false); + leftItem->showButton(AddressItem::Add); + } + rightList.removeAll(rightItem->getKey()); + updated = true; + ui->confirm->setDisabled(rightList.isEmpty()); + }); ui->rightPane->addWidget(rightItem); - ui->confirm->setDisabled(rightList.isEmpty()); - historyCertData.addAndSave({key.cert}); - return true; -} - -void AddRecipients::addRecipientToRightPane(AddressItem *leftItem, bool update) -{ - if(addRecipientToRightPane(leftItem->getKey(), update)) { + ui->confirm->setEnabled(true); + historyCertData.addAndSave(key.cert); + if(auto *leftItem = itemListValue(ui->leftPane, key)) + { leftItem->setDisabled(true); leftItem->showButton(AddressItem::Added); } } -void AddRecipients::addSelectedCerts(const QList& selectedCertData) -{ - if(selectedCertData.isEmpty()) - return; - - leftList.clear(); - ui->leftPane->clear(); - for(const HistoryCertData &certData: selectedCertData) { - QString term = (certData.type == QStringLiteral("1") || certData.type == QStringLiteral("3")) ? certData.CN : certData.CN.split(',').value(2); - search(term, true, certData.type); - } -} - QString AddRecipients::defaultUrl(QLatin1String key, const QString &defaultValue) { return Application::confValue(key).toString(defaultValue); } -void AddRecipients::enableRecipientFromCard() +bool AddRecipients::isUpdated() const { - ui->fromCard->setDisabled( qApp->signer()->tokenauth().cert().isNull() ); + return updated; } -bool AddRecipients::isUpdated() const +AddressItem* AddRecipients::itemListValue(ItemList *list, const CKey &cert) { - return updated; + for(auto *item: list->items) + { + if(auto *address = qobject_cast(item); address && address->getKey() == cert) + return address; + } + return nullptr; } QList AddRecipients::keys() @@ -281,24 +260,9 @@ QList AddRecipients::keys() return recipients; } -void AddRecipients::removeRecipientFromRightPane(Item *toRemove) -{ - auto *rightItem = qobject_cast(toRemove); - if(auto it = leftList.find(rightItem->getKey().cert); it != leftList.end()) - { - it.value()->setDisabled(false); - it.value()->showButton(AddressItem::Add); - } - rightList.removeAll(rightItem->getKey()); - updated = true; - ui->confirm->setDisabled(rightList.isEmpty()); -} - void AddRecipients::search(const QString &term, bool select, const QString &type) { QApplication::setOverrideCursor(Qt::WaitCursor); - ui->confirm->setDefault(false); - ui->confirm->setAutoDefault(false); QVariantMap userData { {QStringLiteral("type"), type}, @@ -318,25 +282,19 @@ void AddRecipients::search(const QString &term, bool select, const QString &type #endif bool isDigit = false; void(cleanTerm.toULongLong(&isDigit)); - if(isDigit && (cleanTerm.size() == 11 || cleanTerm.size() == 8)) + if(!isDigit || (cleanTerm.size() != 11 && cleanTerm.size() != 8)) + ldap_corp->search(QStringLiteral("(cn=*%1*)").arg(cleanTerm), userData); + else if(cleanTerm.size() == 8) + ldap_corp->search(QStringLiteral("(serialNumber=%1)" ).arg(cleanTerm), userData); + else if(IKValidator::isValid(cleanTerm)) { - if(cleanTerm.size() == 11) - { - if(!IKValidator::isValid(cleanTerm)) - { - QApplication::restoreOverrideCursor(); - WarningDialog::show(this, tr("Personal code is not valid!")); - return; - } - userData[QStringLiteral("personSearch")] = true; - ldap_person->search(QStringLiteral("(serialNumber=%1%2)" ).arg(ldap_person->isSSL() ? QStringLiteral("PNOEE-") : QString(), cleanTerm), userData); - } - else - ldap_corp->search(QStringLiteral("(serialNumber=%1)" ).arg(cleanTerm), userData); + userData[QStringLiteral("personSearch")] = true; + ldap_person->search(QStringLiteral("(serialNumber=%1%2)" ).arg(ldap_person->isSSL() ? QStringLiteral("PNOEE-") : QString(), cleanTerm), userData); } else { - ldap_corp->search(QStringLiteral("(cn=*%1*)").arg(cleanTerm), userData); + QApplication::restoreOverrideCursor(); + WarningDialog::show(this, tr("Personal code is not valid!")); } } @@ -348,7 +306,6 @@ void AddRecipients::showError( const QString &msg, const QString &details ) void AddRecipients::showResult(const QList &result, int resultCount, const QVariantMap &userData) { - bool isEmpty = true; for(const QSslCertificate &k: result) { SslCertificate c(k); @@ -358,16 +315,13 @@ void AddRecipients::showResult(const QList &result, int resultC (userData.value(QStringLiteral("personSearch"), false).toBool() || !c.enhancedKeyUsage().contains(SslCertificate::ClientAuth)) && c.type() != SslCertificate::MobileIDType) { - isEmpty = false; - AddressItem *item = addRecipientToLeftPane(k); - if(userData.value(QStringLiteral("select"), false).toBool() && - (userData.value(QStringLiteral("type")).isNull() || HistoryCertData::toType(SslCertificate(k)) == userData[QStringLiteral("type")])) - addRecipientToRightPane(item, true); + addRecipient(k, userData.value(QStringLiteral("select"), false).toBool() && + (userData.value(QStringLiteral("type")).isNull() || HistoryCertData::toType(SslCertificate(k)) == userData[QStringLiteral("type")])); } } if(resultCount >= 50) showError(tr("The name you were looking for gave too many results, please refine your search.")); - else if(isEmpty) + else if(ui->leftPane->items.isEmpty()) { showError(tr("Person or company does not own a valid certificate.
" "It is necessary to have a valid certificate for encryption.
" diff --git a/client/dialogs/AddRecipients.h b/client/dialogs/AddRecipients.h index 4f9e5d2d6..0c9fb0013 100644 --- a/client/dialogs/AddRecipients.h +++ b/client/dialogs/AddRecipients.h @@ -45,17 +45,12 @@ class AddRecipients final : public QDialog bool isUpdated() const; private: - void addAllRecipientToRightPane(); - void addRecipientFromCard(); void addRecipientFromFile(); void addRecipientFromHistory(); - AddressItem * addRecipientToLeftPane(const QSslCertificate& cert); - bool addRecipientToRightPane(const CKey &key, bool update = true); - void addRecipientToRightPane(AddressItem *leftItem, bool update = true); - void addSelectedCerts(const QList& selectedCertData); - void enableRecipientFromCard(); - void removeRecipientFromRightPane(Item *toRemove); + void addRecipient(const QSslCertificate& cert, bool select = true); + void addRecipientToRightPane(Item *item, bool update = true); + AddressItem* itemListValue(ItemList *list, const CKey &cert); void search(const QString &term, bool select = false, const QString &type = {}); void showError(const QString &msg, const QString &details = {}); void showResult(const QList &result, int resultCount, const QVariantMap &userData); @@ -63,7 +58,6 @@ class AddRecipients final : public QDialog static QString defaultUrl(QLatin1String key, const QString &defaultValue); Ui::AddRecipients *ui; - QHash leftList; QList rightList; LdapSearch *ldap_person, *ldap_corp; bool updated = false; diff --git a/client/dialogs/AddRecipients.ui b/client/dialogs/AddRecipients.ui index 66fa94fe2..9eeda816b 100644 --- a/client/dialogs/AddRecipients.ui +++ b/client/dialogs/AddRecipients.ui @@ -21,25 +21,18 @@ QWidget { -color: #000000; +color: #07142A; +font-family: Roboto, Helvetica; +font-size: 14px; } #leftPane, #rightPane { background-color: #ffffff; } #leftPane { -border: solid #D9D9D8; -border-width: 0px 1px 0px 0px; -} -#navigationArea { -background-color: #f7f7f7; -border: 1px solid #c8c8c8; -border-width: 1px 0px 0px 0px; +border-right: 1px solid #E7EAEF; } - - - 0 - + 0 @@ -52,83 +45,95 @@ border-width: 1px 0px 0px 0px; 0 - - - - 0 - - - - - - - - + + 0 + + + + + + - + 0 - 40 + 48 16777215 - 40 + 48 - QPushButton { - border-radius: 2px; - border: none; - color: #006EB5; + #navigationArea { +border-top: 1px solid #E7EAEF; +background-color: #F3F5F7; } -QPushButton:pressed { - color: #FFFFFF; - background-color: #006EB5; +QPushButton { +padding: 10px 12px; +border: 1px solid transparent; +border-radius: 4px; +color: #2F70B6; +font-size: 12px; +font-weight: 700; +} +QPushButton:hover { +background-color: #EAF1F8; } -QPushButton:hover:!pressed { - border: 1px solid #006EB5; - color: #006EB5; +QPushButton:pressed { +background-color: #BFD3E8; } QPushButton:disabled { - color: #727679; +color: #82A9D3; +} +QPushButton:default { +color: #ffffff; +border-color: #2F70B6; +background-color: #2F70B6; +} +QPushButton:default:hover { +border-color: #2B66A6; +background-color: #2B66A6; +} +QPushButton:default:pressed { +border-color: #215081; +background-color: #215081; +} +QPushButton:default:disabled { +border-color: #82A9D3; +background-color: #82A9D3; } - 15 + 16 - 20 + 24 - 7 + 0 - 15 + 24 - 8 + 0 - - - 145 - 25 - + + false PointingHandCursor - - Certificate from card - - CERTIFICATE FROM CARD + Certificate from card false @@ -137,20 +142,11 @@ QPushButton:disabled { - - - 134 - 25 - - PointingHandCursor - - Certificate from file - - CERTIFICATE FROM FILE + Certificate from file false @@ -159,20 +155,11 @@ QPushButton:disabled { - - - 145 - 25 - - PointingHandCursor - - Latest used certificate - - LATEST USED CERTIFICATE + Latest used certificate false @@ -195,38 +182,27 @@ QPushButton:disabled { - 2 + 16 - - - 120 - 25 - - PointingHandCursor - - Cancel - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #981E32; +border: 1px solid #AD2A45; +color: #AD2A45; } -QPushButton:pressed { - background-color: #F24A66; +QPushButton:hover { +background-color: #F5EBED; } -QPushButton:hover:!pressed { - background-color: #CD2541; +QPushButton:pressed { +background-color: #E1C1C6; } - CANCEL + Cancel false @@ -235,37 +211,14 @@ QPushButton:hover:!pressed { - - - 120 - 25 - + + false PointingHandCursor - - Confirm - - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #006EB5; -} -QPushButton:pressed { - background-color: #41B6E6; -} -QPushButton:hover:!pressed { - background-color: #008DCF; -} -QPushButton:disabled { - background-color: #BEDBED; -} - - CONFIRM + Confirm true @@ -287,13 +240,6 @@ QPushButton:disabled { 1 - - fromCard - fromFile - fromHistory - cancel - confirm - diff --git a/client/dialogs/CertificateDetails.cpp b/client/dialogs/CertificateDetails.cpp index daf595f64..ea7d91f0f 100644 --- a/client/dialogs/CertificateDetails.cpp +++ b/client/dialogs/CertificateDetails.cpp @@ -23,7 +23,6 @@ #include "Application.h" #include "DateTime.h" -#include "Styles.h" #include "SslCertificate.h" #include "effects/Overlay.h" #include "dialogs/WarningDialog.h" @@ -34,13 +33,12 @@ #include #include #include -#include CertificateDetails::CertificateDetails(const SslCertificate &cert, QWidget *parent) : QDialog(parent) - , ui(new Ui::CertificateDetails) { - ui->setupUi(this); + Ui::CertificateDetails ui; + ui.setupUi(this); #ifdef Q_OS_MAC setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::Sheet); #else @@ -48,23 +46,6 @@ CertificateDetails::CertificateDetails(const SslCertificate &cert, QWidget *pare #endif new Overlay(this); - QFont headerFont = Styles::font( Styles::Regular, 18 ); - QFont regularFont = Styles::font( Styles::Regular, 14 ); - QFont smallFont = Styles::font(Styles::Regular, 13); - - ui->lblCertHeader->setFont(headerFont); - ui->lblCertDetails->setFont(headerFont); - - ui->lblCertInfo->setFont(regularFont); - ui->tblDetails->setFont(smallFont); - ui->detailedValue->setFont(smallFont); - - QFont condensed14 = Styles::font(Styles::Condensed, 14); - ui->close->setFont(condensed14); - ui->save->setFont(condensed14); - - ui->lblCertHeader->setText(tr("Certificate information")); - QString i; QTextStream s( &i ); s << "" << tr("This certificate is intended for following purpose(s):") << ""; @@ -80,10 +61,9 @@ CertificateDetails::CertificateDetails(const SslCertificate &cert, QWidget *pare s << "" << tr("Valid:") << "
"; s << "" << tr("From") << " " << cert.effectiveDate().toLocalTime().toString(QStringLiteral("dd.MM.yyyy")) << "
"; s << "" << tr("To") << " " << cert.expiryDate().toLocalTime().toString(QStringLiteral("dd.MM.yyyy")); - ui->lblCertInfo->setHtml( i ); + ui.lblCertInfo->setHtml( i ); - - connect(ui->save, &QPushButton::clicked, this, [this, cert] { + connect(ui.save, &QPushButton::clicked, this, [this, cert] { QString file = QFileDialog::getSaveFileName(this, tr("Save certificate"), QStringLiteral("%1%2%3.cer") .arg(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)) .arg(QDir::separator()) @@ -97,26 +77,25 @@ CertificateDetails::CertificateDetails(const SslCertificate &cert, QWidget *pare else WarningDialog::show(this, tr("Failed to save file")); }); - connect( ui->close, &QPushButton::clicked, this, &CertificateDetails::accept ); + connect(ui.close, &QPushButton::clicked, this, &CertificateDetails::accept); connect( this, &CertificateDetails::finished, this, &CertificateDetails::close ); - connect(ui->tblDetails, &QTableWidget::itemSelectionChanged, this, [this] { - const QList &list = ui->tblDetails->selectedItems(); + connect(ui.tblDetails, &QTableWidget::itemSelectionChanged, this, [detailedValue = ui.detailedValue, tblDetails = ui.tblDetails] { + const QList &list = tblDetails->selectedItems(); if(list.isEmpty()) return; auto *contentItem = list.last(); auto userData = contentItem->data(Qt::UserRole); - ui->detailedValue->setPlainText(userData.isNull() ? + detailedValue->setPlainText(userData.isNull() ? contentItem->data(Qt::DisplayRole).toString() : userData.toString()); }); - ui->tblDetails->setHorizontalHeaderLabels({ tr("Field"), tr("Value") }); - auto addItem = [this](const QString &variable, const QString &value, const QVariant &valueext = {}) { - int row = ui->tblDetails->model()->rowCount(); - ui->tblDetails->setRowCount(row + 1); + auto addItem = [tblDetails = ui.tblDetails](const QString &variable, const QString &value, const QVariant &valueext = {}) { + int row = tblDetails->model()->rowCount(); + tblDetails->setRowCount(row + 1); auto *item = new QTableWidgetItem(value); item->setData(Qt::UserRole, valueext); - ui->tblDetails->setItem(row, 0, new QTableWidgetItem(variable)); - ui->tblDetails->setItem(row, 1, item); + tblDetails->setItem(row, 0, new QTableWidgetItem(variable)); + tblDetails->setItem(row, 1, item); }; addItem(tr("Version"), QString("V" + cert.version())); @@ -150,36 +129,31 @@ CertificateDetails::CertificateDetails(const SslCertificate &cert, QWidget *pare textExt << QStringLiteral("%1 = %2").arg(obj.constData(), data); } addItem(tr("Subject"), text.join(QStringLiteral(", ")), textExt.join('\n')); - addItem(tr("Public key"), cert.keyName(), cert.toHex(cert.publicKey().toDer())); + addItem(tr("Public key"), cert.keyName(), cert.publicKey().toDer().toHex(' ').toUpper()); QStringList enhancedKeyUsage = cert.enhancedKeyUsage().values(); if( !enhancedKeyUsage.isEmpty() ) addItem(tr("Enhanced key usage"), enhancedKeyUsage.join(QStringLiteral(", ")), enhancedKeyUsage.join('\n')); QStringList policies = cert.policies(); if( !policies.isEmpty() ) addItem(tr("Certificate policies"), policies.join(QStringLiteral(", "))); - addItem(tr("Authority key identifier"), cert.toHex(cert.authorityKeyIdentifier())); - addItem(tr("Subject key identifier"), cert.toHex(cert.subjectKeyIdentifier())); + addItem(tr("Authority key identifier"), cert.authorityKeyIdentifier().toHex(' ').toUpper()); + addItem(tr("Subject key identifier"), cert.subjectKeyIdentifier().toHex(' ').toUpper()); QStringList keyUsage = cert.keyUsage().values(); if( !keyUsage.isEmpty() ) addItem(tr("Key usage"), keyUsage.join(QStringLiteral(", ")), keyUsage.join('\n')); // Disable resizing - ui->tblDetails->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); -} - -CertificateDetails::~CertificateDetails() -{ - delete ui; + ui.tblDetails->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); } #ifndef Q_OS_MAC -void CertificateDetails::showCertificate(const SslCertificate &cert, QWidget *parent, const QString &suffix) +void CertificateDetails::showCertificate(const QSslCertificate &cert, QWidget *parent, const QString &suffix) { #ifdef Q_OS_UNIX CertificateDetails(cert, parent).exec(); #else Q_UNUSED(parent); - QString name = cert.subjectInfo("serialNumber"); + QString name = cert.subjectInfo("serialNumber").join('_'); if(name.isEmpty()) name = cert.serialNumber().replace(':', ""); QString path = QStringLiteral("%1/%2%3.cer").arg(QDir::tempPath(), name, suffix); diff --git a/client/dialogs/CertificateDetails.h b/client/dialogs/CertificateDetails.h index f28360883..23bda8dff 100644 --- a/client/dialogs/CertificateDetails.h +++ b/client/dialogs/CertificateDetails.h @@ -21,8 +21,8 @@ #include -namespace Ui { class CertificateDetails; } class SslCertificate; +class QSslCertificate; class CertificateDetails final : public QDialog { @@ -30,10 +30,6 @@ class CertificateDetails final : public QDialog public: explicit CertificateDetails(const SslCertificate &c, QWidget *parent = nullptr); - ~CertificateDetails() final; - static void showCertificate(const SslCertificate &cert, QWidget *parent, const QString &suffix = {}); - -private: - Ui::CertificateDetails *ui; + static void showCertificate(const QSslCertificate &cert, QWidget *parent, const QString &suffix = {}); }; diff --git a/client/dialogs/CertificateDetails.ui b/client/dialogs/CertificateDetails.ui index df95e54d7..8ad8de743 100644 --- a/client/dialogs/CertificateDetails.ui +++ b/client/dialogs/CertificateDetails.ui @@ -13,34 +13,24 @@ 570
- - - 0 - 0 - - - - - 994 - 570 - - - - - 16777215 - 16777215 - - QWidget { - color: #000000; - background-color: #FFFFFF +font-family: Roboto, Helvetica; +font-size: 14px; +} +#CertificateDetails { +background-color: #FFFFFF; +border-radius: 4px; +} +#leftPane { +border-right: 1px solid #E7EAEF; +} +#lblCertHeader, #lblCertDetails { +color: #003168; +font-size: 22px; } - - - 0 - + 0 @@ -53,416 +43,263 @@ 0 - - - - - 1 - 1 - + + 0 + + + + + 24 + + + 24 + + + 32 + + + 24 + + + + + Certificate information + + + Qt::AlignCenter + + + + + + + QFrame::NoFrame + + + true + + + + + + + + + 24 + + + 24 + + 32 + + + 24 + + + + + Certificate details + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + + 0 + 320 + + + + QHeaderView::section { +border: 1px solid #E7EAEF; +border-width: 0px 0px 1px 0px; +padding: 0px 0px 8px 5px; +background-color: #FFFFFF; +} + + + QFrame::NoFrame + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + false + + + true + + + 26 + + + 140 + + + true + + + false + + + 20 + + + 20 + + + + Field + + + AlignLeading|AlignVCenter + + + + + Value + + + AlignLeading|AlignVCenter + + + + + + + + QFrame::NoFrame + + + true + + + + + + + - 880 - 399 + 0 + 48 + + + + + 16777215 + 48 - background-color: #ffffff; + #navigationArea { +border-top: 1px solid #E7EAEF; +background-color: #F3F5F7; +} +QPushButton { +padding: 10px 12px; +border: 1px solid #2F70B6; +border-radius: 4px; +color: #ffffff; +background-color: #2F70B6; +font-size: 12px; +font-weight: 700; +} +QPushButton:hover { +border-color: #2B66A6; +background-color: #2B66A6; +} +QPushButton:pressed { +border-color: #215081; +background-color: #215081; +} +QPushButton:disabled { +border-color: #82A9D3; +background-color: #82A9D3; +} +QPushButton:default { +background-color: transparent; +border-color: #AD2A45; +color: #AD2A45; +} +QPushButton:default:hover { +background-color: #F5EBED; +} +QPushButton:default:pressed { +background-color: #E1C1C6; +} - + - 0 + 16 - 0 + 24 0 - 0 + 24 0 - - - - 0 - 0 - + + + Qt::Horizontal - + - 300 - 0 + 40 + 20 - - - 300 - 16777215 - + + + + + + Close - - border-right: 1px solid #DEE4E9; + + true - - - - 21 - 20 - 278 - 21 - - - - - 278 - 21 - - - - - 278 - 21 - - - - border: none; - - - Certificate information - - - Qt::AlignCenter - - - - - - 21 - 53 - 250 - 470 - - - - - 250 - 470 - - - - - 250 - 470 - - - - border: none; -span { - line-height: 1.5; -} - - - true - - - - - - 0 - 0 - + + + Save + + + false + + + false - - - 3 - - - 3 - - - - - - 0 - 0 - - - - - 652 - 38 - - - - - 652 - 38 - - - - border: none; - - - Certificate details - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - - 0 - 0 - - - - - 0 - 320 - - - - - 16777215 - 360 - - - - - 13 - - - - #tblDetails { - border:none; -} -QHeaderView::section { - border: 1px solid #D9D9D8; - border-width: 0px 1px 1px 0px; - text-align: center; - padding: 2px 0px 3px 0px; - background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, - stop:0 #FFFFFF, stop:1 #FFFFFF); -} - - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - false - - - 0 - - - 2 - - - true - - - 19 - - - 140 - - - true - - - false - - - 14 - - - 23 - - - - - - - - - border: none; - - - true - - - - - - - - - 1 - 0 - - - - - 0 - 40 - - - - - 16777215 - 40 - - - - border-top: 1px solid #DEE4E9; -background-color: #f7f7f7; - - - - true - - - - 720 - 8 - 120 - 25 - - - - - 0 - 0 - - - - - 120 - 25 - - - - - 120 - 20 - - - - Close - - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #981E32; -} -QPushButton:pressed { - background-color: #F24A66; -} -QPushButton:hover:!pressed { - background-color: #CD2541; -} -QPushButton:disabled { - background-color: #BEDBED; -} - - - CLOSE - - - false - - - true - - - - - - 854 - 8 - 120 - 25 - - - - - 120 - 25 - - - - - 120 - 25 - - - - Save - - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #006EB5; -} -QPushButton:pressed { - background-color: #41B6E6; -} -QPushButton:hover:!pressed { - background-color: #008DCF; -} -QPushButton:disabled { - background-color: #BEDBED; -} - - - SAVE - - - false - - - -
- - lblCertInfo - tblDetails - detailedValue - save - close - diff --git a/client/dialogs/CertificateDetails_mac.mm b/client/dialogs/CertificateDetails_mac.mm index b54f3de1a..b211fe164 100644 --- a/client/dialogs/CertificateDetails_mac.mm +++ b/client/dialogs/CertificateDetails_mac.mm @@ -24,44 +24,15 @@ #include #include #include -#include -#import -#import +#import -@interface CertPreview : NSResponder +@interface CertPreview : NSResponder @property (nonatomic, copy) NSURL *certUrl; @end @implementation CertPreview -- (BOOL)acceptsFirstResponder -{ - return YES; -} - -- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel *)panel -{ - Q_UNUSED(panel) - return YES; -} - -- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel -{ - Q_UNUSED(panel) - panel.dataSource = self; - panel.delegate = self; -} - -- (void)endPreviewPanelControl:(QLPreviewPanel *)panel -{ - Q_UNUSED(panel) - QFile::remove(QUrl::fromNSURL(self.certUrl).toLocalFile()); - panel.dataSource = nil; - panel.delegate = nil; - self.certUrl = nil; -} - - (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel *)panel { return 1; @@ -76,32 +47,31 @@ - (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel *)panel @end -void CertificateDetails::showCertificate(const SslCertificate &cert, QWidget *parent, const QString &suffix) +void CertificateDetails::showCertificate(const QSslCertificate &cert, QWidget *parent, const QString &suffix) { - QString name = cert.subjectInfo("serialNumber"); + QString name = cert.subjectInfo("serialNumber").join('_'); if(name.isNull() || name.isEmpty()) name = QString::fromUtf8(cert.serialNumber()); QString path = QStringLiteral("%1/%2%3.cer").arg(QDir::tempPath(), name, suffix); - QFile f(path); - if(f.open(QIODevice::WriteOnly)) - f.write(cert.toPem()); - f.close(); static CertPreview *cp; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ cp = [CertPreview new]; }); - + if(cp.certUrl != nullptr) QFile::remove(QUrl::fromNSURL(cp.certUrl).toLocalFile()); - + if(QFile f(path); f.open(QIODevice::WriteOnly)) + f.write(cert.toPem()); cp.certUrl = [NSURL fileURLWithPath:path.toNSString()]; - [[(__bridge NSView *)reinterpret_cast(parent->winId()) window] makeFirstResponder:cp]; - + auto qlPanel = QLPreviewPanel.sharedPreviewPanel; if (qlPanel.isVisible) [qlPanel reloadData]; else - [qlPanel makeKeyAndOrderFront:cp]; + { + qlPanel.dataSource = cp; + [qlPanel makeKeyAndOrderFront:nil]; + } } diff --git a/client/dialogs/CertificateHistory.cpp b/client/dialogs/CertificateHistory.cpp index b7c84adba..7fea7ec0f 100644 --- a/client/dialogs/CertificateHistory.cpp +++ b/client/dialogs/CertificateHistory.cpp @@ -21,7 +21,6 @@ #include "ui_CertificateHistory.h" #include "Application.h" -#include "Styles.h" #include "SslCertificate.h" #include @@ -92,28 +91,20 @@ HistoryList::HistoryList() } } -void HistoryList::addAndSave(const QList &data) +void HistoryList::addAndSave(const SslCertificate &cert) { - if(data.isEmpty()) + if(cert.isNull()) return; - bool changed = false; - for(const auto &cert: data) - { - if(cert.isNull()) - continue; - HistoryCertData certData{ - cert.subjectInfo("CN"), - HistoryCertData::toType(cert), - cert.issuerInfo("CN"), - cert.expiryDate().toLocalTime().toString(QStringLiteral("dd.MM.yyyy")), - }; - if(contains(certData)) - continue; - append(std::move(certData)); - changed = true; - } - if(changed) - save(); + HistoryCertData certData{ + cert.subjectInfo("CN"), + HistoryCertData::toType(cert), + cert.issuerInfo("CN"), + cert.expiryDate().toLocalTime().toString(QStringLiteral("dd.MM.yyyy")), + }; + if(contains(certData)) + return; + append(std::move(certData)); + save(); } void HistoryList::removeAndSave(const QList &data) @@ -164,14 +155,6 @@ CertificateHistory::CertificateHistory(HistoryList &_historyCertData, QWidget *p setMinimumSize(parent->frameSize()); move(parent->frameGeometry().center() - frameGeometry().center()); - QFont condensed = Styles::font(Styles::Condensed, 12); - QFont regular = Styles::font(Styles::Regular, 14); - ui->view->header()->setFont(regular); - ui->view->setFont(regular); - ui->close->setFont(condensed); - ui->select->setFont(condensed); - ui->remove->setFont(condensed); - connect(ui->view->selectionModel(), &QItemSelectionModel::selectionChanged, ui->remove, [this] { ui->select->setDisabled(ui->view->selectedItems().isEmpty()); ui->remove->setDisabled(ui->view->selectedItems().isEmpty()); @@ -193,7 +176,6 @@ CertificateHistory::CertificateHistory(HistoryList &_historyCertData, QWidget *p ui->view->header()->setSectionResizeMode(QHeaderView::ResizeToContents); ui->view->header()->setSectionResizeMode(0, QHeaderView::Stretch); ui->view->sortItems(0, Qt::AscendingOrder); - adjustSize(); } CertificateHistory::~CertificateHistory() diff --git a/client/dialogs/CertificateHistory.h b/client/dialogs/CertificateHistory.h index adda94907..a3183b38d 100644 --- a/client/dialogs/CertificateHistory.h +++ b/client/dialogs/CertificateHistory.h @@ -49,7 +49,7 @@ class HistoryList: public QList public: HistoryList(); - void addAndSave(const QList &data); + void addAndSave(const SslCertificate &cert); void removeAndSave(const QList &data); private: diff --git a/client/dialogs/CertificateHistory.ui b/client/dialogs/CertificateHistory.ui index ccba45015..6a103f844 100644 --- a/client/dialogs/CertificateHistory.ui +++ b/client/dialogs/CertificateHistory.ui @@ -18,30 +18,60 @@
QWidget { -color: #000000; -background-color: #FFFFFF; -} -QPushButton { -border-radius: 2px; -border: none; -color: #FFFFFF; -background-color: #006EB5; -} -QPushButton:pressed { -background-color: #41B6E6; +color: #07142A; +font-family: Roboto, Helvetica; +font-size: 14px; } -QPushButton:hover:!pressed { -background-color: #008DCF; +#label { +color: #003168; +font-size: 20px; +font-weight: 700; } -QPushButton:disabled { -background-color: #BEDBED; +#CertificateHistory { +background-color: #FFFFFF; } - - - - - #view { + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 24 + + + 24 + + + 24 + + + 24 + + + + + Last used certificates + + + + + + + #view { border:none; } QHeaderView::section { @@ -60,159 +90,179 @@ QHeaderView::down-arrow { width: 7px; padding-right: 5px; } - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::CurrentChanged|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - QAbstractItemView::MultiSelection - - - false - - - true - - - 4 - - - true - - - false - - - - Owner - - - - - Type - - - - - Issuer - - - - - Expiry date - - - + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::CurrentChanged|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + QAbstractItemView::MultiSelection + + + false + + + true + + + 4 + + + true + + + false + + + + Owner + + + + + Type + + + + + Issuer + + + + + Expiry date + + + AlignCenter + + + + +
- - - - Qt::Horizontal - - + + + - 25 - 18 + 0 + 48 - - - - - - true - - + - 120 - 30 + 16777215 + 48 - - - 14 - - - - Close - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #981E32; + #navigationArea { +border-top: 1px solid #E7EAEF; +background-color: #F3F5F7; } -QPushButton:pressed { - background-color: #F24A66; +QPushButton { +padding: 10px 12px; +border: 1px solid #2F70B6; +border-radius: 4px; +color: #ffffff; +background-color: #2F70B6; +font-size: 12px; +font-weight: 700; } -QPushButton:hover:!pressed { - background-color: #CD2541; +QPushButton:hover { +border-color: #2B66A6; +background-color: #2B66A6; } -QPushButton:disabled { - background-color: #BEDBED; +QPushButton:pressed { +border-color: #215081; +background-color: #215081; } QPushButton:disabled { - background-color: #BEDBED; +border-color: #82A9D3; +background-color: #82A9D3; +} +QPushButton:default { +background-color: transparent; +border-color: #AD2A45; +color: #AD2A45; +} +QPushButton:default:hover { +background-color: #F5EBED; +} +QPushButton:default:pressed { +background-color: #E1C1C6; } - - CLOSE - - - true - - - - - - - false - - - - 120 - 30 - - - - - 14 - - - - Select - - - ADD - - - - - - - false - - - - 120 - 30 - - - - - 14 - - - - Remove - - - REMOVE - + + + 16 + + + 24 + + + 0 + + + 24 + + + 0 + + + + + Qt::Horizontal + + + + 590 + 15 + + + + + + + + Close + + + CLOSE + + + true + + + + + + + false + + + Add + + + false + + + + + + + false + + + Remove + + + false + + + +
diff --git a/client/dialogs/KeyDialog.cpp b/client/dialogs/KeyDialog.cpp index 1fdac3556..69f43f9ce 100644 --- a/client/dialogs/KeyDialog.cpp +++ b/client/dialogs/KeyDialog.cpp @@ -21,46 +21,34 @@ #include "ui_KeyDialog.h" #include "CryptoDoc.h" -#include "Styles.h" -#include "SslCertificate.h" #include "effects/Overlay.h" #include "dialogs/CertificateDetails.h" -#include - KeyDialog::KeyDialog( const CKey &k, QWidget *parent ) : QDialog( parent ) { - auto d = std::make_unique(); - d->setupUi(this); + Ui::KeyDialog d; + d.setupUi(this); #if defined (Q_OS_WIN) - d->buttonLayout->setDirection(QBoxLayout::RightToLeft); + d.buttonLayout->setDirection(QBoxLayout::RightToLeft); #endif setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint); setAttribute(Qt::WA_DeleteOnClose); new Overlay(this); - QFont condensed = Styles::font(Styles::Condensed, 12); - QFont regular = Styles::font(Styles::Regular, 14); - d->close->setFont(condensed); - d->showCert->setFont(condensed); - d->view->header()->setFont(regular); - d->view->setFont(regular); - d->view->setHeaderLabels({tr("Attribute"), tr("Value")}); - - connect(d->close, &QPushButton::clicked, this, &KeyDialog::accept); - connect(d->showCert, &QPushButton::clicked, this, [this, cert=k.cert] { + connect(d.close, &QPushButton::clicked, this, &KeyDialog::accept); + connect(d.showCert, &QPushButton::clicked, this, [this, cert=k.cert] { CertificateDetails::showCertificate(cert, this); }); - d->showCert->setHidden(k.cert.isNull()); + d.showCert->setHidden(k.cert.isNull()); - auto addItem = [&](const QString ¶meter, const QString &value) { + auto addItem = [view = d.view](const QString ¶meter, const QString &value) { if(value.isEmpty()) return; - auto *i = new QTreeWidgetItem(d->view); + auto *i = new QTreeWidgetItem(view); i->setText(0, parameter); i->setText(1, value); - d->view->addTopLevelItem(i); + view->addTopLevelItem(i); }; addItem(tr("Recipient"), k.recipient); @@ -68,7 +56,7 @@ KeyDialog::KeyDialog( const CKey &k, QWidget *parent ) addItem(tr("Key server ID"), k.keyserver_id); addItem(tr("Transaction ID"), k.transaction_id); addItem(tr("Expiry date"), k.cert.expiryDate().toLocalTime().toString(QStringLiteral("dd.MM.yyyy hh:mm:ss"))); - addItem(tr("Issuer"), SslCertificate(k.cert).issuerInfo(QSslCertificate::CommonName)); - d->view->resizeColumnToContents( 0 ); + addItem(tr("Issuer"), k.cert.issuerInfo(QSslCertificate::CommonName).join(' ')); + d.view->resizeColumnToContents( 0 ); adjustSize(); } diff --git a/client/dialogs/KeyDialog.ui b/client/dialogs/KeyDialog.ui index 77c859344..095698d5b 100644 --- a/client/dialogs/KeyDialog.ui +++ b/client/dialogs/KeyDialog.ui @@ -6,8 +6,8 @@ 0 0 - 500 - 222 + 515 + 369 @@ -20,24 +20,72 @@ Encrypt for - QWidget{ background-color: #FFFFFF; border: none;} -QWidget#KeyDialog{ border-radius: 2px; } - + QWidget { +color: #07142A; +font-family: Roboto, Helvetica; +font-size: 14px; +} +#KeyDialog { +background-color: #FFFFFF; +border-radius: 4px; +} +QHeaderView::section { +border: 1px solid #E7EAEF; +border-width: 0px 0px 1px 0px; +padding: 0px 0px 8px 5px; +background-color: #FFFFFF; +} +QPushButton { +padding: 12px 12px; +border-radius: 4px; +border: 1px solid #AD2A45; +color: #AD2A45; +font-weight: 700; +} +QPushButton:hover { +background-color: #F5EBED; +} +QPushButton:pressed { +background-color: #E1C1C6; +} +QPushButton:default { +color: #ffffff; +border-color: #2F70B6; +background-color: #2F70B6; +} +QPushButton:default:hover { +border-color: #2B66A6; +background-color: #2B66A6; +} +QPushButton:default:pressed { +border-color: #215081; +background-color: #215081; +} +QPushButton:default:disabled { +border-color: #82A9D3; +background-color: #82A9D3; +} + + 40 + + + 40 + + + 32 + + + 40 + + + 32 + - - #view { - border:none; -} -QHeaderView::section { - border: 1px solid #D9D9D8; - border-width: 0px 0px 1px 0px; - padding: 2px 0px 3px 5px; - background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, - stop:0 #FFFFFF, stop:1 #FFFFFF); -} + + QFrame::NoFrame false @@ -56,8 +104,24 @@ QHeaderView::section { + + 0 + + + + + PointingHandCursor + + + Close + + + false + + + - + Qt::Horizontal @@ -70,110 +134,29 @@ QHeaderView::section { - - - - 150 - 34 - - + - 14 + Roboto + -1 + true PointingHandCursor - - Close - - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #981E32; -} -QPushButton:pressed { - background-color: #F24A66; -} -QPushButton:hover:!pressed { - background-color: #CD2541; -} -QPushButton:disabled { - background-color: #BEDBED; -} - - CLOSE + Show certificate true - - - - - 150 - 34 - - - - - 14 - - - - PointingHandCursor - - - Show certificate - - - QPushButton { - border-radius: 2px; - border: none; - color: #ffffff; - background-color: #006EB5; -} -QPushButton:pressed { - background-color: #41B6E6; -} -QPushButton:hover:!pressed { - background-color: #008DCF; -} -QPushButton:disabled { - background-color: #BEDBED; -} - - - SHOW CERTIFICATE - - - - - - - Qt::Horizontal - - - - 25 - 18 - - - -
- - showCertificate() - diff --git a/client/dialogs/MobileDialog.ui b/client/dialogs/MobileDialog.ui index f539fc765..4817dd2f4 100644 --- a/client/dialogs/MobileDialog.ui +++ b/client/dialogs/MobileDialog.ui @@ -90,13 +90,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/dialogs/MobileProgress.ui b/client/dialogs/MobileProgress.ui index e0ac56d27..9b0a2afdc 100644 --- a/client/dialogs/MobileProgress.ui +++ b/client/dialogs/MobileProgress.ui @@ -47,13 +47,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/dialogs/PinPopup.ui b/client/dialogs/PinPopup.ui index 79ecdd113..c155e6579 100644 --- a/client/dialogs/PinPopup.ui +++ b/client/dialogs/PinPopup.ui @@ -58,13 +58,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/dialogs/PinUnblock.ui b/client/dialogs/PinUnblock.ui index 14656ace6..f91e948db 100644 --- a/client/dialogs/PinUnblock.ui +++ b/client/dialogs/PinUnblock.ui @@ -58,13 +58,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/dialogs/RoleAddressDialog.ui b/client/dialogs/RoleAddressDialog.ui index 5c69a00fd..69eaf4f2c 100644 --- a/client/dialogs/RoleAddressDialog.ui +++ b/client/dialogs/RoleAddressDialog.ui @@ -58,13 +58,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/dialogs/SettingsDialog.ui b/client/dialogs/SettingsDialog.ui index aa80b3267..73d5709f8 100644 --- a/client/dialogs/SettingsDialog.ui +++ b/client/dialogs/SettingsDialog.ui @@ -265,7 +265,7 @@ QPushButton:default:pressed { background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +background-color: #82A9D3; } diff --git a/client/dialogs/SmartIDDialog.ui b/client/dialogs/SmartIDDialog.ui index 2132ff252..5901977c5 100644 --- a/client/dialogs/SmartIDDialog.ui +++ b/client/dialogs/SmartIDDialog.ui @@ -126,13 +126,16 @@ border-color: #2F70B6; background-color: #2F70B6; } QPushButton:default:hover { +border-color: #2B66A6; background-color: #2B66A6; } QPushButton:default:pressed { +border-color: #215081; background-color: #215081; } QPushButton:default:disabled { -background-color: #2F70B6; +border-color: #82A9D3; +background-color: #82A9D3; } diff --git a/client/translations/en.ts b/client/translations/en.ts index 277107699..3f9c3e552 100644 --- a/client/translations/en.ts +++ b/client/translations/en.ts @@ -15,26 +15,6 @@ AddRecipients - - CANCEL - CANCEL - - - CONFIRM - CONFIRM - - - CERTIFICATE FROM CARD - CERTIFICATE FROM CARD - - - CERTIFICATE FROM FILE - CERTIFICATE FROM FILE - - - LATEST USED CERTIFICATE - LATEST USED CERTIFICATE - Failed to read certificate Failed to read certificate @@ -65,27 +45,22 @@ Certificate from card - accessible Certificate from card Certificate from file - accessible Certificate from file Latest used certificate - accessible Latest used certificate Cancel - accessible Cancel Confirm - accessible Confirm @@ -298,14 +273,6 @@ Certificate details Certificate details - - CLOSE - CLOSE - - - SAVE - SAVE - This certificate is intended for following purpose(s): This certificate is intended for following purpose(s): @@ -404,12 +371,10 @@ Close - accessible Close Save - accessible Save @@ -419,10 +384,6 @@ CLOSE CLOSE - - REMOVE - REMOVE - Owner Owner @@ -460,14 +421,8 @@ accessible Close - - Select - accessible - Select - Remove - accessible Remove @@ -475,8 +430,12 @@ Certificate for Encryption - ADD - ADD + Last used certificates + Last used certificates + + + Add + Add @@ -1289,14 +1248,6 @@ Value Value - - CLOSE - CLOSE - - - SHOW CERTIFICATE - SHOW CERTIFICATE - ConcatKDF digest method ConcatKDF digest method @@ -1307,12 +1258,10 @@ Close - accessible Close Show certificate - accessible Show certificate @@ -2623,10 +2572,6 @@ Additional licenses and components Signature Signature - - CLOSE - CLOSE - Attribute Attribute @@ -2775,7 +2720,6 @@ Additional licenses and components Close - accessible Close diff --git a/client/translations/et.ts b/client/translations/et.ts index 6bdb232f1..e0de422ee 100644 --- a/client/translations/et.ts +++ b/client/translations/et.ts @@ -15,26 +15,6 @@ AddRecipients - - CANCEL - KATKESTA - - - CONFIRM - KINNITA - - - CERTIFICATE FROM CARD - LISA SERTIFIKAAT KAARDILT - - - CERTIFICATE FROM FILE - LISA SERTIFIKAAT FAILIST - - - LATEST USED CERTIFICATE - VIIMATI LISATUD - Failed to read certificate Sertifikaadi lugemine ebaõnnestus @@ -65,27 +45,22 @@ Certificate from card - accessible Lisa sertifikaat kaardilt Certificate from file - accessible Lisa sertifikaat failist Latest used certificate - accessible Viimati lisatud Cancel - accessible Katkesta Confirm - accessible Kinnita @@ -298,14 +273,6 @@ Certificate details Sertifikaadi detailid - - CLOSE - SULGE - - - SAVE - SALVESTA - This certificate is intended for following purpose(s): Selle sertifikaadi otstarve on: @@ -404,12 +371,10 @@ Close - accessible Sulge Save - accessible Salvesta @@ -419,10 +384,6 @@ CLOSE SULGE - - REMOVE - EEMALDA - Owner Omanik @@ -460,14 +421,8 @@ accessible Sulge - - Select - accessible - Lisa - Remove - accessible Eemalda @@ -475,8 +430,12 @@ Krüpteerimissertifikaat - ADD - LISA + Last used certificates + Viimati lisatud sertifikaadid + + + Add + Lisa @@ -1289,14 +1248,6 @@ Value Väärtus - - CLOSE - SULGE - - - SHOW CERTIFICATE - NÄITA SERTIFIKAATI - ConcatKDF digest method ConcatKDF referaatmeetod @@ -1307,12 +1258,10 @@ Close - accessible Sulge Show certificate - accessible Näita sertifikaati @@ -2623,10 +2572,6 @@ Täiendavad litsentsid ja komponendid Signature Allkiri - - CLOSE - SULGE - Attribute Atribuut @@ -2775,7 +2720,6 @@ Täiendavad litsentsid ja komponendid Close - accessible Sulge diff --git a/client/translations/ru.ts b/client/translations/ru.ts index 8022b67b3..92e8d09d5 100644 --- a/client/translations/ru.ts +++ b/client/translations/ru.ts @@ -15,26 +15,6 @@ AddRecipients - - CANCEL - ОТМЕНА - - - CONFIRM - ПОДТВЕРДИТЬ - - - CERTIFICATE FROM CARD - СЕРТИФИКАТ С КАРТЫ - - - CERTIFICATE FROM FILE - СЕРТИФИКАТ ИЗ ФАЙЛА - - - LATEST USED CERTIFICATE - ПОСЛЕДНИЙ СЕРТИФИКАТ - Failed to read certificate Не удалось прочитать сертификат @@ -49,7 +29,7 @@ Person or company does not own a valid certificate.<br />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>. - У человека или предприятия отсутствует действующий сертификат.<br />Для шифрования нужен действующий сертификат.<br /><a href='https://www.id.ee/ru/artikkel/shifrovanie-i-deshifrovka-dokumentov/'>Точнее можно прочитать</a> + У человека или предприятия отсутствует действующий сертификат.<br />Для шифрования нужен действующий сертификат.<br /><a href='https://www.id.ee/ru/artikkel/shifrovanie-i-deshifrovka-dokumentov/'>Точнее можно прочитать</a>. Certificates (*.cer *.crt *.pem) @@ -65,27 +45,22 @@ Certificate from card - accessible Сертификат с карты Certificate from file - accessible Сертификат из файла Latest used certificate - accessible Последний сертификат Cancel - accessible Отмена Confirm - accessible Подтвердить @@ -298,14 +273,6 @@ Certificate details Сведения о сертификате - - CLOSE - ЗАКРЫТЬ - - - SAVE - СОХРАНИТЬ - This certificate is intended for following purpose(s): Этот сертификат предназначен для следующих целей: @@ -404,12 +371,10 @@ Close - accessible Закрыть Save - accessible Сохранить @@ -419,10 +384,6 @@ CLOSE ЗАКРЫТЬ - - REMOVE - УДАЛИТЬ - Owner Владелец @@ -460,14 +421,8 @@ accessible Закрыть - - Select - accessible - Выбрать - Remove - accessible Удалить @@ -475,8 +430,12 @@ Сертификат шифрования - ADD - ДОБАВИТЬ + Last used certificates + Последний сертификат + + + Add + Добавить @@ -1289,14 +1248,6 @@ Value Значение - - CLOSE - ЗАКРЫТЬ - - - SHOW CERTIFICATE - ПОКАЗАТЬ СЕРТИФИКАТ - ConcatKDF digest method Метод подсчета ConcatKDF @@ -1307,12 +1258,10 @@ Close - accessible Закрыть Show certificate - accessible Показать сертификат @@ -2624,10 +2573,6 @@ Additional licenses and components Signature Подпись - - CLOSE - ЗАКРЫТЬ - Attribute Атрибут @@ -2776,7 +2721,6 @@ Additional licenses and components Close - accessible Закрыть