include/svtools/strings.hrc | 6 +- officecfg/registry/data/org/openoffice/Office/Common.xcu | 3 + officecfg/registry/schema/org/openoffice/Office/Common.xcs | 5 ++ svtools/source/java/javainteractionhandler.cxx | 28 +++++++------ 4 files changed, 27 insertions(+), 15 deletions(-)
New commits: commit 2048a5afc9b1c6340cea594c4ead75914b358e74 Author: Bryan Gazali <[email protected]> AuthorDate: Sat Oct 3 01:46:48 2020 -0400 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Oct 28 19:08:05 2020 +0100 tdf#125379 updated javainteractionhandler.cxx to add a link for the JRE missing warning Change-Id: Iac940b24a9fbe914af46fe928b758ad962d3d3e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103881 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Mike Kaganski <[email protected]> diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc index c8b84f0e53a4..e07a94f6aa2b 100644 --- a/include/svtools/strings.hrc +++ b/include/svtools/strings.hrc @@ -261,9 +261,9 @@ #define STR_SVT_DEFAULT_SERVICE_LABEL NC_("STR_SVT_DEFAULT_SERVICE_LABEL", "$user$'s $service$") -#define STR_WARNING_JAVANOTFOUND NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.") -#define STR_WARNING_JAVANOTFOUND_WIN NC_("STR_WARNING_JAVANOTFOUND_WIN", "%PRODUCTNAME requires a %BITNESS-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.") -#define STR_WARNING_JAVANOTFOUND_MAC NC_("STR_WARNING_JAVANOTFOUND_MAC", "%PRODUCTNAME requires Oracle's Java Development Kit (JDK) on macOS 10.10 or greater to perform this task. Please install them and restart %PRODUCTNAME.") +#define STR_WARNING_JAVANOTFOUND NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME. %FAQLINK") +#define STR_WARNING_JAVANOTFOUND_WIN NC_("STR_WARNING_JAVANOTFOUND_WIN", "%PRODUCTNAME requires a %BITNESS-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME. %FAQLINK") +#define STR_WARNING_JAVANOTFOUND_MAC NC_("STR_WARNING_JAVANOTFOUND_MAC", "%PRODUCTNAME requires Oracle's Java Development Kit (JDK) on macOS 10.10 or greater to perform this task. Please install them and restart %PRODUCTNAME. %FAQLINK") #define STR_WARNING_INVALIDJAVASETTINGS_MAC NC_("STR_WARNING_INVALIDJAVASETTINGS_MAC", "The %PRODUCTNAME configuration has been changed. Under %PRODUCTNAME - Preferences - %PRODUCTNAME - Advanced, select the Java runtime environment you want to have used by %PRODUCTNAME.") #define STR_WARNING_INVALIDJAVASETTINGS NC_("STR_WARNING_INVALIDJAVASETTINGS", "The %PRODUCTNAME configuration has been changed. Under Tools - Options - %PRODUCTNAME - Advanced, select the Java runtime environment you want to have used by %PRODUCTNAME.") #define STR_ERROR_JVMCREATIONFAILED_MAC NC_("STR_ERROR_JVMCREATIONFAILED_MAC", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under %PRODUCTNAME - Preferences - %PRODUCTNAME - Advanced.") diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 2ae05c749fc6..e4c3fca51f7e 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -376,6 +376,9 @@ <prop oor:name="ReleaseNotesURL" oor:type="xs:string"> <value>https://hub.libreoffice.org/ReleaseNotes/</value> </prop> + <prop oor:name="InstallJavaURL" oor:type="xs:string"> + <value>https://hub.libreoffice.org/InstallJava/</value> + </prop> </node> <node oor:name="Forms"> <node oor:name="ControlLayout"> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index f0420ec158cd..02e62d950ed2 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2131,6 +2131,11 @@ <desc>Specifies the URL used with the UNO command WhatsNew (SID_WHATSNEW).</desc> </info> </prop> + <prop oor:name="InstallJavaURL" oor:type="xs:string" oor:nillable="false"> + <info> + <desc>Specifies the URL used for Install Java message box.</desc> + </info> + </prop> </group> <group oor:name="History"> <!-- OldLocation: soffice.ini --> diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index e484eb56a0ac..ce360463b6dc 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -34,6 +34,8 @@ #include <svtools/restartdialog.hxx> #include <svtools/svtresid.hxx> #include <svtools/javainteractionhandler.hxx> +#include <unotools/configmgr.hxx> +#include <officecfg/Office/Common.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::task; @@ -126,23 +128,25 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque if( !g_JavaEvents.bNotFoundHandled ) { // No suitable JRE found + OUString sPrimTex; + OUString urlLink(officecfg::Office::Common::Menus::InstallJavaURL::get() + // https://hub.libreoffice.org/InstallJava/ + "?LOlocale=" + utl::ConfigManager::getUILocale()); g_JavaEvents.bNotFoundHandled = true; -#if defined( MACOSX ) - std::unique_ptr<weld::MessageDialog> xWarningBox(Application::CreateMessageDialog(nullptr, - VclMessageType::Warning, VclButtonsType::Ok, SvtResId(STR_WARNING_JAVANOTFOUND_MAC))); -#elif defined( _WIN32 ) - std::unique_ptr<weld::MessageDialog> xWarningBox(Application::CreateMessageDialog(nullptr, - VclMessageType::Warning, VclButtonsType::Ok, SvtResId(STR_WARNING_JAVANOTFOUND_WIN))); - OUString sPrimTex = xWarningBox->get_primary_text(); -#if defined( _WIN64 ) - xWarningBox->set_primary_text(sPrimTex.replaceAll( "%BITNESS", "64" )); +#if defined(MACOSX) + sPrimTex = SvtResId(STR_WARNING_JAVANOTFOUND_MAC); +#elif defined(_WIN32) + sPrimTex = SvtResId(STR_WARNING_JAVANOTFOUND_WIN); +#if defined(_WIN64) + sPrimTex = sPrimTex.replaceAll("%BITNESS", "64"); #else - xWarningBox->set_primary_text(sPrimTex.replaceAll( "%BITNESS", "32" )); + sPrimTex = sPrimTex.replaceAll("%BITNESS", "32"); #endif #else - std::unique_ptr<weld::MessageDialog> xWarningBox(Application::CreateMessageDialog(nullptr, - VclMessageType::Warning, VclButtonsType::Ok, SvtResId(STR_WARNING_JAVANOTFOUND))); + sPrimTex = SvtResId(STR_WARNING_JAVANOTFOUND); #endif + sPrimTex = sPrimTex.replaceAll("%FAQLINK", urlLink); + std::unique_ptr<weld::MessageDialog> xWarningBox(Application::CreateMessageDialog( + nullptr, VclMessageType::Warning, VclButtonsType::Ok, sPrimTex)); xWarningBox->set_title(SvtResId(STR_WARNING_JAVANOTFOUND_TITLE)); nResult = xWarningBox->run(); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
