Kaydet (Commit) e2b0e757 authored tarafından Rachit Gupta's avatar Rachit Gupta Kaydeden (comit) David Tardon

Converted RID_XMLSECTP_DETAILS to Widget Layout.

Change-Id: Ie284f5902879093f882a1f69b481df4a1a319a35
Reviewed-on: https://gerrit.libreoffice.org/10693Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 7aa7047e
...@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,xmlsec)) ...@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,xmlsec))
$(eval $(call gb_UIConfig_add_uifiles,xmlsec,\ $(eval $(call gb_UIConfig_add_uifiles,xmlsec,\
xmlsecurity/uiconfig/ui/certpage \ xmlsecurity/uiconfig/ui/certpage \
xmlsecurity/uiconfig/ui/certdetails \
xmlsecurity/uiconfig/ui/digitalsignaturesdialog \ xmlsecurity/uiconfig/ui/digitalsignaturesdialog \
xmlsecurity/uiconfig/ui/securitylevelpage \ xmlsecurity/uiconfig/ui/securitylevelpage \
xmlsecurity/uiconfig/ui/securitytrustpage \ xmlsecurity/uiconfig/ui/securitytrustpage \
......
...@@ -101,11 +101,11 @@ public: ...@@ -101,11 +101,11 @@ public:
class CertificateViewerDetailsTP : public CertificateViewerTP class CertificateViewerDetailsTP : public CertificateViewerTP
{ {
private: private:
SvSimpleTableContainer m_aElementsLBContainer; SvSimpleTableContainer* m_pElementsLBContainer;
SvSimpleTable maElementsLB; SvSimpleTable* m_pElementsLB;
MultiLineEdit maElementML; MultiLineEdit* m_pValueDetails;
Font maStdFont; Font m_aStdFont;
Font maFixedWidthFont; Font m_aFixedWidthFont;
DECL_LINK( ElementSelectHdl, void* ); DECL_LINK( ElementSelectHdl, void* );
void Clear( void ); void Clear( void );
......
...@@ -224,44 +224,45 @@ inline Details_UserDatat::Details_UserDatat( const OUString& _rTxt, bool _bFixed ...@@ -224,44 +224,45 @@ inline Details_UserDatat::Details_UserDatat( const OUString& _rTxt, bool _bFixed
void CertificateViewerDetailsTP::Clear( void ) void CertificateViewerDetailsTP::Clear( void )
{ {
maElementML.SetText( OUString() ); m_pValueDetails->SetText( OUString() );
sal_uLong i = 0; sal_uLong i = 0;
SvTreeListEntry* pEntry = maElementsLB.GetEntry( i ); SvTreeListEntry* pEntry = m_pElementsLB->GetEntry( i );
while( pEntry ) while( pEntry )
{ {
delete ( Details_UserDatat* ) pEntry->GetUserData(); delete ( Details_UserDatat* ) pEntry->GetUserData();
++i; ++i;
pEntry = maElementsLB.GetEntry( i ); pEntry = m_pElementsLB->GetEntry( i );
} }
maElementsLB.Clear(); m_pElementsLB->Clear();
} }
void CertificateViewerDetailsTP::InsertElement( const OUString& _rField, const OUString& _rValue, void CertificateViewerDetailsTP::InsertElement( const OUString& _rField, const OUString& _rValue,
const OUString& _rDetails, bool _bFixedWidthFont ) const OUString& _rDetails, bool _bFixedWidthFont )
{ {
SvTreeListEntry* pEntry = maElementsLB.InsertEntry( _rField ); SvTreeListEntry* pEntry = m_pElementsLB->InsertEntry( _rField );
maElementsLB.SetEntryText( _rValue, pEntry, 1 ); m_pElementsLB->SetEntryText( _rValue, pEntry, 1 );
pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) ); pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) );
} }
CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg ) CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg )
:CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg ) :CertificateViewerTP ( _pParent, "CertDetails", "xmlsec/ui/certdetails.ui", _pDlg )
,m_aElementsLBContainer(this, XMLSEC_RES(LB_ELEMENTS)) ,m_aFixedWidthFont( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )
,maElementsLB(m_aElementsLBContainer)
,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) )
,maStdFont ( maElementML.GetControlFont() )
,maFixedWidthFont ( 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; 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 }; static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 };
maElementsLB.SetTabs( &nTabs[ 0 ] ); m_pElementsLB->SetTabs( &nTabs[ 0 ] );
maElementsLB.InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) ); m_pElementsLB->InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) );
// fill list box // fill list box
Reference< security::XCertificate > xCert = mpDlg->mxCert; Reference< security::XCertificate > xCert = mpDlg->mxCert;
...@@ -321,14 +322,13 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif ...@@ -321,14 +322,13 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif
aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak );
InsertElement( XMLSEC_RES( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true ); InsertElement( XMLSEC_RES( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true );
FreeResource(); m_pElementsLB->SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) );
maElementsLB.SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) );
} }
CertificateViewerDetailsTP::~CertificateViewerDetailsTP() CertificateViewerDetailsTP::~CertificateViewerDetailsTP()
{ {
Clear(); Clear();
delete m_pElementsLB;
} }
void CertificateViewerDetailsTP::ActivatePage() void CertificateViewerDetailsTP::ActivatePage()
...@@ -337,7 +337,7 @@ void CertificateViewerDetailsTP::ActivatePage() ...@@ -337,7 +337,7 @@ void CertificateViewerDetailsTP::ActivatePage()
IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl) IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl)
{ {
SvTreeListEntry* pEntry = maElementsLB.FirstSelected(); SvTreeListEntry* pEntry = m_pElementsLB->FirstSelected();
OUString aElementText; OUString aElementText;
bool bFixedWidthFont; bool bFixedWidthFont;
if( pEntry ) if( pEntry )
...@@ -349,9 +349,9 @@ IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl) ...@@ -349,9 +349,9 @@ IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl)
else else
bFixedWidthFont = false; bFixedWidthFont = false;
maElementML.SetFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); m_pValueDetails->SetFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
maElementML.SetControlFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); m_pValueDetails->SetControlFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
maElementML.SetText( aElementText ); m_pValueDetails->SetText( aElementText );
return 0; return 0;
} }
......
...@@ -122,90 +122,69 @@ TabPage RID_XMLSECTP_GENERAL ...@@ -122,90 +122,69 @@ TabPage RID_XMLSECTP_GENERAL
}; };
}; };
TabPage RID_XMLSECTP_DETAILS String STR_HEADERBAR
{ {
HelpId = HID_XMLSEC_TP_DETAILS; Text [ en-US ] = "Field\tValue";
Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); };
OutputSize = TRUE;
Hide = TRUE; String STR_VERSION
SVLook = TRUE; {
Control LB_ELEMENTS Text [ en-US ] = "Version";
{ };
HelpId = HID_XMLSEC_CTRL_ELEMENTS;
Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 ); String STR_SERIALNUM
Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0 ); {
SVLook = TRUE; Text [ en-US ] = "Serial Number";
Border = TRUE; };
};
String STR_HEADERBAR String STR_SIGALGORITHM
{ {
Text [ en-US ] = "Field\tValue"; Text [ en-US ] = "Signature Algorithm";
}; };
MultiLineEdit ML_ELEMENT
{ String STR_ISSUER
HelpID = "xmlsecurity:MultiLineEdit:RID_XMLSECTP_DETAILS:ML_ELEMENT"; {
Pos = MAP_APPFONT( CV_COL_0, CV_ROW_2 ); Text [ en-US ] = "Issuer";
Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_3-CV_ROW_2 ); };
ReadOnly = TRUE;
Border = TRUE; String STR_VALIDFROM
VSCROLL = TRUE; {
}; Text [ en-US ] = "Valid From";
String STR_VERSION };
{
Text [ en-US ] = "Version"; String STR_VALIDTO
}; {
String STR_SERIALNUM Text [ en-US ] = "Valid to";
{ };
Text [ en-US ] = "Serial Number";
}; String STR_SUBJECT
String STR_SIGALGORITHM {
{ Text [ en-US ] = "Subject";
Text [ en-US ] = "Signature Algorithm"; };
};
String STR_ISSUER String STR_SUBJECT_PUBKEY_ALGO
{ {
Text [ en-US ] = "Issuer"; Text [ en-US ] = "Subject Algorithm";
}; };
String STR_ISSUER_ID
{ String STR_SUBJECT_PUBKEY_VAL
Text [ en-US ] = "Issuer Unique ID"; {
}; Text [ en-US ] = "Public Key";
String STR_VALIDFROM };
{
Text [ en-US ] = "Valid From"; String STR_SIGNATURE_ALGO
}; {
String STR_VALIDTO Text [ en-US ] = "Signature Algorithm";
{ };
Text [ en-US ] = "Valid to";
}; String STR_THUMBPRINT_SHA1
String STR_SUBJECT {
{ Text [ en-US ] = "Thumbprint SHA1";
Text [ en-US ] = "Subject"; };
};
String STR_SUBJECT_ID String STR_THUMBPRINT_MD5
{ {
Text [ en-US ] = "Subject Unique ID"; Text [ en-US ] = "Thumbprint MD5";
};
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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -28,7 +28,19 @@ ...@@ -28,7 +28,19 @@
#define FL_BOTTOM_SEP 50 #define FL_BOTTOM_SEP 50
#define BTN_HELP 53 #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 --------- // --------- general metrics ---------
#define DLGS_WIDTH 287 #define DLGS_WIDTH 287
...@@ -103,25 +115,6 @@ ...@@ -103,25 +115,6 @@
#define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT) #define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
#define CW_ROW_10 (CW_ROW_9+2) #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 --------- // --------- tab page Certificate viewer - Certification Path ---------
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<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>
<child>
<object class="svtlo-SvSimpleTableContainer" id="tablecontainer:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="svtlo-MultiLineEditSyntaxHighlight" id="valuedetails:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment