Kaydet (Commit) 13d4f7b8 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Grid and separarate "valid from/to" for CertificateViewer

Change-Id: I32661d0ec57c9f855806a44349d20c8fe651f293
üst 555c988f
...@@ -81,7 +81,8 @@ private: ...@@ -81,7 +81,8 @@ private:
FixedText* m_pHintNotTrustedFI; FixedText* m_pHintNotTrustedFI;
FixedText* m_pIssuedToFI; FixedText* m_pIssuedToFI;
FixedText* m_pIssuedByFI; FixedText* m_pIssuedByFI;
FixedText* m_pValidDateFI; FixedText* m_pValidFromDateFI;
FixedText* m_pValidToDateFI;
FixedImage* m_pKeyImg; FixedImage* m_pKeyImg;
FixedText* m_pHintCorrespPrivKeyFI; FixedText* m_pHintCorrespPrivKeyFI;
public: public:
......
...@@ -78,9 +78,10 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ...@@ -78,9 +78,10 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
{ {
get( m_pCertImg, "certimage" ); get( m_pCertImg, "certimage" );
get( m_pHintNotTrustedFI, "hintnotrust" ); get( m_pHintNotTrustedFI, "hintnotrust" );
get( m_pIssuedToFI, "issuedto" ); get( m_pIssuedToFI, "issued_to_value" );
get( m_pIssuedByFI, "issuedby" ); get( m_pIssuedByFI, "issued_by_value" );
get( m_pValidDateFI, "validdate" ); get( m_pValidFromDateFI, "valid_from_value" );
get( m_pValidToDateFI, "valid_to_value" );
get( m_pKeyImg, "keyimage" ); get( m_pKeyImg, "keyimage" );
get( m_pHintCorrespPrivKeyFI, "privatekey" ); get( m_pHintCorrespPrivKeyFI, "privatekey" );
...@@ -107,12 +108,12 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ...@@ -107,12 +108,12 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
DateTime aDateTimeEnd( DateTime::EMPTY ); DateTime aDateTimeEnd( DateTime::EMPTY );
utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart ); utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart );
utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd ); utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd );
OUString sText = m_pValidDateFI->GetText();
sText = sText.replaceFirst( "%SDATE%", OUString sValidFromDate = GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() );
GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) ); OUString sValidToDate = GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() );
sText = sText.replaceFirst( "%EDATE%",
GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) ); m_pValidFromDateFI->SetText(sValidFromDate);
m_pValidDateFI->SetText( sText ); m_pValidToDateFI->SetText(sValidToDate);
// Check if we have the private key... // Check if we have the private key...
bool bHasPrivateKey = false; bool bHasPrivateKey = false;
...@@ -120,7 +121,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ...@@ -120,7 +121,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
if ( _pDlg->mbCheckForPrivateKey ) if ( _pDlg->mbCheckForPrivateKey )
{ {
long nCertificateCharacters = _pDlg->mxSecurityEnvironment->getCertificateCharacters( xCert ); long nCertificateCharacters = _pDlg->mxSecurityEnvironment->getCertificateCharacters( xCert );
bHasPrivateKey = ( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY ) ? sal_True : sal_False; bHasPrivateKey = ( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY );
} }
if ( !bHasPrivateKey ) if ( !bHasPrivateKey )
{ {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 --> <!-- Generated with glade 3.18.3 -->
<interface> <interface>
<requires lib="gtk+" version="3.10"/> <requires lib="gtk+" version="3.10"/>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child> <child>
<object class="GtkBox" id="CertGeneral"> <object class="GtkBox" id="CertGeneral">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -15,13 +16,12 @@ ...@@ -15,13 +16,12 @@
<object class="GtkImage" id="certimage"> <object class="GtkImage" id="certimage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_top">12</property>
<property name="pixbuf">xmlsecurity/res/certificate_40x56.png</property> <property name="pixbuf">xmlsecurity/res/certificate_40x56.png</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="padding">6</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
<object class="GtkLabel" id="label1"> <object class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">24</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="label" translatable="yes">Certificate Information</property> <property name="label" translatable="yes">Certificate Information</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
...@@ -47,6 +44,7 @@ ...@@ -47,6 +44,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="padding">6</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
...@@ -69,7 +67,7 @@ ...@@ -69,7 +67,7 @@
<property name="margin_right">36</property> <property name="margin_right">36</property>
<property name="margin_bottom">108</property> <property name="margin_bottom">108</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">This certificate is intended for the following purpose(s):</property> <property name="label" translatable="yes">This certificate is validated.</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
...@@ -92,106 +90,81 @@ ...@@ -92,106 +90,81 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box4"> <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Issued to: </property> <property name="label" translatable="yes">Issued to: </property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="issuedto"> <object class="GtkLabel" id="issued_to_value">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box6"> <object class="GtkLabel" id="issued_by">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">6</property> <property name="xalign">0</property>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="label" translatable="yes">Issued by: </property> <property name="label" translatable="yes">Issued by: </property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="issuedby"> <object class="GtkLabel" id="issued_by_value">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="validdate"> <object class="GtkLabel" id="valid_from">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Valid from %SDATE% to %EDATE%</property> <property name="label" translatable="yes">Valid from:</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">2</property>
<property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box7"> <object class="GtkBox" id="box2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
...@@ -199,7 +172,6 @@ ...@@ -199,7 +172,6 @@
<object class="GtkImage" id="keyimage"> <object class="GtkImage" id="keyimage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="pixbuf">xmlsecurity/res/key_12.png</property> <property name="pixbuf">xmlsecurity/res/key_12.png</property>
</object> </object>
<packing> <packing>
...@@ -212,7 +184,6 @@ ...@@ -212,7 +184,6 @@
<object class="GtkLabel" id="privatekey"> <object class="GtkLabel" id="privatekey">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="label" translatable="yes">You have a private key that corresponds to this certificate.</property> <property name="label" translatable="yes">You have a private key that corresponds to this certificate.</property>
</object> </object>
<packing> <packing>
...@@ -223,9 +194,46 @@ ...@@ -223,9 +194,46 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">4</property>
<property name="position">3</property> <property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="valid_to">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Valid to:</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="valid_from_value">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="valid_to_value">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing> </packing>
</child> </child>
</object> </object>
......
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