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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Fri Apr 13 15:29:00 UTC 2018


 cui/source/dialogs/SignSignatureLineDialog.cxx |   15 +++++++++++
 cui/source/inc/SignSignatureLineDialog.hxx     |    2 +
 cui/uiconfig/ui/signsignatureline.ui           |   32 ++++++++++++++++++++++++-
 3 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 28db2de99a85f3b6397fbd372658853e8020bf15
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Fri Apr 13 15:22:45 2018 +0200

    tdf#83877 Show signing instructions in sign dialog
    
    Change-Id: I230ff1fcbc6f98755ae588dca32d77c442d5f042
    Reviewed-on: https://gerrit.libreoffice.org/52832
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx
index 3c3052901c26..1b39b1f8e61b 100644
--- a/cui/source/dialogs/SignSignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignSignatureLineDialog.cxx
@@ -53,6 +53,8 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc
     , m_xEditComment(m_xBuilder->weld_text_view("edit_comment"))
     , m_xBtnChooseCertificate(m_xBuilder->weld_button("btn_select_certificate"))
     , m_xBtnSign(m_xBuilder->weld_button("ok"))
+    , m_xLabelHint(m_xBuilder->weld_label("label_hint"))
+    , m_xLabelHintText(m_xBuilder->weld_label("label_hint_text"))
 {
     Reference<container::XIndexAccess> xIndexAccess(m_xModel->getCurrentSelection(),
                                                     UNO_QUERY_THROW);
@@ -84,8 +86,21 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc
         >>= m_aSuggestedSignerName;
     m_xShapeProperties->getPropertyValue("SignatureLineSuggestedSignerTitle")
         >>= m_aSuggestedSignerTitle;
+    OUString aSigningInstructions;
+    m_xShapeProperties->getPropertyValue("SignatureLineSigningInstructions")
+        >>= aSigningInstructions;
     m_xShapeProperties->getPropertyValue("SignatureLineShowSignDate") >>= m_bShowSignDate;
 
+    if (aSigningInstructions.isEmpty())
+    {
+        m_xLabelHint->hide();
+        m_xLabelHintText->hide();
+    }
+    else
+    {
+        m_xLabelHintText->set_label(aSigningInstructions);
+    }
+
     ValidateFields();
 }
 
diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx
index c7a6e565bd7b..fb9c1c1ca2d0 100644
--- a/cui/source/inc/SignSignatureLineDialog.hxx
+++ b/cui/source/inc/SignSignatureLineDialog.hxx
@@ -25,6 +25,8 @@ private:
     std::unique_ptr<weld::TextView> m_xEditComment;
     std::unique_ptr<weld::Button> m_xBtnChooseCertificate;
     std::unique_ptr<weld::Button> m_xBtnSign;
+    std::unique_ptr<weld::Label> m_xLabelHint;
+    std::unique_ptr<weld::Label> m_xLabelHintText;
 
     css::uno::Reference<css::beans::XPropertySet> m_xShapeProperties;
     css::uno::Reference<css::security::XCertificate> m_xSelectedCertifate;
diff --git a/cui/uiconfig/ui/signsignatureline.ui b/cui/uiconfig/ui/signsignatureline.ui
index 860da621d4f4..87bdefdfa74c 100644
--- a/cui/uiconfig/ui/signsignatureline.ui
+++ b/cui/uiconfig/ui/signsignatureline.ui
@@ -190,7 +190,7 @@
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
+                            <property name="top_attach">2</property>
                           </packing>
                         </child>
                         <child>
@@ -212,6 +212,36 @@
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
+                            <property name="top_attach">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label_hint">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="label" translatable="yes" context="signsignatureline|label_hint">Instructions from the document creator:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">label_hint_text</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label_hint_text">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="margin_left">12</property>
+                            <property name="mnemonic_widget">edit_comment</property>
+                            <attributes>
+                              <attribute name="style" value="oblique"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
                             <property name="top_attach">1</property>
                           </packing>
                         </child>


More information about the Libreoffice-commits mailing list