From e2b0e7571a8b082a2cb532e34b9770060128452b Mon Sep 17 00:00:00 2001 From: Rachit Gupta Date: Sat, 2 Aug 2014 19:04:56 +0530 Subject: Converted RID_XMLSECTP_DETAILS to Widget Layout. Change-Id: Ie284f5902879093f882a1f69b481df4a1a319a35 Reviewed-on: https://gerrit.libreoffice.org/10693 Reviewed-by: David Tardon Tested-by: David Tardon --- xmlsecurity/UIConfig_xmlsec.mk | 1 + xmlsecurity/inc/xmlsecurity/certificateviewer.hxx | 10 +- xmlsecurity/source/dialogs/certificateviewer.cxx | 48 +++---- xmlsecurity/source/dialogs/certificateviewer.src | 145 +++++++++------------- xmlsecurity/source/dialogs/dialogs.hrc | 33 ++--- xmlsecurity/uiconfig/ui/certdetails.ui | 38 ++++++ 6 files changed, 143 insertions(+), 132 deletions(-) create mode 100644 xmlsecurity/uiconfig/ui/certdetails.ui (limited to 'xmlsecurity') diff --git a/xmlsecurity/UIConfig_xmlsec.mk b/xmlsecurity/UIConfig_xmlsec.mk index 1a7ef1eb4491..1832191a62b7 100644 --- a/xmlsecurity/UIConfig_xmlsec.mk +++ b/xmlsecurity/UIConfig_xmlsec.mk @@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,xmlsec)) $(eval $(call gb_UIConfig_add_uifiles,xmlsec,\ xmlsecurity/uiconfig/ui/certpage \ + xmlsecurity/uiconfig/ui/certdetails \ xmlsecurity/uiconfig/ui/digitalsignaturesdialog \ xmlsecurity/uiconfig/ui/securitylevelpage \ xmlsecurity/uiconfig/ui/securitytrustpage \ diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx index 9d2f35445725..99649007f078 100644 --- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx @@ -101,11 +101,11 @@ public: class CertificateViewerDetailsTP : public CertificateViewerTP { private: - SvSimpleTableContainer m_aElementsLBContainer; - SvSimpleTable maElementsLB; - MultiLineEdit maElementML; - Font maStdFont; - Font maFixedWidthFont; + SvSimpleTableContainer* m_pElementsLBContainer; + SvSimpleTable* m_pElementsLB; + MultiLineEdit* m_pValueDetails; + Font m_aStdFont; + Font m_aFixedWidthFont; DECL_LINK( ElementSelectHdl, void* ); void Clear( void ); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 99177dc1c2c5..9ff204a9610a 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -224,44 +224,45 @@ inline Details_UserDatat::Details_UserDatat( const OUString& _rTxt, bool _bFixed void CertificateViewerDetailsTP::Clear( void ) { - maElementML.SetText( OUString() ); + m_pValueDetails->SetText( OUString() ); sal_uLong i = 0; - SvTreeListEntry* pEntry = maElementsLB.GetEntry( i ); + SvTreeListEntry* pEntry = m_pElementsLB->GetEntry( i ); while( pEntry ) { delete ( Details_UserDatat* ) pEntry->GetUserData(); ++i; - pEntry = maElementsLB.GetEntry( i ); + pEntry = m_pElementsLB->GetEntry( i ); } - maElementsLB.Clear(); + m_pElementsLB->Clear(); } void CertificateViewerDetailsTP::InsertElement( const OUString& _rField, const OUString& _rValue, const OUString& _rDetails, bool _bFixedWidthFont ) { - SvTreeListEntry* pEntry = maElementsLB.InsertEntry( _rField ); - maElementsLB.SetEntryText( _rValue, pEntry, 1 ); + SvTreeListEntry* pEntry = m_pElementsLB->InsertEntry( _rField ); + m_pElementsLB->SetEntryText( _rValue, pEntry, 1 ); pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) ); } CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg ) - :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg ) - ,m_aElementsLBContainer(this, XMLSEC_RES(LB_ELEMENTS)) - ,maElementsLB(m_aElementsLBContainer) - ,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) ) - ,maStdFont ( maElementML.GetControlFont() ) - ,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) ) + :CertificateViewerTP ( _pParent, "CertDetails", "xmlsec/ui/certdetails.ui", _pDlg ) + ,m_aFixedWidthFont( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) ) { - WinBits nStyle = maElementsLB.GetStyle(); + get( m_pValueDetails, "valuedetails" ); + get( m_pElementsLBContainer, "tablecontainer" ); + m_pElementsLB = new SvSimpleTable( *m_pElementsLBContainer ); + + m_aStdFont = m_pValueDetails->GetControlFont(); + WinBits nStyle = m_pElementsLB->GetStyle(); nStyle &= ~WB_HSCROLL; - maElementsLB.SetStyle( nStyle ); + m_pElementsLB->SetStyle( nStyle ); - maFixedWidthFont.SetHeight( maStdFont.GetHeight() ); + m_aFixedWidthFont.SetHeight( m_aStdFont.GetHeight() ); static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 }; - maElementsLB.SetTabs( &nTabs[ 0 ] ); - maElementsLB.InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) ); + m_pElementsLB->SetTabs( &nTabs[ 0 ] ); + m_pElementsLB->InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) ); // fill list box Reference< security::XCertificate > xCert = mpDlg->mxCert; @@ -321,14 +322,13 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); InsertElement( XMLSEC_RES( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true ); - FreeResource(); - - maElementsLB.SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) ); + m_pElementsLB->SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) ); } CertificateViewerDetailsTP::~CertificateViewerDetailsTP() { Clear(); + delete m_pElementsLB; } void CertificateViewerDetailsTP::ActivatePage() @@ -337,7 +337,7 @@ void CertificateViewerDetailsTP::ActivatePage() IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl) { - SvTreeListEntry* pEntry = maElementsLB.FirstSelected(); + SvTreeListEntry* pEntry = m_pElementsLB->FirstSelected(); OUString aElementText; bool bFixedWidthFont; if( pEntry ) @@ -349,9 +349,9 @@ IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl) else bFixedWidthFont = false; - maElementML.SetFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); - maElementML.SetControlFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); - maElementML.SetText( aElementText ); + m_pValueDetails->SetFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont ); + m_pValueDetails->SetControlFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont ); + m_pValueDetails->SetText( aElementText ); return 0; } diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src index a7b35865d89c..957b141d6f38 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.src +++ b/xmlsecurity/source/dialogs/certificateviewer.src @@ -122,90 +122,69 @@ TabPage RID_XMLSECTP_GENERAL }; }; -TabPage RID_XMLSECTP_DETAILS +String STR_HEADERBAR { - HelpId = HID_XMLSEC_TP_DETAILS; - Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); - OutputSize = TRUE; - Hide = TRUE; - SVLook = TRUE; - Control LB_ELEMENTS - { - HelpId = HID_XMLSEC_CTRL_ELEMENTS; - Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 ); - Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0 ); - SVLook = TRUE; - Border = TRUE; - }; - String STR_HEADERBAR - { - Text [ en-US ] = "Field\tValue"; - }; - MultiLineEdit ML_ELEMENT - { - HelpID = "xmlsecurity:MultiLineEdit:RID_XMLSECTP_DETAILS:ML_ELEMENT"; - Pos = MAP_APPFONT( CV_COL_0, CV_ROW_2 ); - Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_3-CV_ROW_2 ); - ReadOnly = TRUE; - Border = TRUE; - VSCROLL = TRUE; - }; - String STR_VERSION - { - Text [ en-US ] = "Version"; - }; - String STR_SERIALNUM - { - Text [ en-US ] = "Serial Number"; - }; - String STR_SIGALGORITHM - { - Text [ en-US ] = "Signature Algorithm"; - }; - String STR_ISSUER - { - Text [ en-US ] = "Issuer"; - }; - String STR_ISSUER_ID - { - Text [ en-US ] = "Issuer Unique ID"; - }; - String STR_VALIDFROM - { - Text [ en-US ] = "Valid From"; - }; - String STR_VALIDTO - { - Text [ en-US ] = "Valid to"; - }; - String STR_SUBJECT - { - Text [ en-US ] = "Subject"; - }; - String STR_SUBJECT_ID - { - Text [ en-US ] = "Subject Unique ID"; - }; - String STR_SUBJECT_PUBKEY_ALGO - { - Text [ en-US ] = "Subject Algorithm"; - }; - String STR_SUBJECT_PUBKEY_VAL - { - Text [ en-US ] = "Public Key"; - }; - String STR_SIGNATURE_ALGO - { - Text [ en-US ] = "Signature Algorithm"; - }; - String STR_THUMBPRINT_SHA1 - { - Text [ en-US ] = "Thumbprint SHA1"; - }; - String STR_THUMBPRINT_MD5 - { - Text [ en-US ] = "Thumbprint MD5"; - }; + Text [ en-US ] = "Field\tValue"; +}; + +String STR_VERSION +{ + Text [ en-US ] = "Version"; +}; + +String STR_SERIALNUM +{ + Text [ en-US ] = "Serial Number"; +}; + +String STR_SIGALGORITHM +{ + Text [ en-US ] = "Signature Algorithm"; +}; + +String STR_ISSUER +{ + Text [ en-US ] = "Issuer"; +}; + +String STR_VALIDFROM +{ + Text [ en-US ] = "Valid From"; +}; + +String STR_VALIDTO +{ + Text [ en-US ] = "Valid to"; +}; + +String STR_SUBJECT +{ + Text [ en-US ] = "Subject"; +}; + +String STR_SUBJECT_PUBKEY_ALGO +{ + Text [ en-US ] = "Subject Algorithm"; +}; + +String STR_SUBJECT_PUBKEY_VAL +{ + Text [ en-US ] = "Public Key"; +}; + +String STR_SIGNATURE_ALGO +{ + Text [ en-US ] = "Signature Algorithm"; +}; + +String STR_THUMBPRINT_SHA1 +{ + Text [ en-US ] = "Thumbprint SHA1"; +}; + +String STR_THUMBPRINT_MD5 +{ + Text [ en-US ] = "Thumbprint MD5"; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc index 7e7476aa49a2..f07d52de8d44 100644 --- a/xmlsecurity/source/dialogs/dialogs.hrc +++ b/xmlsecurity/source/dialogs/dialogs.hrc @@ -28,7 +28,19 @@ #define FL_BOTTOM_SEP 50 #define BTN_HELP 53 -#define STR_HEADERBAR 56 +#define STR_HEADERBAR 256 +#define STR_VERSION 257 +#define STR_SERIALNUM 258 +#define STR_ISSUER 259 +#define STR_VALIDFROM 260 +#define STR_VALIDTO 261 +#define STR_SUBJECT 262 +#define STR_SUBJECT_PUBKEY_ALGO 263 +#define STR_SUBJECT_PUBKEY_VAL 264 +#define STR_SIGALGORITHM 265 +#define STR_SIGNATURE_ALGO 266 +#define STR_THUMBPRINT_SHA1 267 +#define STR_THUMBPRINT_MD5 268 // --------- general metrics --------- #define DLGS_WIDTH 287 @@ -103,25 +115,6 @@ #define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT) #define CW_ROW_10 (CW_ROW_9+2) -// --------- tab page Certificate viewer - Details --------- - -#define LB_ELEMENTS 1 -#define ML_ELEMENT 2 - -#define STR_VERSION 1 -#define STR_SERIALNUM 2 -#define STR_SIGALGORITHM 3 -#define STR_ISSUER 4 -#define STR_ISSUER_ID 5 -#define STR_VALIDFROM 6 -#define STR_VALIDTO 7 -#define STR_SUBJECT 8 -#define STR_SUBJECT_ID 9 -#define STR_SUBJECT_PUBKEY_ALGO 10 -#define STR_SUBJECT_PUBKEY_VAL 11 -#define STR_SIGNATURE_ALGO 12 -#define STR_THUMBPRINT_SHA1 13 -#define STR_THUMBPRINT_MD5 14 // --------- tab page Certificate viewer - Certification Path --------- diff --git a/xmlsecurity/uiconfig/ui/certdetails.ui b/xmlsecurity/uiconfig/ui/certdetails.ui new file mode 100644 index 000000000000..52a6681d495f --- /dev/null +++ b/xmlsecurity/uiconfig/ui/certdetails.ui @@ -0,0 +1,38 @@ + + + + + + + True + False + vertical + True + 12 + True + True + 6 + + + True + True + + + False + True + 0 + + + + + True + True + + + False + True + 1 + + + + -- cgit