summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-12-14 08:30:15 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-12-14 16:12:45 +0100
commitdb8d97a1906870f8b83415ef8335822da0179a64 (patch)
treed41abb24b715e39ec5c2796cddbbe40c1715044d /uui
parent7bf02b035033c87ebd61742dbd3f71da0229114f (diff)
tdf#158576 Explain why OK btn is disabled
User needs to view (verify) the cert first Change-Id: I52ce64678abc3b9f95a384e4082eaee1abf0549a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160755 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'uui')
-rw-r--r--uui/inc/strings.hrc1
-rw-r--r--uui/source/secmacrowarnings.cxx16
-rw-r--r--uui/source/secmacrowarnings.hxx1
3 files changed, 15 insertions, 3 deletions
diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc
index db6c83e777fb..6a26f10ac69b 100644
--- a/uui/inc/strings.hrc
+++ b/uui/inc/strings.hrc
@@ -79,5 +79,6 @@
#define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?")
#define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload")
#define STR_LOADREADONLY_MSG NC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?")
+#define STR_VERIFIY_CERT NC_("STR_VERIFIY_CERT", "You need to view the certificate first.")
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index eb93c9d13815..f1cddb11cb9f 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -26,11 +26,14 @@
#include <tools/datetime.hxx>
#include <tools/debug.hxx>
#include <unotools/datetime.hxx>
+#include <unotools/resmgr.hxx>
#include <unotools/securityoptions.hxx>
#include <tools/urlobj.hxx>
#include "secmacrowarnings.hxx"
+#include <strings.hrc>
+
using namespace ::com::sun::star::security;
using namespace ::com::sun::star;
@@ -116,7 +119,7 @@ IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl, weld::Button&, void)
return;
mxAlwaysTrustCB->set_sensitive(true);
- mxEnableBtn->set_sensitive(true);
+ EnableOkBtn(true);
}
IMPL_LINK_NOARG(MacroWarning, EnableBtnHdl, weld::Button&, void)
@@ -148,7 +151,7 @@ IMPL_LINK_NOARG(MacroWarning, DisableBtnHdl, weld::Button&, void)
IMPL_LINK_NOARG(MacroWarning, AlwaysTrustCheckHdl, weld::Toggleable&, void)
{
const bool bEnable = (mnActSecLevel < 3 || mxAlwaysTrustCB->get_active());
- mxEnableBtn->set_sensitive(bEnable);
+ EnableOkBtn(bEnable);
mxDisableBtn->set_sensitive(!mxAlwaysTrustCB->get_active());
}
@@ -166,7 +169,7 @@ void MacroWarning::InitControls()
mnActSecLevel = SvtSecurityOptions::GetMacroSecurityLevel();
if ( mnActSecLevel >= 2 )
- mxEnableBtn->set_sensitive(false);
+ EnableOkBtn(false);
}
else
{
@@ -174,6 +177,13 @@ void MacroWarning::InitControls()
}
}
+void MacroWarning::EnableOkBtn(bool bEnable)
+{
+ mxEnableBtn->set_sensitive(bEnable);
+ std::locale aResLocale(Translate::Create("uui"));
+ mxEnableBtn->set_tooltip_text(bEnable ? "" : Translate::get(STR_VERIFIY_CERT, aResLocale));
+}
+
void MacroWarning::SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStore,
const OUString& aODFVersion,
const css::uno::Sequence< security::DocumentSignatureInformation >& rInfos )
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 80f1fb76599e..463ccf1d9091 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -55,6 +55,7 @@ private:
DECL_STATIC_LINK(MacroWarning, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
void InitControls();
+ void EnableOkBtn(bool bEnable);
public:
MacroWarning(weld::Window* pParent, bool _bShowSignatures);