diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-13 15:45:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-02-14 14:21:57 +0100 |
commit | 9127763db1fcb90b168befda6ce07aece774ceb4 (patch) | |
tree | ebaedd53b80f90a3d1412b694141d2c83fe2c400 | |
parent | bb9481a489cc21b0695c9a7c3e9d4ffe1446f8a9 (diff) |
weld MacroSecurity cluster
MacroSecurity, MacroSecurityLevelTP and MacroSecurityTrustedSourcesTP
Change-Id: I0c3494a051cdac2723710484d5e00146d3f3dfe7
Reviewed-on: https://gerrit.libreoffice.org/67797
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/options/optinet2.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 1 | ||||
-rw-r--r-- | xmlsecurity/inc/macrosecurity.hxx | 122 | ||||
-rw-r--r-- | xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx | 1 | ||||
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/macrosecurity.cxx | 384 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/macrosecuritydialog.ui | 81 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/securitylevelpage.ui | 32 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/securitytrustpage.ui | 194 |
9 files changed, 421 insertions, 400 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index e090744d5f90..9353b990e847 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -822,7 +822,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MacroSecPBHdl, Button*, void) { Reference< security::XDocumentDigitalSignatures > xD( security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext() ) ); - xD->setParentWindow(VCLUnoHelper::GetInterface(GetTabDialog())); + xD->setParentWindow(VCLUnoHelper::GetInterface(GetParentDialog())); xD->manageTrustedSources(); } catch (const Exception& e) diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 5e915f8ba31b..3ca962d882ff 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1885,7 +1885,6 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(TabPageParent pParent, { m_xCBRemoveList->set_label_line_wrap(true); m_xCBRemoveList->set_size_request(nMaxWidth, -1); - aPrefSize = m_xCBRemoveList->get_preferred_size(); } m_xLBEntries->set_size_request(m_xLBEntries->get_approximate_digit_width() * 30, diff --git a/xmlsecurity/inc/macrosecurity.hxx b/xmlsecurity/inc/macrosecurity.hxx index 66d473341c2c..4888a5e2f2a0 100644 --- a/xmlsecurity/inc/macrosecurity.hxx +++ b/xmlsecurity/inc/macrosecurity.hxx @@ -20,13 +20,7 @@ #ifndef INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX #define INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/tabdlg.hxx> -#include <vcl/tabctrl.hxx> -#include <vcl/tabpage.hxx> -#include <svtools/simptabl.hxx> +#include <vcl/weld.hxx> #include <unotools/securityoptions.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -40,103 +34,99 @@ namespace xml { namespace crypto { class MacroSecurityTP; -class MacroSecurity : public TabDialog +class MacroSecurity : public weld::GenericDialogController { private: friend class MacroSecurityLevelTP; friend class MacroSecurityTrustedSourcesTP; - VclPtr<TabControl> m_pTabCtrl; - VclPtr<OKButton> m_pOkBtn; - VclPtr<PushButton> m_pResetBtn; + css::uno::Reference<css::xml::crypto::XSecurityEnvironment> m_xSecurityEnvironment; + SvtSecurityOptions m_aSecOptions; - css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; - SvtSecurityOptions maSecOptions; + std::unique_ptr<weld::Notebook> m_xTabCtrl; + std::unique_ptr<weld::Button> m_xOkBtn; + std::unique_ptr<weld::Button> m_xResetBtn; - sal_uInt16 m_nSecLevelId; - sal_uInt16 m_nSecTrustId; + std::unique_ptr<MacroSecurityTP> m_xLevelTP; + std::unique_ptr<MacroSecurityTP> m_xTrustSrcTP; - VclPtr<MacroSecurityTP> mpLevelTP; - VclPtr<MacroSecurityTP> mpTrustSrcTP; - - DECL_LINK( OkBtnHdl, Button*, void ); + DECL_LINK(ActivatePageHdl, const OString&, void); + DECL_LINK(OkBtnHdl, weld::Button&, void); public: - MacroSecurity(vcl::Window* pParent, - const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); - virtual ~MacroSecurity() override; - virtual void dispose() override; + MacroSecurity(weld::Window* pParent, + const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& rxSecurityEnvironment); - void EnableReset(bool _bEnable = true) + void EnableReset(bool bEnable = true) { - m_pResetBtn->Enable ( _bEnable ); + m_xResetBtn->set_sensitive(bEnable); } }; -class MacroSecurityTP : public TabPage +class MacroSecurityTP { protected: - VclPtr<MacroSecurity> mpDlg; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + + MacroSecurity* m_pDlg; public: - MacroSecurityTP(vcl::Window* _pParent, const OString& rID, - const OUString& rUIXMLDescription, MacroSecurity* _pDlg); - virtual ~MacroSecurityTP() override; - virtual void dispose() override; + MacroSecurityTP(weld::Container* pParent, const OUString& rUIXMLDescription, + const OString& rID, MacroSecurity* pDlg); + virtual ~MacroSecurityTP(); - virtual void ClosePage() = 0; + virtual void ActivatePage(); + virtual void ClosePage() = 0; }; class MacroSecurityLevelTP : public MacroSecurityTP { private: - VclPtr<RadioButton> m_pVeryHighRB; - VclPtr<RadioButton> m_pHighRB; - VclPtr<RadioButton> m_pMediumRB; - VclPtr<RadioButton> m_pLowRB; - sal_uInt16 mnCurLevel; - DECL_LINK(RadioButtonHdl, Button*, void); + std::unique_ptr<weld::RadioButton> m_xVeryHighRB; + std::unique_ptr<weld::RadioButton> m_xHighRB; + std::unique_ptr<weld::RadioButton> m_xMediumRB; + std::unique_ptr<weld::RadioButton> m_xLowRB; + std::unique_ptr<weld::Widget> m_xVHighImg; + std::unique_ptr<weld::Widget> m_xHighImg; + std::unique_ptr<weld::Widget> m_xMedImg; + std::unique_ptr<weld::Widget> m_xLowImg; + DECL_LINK(RadioButtonHdl, weld::ToggleButton&, void); public: - MacroSecurityLevelTP( vcl::Window* pParent, MacroSecurity* _pDlg ); - virtual ~MacroSecurityLevelTP() override; - virtual void dispose() override; - - virtual void ClosePage() override; + MacroSecurityLevelTP(weld::Container* pParent, MacroSecurity* pDlg); + virtual void ClosePage() override; }; - class MacroSecurityTrustedSourcesTP : public MacroSecurityTP { private: - VclPtr<FixedImage> m_pTrustCertROFI; - VclPtr<SvSimpleTable> m_pTrustCertLB; - VclPtr<PushButton> m_pViewCertPB; - VclPtr<PushButton> m_pRemoveCertPB; - VclPtr<FixedImage> m_pTrustFileROFI; - VclPtr<ListBox> m_pTrustFileLocLB; - VclPtr<PushButton> m_pAddLocPB; - VclPtr<PushButton> m_pRemoveLocPB; - - css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors; + css::uno::Sequence< SvtSecurityOptions::Certificate > m_aTrustedAuthors; bool mbAuthorsReadonly; bool mbURLsReadonly; - DECL_LINK( ViewCertPBHdl, Button*, void ); - DECL_LINK( RemoveCertPBHdl, Button*, void ); - DECL_LINK( AddLocPBHdl, Button*, void ); - DECL_LINK( RemoveLocPBHdl, Button*, void ); - DECL_LINK( TrustCertLBSelectHdl, SvTreeListBox*, void ); - DECL_LINK( TrustFileLocLBSelectHdl, ListBox&, void ); - - void FillCertLB(); - void ImplCheckButtons(); + std::unique_ptr<weld::Image> m_xTrustCertROFI; + std::unique_ptr<weld::TreeView> m_xTrustCertLB; + std::unique_ptr<weld::Button> m_xViewCertPB; + std::unique_ptr<weld::Button> m_xRemoveCertPB; + std::unique_ptr<weld::Image> m_xTrustFileROFI; + std::unique_ptr<weld::TreeView> m_xTrustFileLocLB; + std::unique_ptr<weld::Button> m_xAddLocPB; + std::unique_ptr<weld::Button> m_xRemoveLocPB; + + DECL_LINK(ViewCertPBHdl, weld::Button&, void); + DECL_LINK(RemoveCertPBHdl, weld::Button&, void); + DECL_LINK(AddLocPBHdl, weld::Button&, void); + DECL_LINK(RemoveLocPBHdl, weld::Button&, void); + DECL_LINK(TrustCertLBSelectHdl, weld::TreeView&, void); + DECL_LINK(TrustFileLocLBSelectHdl, weld::TreeView&, void); + + void FillCertLB(); + void ImplCheckButtons(); public: - MacroSecurityTrustedSourcesTP(vcl::Window* pParent, MacroSecurity* _pDlg); - virtual ~MacroSecurityTrustedSourcesTP() override; - virtual void dispose() override; + MacroSecurityTrustedSourcesTP(weld::Container* pParent, MacroSecurity* pDlg); virtual void ActivatePage() override; virtual void ClosePage() override; diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx index 548a231f7e4f..c23d8bb5eae9 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -120,7 +120,6 @@ #include <vcl/ctrl.hxx> #include <vcl/cursor.hxx> #include <vcl/devicecoordinate.hxx> -#include <vcl/dialog.hxx> #include <vcl/dllapi.h> #include <vcl/dndhelp.hxx> #include <vcl/edit.hxx> diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 4076af53bd86..78f1b9e52960 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -591,8 +591,8 @@ void DocumentDigitalSignatures::manageTrustedSources( ) if (aSignatureManager.init()) xSecEnv = aSignatureManager.getSecurityEnvironment(); - ScopedVclPtrInstance< MacroSecurity > aDlg( nullptr, xSecEnv ); - aDlg->Execute(); + MacroSecurity aDlg(Application::GetFrameWeld(mxParentWindow), xSecEnv); + aDlg.run(); } void DocumentDigitalSignatures::showCertificate( diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 69a5dff78321..e77a5815c045 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -48,206 +48,197 @@ using namespace comphelper; using namespace ::com::sun::star; -IMPL_LINK_NOARG(MacroSecurity, OkBtnHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurity, OkBtnHdl, weld::Button&, void) { - mpLevelTP->ClosePage(); - mpTrustSrcTP->ClosePage(); - - EndDialog( RET_OK ); + m_xLevelTP->ClosePage(); + m_xTrustSrcTP->ClosePage(); + m_xDialog->response(RET_OK); } -MacroSecurity::MacroSecurity( vcl::Window* _pParent, - const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment) - : TabDialog(_pParent, "MacroSecurityDialog", "xmlsec/ui/macrosecuritydialog.ui") - , mxSecurityEnvironment(_rxSecurityEnvironment) +MacroSecurity::MacroSecurity(weld::Window* pParent, + const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& rxSecurityEnvironment) + : GenericDialogController(pParent, "xmlsec/ui/macrosecuritydialog.ui", "MacroSecurityDialog") + , m_xSecurityEnvironment(rxSecurityEnvironment) + , m_xTabCtrl(m_xBuilder->weld_notebook("tabcontrol")) + , m_xOkBtn(m_xBuilder->weld_button("ok")) + , m_xResetBtn(m_xBuilder->weld_button("reset")) { - get(m_pTabCtrl, "tabcontrol"); - get(m_pResetBtn, "reset"); - get(m_pOkBtn, "ok"); - - mpLevelTP.reset(VclPtr<MacroSecurityLevelTP>::Create(m_pTabCtrl, this)); - mpTrustSrcTP.reset(VclPtr<MacroSecurityTrustedSourcesTP>::Create(m_pTabCtrl, this)); + m_xTabCtrl->connect_enter_page(LINK(this, MacroSecurity, ActivatePageHdl)); - m_nSecLevelId = m_pTabCtrl->GetPageId("SecurityLevelPage"); - m_nSecTrustId = m_pTabCtrl->GetPageId("SecurityTrustPage"); + m_xLevelTP.reset(new MacroSecurityLevelTP(m_xTabCtrl->get_page("SecurityLevelPage"), this)); + m_xTrustSrcTP.reset(new MacroSecurityTrustedSourcesTP(m_xTabCtrl->get_page("SecurityTrustPage"), this)); - m_pTabCtrl->SetTabPage(m_nSecLevelId, mpLevelTP); - m_pTabCtrl->SetTabPage(m_nSecTrustId, mpTrustSrcTP); - m_pTabCtrl->SetCurPageId(m_nSecLevelId); - - m_pOkBtn->SetClickHdl( LINK( this, MacroSecurity, OkBtnHdl ) ); + m_xTabCtrl->set_current_page("SecurityLevelPage"); + m_xOkBtn->connect_clicked(LINK(this, MacroSecurity, OkBtnHdl)); } -MacroSecurity::~MacroSecurity() +IMPL_LINK(MacroSecurity, ActivatePageHdl, const OString&, rPage, void) { - disposeOnce(); + if (rPage == "SecurityLevelPage") + m_xLevelTP->ActivatePage(); + else if (rPage == "SecurityTrustPage") + m_xTrustSrcTP->ActivatePage(); } -void MacroSecurity::dispose() +MacroSecurityTP::MacroSecurityTP(weld::Container* pParent, const OUString& rUIXMLDescription, + const OString& rID, MacroSecurity* pDlg) + : m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription)) + , m_xContainer(m_xBuilder->weld_container(rID)) + , m_pDlg(pDlg) { - m_pTabCtrl->GetTabPage(m_nSecTrustId)->disposeOnce(); - m_pTabCtrl->GetTabPage(m_nSecLevelId)->disposeOnce(); - m_pTabCtrl.clear(); - m_pOkBtn.clear(); - m_pResetBtn.clear(); - mpLevelTP.disposeAndClear(); - mpTrustSrcTP.disposeAndClear(); - TabDialog::dispose(); } -MacroSecurityTP::MacroSecurityTP(vcl::Window* _pParent, const OString& rID, - const OUString& rUIXMLDescription, MacroSecurity* _pDlg) - : TabPage(_pParent, rID, rUIXMLDescription) - , mpDlg(_pDlg) +void MacroSecurityTP::ActivatePage() { } MacroSecurityTP::~MacroSecurityTP() { - disposeOnce(); -} - -void MacroSecurityTP::dispose() -{ - mpDlg.clear(); - TabPage::dispose(); } -MacroSecurityLevelTP::MacroSecurityLevelTP(vcl::Window* _pParent, MacroSecurity* _pDlg) - : MacroSecurityTP(_pParent, "SecurityLevelPage", "xmlsec/ui/securitylevelpage.ui", _pDlg) +MacroSecurityLevelTP::MacroSecurityLevelTP(weld::Container* pParent, MacroSecurity* pDlg) + : MacroSecurityTP(pParent, "xmlsec/ui/securitylevelpage.ui", "SecurityLevelPage", pDlg) + , m_xVeryHighRB(m_xBuilder->weld_radio_button("vhigh")) + , m_xHighRB(m_xBuilder->weld_radio_button("high")) + , m_xMediumRB(m_xBuilder->weld_radio_button("med")) + , m_xLowRB(m_xBuilder->weld_radio_button("low")) + , m_xVHighImg(m_xBuilder->weld_widget("vhighimg")) + , m_xHighImg(m_xBuilder->weld_widget("highimg")) + , m_xMedImg(m_xBuilder->weld_widget("medimg")) + , m_xLowImg(m_xBuilder->weld_widget("lowimg")) { - get(m_pVeryHighRB, "vhigh"); - get(m_pHighRB, "high"); - get(m_pMediumRB, "med"); - get(m_pLowRB, "low"); - - m_pLowRB->SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); - m_pMediumRB->SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); - m_pHighRB->SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); - m_pVeryHighRB->SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + m_xLowRB->connect_toggled( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + m_xMediumRB->connect_toggled( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + m_xHighRB->connect_toggled( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + m_xVeryHighRB->connect_toggled( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + + int nPrefWidth(std::max({m_xVeryHighRB->get_preferred_size().Width(), + m_xHighRB->get_preferred_size().Width(), + m_xMediumRB->get_preferred_size().Width(), + m_xLowRB->get_preferred_size().Width()})); + int nMaxWidth = m_xLowRB->get_approximate_digit_width() * 60; + if (nPrefWidth > nMaxWidth) + { + m_xLowRB->set_label_line_wrap(true); + m_xLowRB->set_size_request(nMaxWidth, -1); + m_xMediumRB->set_label_line_wrap(true); + m_xMediumRB->set_size_request(nMaxWidth, -1); + m_xHighRB->set_label_line_wrap(true); + m_xHighRB->set_size_request(nMaxWidth, -1); + m_xVeryHighRB->set_label_line_wrap(true); + m_xVeryHighRB->set_size_request(nMaxWidth, -1); + } - mnCurLevel = static_cast<sal_uInt16>(mpDlg->maSecOptions.GetMacroSecurityLevel()); - bool bReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroSecLevel ); + mnCurLevel = static_cast<sal_uInt16>(m_pDlg->m_aSecOptions.GetMacroSecurityLevel()); + bool bReadonly = m_pDlg->m_aSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroSecLevel ); - RadioButton* pCheck = nullptr; - FixedImage* pImage = nullptr; + weld::RadioButton* pCheck = nullptr; + weld::Widget* pImage = nullptr; switch (mnCurLevel) { case 3: - pCheck = m_pVeryHighRB; - pImage = get<FixedImage>("vhighimg"); + pCheck = m_xVeryHighRB.get(); + pImage = m_xVHighImg.get(); break; case 2: - pCheck = m_pHighRB; - pImage = get<FixedImage>("highimg"); + pCheck = m_xHighRB.get(); + pImage = m_xHighImg.get(); break; case 1: - pCheck = m_pMediumRB; - pImage = get<FixedImage>("medimg"); + pCheck = m_xMediumRB.get(); + pImage = m_xMedImg.get(); break; case 0: - pCheck = m_pLowRB; - pImage = get<FixedImage>("lowimg"); + pCheck = m_xLowRB.get(); + pImage = m_xLowImg.get(); break; } if (pCheck) - pCheck->Check(); + pCheck->set_active(true); else { OSL_FAIL("illegal macro security level"); } if (bReadonly && pImage) { - pImage->Show(); - m_pVeryHighRB->Enable(false); - m_pHighRB->Enable(false); - m_pMediumRB->Enable(false); - m_pLowRB->Enable(false); + pImage->show(); + m_xVeryHighRB->set_sensitive(false); + m_xHighRB->set_sensitive(false); + m_xMediumRB->set_sensitive(false); + m_xLowRB->set_sensitive(false); } } -MacroSecurityLevelTP::~MacroSecurityLevelTP() -{ - disposeOnce(); -} - -void MacroSecurityLevelTP::dispose() -{ - m_pVeryHighRB.clear(); - m_pHighRB.clear(); - m_pMediumRB.clear(); - m_pLowRB.clear(); - MacroSecurityTP::dispose(); -} - -IMPL_LINK_NOARG(MacroSecurityLevelTP, RadioButtonHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurityLevelTP, RadioButtonHdl, weld::ToggleButton&, void) { sal_uInt16 nNewLevel = 0; - if( m_pVeryHighRB->IsChecked() ) + if( m_xVeryHighRB->get_active() ) nNewLevel = 3; - else if( m_pHighRB->IsChecked() ) + else if( m_xHighRB->get_active() ) nNewLevel = 2; - else if( m_pMediumRB->IsChecked() ) + else if( m_xMediumRB->get_active() ) nNewLevel = 1; if ( nNewLevel != mnCurLevel ) { mnCurLevel = nNewLevel; - mpDlg->EnableReset(); + m_pDlg->EnableReset(); } } void MacroSecurityLevelTP::ClosePage() { - mpDlg->maSecOptions.SetMacroSecurityLevel( mnCurLevel ); + m_pDlg->m_aSecOptions.SetMacroSecurityLevel( mnCurLevel ); } void MacroSecurityTrustedSourcesTP::ImplCheckButtons() { - bool bCertSelected = m_pTrustCertLB->FirstSelected() != nullptr; - m_pViewCertPB->Enable( bCertSelected ); - m_pRemoveCertPB->Enable( bCertSelected && !mbAuthorsReadonly); + bool bCertSelected = m_xTrustCertLB->get_selected_index() != -1; + m_xViewCertPB->set_sensitive( bCertSelected ); + m_xRemoveCertPB->set_sensitive( bCertSelected && !mbAuthorsReadonly); - bool bLocationSelected = m_pTrustFileLocLB->GetSelectedEntryPos() != LISTBOX_ENTRY_NOTFOUND; - m_pRemoveLocPB->Enable( bLocationSelected && !mbURLsReadonly); + bool bLocationSelected = m_xTrustFileLocLB->get_selected_index() != -1; + m_xRemoveLocPB->set_sensitive( bLocationSelected && !mbURLsReadonly); } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl, weld::Button&, void) { - if( m_pTrustCertLB->FirstSelected() ) + int nEntry = m_xTrustCertLB->get_selected_index(); + if (nEntry != -1) { - sal_uInt16 nSelected = sal_uInt16( sal_uIntPtr( m_pTrustCertLB->FirstSelected()->GetUserData() ) ); + sal_uInt16 nSelected = m_xTrustCertLB->get_id(nEntry).toUInt32(); - uno::Reference< css::security::XCertificate > xCert = mpDlg->mxSecurityEnvironment->getCertificate( maTrustedAuthors[nSelected][0], xmlsecurity::numericStringToBigInteger( maTrustedAuthors[nSelected][1] ) ); + uno::Reference< css::security::XCertificate > xCert = m_pDlg->m_xSecurityEnvironment->getCertificate( m_aTrustedAuthors[nSelected][0], xmlsecurity::numericStringToBigInteger( m_aTrustedAuthors[nSelected][1] ) ); // If we don't get it, create it from signature data: if ( !xCert.is() ) - xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( maTrustedAuthors[nSelected][2] ) ; + xCert = m_pDlg->m_xSecurityEnvironment->createCertificateFromAscii( m_aTrustedAuthors[nSelected][2] ) ; SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "*MacroSecurityTrustedSourcesTP::ViewCertPBHdl(): Certificate not found and can't be created!" ); if ( xCert.is() ) { - CertificateViewer aViewer(GetFrameWeld(), mpDlg->mxSecurityEnvironment, xCert, false, nullptr); + CertificateViewer aViewer(m_pDlg->getDialog(), m_pDlg->m_xSecurityEnvironment, xCert, false, nullptr); aViewer.run(); } } } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, RemoveCertPBHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, RemoveCertPBHdl, weld::Button&, void) { - if( m_pTrustCertLB->FirstSelected() ) + int nEntry = m_xTrustCertLB->get_selected_index(); + if (nEntry != -1) { - sal_uInt16 nAuthor = sal_uInt16( sal_uIntPtr( m_pTrustCertLB->FirstSelected()->GetUserData() ) ); - ::comphelper::removeElementAt( maTrustedAuthors, nAuthor ); + sal_uInt16 nAuthor = m_xTrustCertLB->get_id(nEntry).toUInt32(); + ::comphelper::removeElementAt( m_aTrustedAuthors, nAuthor ); FillCertLB(); ImplCheckButtons(); } } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl, weld::Button&, void) { try { @@ -272,10 +263,8 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl, Button*, void) if ( osl::FileBase::getSystemPathFromFileURL( aSystemFileURL, aSystemFileURL ) == osl::FileBase::E_None ) aNewPathStr = aSystemFileURL; - if( m_pTrustFileLocLB->GetEntryPos( aNewPathStr ) == LISTBOX_ENTRY_NOTFOUND ) - { - m_pTrustFileLocLB->InsertEntry( aNewPathStr ); - } + if (m_xTrustFileLocLB->find_text(aNewPathStr) == -1) + m_xTrustFileLocLB->append_text(aNewPathStr); ImplCheckButtons(); } @@ -285,176 +274,137 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl, Button*, void) } } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, Button*, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, weld::Button&, void) { - sal_Int32 nSel = m_pTrustFileLocLB->GetSelectedEntryPos(); - if( nSel != LISTBOX_ENTRY_NOTFOUND ) + sal_Int32 nSel = m_xTrustFileLocLB->get_selected_index(); + if (nSel != -1) { - m_pTrustFileLocLB->RemoveEntry( nSel ); + m_xTrustFileLocLB->remove(nSel); // Trusted Path could not be removed (#i33584#) // after remove an entry, select another one if exists - sal_Int32 nNewCount = m_pTrustFileLocLB->GetEntryCount(); - if ( nNewCount > 0 ) + int nNewCount = m_xTrustFileLocLB->n_children(); + if (nNewCount > 0) { - if ( nSel >= nNewCount ) + if (nSel >= nNewCount) nSel = nNewCount - 1; - m_pTrustFileLocLB->SelectEntryPos( nSel ); + m_xTrustFileLocLB->select(nSel); } ImplCheckButtons(); } } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl, SvTreeListBox*, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl, weld::TreeView&, void) { ImplCheckButtons(); } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl, ListBox&, void) +IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl, weld::TreeView&, void) { ImplCheckButtons(); } void MacroSecurityTrustedSourcesTP::FillCertLB() { - m_pTrustCertLB->Clear(); + m_xTrustCertLB->clear(); - sal_uInt32 nEntries = maTrustedAuthors.getLength(); + sal_uInt32 nEntries = m_aTrustedAuthors.getLength(); - if ( nEntries && mpDlg->mxSecurityEnvironment.is() ) + if ( nEntries && m_pDlg->m_xSecurityEnvironment.is() ) { for( sal_uInt32 nEntry = 0 ; nEntry < nEntries ; ++nEntry ) { - css::uno::Sequence< OUString >& rEntry = maTrustedAuthors[ nEntry ]; + css::uno::Sequence< OUString >& rEntry = m_aTrustedAuthors[ nEntry ]; uno::Reference< css::security::XCertificate > xCert; // create from RawData - xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( rEntry[ 2 ] ); + xCert = m_pDlg->m_xSecurityEnvironment->createCertificateFromAscii( rEntry[ 2 ] ); - SvTreeListEntry* pLBEntry = m_pTrustCertLB->InsertEntry( xmlsec::GetContentPart( xCert->getSubjectName() ) ); - m_pTrustCertLB->SetEntryText( xmlsec::GetContentPart( xCert->getIssuerName() ), pLBEntry, 1 ); - m_pTrustCertLB->SetEntryText( utl::GetDateTimeString( xCert->getNotValidAfter() ), pLBEntry, 2 ); - pLBEntry->SetUserData( reinterpret_cast<void*>(nEntry) ); // misuse user data as index + m_xTrustCertLB->append(OUString::number(nEntry), xmlsec::GetContentPart(xCert->getSubjectName())); + m_xTrustCertLB->set_text(nEntry, xmlsec::GetContentPart(xCert->getIssuerName()), 1); + m_xTrustCertLB->set_text(nEntry, utl::GetDateTimeString(xCert->getNotValidAfter()), 2); } } } -class TrustCertLB : public SvSimpleTable +MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(weld::Container* pParent, MacroSecurity* pDlg) + : MacroSecurityTP(pParent, "xmlsec/ui/securitytrustpage.ui", "SecurityTrustPage", pDlg) + , m_xTrustCertROFI(m_xBuilder->weld_image("lockcertimg")) + , m_xTrustCertLB(m_xBuilder->weld_tree_view("certificates")) + , m_xViewCertPB(m_xBuilder->weld_button("viewcert")) + , m_xRemoveCertPB(m_xBuilder->weld_button("removecert")) + , m_xTrustFileROFI(m_xBuilder->weld_image("lockfileimg")) + , m_xTrustFileLocLB(m_xBuilder->weld_tree_view("locations")) + , m_xAddLocPB(m_xBuilder->weld_button("addfile")) + , m_xRemoveLocPB(m_xBuilder->weld_button("removefile")) { -public: - explicit TrustCertLB(SvSimpleTableContainer &rContainer) - : SvSimpleTable(rContainer, 0) - { - } - virtual void Resize() override - { - SvSimpleTable::Resize(); - if (isInitialLayout(this)) - { - const long nControlWidth = GetSizePixel().Width(); - long aTabLocs[] = { 0, 35*nControlWidth/100, 70*nControlWidth/100 }; - SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabLocs), aTabLocs, MapUnit::MapPixel); - } - } -}; - -MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(vcl::Window* _pParent, MacroSecurity* _pDlg) - : MacroSecurityTP(_pParent, "SecurityTrustPage", "xmlsec/ui/securitytrustpage.ui", _pDlg) -{ - get(m_pTrustCertROFI, "lockcertimg"); - get(m_pViewCertPB, "viewcert"); - get(m_pRemoveCertPB, "removecert"); - get(m_pTrustFileROFI, "lockfileimg"); - get(m_pTrustFileLocLB, "locations"); - m_pTrustFileLocLB->SetDropDownLineCount(6); - get(m_pAddLocPB, "addfile"); - get(m_pRemoveLocPB, "removefile"); - - SvSimpleTableContainer *pCertificates = get<SvSimpleTableContainer>("certificates"); - m_pTrustCertLB.reset(VclPtr<TrustCertLB>::Create(*pCertificates)); - static long aTabs[] = { 0, 0, 0 }; - m_pTrustCertLB->SetTabs( SAL_N_ELEMENTS(aTabs), aTabs ); - - m_pTrustCertLB->InsertHeaderEntry(get<FixedText>("to")->GetText() + "\t" - + get<FixedText>("by")->GetText() + "\t" + get<FixedText>("date")->GetText()); - - m_pTrustCertLB->SetSelectHdl( LINK( this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl ) ); - m_pViewCertPB->SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, ViewCertPBHdl ) ); - m_pViewCertPB->Disable(); - m_pRemoveCertPB->SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, RemoveCertPBHdl ) ); - m_pRemoveCertPB->Disable(); - - m_pTrustFileLocLB->SetSelectHdl( LINK( this, MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl ) ); - m_pAddLocPB->SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, AddLocPBHdl ) ); - m_pRemoveLocPB->SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, RemoveLocPBHdl ) ); - m_pRemoveLocPB->Disable(); - - maTrustedAuthors = mpDlg->maSecOptions.GetTrustedAuthors(); - mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroTrustedAuthors ); - m_pTrustCertROFI->Show( mbAuthorsReadonly ); - mbAuthorsReadonly ? m_pTrustCertLB->DisableTable() : m_pTrustCertLB->EnableTable(); + auto nColWidth = m_xTrustCertLB->get_approximate_digit_width() * 12; + std::vector<int> aWidths; + aWidths.push_back(nColWidth * 2); + aWidths.push_back(nColWidth * 2); + m_xTrustCertLB->set_column_fixed_widths(aWidths); + m_xTrustCertLB->set_size_request(nColWidth * 5.5, m_xTrustCertLB->get_height_rows(5)); + + m_xTrustCertLB->connect_changed( LINK( this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl ) ); + m_xViewCertPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, ViewCertPBHdl ) ); + m_xViewCertPB->set_sensitive(false); + m_xRemoveCertPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, RemoveCertPBHdl ) ); + m_xRemoveCertPB->set_sensitive(false); + + m_xTrustFileLocLB->connect_changed( LINK( this, MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl ) ); + m_xTrustFileLocLB->set_size_request(nColWidth * 5, m_xTrustFileLocLB->get_height_rows(5)); + m_xAddLocPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, AddLocPBHdl ) ); + m_xRemoveLocPB->connect_clicked( LINK( this, MacroSecurityTrustedSourcesTP, RemoveLocPBHdl ) ); + m_xRemoveLocPB->set_sensitive(false); + + m_aTrustedAuthors = m_pDlg->m_aSecOptions.GetTrustedAuthors(); + mbAuthorsReadonly = m_pDlg->m_aSecOptions.IsReadOnly( SvtSecurityOptions::EOption::MacroTrustedAuthors ); + m_xTrustCertROFI->show(mbAuthorsReadonly); + m_xTrustCertLB->set_sensitive(!mbAuthorsReadonly); FillCertLB(); - css::uno::Sequence< OUString > aSecureURLs = mpDlg->maSecOptions.GetSecureURLs(); - mbURLsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::EOption::SecureUrls ); - m_pTrustFileROFI->Show( mbURLsReadonly ); - m_pTrustFileLocLB->Enable( !mbURLsReadonly ); - m_pAddLocPB->Enable( !mbURLsReadonly ); + css::uno::Sequence< OUString > aSecureURLs = m_pDlg->m_aSecOptions.GetSecureURLs(); + mbURLsReadonly = m_pDlg->m_aSecOptions.IsReadOnly( SvtSecurityOptions::EOption::SecureUrls ); + m_xTrustFileROFI->show(mbURLsReadonly); + m_xTrustFileLocLB->set_sensitive(!mbURLsReadonly); + m_xAddLocPB->set_sensitive(!mbURLsReadonly); sal_Int32 nEntryCnt = aSecureURLs.getLength(); - for( sal_Int32 i = 0 ; i < nEntryCnt ; ++i ) + for (sal_Int32 i = 0; i < nEntryCnt; ++i) { OUString aSystemFileURL( aSecureURLs[ i ] ); osl::FileBase::getSystemPathFromFileURL( aSystemFileURL, aSystemFileURL ); - m_pTrustFileLocLB->InsertEntry( aSystemFileURL ); + m_xTrustFileLocLB->append_text(aSystemFileURL); } } -MacroSecurityTrustedSourcesTP::~MacroSecurityTrustedSourcesTP() -{ - disposeOnce(); -} - -void MacroSecurityTrustedSourcesTP::dispose() -{ - m_pTrustCertLB.disposeAndClear(); - m_pTrustCertROFI.clear(); - m_pViewCertPB.clear(); - m_pRemoveCertPB.clear(); - m_pTrustFileROFI.clear(); - m_pTrustFileLocLB.clear(); - m_pAddLocPB.clear(); - m_pRemoveLocPB.clear(); - MacroSecurityTP::dispose(); -} - void MacroSecurityTrustedSourcesTP::ActivatePage() { - mpDlg->EnableReset( false ); + m_pDlg->EnableReset( false ); FillCertLB(); } void MacroSecurityTrustedSourcesTP::ClosePage() { - sal_Int32 nEntryCnt = m_pTrustFileLocLB->GetEntryCount(); + sal_Int32 nEntryCnt = m_xTrustFileLocLB->n_children(); if( nEntryCnt ) { css::uno::Sequence< OUString > aSecureURLs( nEntryCnt ); - for( sal_Int32 i = 0 ; i < nEntryCnt ; ++i ) + for (sal_Int32 i = 0; i < nEntryCnt; ++i) { - OUString aURL( m_pTrustFileLocLB->GetEntry( i ) ); + OUString aURL(m_xTrustFileLocLB->get_text(i)); osl::FileBase::getFileURLFromSystemPath( aURL, aURL ); aSecureURLs[ i ] = aURL; } - mpDlg->maSecOptions.SetSecureURLs( aSecureURLs ); + m_pDlg->m_aSecOptions.SetSecureURLs( aSecureURLs ); } // Trusted Path could not be removed (#i33584#) // don't forget to remove the old saved SecureURLs else - mpDlg->maSecOptions.SetSecureURLs( css::uno::Sequence< OUString >() ); + m_pDlg->m_aSecOptions.SetSecureURLs( css::uno::Sequence< OUString >() ); - mpDlg->maSecOptions.SetTrustedAuthors( maTrustedAuthors ); + m_pDlg->m_aSecOptions.SetTrustedAuthors( m_aTrustedAuthors ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/uiconfig/ui/macrosecuritydialog.ui b/xmlsecurity/uiconfig/ui/macrosecuritydialog.ui index b07c5e4d2c73..ffbb57cf5601 100644 --- a/xmlsecurity/uiconfig/ui/macrosecuritydialog.ui +++ b/xmlsecurity/uiconfig/ui/macrosecuritydialog.ui @@ -1,13 +1,18 @@ <?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="MacroSecurityDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="macrosecuritydialog|MacroSecurityDialog">Macro Security</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> @@ -18,12 +23,10 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -34,10 +37,12 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -48,8 +53,8 @@ </packing> </child> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -59,12 +64,11 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">2</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -74,6 +78,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">3</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -99,6 +104,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"> @@ -118,6 +147,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> @@ -144,10 +197,10 @@ </object> </child> <action-widgets> + <action-widget response="101">reset</action-widget> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> </action-widgets> </object> </interface> diff --git a/xmlsecurity/uiconfig/ui/securitylevelpage.ui b/xmlsecurity/uiconfig/ui/securitylevelpage.ui index 349e9a7b1ef2..53cecc7d2e3e 100644 --- a/xmlsecurity/uiconfig/ui/securitylevelpage.ui +++ b/xmlsecurity/uiconfig/ui/securitylevelpage.ui @@ -1,26 +1,30 @@ <?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="GtkGrid" id="SecurityLevelPage"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="border_width">6</property> + <property name="orientation">vertical</property> <property name="row_spacing">6</property> <property name="column_spacing">12</property> <property name="row_homogeneous">True</property> <child> - <object class="GtkRadioButton" id="low:wrap"> + <object class="GtkRadioButton" id="low"> <property name="label" translatable="yes" context="securitylevelpage|low">_Low (not recommended). All macros will be executed without confirmation. Use this setting only if you are certain that all documents that will be opened are safe.</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="hexpand">True</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">vhigh:wrap</property> + <property name="group">high</property> </object> <packing> <property name="left_attach">1</property> @@ -28,16 +32,17 @@ Use this setting only if you are certain that all documents that will be opened </packing> </child> <child> - <object class="GtkRadioButton" id="med:wrap"> + <object class="GtkRadioButton" id="med"> <property name="label" translatable="yes" context="securitylevelpage|med">_Medium. Confirmation required before executing macros from untrusted sources.</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="hexpand">True</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">low:wrap</property> + <property name="group">high</property> </object> <packing> <property name="left_attach">1</property> @@ -45,18 +50,18 @@ Confirmation required before executing macros from untrusted sources.</property> </packing> </child> <child> - <object class="GtkRadioButton" id="high:wrap"> + <object class="GtkRadioButton" id="high"> <property name="label" translatable="yes" context="securitylevelpage|high">H_igh. Only signed macros from trusted sources are allowed to run. Unsigned macros are disabled.</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="hexpand">True</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">med:wrap</property> </object> <packing> <property name="left_attach">1</property> @@ -64,17 +69,18 @@ Unsigned macros are disabled.</property> </packing> </child> <child> - <object class="GtkRadioButton" id="vhigh:wrap"> + <object class="GtkRadioButton" id="vhigh"> <property name="label" translatable="yes" context="securitylevelpage|vhigh">_Very high. Only macros from trusted file locations are allowed to run. All other macros, regardless whether signed or not, are disabled.</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="hexpand">True</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="group">high:wrap</property> + <property name="group">high</property> </object> <packing> <property name="left_attach">1</property> @@ -87,7 +93,7 @@ All other macros, regardless whether signed or not, are disabled.</property> <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> @@ -100,7 +106,7 @@ All other macros, regardless whether signed or not, are disabled.</property> <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> @@ -113,7 +119,7 @@ All other macros, regardless whether signed or not, are disabled.</property> <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> @@ -126,7 +132,7 @@ All other macros, regardless whether signed or not, are disabled.</property> <property name="no_show_all">True</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> diff --git a/xmlsecurity/uiconfig/ui/securitytrustpage.ui b/xmlsecurity/uiconfig/ui/securitytrustpage.ui index c6c13f87f87e..88edf37e485c 100644 --- a/xmlsecurity/uiconfig/ui/securitytrustpage.ui +++ b/xmlsecurity/uiconfig/ui/securitytrustpage.ui @@ -2,10 +2,31 @@ <!-- 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="liststore2"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> + <object class="GtkTreeStore" id="liststore3"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name text2 --> + <column type="gchararray"/> + <!-- column-name text3 --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkBox" id="SecurityTrustPage"> <property name="visible">True</property> <property name="can_focus">False</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> @@ -38,6 +59,7 @@ <object class="GtkButtonBox" id="buttonbox1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="spacing">12</property> <property name="layout_style">end</property> <child> @@ -71,98 +93,91 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> + <property name="top_attach">1</property> </packing> </child> <child> - <object class="GtkGrid" id="grid2"> - <property name="can_focus">False</property> - <property name="no_show_all">True</property> - <child> - <object class="GtkLabel" id="to"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="securitytrustpage|to">Issued to</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="GtkLabel" id="by"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="securitytrustpage|by">Issued by</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> + <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="shadow_type">in</property> <child> - <object class="GtkLabel" id="date"> + <object class="GtkTreeView" id="certificates"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="securitytrustpage|date">Expiration date</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> + <property name="headers_visible">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> + <property name="title" translatable="yes" context="securitytrustpage|to">Issued to</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="securitytrustpage|by">Issued by</property> + <child> + <object class="GtkCellRendererText" id="cellrenderer2"/> + <attributes> + <attribute name="text">1</attribute> + </attributes> + </child> + </object> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn5"> + <property name="resizable">True</property> + <property name="spacing">6</property> + <property name="title" translatable="yes" context="securitytrustpage|date">Expiration date</property> + <child> + <object class="GtkCellRendererText" id="cellrenderer3"/> + <attributes> + <attribute name="text">2</attribute> + </attributes> + </child> + </object> + </child> </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> </child> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="svtlo-SvSimpleTableContainer" id="certificates"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> <object class="GtkImage" id="lockcertimg"> <property name="can_focus">False</property> <property name="no_show_all">True</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> + <property name="top_attach">0</property> </packing> </child> + <child> + <placeholder/> + </child> </object> </child> </object> @@ -213,16 +228,15 @@ <object class="GtkLabel" id="label8"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="securitytrustpage|label8">Document macros are always executed if they have been opened from one of the following locations.</property> <property name="wrap">True</property> + <property name="width_chars">56</property> <property name="max_width_chars">56</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -263,26 +277,40 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> - <object class="GtkScrolledWindow" id="scrolledwindow2"> + <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="shadow_type">in</property> <child> - <object class="GtkTreeView" id="locations:border"> + <object class="GtkTreeView" id="locations"> <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">liststore2</property> + <property name="headers_visible">False</property> + <property name="search_column">0</property> <property name="show_expanders">False</property> <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> + <object class="GtkTreeSelection" id="Macro Library List-selection1"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn9"> + <property name="resizable">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkCellRendererText" id="cellrenderer0"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> </child> </object> </child> @@ -290,21 +318,17 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkImage" id="lockfileimg"> <property name="can_focus">False</property> <property name="no_show_all">True</property> - <property name="pixbuf">res/lock.png</property> + <property name="icon_name">res/lock.png</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> @@ -345,7 +369,7 @@ <property name="mode">vertical</property> <widgets> <widget name="certificates"/> - <widget name="locations:border"/> + <widget name="locations"/> </widgets> </object> </interface> |