aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-17 17:44:04 +0000
committersaturneric <[email protected]>2025-04-17 17:44:04 +0000
commit6f504e4f915f928e42b8574ca3f93eea5038984b (patch)
treed5542b5cfad3d597038f7621e9975447efd7d9e6 /src/ui/dialog
parentchore: update and check translations (diff)
downloadGpgFrontend-6f504e4f915f928e42b8574ca3f93eea5038984b.tar.gz
GpgFrontend-6f504e4f915f928e42b8574ca3f93eea5038984b.zip
feat: check scd version
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/controller/SmartCardControllerDialog.cpp15
-rw-r--r--src/ui/dialog/controller/SmartCardControllerDialog.h1
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ui/dialog/controller/SmartCardControllerDialog.cpp b/src/ui/dialog/controller/SmartCardControllerDialog.cpp
index 450f1a35..254ed83c 100644
--- a/src/ui/dialog/controller/SmartCardControllerDialog.cpp
+++ b/src/ui/dialog/controller/SmartCardControllerDialog.cpp
@@ -42,7 +42,9 @@ namespace GpgFrontend::UI {
SmartCardControllerDialog::SmartCardControllerDialog(QWidget* parent)
: GeneralDialog("SmartCardControllerDialog", parent),
ui_(QSharedPointer<Ui_SmartCardControllerDialog>::create()),
- channel_(kGpgFrontendDefaultChannel) {
+ channel_(kGpgFrontendDefaultChannel),
+ scd_version_supported_(
+ GpgSmartCardManager::GetInstance(channel_).IsSCDVersionSupported()) {
ui_->setupUi(this);
ui_->smartCardLabel->setText(tr("Smart Card(s):"));
@@ -384,6 +386,11 @@ void SmartCardControllerDialog::reset_status() {
"restarting the application.")
<< "</p>";
+ out << "<p><b>"
+ << tr("Note: Smart card support of GpgFrontend requires GnuPG version "
+ "2.3.0 or later.")
+ << "</b></p>";
+
out << "<p>" << tr("Read the GnuPG Smart Card HOWTO: ")
<< "https://gnupg.org/howtos/card-howto/en/" << "</p>";
@@ -391,6 +398,12 @@ void SmartCardControllerDialog::reset_status() {
}
void SmartCardControllerDialog::slot_listen_smart_card_changes() {
+ if (!scd_version_supported_) {
+ LOG_D() << "scd version is not suppored";
+ reset_status();
+ return;
+ }
+
auto serial_numbers =
GpgSmartCardManager::GetInstance(channel_).GetSerialNumbers();
diff --git a/src/ui/dialog/controller/SmartCardControllerDialog.h b/src/ui/dialog/controller/SmartCardControllerDialog.h
index affe01a8..69b1d723 100644
--- a/src/ui/dialog/controller/SmartCardControllerDialog.h
+++ b/src/ui/dialog/controller/SmartCardControllerDialog.h
@@ -78,6 +78,7 @@ class SmartCardControllerDialog : public GeneralDialog {
GpgOpenPGPCard card_info_;
QString cached_status_hash_;
QTimer* timer_;
+ bool scd_version_supported_;
/**
* @brief Get the smart card serial number object