summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-12 21:31:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-13 15:15:48 +0100
commitb6de43a14a768e261d2233df57cf5fa46480d991 (patch)
tree464926ba6ae362c6aad904f9583dbecf527d9e39 /xmlsecurity
parente31c2c03f9ff06df553e577a1d9149ce75e7ff7f (diff)
weld CertificateViewer cluster
CertificateViewer, CertificateViewerGeneralTP, CertificateViewerDetailsTP, CertificateViewerCertPathTP Change-Id: I5792b673f17b3cd465ff17444776066139877ec1 Reviewed-on: https://gerrit.libreoffice.org/67756 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/bitmaps.hlst3
-rw-r--r--xmlsecurity/inc/certificateviewer.hxx146
-rw-r--r--xmlsecurity/inc/strings.hrc1
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx5
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx4
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx431
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx4
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx4
-rw-r--r--xmlsecurity/uiconfig/ui/certdetails.ui78
-rw-r--r--xmlsecurity/uiconfig/ui/certgeneral.ui21
-rw-r--r--xmlsecurity/uiconfig/ui/certpage.ui98
-rw-r--r--xmlsecurity/uiconfig/ui/viewcertdialog.ui80
12 files changed, 461 insertions, 414 deletions
diff --git a/xmlsecurity/inc/bitmaps.hlst b/xmlsecurity/inc/bitmaps.hlst
index 0cfeb433bc1a..1af4ff3c6234 100644
--- a/xmlsecurity/inc/bitmaps.hlst
+++ b/xmlsecurity/inc/bitmaps.hlst
@@ -12,6 +12,9 @@
#define BMP_STATE_NOT_VALIDATED "xmlecurity/res/notcertificate_40x56.png"
+#define BMP_CERT_OK "xmlsecurity/res/certificate_16.png"
+#define BMP_CERT_NOT_OK "xmlsecurity/res/notcertificate_16.png"
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx
index b439362f18ee..9f816c9a0671 100644
--- a/xmlsecurity/inc/certificateviewer.hxx
+++ b/xmlsecurity/inc/certificateviewer.hxx
@@ -37,111 +37,131 @@ namespace xml { namespace crypto {
class XSecurityEnvironment; }}
}}}
-class CertificateViewer : public TabDialog
+class CertificateViewerGeneralTP;
+class CertificateViewerDetailsTP;
+class CertificateViewerCertPathTP;
+
+class CertificateViewer : public weld::GenericDialogController
{
private:
friend class CertificateViewerGeneralTP;
friend class CertificateViewerDetailsTP;
friend class CertificateViewerCertPathTP;
- VclPtr<TabControl> mpTabCtrl;
- sal_uInt16 mnGeneralId;
- sal_uInt16 mnDetailsId;
- sal_uInt16 mnPathId;
-
bool const mbCheckForPrivateKey;
css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
css::uno::Reference< css::security::XCertificate > mxCert;
+
+ VclPtr<CertificateChooser> mpParentChooser;
+
+ std::unique_ptr<weld::Notebook> mxTabCtrl;
+
+ std::unique_ptr<CertificateViewerGeneralTP> mxGeneralPage;
+ std::unique_ptr<CertificateViewerDetailsTP> mxDetailsPage;
+ std::unique_ptr<CertificateViewerCertPathTP> mxPathId;
+
+ DECL_LINK(ActivatePageHdl, const OString&, void);
+
public:
- CertificateViewer( vcl::Window* pParent, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const css::uno::Reference< css::security::XCertificate >& rXCert, bool bCheckForPrivateKey );
- virtual ~CertificateViewer() override;
- virtual void dispose() override;
+ CertificateViewer(weld::Window* pParent, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const css::uno::Reference< css::security::XCertificate >& rXCert, bool bCheckForPrivateKey, CertificateChooser* pParentChooser);
+ CertificateChooser* GetParentChooser() { return mpParentChooser; }
};
-
-class CertificateViewerTP : public TabPage
+class CertificateViewerTP
{
protected:
- VclPtr<CertificateViewer> mpDlg;
+ std::unique_ptr<weld::Builder> mxBuilder;
+ std::unique_ptr<weld::Container> mxContainer;
+ CertificateViewer* mpDlg;
+
public:
- CertificateViewerTP( vcl::Window* _pParent, const OString& rID,
- const OUString& rUIXMLDescription, CertificateViewer* _pDlg );
- virtual ~CertificateViewerTP() override;
- virtual void dispose() override;
+ CertificateViewerTP(weld::Container* pParent, const OUString& rUIXMLDescription,
+ const OString& rID, CertificateViewer* pDlg);
};
class CertificateViewerGeneralTP : public CertificateViewerTP
{
private:
- VclPtr<FixedImage> m_pCertImg;
- VclPtr<FixedText> m_pHintNotTrustedFT;
- VclPtr<FixedText> m_pIssuedToLabelFT;
- VclPtr<FixedText> m_pIssuedToFT;
- VclPtr<FixedText> m_pIssuedByLabelFT;
- VclPtr<FixedText> m_pIssuedByFT;
- VclPtr<FixedText> m_pValidFromDateFT;
- VclPtr<FixedText> m_pValidToDateFT;
- VclPtr<FixedImage> m_pKeyImg;
- VclPtr<FixedText> m_pHintCorrespPrivKeyFT;
-public:
- CertificateViewerGeneralTP( vcl::Window* pParent, CertificateViewer* _pDlg );
- virtual ~CertificateViewerGeneralTP() override;
- virtual void dispose() override;
+ std::unique_ptr<weld::Image> m_xCertImg;
+ std::unique_ptr<weld::Label> m_xHintNotTrustedFT;
+ std::unique_ptr<weld::Label> m_xIssuedToLabelFT;
+ std::unique_ptr<weld::Label> m_xIssuedToFT;
+ std::unique_ptr<weld::Label> m_xIssuedByLabelFT;
+ std::unique_ptr<weld::Label> m_xIssuedByFT;
+ std::unique_ptr<weld::Label> m_xValidFromDateFT;
+ std::unique_ptr<weld::Label> m_xValidToDateFT;
+ std::unique_ptr<weld::Image> m_xKeyImg;
+ std::unique_ptr<weld::Label> m_xHintCorrespPrivKeyFT;
- virtual void ActivatePage() override;
+public:
+ CertificateViewerGeneralTP(weld::Container* pParent, CertificateViewer* pDlg);
};
+struct Details_UserDatat
+{
+ OUString const maTxt;
+ bool const mbFixedWidthFont;
+
+ Details_UserDatat(const OUString& rTxt, bool bFixedWidthFont)
+ : maTxt(rTxt)
+ , mbFixedWidthFont(bFixedWidthFont)
+ {
+ }
+};
class CertificateViewerDetailsTP : public CertificateViewerTP
{
private:
- VclPtr<SvSimpleTableContainer> m_pElementsLBContainer;
- VclPtr<SvSimpleTable> m_pElementsLB;
- VclPtr<VclMultiLineEdit> m_pValueDetails;
- vcl::Font m_aStdFont;
- vcl::Font m_aFixedWidthFont;
+ std::vector<std::unique_ptr<Details_UserDatat>> m_aUserData;
+
+ std::unique_ptr<weld::TreeView> m_xElementsLB;
+ std::unique_ptr<weld::TextView> m_xValueDetails;
- DECL_LINK( ElementSelectHdl, SvTreeListBox*, void );
+ DECL_LINK(ElementSelectHdl, weld::TreeView&, void);
void Clear();
- void InsertElement( const OUString& _rField, const OUString& _rValue,
- const OUString& _rDetails, bool _bFixedWidthFont = false );
+ void InsertElement(const OUString& rField, const OUString& rValue,
+ const OUString& rDetails, bool bFixedWidthFont = false);
public:
- CertificateViewerDetailsTP( vcl::Window* pParent, CertificateViewer* _pDlg );
- virtual ~CertificateViewerDetailsTP() override;
- virtual void dispose() override;
-
- virtual void ActivatePage() override;
+ CertificateViewerDetailsTP(weld::Container* pParent, CertificateViewer* pDlg);
};
+struct CertPath_UserData
+{
+ css::uno::Reference< css::security::XCertificate > mxCert;
+ bool const mbValid;
+
+ CertPath_UserData(css::uno::Reference<css::security::XCertificate> const & xCert, bool bValid)
+ : mxCert(xCert)
+ , mbValid(bValid)
+ {
+ }
+};
class CertificateViewerCertPathTP : public CertificateViewerTP
{
private:
- VclPtr<SvTreeListBox> mpCertPathLB;
- VclPtr<PushButton> mpViewCertPB;
- VclPtr<VclMultiLineEdit> mpCertStatusML;
-
- VclPtr<CertificateViewer> mpParent;
+ CertificateViewer* mpParent;
bool mbFirstActivateDone;
- Image maCertImage;
- Image maCertNotValidatedImage;
- OUString msCertOK;
- OUString msCertNotValidated;
- DECL_LINK( ViewCertHdl, Button*, void );
- DECL_LINK( CertSelectHdl, SvTreeListBox*, void );
+ std::vector<std::unique_ptr<CertPath_UserData>> maUserData;
+
+ std::unique_ptr<weld::TreeView> mxCertPathLB;
+ std::unique_ptr<weld::Button> mxViewCertPB;
+ std::unique_ptr<weld::TextView> mxCertStatusML;
+ std::unique_ptr<weld::Label> mxCertOK;
+ std::unique_ptr<weld::Label> mxCertNotValidated;
+
+ DECL_LINK(ViewCertHdl, weld::Button&, void);
+ DECL_LINK(CertSelectHdl, weld::TreeView&, void);
void Clear();
- SvTreeListEntry* InsertCert( SvTreeListEntry* _pParent, const OUString& _rName,
- const css::uno::Reference< css::security::XCertificate >& rxCert,
- bool bValid);
+ void InsertCert(weld::TreeIter* pParent, const OUString& _rName,
+ const css::uno::Reference< css::security::XCertificate >& rxCert,
+ bool bValid);
public:
- CertificateViewerCertPathTP( vcl::Window* pParent, CertificateViewer* _pDlg );
- virtual ~CertificateViewerCertPathTP() override;
- virtual void dispose() override;
-
- virtual void ActivatePage() override;
+ CertificateViewerCertPathTP(weld::Container* pParent, CertificateViewer* pDlg);
+ void ActivatePage();
};
diff --git a/xmlsecurity/inc/strings.hrc b/xmlsecurity/inc/strings.hrc
index 1505e3583d38..c44617e10fed 100644
--- a/xmlsecurity/inc/strings.hrc
+++ b/xmlsecurity/inc/strings.hrc
@@ -23,7 +23,6 @@
#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
#define STR_CERTIFICATE_NOT_VALIDATED NC_("STR_CERTIFICATE_NOT_VALIDATED", "The certificate could not be validated.")
-#define STR_HEADERBAR NC_("STR_HEADERBAR", "Field\tValue")
#define STR_VERSION NC_("STR_VERSION", "Version")
#define STR_SERIALNUM NC_("STR_SERIALNUM", "Serial Number")
#define STR_ISSUER NC_("STR_ISSUER", "Issuer")
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 48b60de55787..ef838b6fedff 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -599,10 +599,9 @@ void DocumentDigitalSignatures::showCertificate(
if ( bInit )
{
- ScopedVclPtrInstance<CertificateViewer> aViewer(nullptr, aSignatureManager.getSecurityEnvironment(), Certificate, false);
- aViewer->Execute();
+ CertificateViewer aViewer(nullptr, aSignatureManager.getSecurityEnvironment(), Certificate, false, nullptr);
+ aViewer.run();
}
-
}
sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index fc230658e491..61ce81f135db 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -347,8 +347,8 @@ void CertificateChooser::ImplShowCertificateDetails()
if (!userData->xSecurityEnvironment.is() || !userData->xCertificate.is())
return;
- ScopedVclPtrInstance< CertificateViewer > aViewer( this, userData->xSecurityEnvironment, userData->xCertificate, true );
- aViewer->Execute();
+ CertificateViewer aViewer(GetFrameWeld(), userData->xSecurityEnvironment, userData->xCertificate, true, this);
+ aViewer.run();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 0731a01cf0c1..501f59296b47 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -27,7 +27,6 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/datetime.hxx>
-#include <vcl/treelistentry.hxx>
#include <strings.hrc>
#include <resourcemanager.hxx>
@@ -37,85 +36,62 @@
#include <bitmaps.hlst>
#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
using namespace comphelper;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-CertificateViewer::CertificateViewer(
- vcl::Window* _pParent,
+CertificateViewer::CertificateViewer(weld::Window* _pParent,
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment,
- const css::uno::Reference< css::security::XCertificate >& _rXCert, bool bCheckForPrivateKey )
- : TabDialog(_pParent, "ViewCertDialog", "xmlsec/ui/viewcertdialog.ui" ),
- mbCheckForPrivateKey(bCheckForPrivateKey)
+ const css::uno::Reference< css::security::XCertificate >& _rXCert, bool bCheckForPrivateKey,
+ CertificateChooser* pParentChooser)
+ : GenericDialogController(_pParent, "xmlsec/ui/viewcertdialog.ui", "ViewCertDialog")
+ , mbCheckForPrivateKey(bCheckForPrivateKey)
+ , mpParentChooser(pParentChooser)
+ , mxTabCtrl(m_xBuilder->weld_notebook("tabcontrol"))
{
- get(mpTabCtrl, "tabcontrol");
-
+ mxTabCtrl->connect_enter_page(LINK(this, CertificateViewer, ActivatePageHdl));
mxSecurityEnvironment = _rxSecurityEnvironment;
mxCert = _rXCert;
- mnGeneralId = mpTabCtrl->GetPageId("general");
- mnDetailsId = mpTabCtrl->GetPageId("details");
- mnPathId = mpTabCtrl->GetPageId("path");
-
- mpTabCtrl->SetTabPage(mnGeneralId, VclPtr<CertificateViewerGeneralTP>::Create( mpTabCtrl, this));
- mpTabCtrl->SetTabPage(mnDetailsId, VclPtr<CertificateViewerDetailsTP>::Create( mpTabCtrl, this));
+ mxGeneralPage.reset(new CertificateViewerGeneralTP(mxTabCtrl->get_page("general"), this));
+ mxDetailsPage.reset(new CertificateViewerDetailsTP(mxTabCtrl->get_page("details"), this));
if (mxSecurityEnvironment->buildCertificatePath(mxCert).getLength() == 0)
- mpTabCtrl->RemovePage(mnPathId);
+ mxTabCtrl->remove_page("path");
else
- mpTabCtrl->SetTabPage(mnPathId, VclPtr<CertificateViewerCertPathTP>::Create( mpTabCtrl, this));
- mpTabCtrl->SetCurPageId(mnGeneralId);
-}
-
-CertificateViewer::~CertificateViewer()
-{
- disposeOnce();
-}
-
-void CertificateViewer::dispose()
-{
- mpTabCtrl->GetTabPage(mnGeneralId)->disposeOnce();
- mpTabCtrl->GetTabPage(mnDetailsId)->disposeOnce();
- if (mpTabCtrl->GetTabPage(mnPathId))
- mpTabCtrl->GetTabPage(mnPathId)->disposeOnce();
- mpTabCtrl.clear();
- TabDialog::dispose();
+ mxPathId.reset(new CertificateViewerCertPathTP(mxTabCtrl->get_page("path"), this));
+ mxTabCtrl->set_current_page("general");
}
-CertificateViewerTP::CertificateViewerTP( vcl::Window* _pParent, const OString& rID,
- const OUString& rUIXMLDescription, CertificateViewer* _pDlg )
- : TabPage(_pParent, rID, rUIXMLDescription)
- , mpDlg(_pDlg)
+IMPL_LINK(CertificateViewer, ActivatePageHdl, const OString&, rPage, void)
{
+ if (rPage == "path")
+ mxPathId->ActivatePage();
}
-CertificateViewerTP::~CertificateViewerTP()
+CertificateViewerTP::CertificateViewerTP(weld::Container* pParent, const OUString& rUIXMLDescription,
+ const OString& rID, CertificateViewer* pDlg)
+ : mxBuilder(Application::CreateBuilder(pParent, rUIXMLDescription))
+ , mxContainer(mxBuilder->weld_container(rID))
+ , mpDlg(pDlg)
{
- disposeOnce();
}
-void CertificateViewerTP::dispose()
+CertificateViewerGeneralTP::CertificateViewerGeneralTP(weld::Container* pParent, CertificateViewer* pDlg)
+ : CertificateViewerTP(pParent, "xmlsec/ui/certgeneral.ui", "CertGeneral", pDlg)
+ , m_xCertImg(mxBuilder->weld_image("certimage"))
+ , m_xHintNotTrustedFT(mxBuilder->weld_label("hintnotrust"))
+ , m_xIssuedToLabelFT(mxBuilder->weld_label("issued_to"))
+ , m_xIssuedToFT(mxBuilder->weld_label("issued_to_value"))
+ , m_xIssuedByLabelFT(mxBuilder->weld_label("issued_by"))
+ , m_xIssuedByFT(mxBuilder->weld_label("issued_by_value"))
+ , m_xValidFromDateFT(mxBuilder->weld_label("valid_from_value"))
+ , m_xValidToDateFT(mxBuilder->weld_label("valid_to_value"))
+ , m_xKeyImg(mxBuilder->weld_image("keyimage"))
+ , m_xHintCorrespPrivKeyFT(mxBuilder->weld_label("privatekey"))
{
- mpDlg.clear();
- TabPage::dispose();
-}
-
-
-CertificateViewerGeneralTP::CertificateViewerGeneralTP( vcl::Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, "CertGeneral", "xmlsec/ui/certgeneral.ui", _pDlg )
-{
- get( m_pCertImg, "certimage" );
- get( m_pHintNotTrustedFT, "hintnotrust" );
- get( m_pIssuedToLabelFT, "issued_to" );
- get( m_pIssuedToFT, "issued_to_value" );
- get( m_pIssuedByLabelFT, "issued_by");
- get( m_pIssuedByFT, "issued_by_value" );
- get( m_pValidFromDateFT, "valid_from_value" );
- get( m_pValidToDateFT, "valid_to_value" );
- get( m_pKeyImg, "keyimage" );
- get( m_pHintCorrespPrivKeyFT, "privatekey" );
-
//Verify the certificate
sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert,
Sequence<Reference<css::security::XCertificate> >());
@@ -124,8 +100,8 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( vcl::Window* _pParent, C
if ( !bCertValid )
{
- m_pCertImg->SetImage(Image(StockImage::Yes, BMP_STATE_NOT_VALIDATED));
- m_pHintNotTrustedFT->SetText( XsResId( STR_CERTIFICATE_NOT_VALIDATED ) );
+ m_xCertImg->set_from_icon_name(BMP_STATE_NOT_VALIDATED);
+ m_xHintNotTrustedFT->set_label(XsResId(STR_CERTIFICATE_NOT_VALIDATED));
}
// insert data
@@ -133,128 +109,69 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( vcl::Window* _pParent, C
OUString sSubjectName(xmlsec::GetContentPart(xCert->getSubjectName()));
if (!sSubjectName.isEmpty())
- m_pIssuedToFT->SetText(sSubjectName);
+ m_xIssuedToFT->set_label(sSubjectName);
else
- m_pIssuedToLabelFT->Hide();
+ m_xIssuedToLabelFT->hide();
OUString sIssuerName(xmlsec::GetContentPart(xCert->getIssuerName()));
if (!sIssuerName.isEmpty())
- m_pIssuedByFT->SetText(sIssuerName);
+ m_xIssuedByFT->set_label(sIssuerName);
else
- m_pIssuedByLabelFT->Hide();
+ m_xIssuedByLabelFT->hide();
DateTime aDateTimeStart( DateTime::EMPTY );
DateTime aDateTimeEnd( DateTime::EMPTY );
utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart );
utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd );
- OUString sValidFromDate = GetSettings().GetUILocaleDataWrapper().getDate( Date( aDateTimeStart.GetDate()));
- OUString sValidToDate = GetSettings().GetUILocaleDataWrapper().getDate( Date( aDateTimeEnd.GetDate()));
+ OUString sValidFromDate = Application::GetSettings().GetUILocaleDataWrapper().getDate(Date(aDateTimeStart.GetDate()));
+ OUString sValidToDate = Application::GetSettings().GetUILocaleDataWrapper().getDate(Date(aDateTimeEnd.GetDate()));
- m_pValidFromDateFT->SetText(sValidFromDate);
- m_pValidToDateFT->SetText(sValidToDate);
+ m_xValidFromDateFT->set_label(sValidFromDate);
+ m_xValidToDateFT->set_label(sValidToDate);
// Check if we have the private key...
bool bHasPrivateKey = false;
// #i41270# Check only if we have that certificate in our security environment
- if ( _pDlg->mbCheckForPrivateKey )
+ if (pDlg->mbCheckForPrivateKey)
{
- long nCertificateCharacters = _pDlg->mxSecurityEnvironment->getCertificateCharacters( xCert );
- bHasPrivateKey = ( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY );
+ long nCertificateCharacters = pDlg->mxSecurityEnvironment->getCertificateCharacters(xCert);
+ bHasPrivateKey = (nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY);
}
- if ( !bHasPrivateKey )
+ if (!bHasPrivateKey)
{
- m_pKeyImg->Hide();
- m_pHintCorrespPrivKeyFT->Hide();
+ m_xKeyImg->hide();
+ m_xHintCorrespPrivKeyFT->hide();
}
}
-CertificateViewerGeneralTP::~CertificateViewerGeneralTP()
-{
- disposeOnce();
-}
-
-void CertificateViewerGeneralTP::dispose()
-{
- m_pCertImg.clear();
- m_pHintNotTrustedFT.clear();
- m_pIssuedToLabelFT.clear();
- m_pIssuedToFT.clear();
- m_pIssuedByLabelFT.clear();
- m_pIssuedByFT.clear();
- m_pValidFromDateFT.clear();
- m_pValidToDateFT.clear();
- m_pKeyImg.clear();
- m_pHintCorrespPrivKeyFT.clear();
- CertificateViewerTP::dispose();
-}
-
-void CertificateViewerGeneralTP::ActivatePage()
-{
-
-}
-
-
-struct Details_UserDatat
-{
- OUString const maTxt;
- bool const mbFixedWidthFont;
-
- inline Details_UserDatat( const OUString& _rTxt, bool _bFixedWidthFont );
-};
-
-inline Details_UserDatat::Details_UserDatat( const OUString& _rTxt, bool _bFixedWidthFont )
- :maTxt ( _rTxt )
- ,mbFixedWidthFont ( _bFixedWidthFont )
-{
-}
-
-
void CertificateViewerDetailsTP::Clear()
{
- m_pValueDetails->SetText( OUString() );
- sal_uLong i = 0;
- SvTreeListEntry* pEntry = m_pElementsLB->GetEntry( i );
- while( pEntry )
- {
- delete static_cast<Details_UserDatat*>(pEntry->GetUserData());
- ++i;
- pEntry = m_pElementsLB->GetEntry( i );
- }
-
- m_pElementsLB->Clear();
+ m_xValueDetails->set_text(OUString());
+ m_aUserData.clear();
+ m_xElementsLB->clear();
}
-void CertificateViewerDetailsTP::InsertElement( const OUString& _rField, const OUString& _rValue,
- const OUString& _rDetails, bool _bFixedWidthFont )
+void CertificateViewerDetailsTP::InsertElement(const OUString& rField, const OUString& rValue,
+ const OUString& rDetails, bool bFixedWidthFont)
{
- SvTreeListEntry* pEntry = m_pElementsLB->InsertEntry( _rField );
- m_pElementsLB->SetEntryText( _rValue, pEntry, 1 );
- pEntry->SetUserData(new Details_UserDatat(_rDetails, _bFixedWidthFont));
+ m_aUserData.emplace_back(std::make_unique<Details_UserDatat>(rDetails, bFixedWidthFont));
+ OUString sId(OUString::number(reinterpret_cast<sal_Int64>(m_aUserData.back().get())));
+ m_xElementsLB->append(sId, rField);
+ m_xElementsLB->set_text(m_xElementsLB->n_children() -1, rValue, 1);
}
-CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, "CertDetails", "xmlsec/ui/certdetails.ui", _pDlg )
- ,m_aFixedWidthFont( OutputDevice::GetDefaultFont( DefaultFontType::UI_FIXED, LANGUAGE_DONTKNOW, GetDefaultFontFlags::OnlyOne, this ) )
+CertificateViewerDetailsTP::CertificateViewerDetailsTP(weld::Container* pParent, CertificateViewer* pDlg)
+ : CertificateViewerTP(pParent, "xmlsec/ui/certdetails.ui", "CertDetails", pDlg)
+ , m_xElementsLB(mxBuilder->weld_tree_view("tablecontainer"))
+ , m_xValueDetails(mxBuilder->weld_text_view("valuedetails"))
{
- get( m_pValueDetails, "valuedetails" );
- WinBits nStyle = m_pValueDetails->GetStyle();
- nStyle |= WB_AUTOVSCROLL;
- m_pValueDetails->SetStyle(nStyle);
- get( m_pElementsLBContainer, "tablecontainer" );
- m_pElementsLB = VclPtr<SvSimpleTable>::Create( *m_pElementsLBContainer );
-
- m_aStdFont = m_pValueDetails->GetControlFont();
- nStyle = m_pElementsLB->GetStyle();
- nStyle &= ~WB_HSCROLL;
- m_pElementsLB->SetStyle( nStyle );
-
- m_aFixedWidthFont.SetFontHeight( m_aStdFont.GetFontHeight() );
-
- constexpr int DLGS_WIDTH = 287;
- constexpr int CS_LB_WIDTH = (DLGS_WIDTH - RSC_SP_DLG_INNERBORDER_RIGHT) - RSC_SP_DLG_INNERBORDER_LEFT;
- static long nTabs[] = { 0, 30*CS_LB_WIDTH/100 };
- m_pElementsLB->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
- m_pElementsLB->InsertHeaderEntry( XsResId( STR_HEADERBAR ) );
+ const int nWidth = m_xElementsLB->get_approximate_digit_width() * 60;
+ const int nHeight = m_xElementsLB->get_height_rows(8);
+ m_xElementsLB->set_size_request(nWidth, nHeight);
+ m_xValueDetails->set_size_request(nWidth, nHeight);
+ std::vector<int> aWidths;
+ aWidths.push_back(nWidth / 2);
+ m_xElementsLB->set_column_fixed_widths(aWidths);
// fill list box
Reference< security::XCertificate > xCert = mpDlg->mxCert;
@@ -278,14 +195,14 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C
DateTime aDateTime( DateTime::EMPTY );
utl::typeConvert( xCert->getNotValidBefore(), aDateTime );
- aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( Date( aDateTime.GetDate()) );
+ aLBEntry = Application::GetSettings().GetUILocaleDataWrapper().getDate(Date(aDateTime.GetDate()));
aLBEntry += " ";
- aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( tools::Time( aDateTime.GetTime()) );
+ aLBEntry += Application::GetSettings().GetUILocaleDataWrapper().getTime(tools::Time(aDateTime.GetTime()));
InsertElement( XsResId( STR_VALIDFROM ), aLBEntry, aLBEntry );
utl::typeConvert( xCert->getNotValidAfter(), aDateTime );
- aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( Date( aDateTime.GetDate()) );
+ aLBEntry = Application::GetSettings().GetUILocaleDataWrapper().getDate(Date(aDateTime.GetDate()) );
aLBEntry += " ";
- aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( tools::Time( aDateTime.GetTime()) );
+ aLBEntry += Application::GetSettings().GetUILocaleDataWrapper().getTime(tools::Time(aDateTime.GetTime()));
InsertElement( XsResId( STR_VALIDTO ), aLBEntry, aLBEntry );
std::pair< OUString, OUString > pairSubject =
@@ -304,7 +221,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C
aLBEntry = aDetails = xCert->getSignatureAlgorithm();
InsertElement( XsResId( STR_SIGNATURE_ALGO ), aLBEntry, aDetails );
- CertificateChooser* pChooser = dynamic_cast<CertificateChooser*>(mpDlg->GetParent());
+ CertificateChooser* pChooser = mpDlg->GetParentChooser();
if (pChooser)
{
aLBEntry = pChooser->UsageInClearText( mpDlg->mxCert->getCertificateUsage() );
@@ -321,98 +238,44 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C
aDetails = xmlsec::GetHexString( aSeq, pHexSep, nLineBreak );
InsertElement( XsResId( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true );
- m_pElementsLB->SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) );
-}
-
-CertificateViewerDetailsTP::~CertificateViewerDetailsTP()
-{
- disposeOnce();
-}
-
-void CertificateViewerDetailsTP::dispose()
-{
- Clear();
- m_pElementsLB.disposeAndClear();
- m_pElementsLBContainer.clear();
- m_pValueDetails.clear();
- CertificateViewerTP::dispose();
-}
-
-void CertificateViewerDetailsTP::ActivatePage()
-{
+ m_xElementsLB->connect_changed(LINK(this, CertificateViewerDetailsTP, ElementSelectHdl));
}
-IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl, SvTreeListBox*, void)
+IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl, weld::TreeView&, void)
{
- SvTreeListEntry* pEntry = m_pElementsLB->FirstSelected();
- OUString aElementText;
- bool bFixedWidthFont;
- if( pEntry )
+ int nEntry = m_xElementsLB->get_selected_index();
+ OUString aElementText;
+ bool bFixedWidthFont;
+ if (nEntry != -1)
{
- const Details_UserDatat* p = static_cast<Details_UserDatat*>(pEntry->GetUserData());
+ const Details_UserDatat* p = reinterpret_cast<Details_UserDatat*>(m_xElementsLB->get_id(nEntry).toInt64());
aElementText = p->maTxt;
bFixedWidthFont = p->mbFixedWidthFont;
}
else
bFixedWidthFont = false;
- m_pValueDetails->SetFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
- m_pValueDetails->SetControlFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
- m_pValueDetails->SetText( aElementText );
+ m_xValueDetails->set_monospace(bFixedWidthFont);
+ m_xValueDetails->set_text(aElementText);
}
-struct CertPath_UserData
-{
- css::uno::Reference< css::security::XCertificate > mxCert;
- bool const mbValid;
-
- CertPath_UserData( css::uno::Reference< css::security::XCertificate > const & xCert, bool bValid):
- mxCert(xCert),
- mbValid(bValid)
- {
- }
-};
-
-
-CertificateViewerCertPathTP::CertificateViewerCertPathTP( vcl::Window* _pParent, CertificateViewer* _pDlg )
- : CertificateViewerTP(_pParent, "CertPage", "xmlsec/ui/certpage.ui", _pDlg)
- , mpParent(_pDlg)
+CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParent, CertificateViewer* pDlg)
+ : CertificateViewerTP(pParent, "xmlsec/ui/certpage.ui", "CertPage", pDlg)
+ , mpParent(pDlg)
, mbFirstActivateDone(false)
+ , mxCertPathLB(mxBuilder->weld_tree_view("signatures"))
+ , mxViewCertPB(mxBuilder->weld_button("viewcert"))
+ , mxCertStatusML(mxBuilder->weld_text_view("status"))
+ , mxCertOK(mxBuilder->weld_label("certok"))
+ , mxCertNotValidated(mxBuilder->weld_label("certnotok"))
{
- get(mpCertPathLB, "signatures");
- get(mpViewCertPB, "viewcert");
- get(mpCertStatusML, "status");
-
- msCertOK = get<FixedText>("certok")->GetText();
- msCertNotValidated = get<FixedText>("certnotok")->GetText();
- maCertImage = get<FixedImage>("imgok")->GetImage();
- maCertNotValidatedImage = get<FixedImage>("imgnotok")->GetImage();
-
- Size aControlSize(LogicToPixel(Size(251, 45), MapMode(MapUnit::MapAppFont)));
- mpCertPathLB->set_width_request(aControlSize.Width());
- mpCertPathLB->set_height_request(aControlSize.Height());
- mpCertStatusML->set_width_request(aControlSize.Width());
- mpCertStatusML->set_height_request(aControlSize.Height());
-
- mpCertPathLB->SetNodeDefaultImages();
- mpCertPathLB->SetSublistOpenWithLeftRight();
- mpCertPathLB->SetSelectHdl( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) );
- mpViewCertPB->SetClickHdl( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) );
-}
-
-CertificateViewerCertPathTP::~CertificateViewerCertPathTP()
-{
- disposeOnce();
-}
+ const int nWidth = mxCertPathLB->get_approximate_digit_width() * 60;
+ const int nHeight = mxCertPathLB->get_height_rows(6);
+ mxCertPathLB->set_size_request(nWidth, nHeight);
+ mxCertStatusML->set_size_request(nWidth, nHeight);
-void CertificateViewerCertPathTP::dispose()
-{
- Clear();
- mpCertPathLB.clear();
- mpViewCertPB.clear();
- mpCertStatusML.clear();
- mpParent.clear();
- CertificateViewerTP::dispose();
+ mxCertPathLB->connect_changed( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) );
+ mxViewCertPB->connect_clicked( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) );
}
void CertificateViewerCertPathTP::ActivatePage()
@@ -425,7 +288,7 @@ void CertificateViewerCertPathTP::ActivatePage()
const Reference< security::XCertificate >* pCertPath = aCertPath.getConstArray();
sal_Int32 i, nCnt = aCertPath.getLength();
- SvTreeListEntry* pParent = nullptr;
+ std::unique_ptr<weld::TreeIter> xParent;
for (i = nCnt-1; i >= 0; i--)
{
const Reference< security::XCertificate > rCert = pCertPath[ i ];
@@ -434,75 +297,85 @@ void CertificateViewerCertPathTP::ActivatePage()
sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(rCert,
Sequence<Reference<css::security::XCertificate> >());
bool bCertValid = certStatus == css::security::CertificateValidity::VALID;
- pParent = InsertCert( pParent, sName, rCert, bCertValid);
+ InsertCert(xParent.get(), sName, rCert, bCertValid);
+ if (!xParent)
+ {
+ xParent = mxCertPathLB->make_iterator();
+ mxCertPathLB->get_iter_first(*xParent);
+ }
+ else
+ {
+ mxCertPathLB->iter_children(*xParent);
+ }
}
- if (pParent)
- mpCertPathLB->Select( pParent );
- mpViewCertPB->Disable(); // Own certificate selected
+ if (xParent)
+ mxCertPathLB->select(*xParent);
+ mxViewCertPB->set_sensitive(false); // Own certificate selected
- while( pParent )
+ while (xParent)
{
- mpCertPathLB->Expand( pParent );
- pParent = mpCertPathLB->GetParent( pParent );
+ mxCertPathLB->expand_row(*xParent);
+ if (!mxCertPathLB->iter_parent(*xParent))
+ xParent.reset();
}
- CertSelectHdl( nullptr );
+ CertSelectHdl(*mxCertPathLB);
}
}
-IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl, Button*, void)
+IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl, weld::Button&, void)
{
- SvTreeListEntry* pEntry = mpCertPathLB->FirstSelected();
- if( pEntry )
+ std::unique_ptr<weld::TreeIter> xIter = mxCertPathLB->make_iterator();
+ if (mxCertPathLB->get_selected(xIter.get()))
{
- ScopedVclPtrInstance< CertificateViewer > aViewer(
- this, mpDlg->mxSecurityEnvironment,
- static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert,
- false );
- aViewer->Execute();
+ CertPath_UserData* pData = reinterpret_cast<CertPath_UserData*>(mxCertPathLB->get_id(*xIter).toInt64());
+ CertificateViewer aViewer(mpDlg->getDialog(), mpDlg->mxSecurityEnvironment,
+ pData->mxCert, false, nullptr);
+ aViewer.run();
}
}
-IMPL_LINK_NOARG(CertificateViewerCertPathTP, CertSelectHdl, SvTreeListBox*, void)
+IMPL_LINK_NOARG(CertificateViewerCertPathTP, CertSelectHdl, weld::TreeView&, void)
{
OUString sStatus;
- SvTreeListEntry* pEntry = mpCertPathLB->FirstSelected();
- if( pEntry )
+
+ std::unique_ptr<weld::TreeIter> xIter = mxCertPathLB->make_iterator();
+ bool bEntry = mxCertPathLB->get_selected(xIter.get());
+ if (bEntry)
{
- CertPath_UserData* pData = static_cast<CertPath_UserData*>(pEntry->GetUserData());
- if ( pData )
- sStatus = pData->mbValid ? msCertOK : msCertNotValidated;
+ CertPath_UserData* pData = reinterpret_cast<CertPath_UserData*>(mxCertPathLB->get_id(*xIter).toInt64());
+ if (pData)
+ sStatus = pData->mbValid ? mxCertOK->get_label() : mxCertNotValidated->get_label();
}
- mpCertStatusML->SetText( sStatus );
- mpViewCertPB->Enable( pEntry && ( pEntry != mpCertPathLB->Last() ) );
-}
+ mxCertStatusML->set_text(sStatus);
-void CertificateViewerCertPathTP::Clear()
-{
- mpCertStatusML->SetText( OUString() );
- sal_uLong i = 0;
- SvTreeListEntry* pEntry = mpCertPathLB->GetEntry( i );
- while( pEntry )
+ bool bSensitive = false;
+ if (bEntry)
{
- delete static_cast<CertPath_UserData*>(pEntry->GetUserData());
- ++i;
- pEntry = mpCertPathLB->GetEntry( i );
+ // if has children, so not the last one in the chain
+ if (mxCertPathLB->iter_children(*xIter))
+ bSensitive = true;
}
-
- mpCertPathLB->Clear();
+ mxViewCertPB->set_sensitive(bSensitive);
}
-SvTreeListEntry* CertificateViewerCertPathTP::InsertCert(
- SvTreeListEntry* _pParent, const OUString& _rName, const css::uno::Reference< css::security::XCertificate >& rxCert,
- bool bValid)
+void CertificateViewerCertPathTP::Clear()
{
- Image aImage = bValid ? maCertImage : maCertNotValidatedImage;
- SvTreeListEntry* pEntry = mpCertPathLB->InsertEntry( _rName, aImage, aImage, _pParent );
- pEntry->SetUserData(new CertPath_UserData(rxCert, bValid));
+ mxCertStatusML->set_text(OUString());
+ maUserData.clear();
+ mxCertPathLB->clear();
+}
- return pEntry;
+void CertificateViewerCertPathTP::InsertCert(weld::TreeIter* pParent, const OUString& rName,
+ const css::uno::Reference< css::security::XCertificate >& rxCert,
+ bool bValid)
+{
+ OUString sImage = bValid ? OUStringLiteral(BMP_CERT_OK) : OUStringLiteral(BMP_CERT_NOT_OK);
+ maUserData.emplace_back(std::make_unique<CertPath_UserData>(rxCert, bValid));
+ OUString sId(OUString::number(reinterpret_cast<sal_Int64>(maUserData.back().get())));
+ mxCertPathLB->insert(pParent, -1, &rName, &sId, nullptr, nullptr, &sImage, false);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index fa5da389d55e..762bcc58c878 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -740,8 +740,8 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
if ( xCert.is() )
{
uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert);
- ScopedVclPtrInstance<CertificateViewer> aViewer(this, xSecEnv, xCert, false);
- aViewer->Execute();
+ CertificateViewer aViewer(GetFrameWeld(), xSecEnv, xCert, false, nullptr);
+ aViewer.run();
}
else
{
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index e38456f4782b..69a5dff78321 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -229,8 +229,8 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl, Button*, void)
if ( xCert.is() )
{
- ScopedVclPtrInstance< CertificateViewer > aViewer( this, mpDlg->mxSecurityEnvironment, xCert, false );
- aViewer->Execute();
+ CertificateViewer aViewer(GetFrameWeld(), mpDlg->mxSecurityEnvironment, xCert, false, nullptr);
+ aViewer.run();
}
}
}
diff --git a/xmlsecurity/uiconfig/ui/certdetails.ui b/xmlsecurity/uiconfig/ui/certdetails.ui
index d2b04cc75011..03c2a1459d39 100644
--- a/xmlsecurity/uiconfig/ui/certdetails.ui
+++ b/xmlsecurity/uiconfig/ui/certdetails.ui
@@ -2,20 +2,74 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="xsc">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore3">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkBox" id="CertDetails">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="homogeneous">True</property>
- <property name="spacing">12</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <property name="homogeneous">True</property>
<child>
- <object class="svtlo-SvSimpleTableContainer" id="tablecontainer:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="hscrollbar_policy">external</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="tablecontainer">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore3</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="certdetails|field">Field</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="title" translatable="yes" context="certdetails|value">Value</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer2"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -24,9 +78,21 @@
</packing>
</child>
<child>
- <object class="GtkTextView" id="valuedetails:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="valuedetails">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/xmlsecurity/uiconfig/ui/certgeneral.ui b/xmlsecurity/uiconfig/ui/certgeneral.ui
index eb814665d67b..a019bbdf3a58 100644
--- a/xmlsecurity/uiconfig/ui/certgeneral.ui
+++ b/xmlsecurity/uiconfig/ui/certgeneral.ui
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="xsc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkBox" id="box1">
+ <object class="GtkBox" id="CertGeneral">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkBox" id="CertGeneral">
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -16,7 +17,7 @@
<object class="GtkImage" id="certimage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="pixbuf">xmlsecurity/res/certificate_40x56.png</property>
+ <property name="icon_name">xmlsecurity/res/certificate_40x56.png</property>
</object>
<packing>
<property name="expand">False</property>
@@ -66,8 +67,8 @@
<property name="margin_left">36</property>
<property name="margin_right">36</property>
<property name="margin_bottom">108</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certgeneral|hintnotrust">This certificate is validated.</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -99,8 +100,8 @@
<object class="GtkLabel" id="issued_to">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certgeneral|issued_to">Issued to: </property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -126,8 +127,8 @@
<object class="GtkLabel" id="issued_by">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certgeneral|issued_by">Issued by: </property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -152,8 +153,8 @@
<object class="GtkLabel" id="valid_from">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certgeneral|valid_from">Valid from:</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -172,7 +173,7 @@
<object class="GtkImage" id="keyimage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="pixbuf">xmlsecurity/res/key_12.png</property>
+ <property name="icon_name">xmlsecurity/res/key_12.png</property>
</object>
<packing>
<property name="expand">False</property>
@@ -203,8 +204,8 @@
<object class="GtkLabel" id="valid_to">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certgeneral|valid_to">Valid to:</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
diff --git a/xmlsecurity/uiconfig/ui/certpage.ui b/xmlsecurity/uiconfig/ui/certpage.ui
index c90dfda415a3..38b0f095ef14 100644
--- a/xmlsecurity/uiconfig/ui/certpage.ui
+++ b/xmlsecurity/uiconfig/ui/certpage.ui
@@ -2,7 +2,14 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="xsc">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore3">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkBox" id="CertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -22,16 +29,14 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certpage|label1">Certification path</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">signatures:border</property>
+ <property name="mnemonic_widget">signatures</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -47,25 +52,47 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="vcllo-SvTreeListBox" id="signatures:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="Tree List-selection1"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="signatures">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore3</property>
+ <property name="headers_visible">False</property>
+ <property name="search_column">0</property>
+ <property name="enable_tree_lines">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -86,31 +113,36 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="certpage|label2">Certification status</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">status:border</property>
+ <property name="mnemonic_widget">status</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkTextView" id="status:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="editable">False</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="status">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -144,29 +176,5 @@
<property name="position">3</property>
</packing>
</child>
- <child>
- <object class="GtkImage" id="imgok">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">xmlsecurity/res/certificate_16.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="imgnotok">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">xmlsecurity/res/notcertificate_16.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
</object>
</interface>
diff --git a/xmlsecurity/uiconfig/ui/viewcertdialog.ui b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
index 007b537a79bc..a545c42494f1 100644
--- a/xmlsecurity/uiconfig/ui/viewcertdialog.ui
+++ b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="xsc">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="ViewCertDialog">
@@ -7,7 +7,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="viewcertdialog|ViewCertDialog">View Certificate</property>
<property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -71,6 +77,30 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
<child type="tab">
@@ -90,6 +120,30 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="position">1</property>
@@ -113,6 +167,30 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="position">2</property>