diff options
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r-- | desktop/source/app/app.cxx | 82 |
1 files changed, 56 insertions, 26 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index aadf6bc625..658212ec1d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -114,18 +114,19 @@ #include <unotools/ucbhelper.hxx> #include <tools/tempfile.hxx> #include <tools/urlobj.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <osl/module.h> #include <osl/file.hxx> #include <osl/signal.h> #include <rtl/uuid.h> -#include <svtools/pathoptions.hxx> -#include <svtools/languageoptions.hxx> -#include <svtools/internaloptions.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/languageoptions.hxx> +#include <unotools/internaloptions.hxx> #include <svtools/miscopt.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/syslocaleoptions.hxx> -#include <svtools/folderrestriction.hxx> +#include <unotools/syslocaleoptions.hxx> +#include <unotools/syslocale.hxx> +#include <svl/folderrestriction.hxx> #include <unotools/tempfile.hxx> #include <rtl/logfile.hxx> #include <rtl/ustrbuf.hxx> @@ -147,9 +148,9 @@ #include <svtools/fontsubstconfig.hxx> #include <svtools/accessibilityoptions.hxx> #include <svtools/apearcfg.hxx> -#include <svtools/misccfg.hxx> +#include <unotools/misccfg.hxx> #include <svtools/filter.hxx> -#include <svtools/regoptions.hxx> +#include <unotools/regoptions.hxx> #include "langselect.hxx" @@ -937,6 +938,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. @@ -1323,13 +1347,15 @@ void Desktop::Main() } String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String(); delete pLabelResMgr; - +/* + // locale and UI locale in AppSettings are now retrieved from configuration or system directly via SvtSysLocale + // no reason to set while starting // set UI language and locale RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ set locale settings" ); //LanguageSelection langselect; OUString aUILocaleString = LanguageSelection::getLanguageString(); Locale aUILocale = LanguageSelection::IsoStringToLocale(aUILocaleString); - LanguageType eLanguage = SvtSysLocaleOptions().GetLocaleLanguageType(); + LanguageType eLanguage = SvtSysLocale().GetLanguage(); // #i39040#, do not call anything between GetSettings and SetSettings that might have // a side effect on the settings (like, eg, SvtSysLocaleOptions().GetLocaleLanguageType(), @@ -1339,7 +1365,7 @@ void Desktop::Main() aSettings.SetLanguage( eLanguage ); Application::SetSettings( aSettings ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" ); - +*/ // Check for StarOffice/Suite specific extensions runs also with OpenOffice installation sets OUString aTitleString( aTitle ); @@ -1349,7 +1375,7 @@ void Desktop::Main() else aTitle = aTitleString; -#ifndef PRODUCT +#ifdef DBG_UTIL //include version ID in non product builds ::rtl::OUString aDefault; aTitle += DEFINE_CONST_UNICODE(" ["); @@ -1397,10 +1423,10 @@ void Desktop::Main() if ( ! pCmdLineArgs->IsNoFirstStartWizard()) { RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ FirstStartWizard" ); - + if (IsFirstStartWizardNeeded()) { - ::svt::RegOptions().removeReminder(); // remove patch registration reminder + ::utl::RegOptions().removeReminder(); // remove patch registration reminder Reference< XJob > xFirstStartJob( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.comp.desktop.FirstStart" ) ), UNO_QUERY ); if (xFirstStartJob.is()) @@ -1411,7 +1437,7 @@ void Desktop::Main() lArgs[0].Value <<= LicenseNeedsAcceptance(); lArgs[1].Name = ::rtl::OUString::createFromAscii("LicensePath"); lArgs[1].Value <<= GetLicensePath(); - + xFirstStartJob->execute(lArgs) >>= bDone; if ( !bDone ) { @@ -1421,7 +1447,7 @@ void Desktop::Main() } else if ( RegistrationPage::hasReminderDateCome() ) RegistrationPage::executeSingleMode(); - + RTL_LOGFILE_CONTEXT_TRACE( aLog, "} FirstStartWizard" ); } @@ -1834,10 +1860,6 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* ) hStyleSettings.SetDragFullOptions( nDragFullOptions ); rSettings.SetStyleSettings ( hStyleSettings ); - - MiscSettings aMiscSettings( rSettings.GetMiscSettings() ); - aMiscSettings.SetTwoDigitYearStart( (USHORT) SfxMiscCfg().GetYear2000() ); - rSettings.SetMiscSettings( aMiscSettings ); } // ======================================================================== @@ -2458,7 +2480,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) { @@ -2486,7 +2516,7 @@ void Desktop::OpenClients() } } } - + OfficeIPCThread::EnableRequests(); sal_Bool bShutdown( sal_False ); @@ -2823,11 +2853,11 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xDesktop( xSMGR->createInstance( OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), ::com::sun::star::uno::UNO_QUERY ); - + // check provider ... we know it's weak reference only if ( ! xDesktop.is()) return; - + css::uno::Reference< css::util::XURLTransformer > xParser(xSMGR->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), css::uno::UNO_QUERY_THROW); css::util::URL aCommand; if( rAppEvent.GetData().EqualsAscii( "PREFERENCES" ) ) @@ -2837,7 +2867,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) if( aCommand.Complete.getLength() ) { xParser->parseStrict(aCommand); - + css::uno::Reference< css::frame::XDispatch > xDispatch = xDesktop->queryDispatch(aCommand, rtl::OUString(), 0); if (xDispatch.is()) xDispatch->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >()); |