Commit 4a18b282 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add a Reload button to the smart card placeholder widget

This makes reloading more user friendly and more accessible than telling
the user to press F5 for refreshing the view.

GnuPG-bug-id: 6026
parent 615dfe83
Pipeline #190372 passed with stage
in 2 minutes and 55 seconds
......@@ -62,7 +62,14 @@ public:
QStringLiteral("<ul><li>") + supported.join(QLatin1String("</li><li>")) +
QStringLiteral("</li></ul>"), this));
lay->addSpacing(10);
lay->addWidget(new QLabel(i18n("Refresh the view (F5) to update the smartcard status."), this));
{
auto hbox = new QHBoxLayout;
hbox->addStretch(1);
mReloadButton = new QPushButton{i18n("Reload"), this};
hbox->addWidget(mReloadButton);
hbox->addStretch(1);
lay->addLayout(hbox);
}
lay->addStretch(-1);
auto hLay = new QHBoxLayout(this);
......@@ -70,7 +77,15 @@ public:
hLay->addLayout(lay);
hLay->addStretch(-1);
lay->addStretch(-1);
connect(mReloadButton, &QPushButton::clicked, this, &PlaceHolderWidget::reload);
}
Q_SIGNALS:
void reload();
private:
QPushButton *mReloadButton = nullptr;
};
} // namespace
......@@ -115,6 +130,7 @@ SmartCardWidget::Private::Private(SmartCardWidget *qq)
mStack->setCurrentWidget(mPlaceHolderWidget);
connect(mPlaceHolderWidget, &PlaceHolderWidget::reload, q, &SmartCardWidget::reload);
connect(ReaderStatus::instance(), &ReaderStatus::cardAdded,
q, [this] (const std::string &serialNumber, const std::string &appName) { cardAddedOrChanged(serialNumber, appName); });
connect(ReaderStatus::instance(), &ReaderStatus::cardChanged,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment