summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-03-10 20:57:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-10 20:57:35 +0100
commit83de4879c3cd416c423dd147be6511a1d074c8c9 (patch)
tree166adc1b48ee819f7f19ed50af21ee50b1ff6ddb
parent45a771ef727585ceb8ebcd4b4627f3aa9bfa9b37 (diff)
Improve error message when URL cannot be opened externally
It need not be due to no browser, but might also be e.g. a misspelled URL like <htp://...>, see mail thread starting at <http://listarchives.libreoffice.org/global/users/msg48090.html> "[libreoffice-users] LO 5.1 Presentation can't find system browser on OSX 10.11." Change-Id: I74ce7abb4e78d72ce9bf92424f66608c6780d2d3
-rw-r--r--sfx2/source/appl/app.src2
-rw-r--r--sfx2/source/appl/openuriexternally.cxx7
2 files changed, 7 insertions, 2 deletions
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index a3cec3ab1f98..aa2024d793e4 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -60,7 +60,7 @@ String STR_QUERY_LASTVERSION
String STR_NO_WEBBROWSER_FOUND
{
- Text [ en-US ] = "%PRODUCTNAME could not find a web browser on your system. Please check your Desktop Preferences or install a web browser (for example, Firefox) in the default location requested during the browser installation." ;
+ Text [ en-US ] = "Opening \"$(ARG1)\" failed with error code $(ARG2) and message: \"$(ARG3)\"\n(Maybe no web browser could be found on your system. In that case, please check your Desktop Preferences or install a web browser (for example, Firefox) in the default location requested during the browser installation.)" ;
};
String STR_NO_ABS_URI_REF
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index 77c412bff0e9..ed702340fb11 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -48,7 +48,7 @@ bool sfx2::openUriExternally(
SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF));
eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", uri));
eb->Execute();
- } catch (css::system::SystemShellExecuteException &) {
+ } catch (css::system::SystemShellExecuteException & e) {
if (!handleSystemShellExecuteException) {
throw;
}
@@ -56,6 +56,11 @@ bool sfx2::openUriExternally(
ScopedVclPtrInstance<MessageDialog> eb(
SfxGetpApp()->GetTopWindow(),
SfxResId(STR_NO_WEBBROWSER_FOUND));
+ eb->set_primary_text(
+ eb->get_primary_text().replaceFirst("$(ARG1)", uri)
+ .replaceFirst("$(ARG2)", OUString::number(e.PosixError))
+ .replaceFirst("$(ARG3)", e.Message));
+ //TODO: avoid subsequent replaceFirst acting on previous replacement
eb->Execute();
}
return false;