summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-12-11 14:11:42 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-12-14 08:19:35 +0100
commita383794fba07cb6a356274febd55968fb25f77e4 (patch)
tree667a3090fff2ee79c8e7e78ba3d6a07f98fed9cf /uui
parent37b381e2877c60c84547b22117663a72ab02fadc (diff)
tdf#158576 This button shows a certificate when only one signature found
"Show signatures" should only be shown when there are multiple signatures, otherwise the button label must be "Show certificate" Change-Id: Iaed2d10b8e94bf6decad937dafef4795b7ed40dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160596 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'uui')
-rw-r--r--uui/source/secmacrowarnings.cxx13
-rw-r--r--uui/source/secmacrowarnings.hxx1
-rw-r--r--uui/uiconfig/ui/macrowarnmedium.ui19
3 files changed, 28 insertions, 5 deletions
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index e5e1a46fdb97..e526b6da8b99 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -43,6 +43,7 @@ MacroWarning::MacroWarning(weld::Window* pParent, bool _bWithSignatures)
, mxNotYetValid(m_xBuilder->weld_label("certNotYetValidLabel"))
, mxNoLongerValid(m_xBuilder->weld_label("certNoLongerValidLabel"))
, mxViewSignsBtn(m_xBuilder->weld_button("viewSignsButton"))
+ , mxViewCertBtn(m_xBuilder->weld_button("viewCertButton"))
, mxAlwaysTrustCB(m_xBuilder->weld_check_button("alwaysTrustCheckbutton"))
, mxEnableBtn(m_xBuilder->weld_button("ok"))
, mxDisableBtn(m_xBuilder->weld_button("cancel"))
@@ -131,10 +132,12 @@ void MacroWarning::InitControls()
// show signature controls?
if (mbShowSignatures)
{
+ mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, AlwaysTrustCheckHdl));
mxAlwaysTrustCB->set_sensitive(false);
mxViewSignsBtn->connect_clicked(LINK(this, MacroWarning, ViewSignsBtnHdl));
- mxViewSignsBtn->set_sensitive(false);
- mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, AlwaysTrustCheckHdl));
+ mxViewSignsBtn->set_visible(false);
+ mxViewCertBtn->connect_clicked(LINK(this, MacroWarning, ViewSignsBtnHdl));
+ mxViewCertBtn->set_visible(false);
mnActSecLevel = SvtSecurityOptions::GetMacroSecurityLevel();
if ( mnActSecLevel >= 2 )
@@ -168,7 +171,8 @@ void MacroWarning::SetStorage( const css::uno::Reference < css::embed::XStorage
}
mxSignsFI->set_label(s.makeStringAndClear());
- mxViewSignsBtn->set_sensitive(true);
+ mxViewSignsBtn->set_visible(true);
+ mxViewCertBtn->set_visible(false);
}
void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCertificate >& _rxCert )
@@ -186,7 +190,8 @@ void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCe
utl::typeConvert( mxCert->getNotValidAfter(), aDateTimeEnd );
mxNotYetValid->set_visible(now < aDateTimeStart);
mxNoLongerValid->set_visible(now > aDateTimeEnd);
- mxViewSignsBtn->set_sensitive(true);
+ mxViewSignsBtn->set_visible(false);
+ mxViewCertBtn->set_visible(true);
}
}
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 1a6e7f0b7380..80f1fb76599e 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -35,6 +35,7 @@ private:
std::unique_ptr<weld::Label> mxNotYetValid;
std::unique_ptr<weld::Label> mxNoLongerValid;
std::unique_ptr<weld::Button> mxViewSignsBtn;
+ std::unique_ptr<weld::Button> mxViewCertBtn;
std::unique_ptr<weld::CheckButton> mxAlwaysTrustCB;
std::unique_ptr<weld::Button> mxEnableBtn;
std::unique_ptr<weld::Button> mxDisableBtn;
diff --git a/uui/uiconfig/ui/macrowarnmedium.ui b/uui/uiconfig/ui/macrowarnmedium.ui
index 810fbbb6d12b..4d7a416e83e9 100644
--- a/uui/uiconfig/ui/macrowarnmedium.ui
+++ b/uui/uiconfig/ui/macrowarnmedium.ui
@@ -125,7 +125,7 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
</child>
<child>
<object class="GtkButton" id="viewSignsButton">
- <property name="label" translatable="yes" context="macrowarnmedium|viewSignsButton">_View Signatures…</property>
+ <property name="label" translatable="yes" context="macrowarnmedium|viewSignsButton">_Show Signatures…</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
@@ -140,6 +140,23 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="viewCertButton">
+ <property name="label" translatable="yes" context="macrowarnmedium|viewCertButton">_Show Certificate…</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="hexpand">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">0</property>