summaryrefslogtreecommitdiff
path: root/desktop/source/app/app.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r--desktop/source/app/app.cxx66
1 files changed, 48 insertions, 18 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ede5fdf7511a..14422298b2aa 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -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(" [");
@@ -1400,7 +1426,7 @@ void Desktop::Main()
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())
@@ -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)
{