summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-12-09 12:24:01 +0000
committerOliver Bolte <obo@openoffice.org>2009-12-09 12:24:01 +0000
commit5d54f34507205fdc88ca59d7d6c22464c6be06e7 (patch)
treef8ed9b17a414c6298fdcdaec7fef33d058bf20ef /desktop/source
parenta4cc452f9b7cb84d418cf594adcc02c534fe9c39 (diff)
CWS-TOOLING: integrate CWS fwk128
2009-12-03 15:16:35 +0100 mav r277713 : #i10000# remove unused variable 2009-12-03 11:37:54 +0100 mav r277710 : #i105172# allow to request storing of documents from the user on session shutdown 2009-12-03 11:22:54 +0100 mav r277709 : #i105172# PL:extend session management 2009-12-03 11:20:53 +0100 mav r277708 : #i105172# PL:extend session management 2009-11-26 15:15:24 +0100 mav r277660 : #i105172# try to store documents on shutdown 2009-11-26 15:13:55 +0100 mav r277658 : #i105172# PL: implement cancelShutdown
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/app.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index aadf6bc625..26866269b7 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -937,6 +937,29 @@ void Desktop::retrieveCrashReporterState()
_bCrashReporterEnabled = bEnabled;
}
+sal_Bool Desktop::isUIOnSessionShutdownAllowed()
+{
+ static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
+ static const ::rtl::OUString CFG_PATH_SESSION = ::rtl::OUString::createFromAscii("SessionShutdown" );
+ static const ::rtl::OUString CFG_ENTRY_UIENABLED = ::rtl::OUString::createFromAscii("DocumentStoreUIEnabled" );
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+
+ sal_Bool bResult = sal_False;
+ if ( xSMGR.is() )
+ {
+ css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ xSMGR,
+ CFG_PACKAGE_RECOVERY,
+ CFG_PATH_SESSION,
+ CFG_ENTRY_UIENABLED,
+ ::comphelper::ConfigurationHelper::E_READONLY);
+ aVal >>= bResult;
+ }
+
+ return bResult;
+}
+
//-----------------------------------------------
/** @short check if crash reporter feature is enabled or
disabled.
@@ -2458,7 +2481,15 @@ void Desktop::OpenClients()
{
xSessionListener = Reference< XInitialization >(::comphelper::getProcessServiceFactory()->createInstance(
OUString::createFromAscii("com.sun.star.frame.SessionListener")), UNO_QUERY_THROW);
- xSessionListener->initialize(Sequence< Any >(0));
+
+ // specifies whether the UI-interaction on Session shutdown is allowed
+ sal_Bool bAllowUI = isUIOnSessionShutdownAllowed();
+ css::beans::NamedValue aProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowUserInteractionOnQuit" ) ),
+ css::uno::makeAny( bAllowUI ) );
+ css::uno::Sequence< css::uno::Any > aArgs( 1 );
+ aArgs[0] <<= aProperty;
+
+ xSessionListener->initialize( aArgs );
}
catch(const com::sun::star::uno::Exception& e)
{