From 20469b56502687f85ce0fa9e5f7a50273daa3e91 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Thu, 7 Jul 2016 19:57:48 -0300 Subject: tdf#96015 (part) links to Askbot in the Help menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the entry "~Get help online" to the modules Help menu. on click, the system browser opens http://hub.libreoffice.org/forum/?&LOlang= is obtained from .getLocale() That in turn will redirect to e.g. askbot (but only few languages are using it at the moment) or other nl-specific resources. (nl-projects can request corresponding targets from infa, without the need to change the code – cf rdm#1983) The link can/should be extended to also include the version of LO and the currently used module to allow finer grained redirects. Change-Id: I56108dba4dd2684405623c4586103fc8ff9bea56 Reviewed-on: https://gerrit.libreoffice.org/27028 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier --- sfx2/sdi/appslots.sdi | 4 ++++ sfx2/sdi/sfx.sdi | 15 +++++++++++++++ sfx2/source/appl/appserv.cxx | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) (limited to 'sfx2') diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index 962eac3a716e..85191e6666fb 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -151,6 +151,10 @@ interface Application [ ExecMethod = MiscExec_Impl ; ] + SID_Q_AND_A + [ + ExecMethod = MiscExec_Impl ; + ] SID_SHOW_LICENSE [ ExecMethod = MiscExec_Impl ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 3edca8d4162a..023c84af7dd0 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5064,6 +5064,21 @@ SfxVoidItem SendFeedback SID_SEND_FEEDBACK ToolBoxConfig = TRUE, GroupId = GID_APPLICATION; ] +SfxVoidItem QuestionAnswers SID_Q_AND_A +() +[ + 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 1f2c3dda91ef..7a0d18a3f7ee 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -451,6 +451,29 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) break; } + case SID_Q_AND_A: + { + // Askbot has URL's normalized to languages, not locales + // Get language from locale: ll or lll or ll-CC or lll-CC + sal_Int32 ix = utl::ConfigManager::getLocale().indexOf("-",0); + OUString aLang; + if (ix == -1) + aLang = utl::ConfigManager::getLocale(); + 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& ) + { + } + break; + } case SID_SHOW_LICENSE: { ScopedVclPtrInstance< LicenseDialog > aDialog; -- cgit