diff options
author | Matt K <mattkse@gmail.com> | 2023-07-25 19:32:11 -0500 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-08-02 08:25:37 +0200 |
commit | efae7b4a1f7248b01e8cd95577c09d772cfe5709 (patch) | |
tree | ac402f120dbb5283817c5eb36ae44366ab2afc8e /desktop | |
parent | b6b26421a1029b18b48b69dbdac4bb70fb622604 (diff) |
tdf#129713 Output message when using "--cat" with other LO instances running
This change modifies the code that determines whether a 2nd LibreOffice
instance is running during the startup of the new soffice.bin process.
In that section of code, we simply write a new error message to console
and pop-up a message box via FatalError. The message tells the user
that they should close other LibreOffice processes if they want to use
the "--cat" or "--script-cat" command line options.
Change-Id: I2c2a00c07d733e2f0ed6c0632f0f0d115188b116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154909
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/app.hxx | 3 | ||||
-rw-r--r-- | desktop/inc/strings.hrc | 1 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 9 |
3 files changed, 12 insertions, 1 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 3372e751dbf1..9d6ac9864a52 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -58,7 +58,8 @@ class Desktop final : public Application BE_LANGUAGE_MISSING, BE_USERINSTALL_NOTENOUGHDISKSPACE, BE_USERINSTALL_NOWRITEACCESS, - BE_OFFICECONFIG_BROKEN + BE_OFFICECONFIG_BROKEN, + BE_2NDOFFICE_WITHCAT, }; enum BootstrapStatus { diff --git a/desktop/inc/strings.hrc b/desktop/inc/strings.hrc index b18117bb5a0d..f4af7ad24602 100644 --- a/desktop/inc/strings.hrc +++ b/desktop/inc/strings.hrc @@ -163,6 +163,7 @@ #define STR_BOOTSTRAP_ERR_LANGUAGE_MISSING NC_("STR_BOOTSTRAP_ERR_LANGUAGE_MISSING", "The user interface language cannot be determined.") #define STR_BOOTSTRAP_ERR_USERINSTALL_FAILED NC_("STR_BOOTSTRAP_ERR_USERINSTALL_FAILED", "User installation could not be completed. ") #define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE NC_("STR_BOOTSTRAP_ERR_NO_CFG_SERVICE", "The configuration service is not available.") +#define STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT NC_("STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT", "There is already another %PRODUCTNAME instance running. Please close all %PRODUCTNAME processes before running with the '--cat' or '--script-cat' option.") #define STR_ASK_START_SETUP_MANUALLY NC_("STR_ASK_START_SETUP_MANUALLY", "Start the setup application to repair the installation from the CD or the folder containing the installation packages.") #define STR_CONFIG_ERR_ACCESS_GENERAL NC_("STR_CONFIG_ERR_ACCESS_GENERAL", "A general error occurred while accessing your central configuration. ") #define STR_LO_MUST_BE_RESTARTED NC_("STR_LO_MUST_BE_RESTARTED", "%PRODUCTNAME must unfortunately be manually restarted once after installation or update." ) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e4058bfe8932..cb3beaf0ae26 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -523,6 +523,10 @@ void Desktop::Init() else if ( aStatus == RequestHandler::IPC_STATUS_2ND_OFFICE ) { // 2nd office startup should terminate after sending cmdlineargs through pipe + if (rCmdLineArgs.IsTextCat() || rCmdLineArgs.IsScriptCat()) + { + HandleBootstrapErrors( BE_2NDOFFICE_WITHCAT, OUString() ); + } SetBootstrapStatus(BS_TERMINATE); } else if ( !rCmdLineArgs.GetUnknown().isEmpty() @@ -880,6 +884,11 @@ void Desktop::HandleBootstrapErrors( FatalError(MakeStartupErrorMessage(aDiagnosticMessage)); } + else if ( aBootstrapError == BE_2NDOFFICE_WITHCAT ) + { + OUString aDiagnosticMessage = DpResId(STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT); + FatalError(MakeStartupErrorMessage(aDiagnosticMessage)); + } } |