diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-10-07 18:19:25 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-10-10 09:31:28 +0200 |
commit | f9a427680f59be8591b5e5d750ce0189a6becd54 (patch) | |
tree | b18ee924bc4732db60ac52ed4c7c9427a6cd5ff1 /desktop | |
parent | 8ac6b51cc484a36bfd789588a03cbf8e978e4236 (diff) |
Show dialog when starting in safe mode
Change-Id: Ie4b5f5b7309735dfa844bbaba9cb2763a3de3dc1
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3456db21e578..bb836d235b6d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1056,6 +1056,22 @@ void handleCrashReport() } #endif +void handleSafeMode() +{ + static const char SERVICENAME_SAFEMODE[] = "com.sun.star.comp.svx.SafeModeUI"; + + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + + Reference< css::frame::XSynchronousDispatch > xSafeModeUI( + xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_SAFEMODE, xContext), + css::uno::UNO_QUERY_THROW); + + css::util::URL aURL; + css::uno::Any aRet = xSafeModeUI->dispatchWithReturnValue(aURL, css::uno::Sequence< css::beans::PropertyValue >()); + bool bRet = false; + aRet >>= bRet; +} + /** @short check if recovery must be started or not. @param bCrashed [boolean ... out!] @@ -2029,6 +2045,11 @@ void Desktop::OpenClients() // need some time, where the user won't see any results and wait for finishing the office startup... bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless() ); + // Enter safe mode if requested + if (rArgs.IsSafeMode()) + handleSafeMode(); + + #if HAVE_FEATURE_BREAKPAD if (crashReportInfoExists()) handleCrashReport(); |