summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOlivier <olivier.hallot@libreoffice.org>2017-02-27 16:49:07 -0300
committerEike Rathke <erack@redhat.com>2017-07-04 15:47:41 +0200
commit9cb1fe80b2dfd3684205277f5222df3d743d09d7 (patch)
tree411939ebc27a5f8bbb8e38ec4dba9a975fdea58d /sfx2
parent209cc5c211260a6c20cc6fb5ac02fd5a88100314 (diff)
tdf#105831 Add Donate entry on Help menu
The full implementation depends on infra Task #2179 https://redmine.documentfoundation.org/issues/2179 revision1: change to https, per demand of #2179 Removed ellipsis Code changed as suggested Change call to pass BCP47 string, with language as fallback. task #2179 will be reviewed accordingly. Change-Id: I573542da0f394d7128faab0106df852d622c98b3 Reviewed-on: https://gerrit.libreoffice.org/34693 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.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, 32 insertions, 10 deletions
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index 12ad63616f37..5f228a2ff137 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -137,6 +137,10 @@ interface Application
[
ExecMethod = MiscExec_Impl ;
]
+ SID_DONATION
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
SID_SHOW_LICENSE
[
ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 03b536d3c4d6..c69d7699410b 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4844,6 +4844,21 @@ SfxVoidItem Documentation SID_DOCUMENTATION
MenuConfig = TRUE,
GroupId = GID_APPLICATION;
]
+SfxVoidItem Donation SID_DONATION
+()
+[
+ 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 a4a8b84dae44..d9910d314a70 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -493,7 +493,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_SEND_FEEDBACK:
{
OUString module = SfxHelp::GetCurrentModuleIdentifier();
- OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
+ OUString sURL("https://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
"&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf('.') + 1 ) );
sfx2::openUriExternally(sURL, false);
break;
@@ -503,21 +503,24 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
// 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);
+ OUString aLang = LanguageTag(utl::ConfigManager::getLocale()).getLanguage();
+ OUString sURL("https://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());
+ OUString sURL("https://hub.libreoffice.org/documentation/?LOlocale=" + utl::ConfigManager::getLocale());
+ sfx2::openUriExternally(sURL, false);
+ break;
+ }
+ case SID_DONATION:
+ {
+ // Open donation page based on language + script (BCP47) with language as fall back.
+ OUString aLang = LanguageTag(utl::ConfigManager::getLocale()).getLanguage();
+ OUString aBcp47 = LanguageTag(utl::ConfigManager::getLocale()).getBcp47();
+ OUString sURL("https://hub.libreoffice.org/donation/?BCP47=" + aBcp47 + "&LOlang=" + aLang );
sfx2::openUriExternally(sURL, false);
break;
}