[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source xmlsecurity/uiconfig

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Tue Aug 12 09:26:02 PDT 2014


 xmlsecurity/inc/xmlsecurity/certificateviewer.hxx |    3 
 xmlsecurity/source/dialogs/certificateviewer.cxx  |   21 +-
 xmlsecurity/uiconfig/ui/certgeneral.ui            |  176 +++++++++++-----------
 3 files changed, 105 insertions(+), 95 deletions(-)

New commits:
commit 13d4f7b800a9f35717ed91f330b38513e0db4bc6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sat Aug 9 22:03:46 2014 +0200

    Grid and separarate "valid from/to" for CertificateViewer
    
    Change-Id: I32661d0ec57c9f855806a44349d20c8fe651f293

diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
index eaf2fa9..9aae278 100644
--- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
@@ -81,7 +81,8 @@ private:
     FixedText*          m_pHintNotTrustedFI;
     FixedText*          m_pIssuedToFI;
     FixedText*          m_pIssuedByFI;
-    FixedText*          m_pValidDateFI;
+    FixedText*          m_pValidFromDateFI;
+    FixedText*          m_pValidToDateFI;
     FixedImage*         m_pKeyImg;
     FixedText*          m_pHintCorrespPrivKeyFI;
 public:
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index b704530..02ce1d8 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -78,9 +78,10 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
 {
     get( m_pCertImg, "certimage" );
     get( m_pHintNotTrustedFI, "hintnotrust" );
-    get( m_pIssuedToFI, "issuedto" );
-    get( m_pIssuedByFI, "issuedby" );
-    get( m_pValidDateFI, "validdate" );
+    get( m_pIssuedToFI, "issued_to_value" );
+    get( m_pIssuedByFI, "issued_by_value" );
+    get( m_pValidFromDateFI, "valid_from_value" );
+    get( m_pValidToDateFI, "valid_to_value" );
     get( m_pKeyImg, "keyimage" );
     get( m_pHintCorrespPrivKeyFI, "privatekey" );
 
@@ -107,12 +108,12 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
     DateTime aDateTimeEnd( DateTime::EMPTY );
     utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart );
     utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd );
-    OUString sText = m_pValidDateFI->GetText();
-    sText = sText.replaceFirst( "%SDATE%",
-        GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) );
-    sText = sText.replaceFirst( "%EDATE%",
-        GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) );
-    m_pValidDateFI->SetText( sText );
+
+    OUString sValidFromDate = GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() );
+    OUString sValidToDate = GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() );
+
+    m_pValidFromDateFI->SetText(sValidFromDate);
+    m_pValidToDateFI->SetText(sValidToDate);
 
     // Check if we have the private key...
     bool bHasPrivateKey = false;
@@ -120,7 +121,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
     if ( _pDlg->mbCheckForPrivateKey )
     {
         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 )
     {
diff --git a/xmlsecurity/uiconfig/ui/certgeneral.ui b/xmlsecurity/uiconfig/ui/certgeneral.ui
index 36af4fa..4ec69e2 100644
--- a/xmlsecurity/uiconfig/ui/certgeneral.ui
+++ b/xmlsecurity/uiconfig/ui/certgeneral.ui
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
   <object class="GtkBox" id="box1">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="orientation">vertical</property>
+    <property name="spacing">6</property>
     <child>
       <object class="GtkBox" id="CertGeneral">
         <property name="visible">True</property>
@@ -15,13 +16,12 @@
           <object class="GtkImage" id="certimage">
             <property name="visible">True</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>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
+            <property name="padding">6</property>
             <property name="position">0</property>
           </packing>
         </child>
@@ -29,9 +29,6 @@
           <object class="GtkLabel" id="label1">
             <property name="visible">True</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>
             <attributes>
               <attribute name="weight" value="bold"/>
@@ -47,6 +44,7 @@
       <packing>
         <property name="expand">False</property>
         <property name="fill">True</property>
+        <property name="padding">6</property>
         <property name="position">0</property>
       </packing>
     </child>
@@ -69,7 +67,7 @@
         <property name="margin_right">36</property>
         <property name="margin_bottom">108</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>
           <attribute name="weight" value="bold"/>
         </attributes>
@@ -92,106 +90,81 @@
       </packing>
     </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>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">6</property>
         <child>
-          <object class="GtkBox" id="box5">
+          <object class="GtkLabel" id="label3">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <child>
-              <object class="GtkLabel" id="label3">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="margin_left">12</property>
-                <property name="label" translatable="yes">Issued to: </property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="issuedto">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Issued to: </property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="box6">
+          <object class="GtkLabel" id="issued_to_value">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="spacing">6</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>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="issuedby">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
+            <property name="hexpand">True</property>
+            <property name="xalign">0</property>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="validdate">
+          <object class="GtkLabel" id="issued_by">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="margin_left">12</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Valid from %SDATE% to %EDATE%</property>
+            <property name="label" translatable="yes">Issued by: </property>
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="issued_by_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">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="valid_from">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Valid from:</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="box7">
+          <object class="GtkBox" id="box2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="spacing">6</property>
@@ -199,7 +172,6 @@
               <object class="GtkImage" id="keyimage">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="margin_left">12</property>
                 <property name="pixbuf">xmlsecurity/res/key_12.png</property>
               </object>
               <packing>
@@ -212,7 +184,6 @@
               <object class="GtkLabel" id="privatekey">
                 <property name="visible">True</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>
               </object>
               <packing>
@@ -223,9 +194,46 @@
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">4</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>
         </child>
       </object>


More information about the Libreoffice-commits mailing list