Kaydet (Commit) ed901c33 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Andras Timar

Make the Help URL configurable

When the Help URL is blank, the Help
buttons are hidden LOK (but not desktop).

Change-Id: Ibd76452108d1e3a92fb43f2c0af0586b0cbed073
Reviewed-on: https://gerrit.libreoffice.org/69071Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/69142
Tested-by: Jenkins
üst 1634a6d9
......@@ -266,6 +266,8 @@ private:
HelpButton( const HelpButton & ) = delete;
HelpButton & operator= ( const HelpButton & ) = delete;
virtual void StateChanged( StateChangedType nStateChange ) override;
public:
explicit HelpButton( vcl::Window* pParent, WinBits nStyle = 0 );
......
......@@ -3592,6 +3592,13 @@
</info>
<value>Default</value>
</prop>
<prop oor:name="HelpRootURL" oor:type="xs:string" oor:nillable="false">
<info>
<desc>Specifies the root URL to the Office help pages. Blank disables
Help buttons on dialogs in LibreOffice Online.</desc>
</info>
<value>https://help.libreoffice.com/help.html?</value>
</prop>
<group oor:name="StartCenter">
<info>
<desc>Contains settings for the start center.</desc>
......
......@@ -71,6 +71,7 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewsh.hxx>
#include <officecfg/Office/Common.hxx>
#include "newhelp.hxx"
#include <sfx2/objsh.hxx>
......@@ -691,12 +692,11 @@ bool SfxHelp::Start(const OUString& rURL, weld::Widget* pWidget)
/// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org
static bool impl_showOnlineHelp( const OUString& rURL )
{
OUString aInternal( "vnd.sun.star.help://" );
static const OUString aInternal("vnd.sun.star.help://");
if ( rURL.getLength() <= aInternal.getLength() || !rURL.startsWith(aInternal) )
return false;
OUString aHelpLink( "https://help.libreoffice.org/help.html?" );
OUString aHelpLink = officecfg::Office::Common::Help::HelpRootURL::get();
OUString aTarget = "Target=" + rURL.copy(aInternal.getLength());
aTarget = aTarget.replaceAll("%2F", "/").replaceAll("?", "&");
aHelpLink += aTarget;
......
......@@ -46,6 +46,8 @@
#include <osl/diagnose.h>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/lok.hxx>
#include <officecfg/Office/Common.hxx>
using namespace css;
......@@ -1811,6 +1813,16 @@ void HelpButton::Click()
PushButton::Click();
}
void HelpButton::StateChanged( StateChangedType nStateChange )
{
// Hide when we have no help URL.
if (comphelper::LibreOfficeKit::isActive() &&
officecfg::Office::Common::Help::HelpRootURL::get().isEmpty())
Hide();
else
PushButton::StateChanged(nStateChange);
}
void RadioButton::ImplInitRadioButtonData()
{
mbChecked = false;
......
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