summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOlivier Hallot <ohallot@collabora.co.uk>2016-07-07 19:57:48 -0300
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-08-11 14:23:28 +0000
commit20469b56502687f85ce0fa9e5f7a50273daa3e91 (patch)
treeb1810e0c873fa02b3c4be10901fc233451b3fcec /sfx2
parent1fcb7eafd95ebed7f5532d86a8cd8cd89196883e (diff)
tdf#96015 (part) links to Askbot in the Help menu
Add the entry "~Get help online" to the modules Help menu. on click, the system browser opens http://hub.libreoffice.org/forum/?&LOlang=<lang> <lang> 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 <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/appslots.sdi4
-rw-r--r--sfx2/sdi/sfx.sdi15
-rw-r--r--sfx2/source/appl/appserv.cxx23
3 files changed, 42 insertions, 0 deletions
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;