diff options
author | Olivier Hallot <ohallot@collabora.co.uk> | 2016-09-10 13:38:52 -0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-10-19 16:07:33 +0000 |
commit | e91a1abe4c53ea3a1ac59e3c1d5dddf98141a4ee (patch) | |
tree | 443334d94087fa92e2ee38d0a2165e2d32109374 /sfx2 | |
parent | af84c70c95e99935d2efdb98bc105d2a7852ebda (diff) |
tdf#96015 (part) link to Doc'tation in Help menu
Add the entry "Documentation" to the modules Help menu.
on click, the system browser opens
http://hub.libreoffice.org/documentation/?&LOlang=<locale>
<locale> is obtained from .getLocale()
Patch2: create a member with try/catch for external URLs
Patch3
Use sfx2::openUriExternally
Revert to User Guides.. in UI.
Change-Id: I8332253c31bd3be330cdd794f9e056b632b38037
Patch4: remove 1st '&' in URLs
Reviewed-on: https://gerrit.libreoffice.org/28817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/appslots.sdi | 4 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 14 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 32 |
3 files changed, 30 insertions, 20 deletions
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index 5df800d52389..bd03c1276b0f 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -155,6 +155,10 @@ interface Application [ ExecMethod = MiscExec_Impl ; ] + SID_DOCUMENTATION + [ + ExecMethod = MiscExec_Impl ; + ] SID_SHOW_LICENSE [ ExecMethod = MiscExec_Impl ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index edf0ea2b0382..e45cf6da194c 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5096,7 +5096,21 @@ SfxVoidItem QuestionAnswers SID_Q_AND_A MenuConfig = TRUE, GroupId = GID_APPLICATION; ] +SfxVoidItem Documentation SID_DOCUMENTATION +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + AccelConfig = TRUE, + MenuConfig = TRUE, + GroupId = GID_APPLICATION; +] SfxVoidItem ShowLicense SID_SHOW_LICENSE () diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index defd3b601d8b..6717966125b3 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -136,6 +136,8 @@ #include <officecfg/Setup.hxx> #include <memory> +#include "openuriexternally.hxx" + using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; @@ -497,15 +499,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) OUString module = SfxHelp::GetCurrentModuleIdentifier(); OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() + "&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf('.') + 1 ) ); - try - { - uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( - css::system::SystemShellExecute::create(::comphelper::getProcessComponentContext()) ); - xSystemShellExecute->execute( sURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY ); - } - catch ( uno::Exception& ) - { - } + sfx2::openUriExternally(sURL, false); break; } @@ -520,16 +514,15 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) else aLang = utl::ConfigManager::getLocale().copy(0,ix); - OUString sURL("http://hub.libreoffice.org/forum/?&LOlang=" + aLang); - try - { - uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( - css::system::SystemShellExecute::create(::comphelper::getProcessComponentContext()) ); - xSystemShellExecute->execute( sURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY ); - } - catch ( uno::Exception& ) - { - } + OUString sURL("http://hub.libreoffice.org/forum/?LOlang=" + aLang); + sfx2::openUriExternally(sURL, false); + break; + } + case SID_DOCUMENTATION: + { + // Open documentation page based on locales + OUString sURL("http://hub.libreoffice.org/documentation/?LOlocale=" + utl::ConfigManager::getLocale()); + sfx2::openUriExternally(sURL, false); break; } case SID_SHOW_LICENSE: @@ -1016,7 +1009,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) rReq.Done(); } - void SfxApplication::MiscState_Impl(SfxItemSet &rSet) { const sal_uInt16 *pRanges = rSet.GetRanges(); |