summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorRachit Gupta <rachitgupta1792@gmail.com>2014-08-09 11:29:36 +0530
committerDavid Tardon <dtardon@redhat.com>2014-08-09 06:14:10 +0000
commitab1892d0cdabc305c1264792d5d3d66ed733d823 (patch)
tree01c5ce9194b57a6132165e92e0d26bd12da0e329 /xmlsecurity/source
parent4d635dcae4d7275d04a17a0efc11b0531d5d0a82 (diff)
Converted RID_XMLSECTP_GENERAL to Widget Layout.
Change-Id: I52a7f857715dc9cba7aa7748cea5b30b91ed9011 Reviewed-on: https://gerrit.libreoffice.org/10842 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx92
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.src107
-rw-r--r--xmlsecurity/source/dialogs/dialogs.hrc17
3 files changed, 27 insertions, 189 deletions
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 9ff204a9610a..af1f59af7c1e 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -88,21 +88,16 @@ CertificateViewerTP::CertificateViewerTP( Window* _pParent, const OString& rID,
}
CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, CertificateViewer* _pDlg )
- :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_GENERAL ), _pDlg )
- ,maFrameWin ( this, XMLSEC_RES( WIN_FRAME ) )
- ,maCertImg ( this, XMLSEC_RES( IMG_CERT ) )
- ,maCertInfoFI ( this, XMLSEC_RES( FI_CERTINFO ) )
- ,maSep1FL ( this, XMLSEC_RES( FL_SEP1 ) )
- ,maHintNotTrustedFI ( this, XMLSEC_RES( FI_HINTNOTTRUST ) )
- ,maSep2FL ( this, XMLSEC_RES( FL_SEP2 ) )
- ,maIssuedToLabelFI ( this, XMLSEC_RES( FI_ISSTOLABEL ) )
- ,maIssuedToFI ( this, XMLSEC_RES( FI_ISSTO ) )
- ,maIssuedByLabelFI ( this, XMLSEC_RES( FI_ISSBYLABEL ) )
- ,maIssuedByFI ( this, XMLSEC_RES( FI_ISSBY ) )
- ,maValidDateFI ( this, XMLSEC_RES( FI_VALIDDATE ) )
- ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) )
- ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) )
+ :CertificateViewerTP ( _pParent, "CertGeneral", "xmlsec/ui/certgeneral.ui", _pDlg )
{
+ get( m_pCertImg, "certimage" );
+ get( m_pHintNotTrustedFI, "hintnotrust" );
+ get( m_pIssuedToFI, "issuedto" );
+ get( m_pIssuedByFI, "issuedby" );
+ get( m_pValidDateFI, "validdate" );
+ get( m_pKeyImg, "keyimage" );
+ get( m_pHintCorrespPrivKeyFI, "privatekey" );
+
//Verify the certificate
sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert,
Sequence<Reference<css::security::XCertificate> >());
@@ -111,80 +106,27 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
if ( !bCertValid )
{
- maCertImg.SetImage(
+ m_pCertImg->SetImage(
Image( XMLSEC_RES( IMG_STATE_NOT_VALIDATED ) ) );
- maHintNotTrustedFI.SetText( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) );
+ m_pHintNotTrustedFI->SetText( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) );
}
- FreeResource();
-
- Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() );
- maFrameWin.SetBackground( aBack );
- maCertImg.SetBackground( aBack );
- maCertInfoFI.SetBackground( aBack );
- maSep1FL.SetBackground( aBack );
- maHintNotTrustedFI.SetBackground( aBack );
- maSep2FL.SetBackground( aBack );
- maIssuedToLabelFI.SetBackground( aBack );
- maIssuedToFI.SetBackground( aBack );
- maIssuedByLabelFI.SetBackground( aBack );
- maIssuedByFI.SetBackground( aBack );
- maValidDateFI.SetBackground( aBack );
- maKeyImg.SetBackground( aBack );
- maHintCorrespPrivKeyFI.SetBackground( aBack );
-
- // make some bold
- Font aFnt( maCertInfoFI.GetFont() );
- aFnt.SetWeight( WEIGHT_BOLD );
- maCertInfoFI.SetFont( aFnt );
- maHintNotTrustedFI.SetFont( aFnt );
- maIssuedToLabelFI.SetFont( aFnt );
- maIssuedByLabelFI.SetFont( aFnt );
- maValidDateFI.SetFont( aFnt );
-
// insert data
css::uno::Reference< css::security::XCertificate > xCert = mpDlg->mxCert;
- maIssuedToFI.SetText( XmlSec::GetContentPart( xCert->getSubjectName() ) );
- maIssuedByFI.SetText( XmlSec::GetContentPart( xCert->getIssuerName() ) );
-
- // dynamic length because of the different languages
- long nWidth1 = maIssuedToLabelFI.GetTextWidth( maIssuedToLabelFI.GetText() );
- long nWidth2 = maIssuedByLabelFI.GetTextWidth( maIssuedByLabelFI.GetText() );
- long nNewWidth = std::max( nWidth1, nWidth2 ) + 5;
- Size aNewSize = maIssuedToLabelFI.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- maIssuedToLabelFI.SetSizePixel( aNewSize );
- maIssuedByLabelFI.SetSizePixel( aNewSize );
- long nNewX = maIssuedToLabelFI.GetPosPixel().X() + nNewWidth + 1;
- Point aNewPos = maIssuedToFI.GetPosPixel();
- aNewPos.X() = nNewX;
- maIssuedToFI.SetPosPixel( aNewPos );
- aNewPos = maIssuedByFI.GetPosPixel();
- aNewPos.X() = nNewX;
- maIssuedByFI.SetPosPixel( aNewPos );
- nNewWidth = maValidDateFI.GetSizePixel().Width() - nNewX;
- aNewSize = maIssuedToFI.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- maIssuedToFI.SetSizePixel( aNewSize );
- maIssuedByFI.SetSizePixel( aNewSize );
+ m_pIssuedToFI->SetText( XmlSec::GetContentPart( xCert->getSubjectName() ) );
+ m_pIssuedByFI->SetText( XmlSec::GetContentPart( xCert->getIssuerName() ) );
DateTime aDateTimeStart( DateTime::EMPTY );
DateTime aDateTimeEnd( DateTime::EMPTY );
utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart );
utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd );
- OUString sText = maValidDateFI.GetText();
+ OUString sText = m_pValidDateFI->GetText();
sText = sText.replaceFirst( "%SDATE%",
GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) );
sText = sText.replaceFirst( "%EDATE%",
GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) );
- maValidDateFI.SetText( sText );
-
- // adjust position of fixed text depending on image sizes
- ShrinkToFit( maCertImg );
- ShrinkToFit( maKeyImg );
- XmlSec::AlignAfterImage( maCertImg, maCertInfoFI, 12 );
- XmlSec::AlignAfterImage( maKeyImg, maHintCorrespPrivKeyFI, 12 );
+ m_pValidDateFI->SetText( sText );
// Check if we have the private key...
bool bHasPrivateKey = false;
@@ -196,8 +138,8 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
}
if ( !bHasPrivateKey )
{
- maKeyImg.Hide();
- maHintCorrespPrivKeyFI.Hide();
+ m_pKeyImg->Hide();
+ m_pHintCorrespPrivKeyFI->Hide();
}
}
diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src
index 957b141d6f38..24e82463ac22 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.src
+++ b/xmlsecurity/source/dialogs/certificateviewer.src
@@ -20,106 +20,15 @@
#include "dialogs.hrc"
#include "helpids.hrc"
-TabPage RID_XMLSECTP_GENERAL
+String STR_CERTIFICATE_NOT_VALIDATED
{
- HelpId = HID_XMLSEC_TP_GENERAL;
- Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT );
- OutputSize = TRUE;
- Hide = TRUE;
- SVLook = TRUE;
- Window WIN_FRAME
- {
- SVLook = TRUE;
- Border = TRUE;
- Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 );
- Size = MAP_APPFONT( CV_CONT_WIDTH, CV_CONT_HEIGHT );
- };
- FixedImage IMG_CERT
- {
- Pos = MAP_APPFONT( CW_COL_0, CW_ROW_0 );
- Size = MAP_APPFONT( IMG1_WIDTH, IMG1_HEIGHT );
- Fixed = Image
- {
- ImageBitmap = Bitmap { File = "certificate_40x56.png"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
- FixedText FI_CERTINFO
- {
- Pos = MAP_APPFONT( CW_COL_3, CW_ROW_1 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_3, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = " Certificate Information";
- };
- FixedLine FL_SEP1
- {
- Pos = MAP_APPFONT( CW_COL_0, CW_ROW_3 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- };
- FixedText FI_HINTNOTTRUST
- {
- Pos = MAP_APPFONT( CW_COL_1, CW_ROW_4 );
- Size = MAP_APPFONT( CW_COL_5a-CW_COL_1, CW_ROW_4a-CW_ROW_4 );
- WordBreak = TRUE;
- Text [ en-US ] = "This certificate is intended for the following purpose(s):";
- };
- FixedLine FL_SEP2
- {
- Pos = MAP_APPFONT( CW_COL_0, CW_ROW_5 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- };
- FixedText FI_ISSTOLABEL
- {
- Pos = MAP_APPFONT( CW_COL_1, CW_ROW_6 );
- Size = MAP_APPFONT( CW_COL_4-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Issued to:";
- };
- FixedText FI_ISSTO
- {
- Pos = MAP_APPFONT( CW_COL_4, CW_ROW_6 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_4, RSC_CD_FIXEDTEXT_HEIGHT );
- };
- FixedText FI_ISSBYLABEL
- {
- Pos = MAP_APPFONT( CW_COL_1, CW_ROW_7 );
- Size = MAP_APPFONT( CW_COL_4-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Issued by:";
- };
- FixedText FI_ISSBY
- {
- Pos = MAP_APPFONT( CW_COL_4, CW_ROW_7 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_4, RSC_CD_FIXEDTEXT_HEIGHT );
- };
- FixedText FI_VALIDDATE
- {
- Pos = MAP_APPFONT( CW_COL_1, CW_ROW_8 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Valid from %SDATE% to %EDATE%";
- };
- FixedImage IMG_KEY
- {
- Pos = MAP_APPFONT( CW_COL_0, CW_ROW_9 );
- Size = MAP_APPFONT( IMG2_WIDTH, IMG2_HEIGHT );
- Fixed = Image
- {
- ImageBitmap = Bitmap { File = "key_12.png"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
- FixedText FI_CORRPRIVKEY
- {
- Pos = MAP_APPFONT( CW_COL_1a, CW_ROW_10 );
- Size = MAP_APPFONT( CW_COL_5-CW_COL_1a, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "You have a private key that corresponds to this certificate.";
- };
- String STR_CERTIFICATE_NOT_VALIDATED
- {
- Text [ en-US ] = "The certificate could not be validated.";
- };
- Image IMG_STATE_NOT_VALIDATED
- {
- ImageBitmap = Bitmap { File = "notcertificate_40x56.png"; };
- MaskColor = STD_MASKCOLOR;
- };
+ Text [ en-US ] = "The certificate could not be validated.";
+};
+
+Image IMG_STATE_NOT_VALIDATED
+{
+ ImageBitmap = Bitmap { File = "notcertificate_40x56.png"; };
+ MaskColor = STD_MASKCOLOR;
};
String STR_HEADERBAR
diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc
index 4d84c64296a9..1973449ab57c 100644
--- a/xmlsecurity/source/dialogs/dialogs.hrc
+++ b/xmlsecurity/source/dialogs/dialogs.hrc
@@ -74,21 +74,8 @@
#define CV_ROW_2 (CV_ROW_1+RSC_SP_CTRL_GROUP_Y)
// --------- tab page Certificate viewer - General ---------
-#define WIN_FRAME 2
-#define IMG_CERT 3
-#define FI_CERTINFO 4
-#define FL_SEP1 5
-#define FI_HINTNOTTRUST 6
-#define FL_SEP2 7
-#define FI_ISSTOLABEL 8
-#define FI_ISSTO 9
-#define FI_ISSBYLABEL 10
-#define FI_ISSBY 11
-#define FI_VALIDDATE 12
-#define IMG_KEY 13
-#define FI_CORRPRIVKEY 14
-#define STR_CERTIFICATE_NOT_VALIDATED 15
-#define IMG_STATE_NOT_VALIDATED 16
+#define STR_CERTIFICATE_NOT_VALIDATED 269
+#define IMG_STATE_NOT_VALIDATED 270
#define IMG1_WIDTH 33
#define IMG1_HEIGHT 22