summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx33
1 files changed, 28 insertions, 5 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 18ccaf2d2166..a27737668eba 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -52,6 +52,7 @@
#include <bitmaps.hlst>
#include <strings.hrc>
#include <resourcemanager.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/xmlsechelper.hxx>
#include <comphelper/processfactory.hxx>
@@ -188,10 +189,22 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
m_xHintPackageFT->show();
break;
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ m_xAddBtn->hide();
+ m_xRemoveBtn->hide();
+ m_xStartCertMgrBtn->hide();
+ }
}
DigitalSignaturesDialog::~DigitalSignaturesDialog()
{
+ if (m_xViewer)
+ m_xViewer->response(RET_OK);
+
+ if (m_xInfoBox)
+ m_xInfoBox->response(RET_OK);
}
bool DigitalSignaturesDialog::Init()
@@ -308,7 +321,7 @@ bool DigitalSignaturesDialog::canRemove()
return (bRet && canAddRemove());
}
-short DigitalSignaturesDialog::run()
+void DigitalSignaturesDialog::beforeRun()
{
// Verify Signatures and add certificates to ListBox...
mbVerifySignatures = true;
@@ -333,7 +346,11 @@ short DigitalSignaturesDialog::run()
// Only verify once, content will not change.
// But for refreshing signature information, StartVerifySignatureHdl will be called after each add/remove
mbVerifySignatures = false;
+}
+short DigitalSignaturesDialog::run()
+{
+ beforeRun();
return GenericDialogController::run();
}
@@ -755,16 +772,22 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
if ( xCert.is() )
{
+ if (m_xViewer)
+ m_xViewer->response(RET_OK);
+
uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert);
- CertificateViewer aViewer(m_xDialog.get(), xSecEnv, xCert, false, nullptr);
- aViewer.run();
+ m_xViewer = std::make_shared<CertificateViewer>(m_xDialog.get(), xSecEnv, xCert, false, nullptr);
+ weld::DialogController::runAsync(m_xViewer, [this] (sal_Int32) { m_xViewer = nullptr; });
}
else
{
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
+ if (m_xInfoBox)
+ m_xInfoBox->response(RET_OK);
+
+ m_xInfoBox = std::shared_ptr<weld::MessageDialog>(Application::CreateMessageDialog(m_xDialog.get(),
VclMessageType::Info, VclButtonsType::Ok,
XsResId(STR_XMLSECDLG_NO_CERT_FOUND)));
- xInfoBox->run();
+ m_xInfoBox->runAsync(m_xInfoBox, [this] (sal_Int32) { m_xInfoBox = nullptr; });
}
}
}