From b8b9d51b8cf1cafe1a94e1baf957f3f282abb32f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 16 Feb 2015 18:07:47 +0200 Subject: tdf#88428: Add GUI to select one of user-configured Time Stamp Authorities Work in progress. The selection not used for anything yet. Change-Id: Ia86fa0f59dcfee8e9d332a028a3fad37f4019fe0 --- filter/Library_pdffilter.mk | 4 ++++ filter/source/pdf/impdialog.cxx | 28 ++++++++++++++++++++++++++++ filter/source/pdf/impdialog.hxx | 2 ++ filter/uiconfig/ui/pdfsignpage.ui | 28 ++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) (limited to 'filter') diff --git a/filter/Library_pdffilter.mk b/filter/Library_pdffilter.mk index b3a62d76f352..6de7d341367e 100644 --- a/filter/Library_pdffilter.mk +++ b/filter/Library_pdffilter.mk @@ -30,6 +30,10 @@ $(eval $(call gb_Library_set_include,pdffilter,\ $$(INCLUDE) \ )) +$(eval $(call gb_Library_use_custom_headers,pdffilter,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_use_libraries,pdffilter,\ svt \ sfx \ diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 6767c5434253..da7929902de8 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -21,6 +21,7 @@ #include "impdialog.hxx" #include "impdialog.hrc" +#include #include #include #include @@ -1537,10 +1538,12 @@ ImpPDFTabSigningPage::ImpPDFTabSigningPage(vcl::Window* pParent, const SfxItemSe get(mpEdSignLocation, "location"); get(mpEdSignContactInfo, "contact"); get(mpEdSignReason, "reason"); + get(mpLBSignTSA, "tsa"); mpPbSignCertSelect->Enable( true ); mpPbSignCertSelect->SetClickHdl( LINK( this, ImpPDFTabSigningPage, ClickmaPbSignCertSelect ) ); mpPbSignCertClear->SetClickHdl( LINK( this, ImpPDFTabSigningPage, ClickmaPbSignCertClear ) ); + mpLBSignTSA->SetSelectHdl( LINK( this, ImpPDFTabSigningPage, SelectLBSignTSA ) ); } @@ -1565,6 +1568,24 @@ IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect ) mpEdSignPassword->Enable( true ); mpEdSignContactInfo->Enable( true ); mpEdSignReason->Enable( true ); + + try + { + css::uno::Sequence aTSAURLs(officecfg::Office::Common::Security::Scripting::TSAURLs::get()); + + for (auto i = aTSAURLs.begin(); i != aTSAURLs.end(); ++i) + { + mpLBSignTSA->InsertEntry( *i ); + } + } + catch (const uno::Exception &e) + { + SAL_INFO("filter.pdf", "TSAURLsDialog::TSAURLsDialog(): caught exception" << e.Message); + } + + // If more than only the "None" entry is there, enable the ListBox + if (mpLBSignTSA->GetEntryCount() > 1) + mpLBSignTSA->Enable(); } return 0; @@ -1579,11 +1600,17 @@ IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertClear ) mpEdSignPassword->Enable( false ); mpEdSignContactInfo->Enable( false ); mpEdSignReason->Enable( false ); + mpLBSignTSA->Enable( false ); return 0; } +IMPL_LINK_NOARG( ImpPDFTabSigningPage, SelectLBSignTSA ) +{ + return 0; +} + SfxTabPage* ImpPDFTabSigningPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) { @@ -1610,6 +1637,7 @@ void ImpPDFTabSigningPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent mpEdSignPassword->Enable( false ); mpEdSignContactInfo->Enable( false ); mpEdSignReason->Enable( false ); + mpLBSignTSA->Enable( false ); mpPbSignCertClear->Enable( false ); if (paParent->mbSignPDF) diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 42f5c2ac3ec1..8ef6b18d57da 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -419,10 +419,12 @@ class ImpPDFTabSigningPage : public SfxTabPage Edit* mpEdSignLocation; Edit* mpEdSignContactInfo; Edit* mpEdSignReason; + ListBox* mpLBSignTSA; com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate; DECL_LINK( ClickmaPbSignCertSelect, void* ); DECL_LINK( ClickmaPbSignCertClear, void* ); + DECL_LINK( SelectLBSignTSA, void* ); public: ImpPDFTabSigningPage( vcl::Window* pParent, diff --git a/filter/uiconfig/ui/pdfsignpage.ui b/filter/uiconfig/ui/pdfsignpage.ui index 4090c8503157..fe10e299496a 100644 --- a/filter/uiconfig/ui/pdfsignpage.ui +++ b/filter/uiconfig/ui/pdfsignpage.ui @@ -150,6 +150,20 @@ 3 + + + True + True + False + + None + + + + 1 + 4 + + True @@ -206,6 +220,20 @@ 3 + + + True + False + 1 + Time Stamp Authority: + True + reason + + + 0 + 4 + + 0 -- cgit