diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 11:39:32 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 11:39:32 +0000 |
commit | da56cfc2bd260c21c7ae9c41a64185f4617a9d6e (patch) | |
tree | 574a31f4fc1a1966cc8497631fe8b4570043fa39 /desktop | |
parent | d1ef575b5f82524f202c4adbf8d28470a4d1e14b (diff) |
INTEGRATION: CWS mergebuild (1.124.4); FILE MERGED
2004/05/28 17:44:01 hjs 1.124.4.6: RESYNC: (1.135-1.137); FILE MERGED
2004/05/21 16:55:44 hjs 1.124.4.5: #i8252# switch to Locale
2004/05/18 17:42:55 hjs 1.124.4.4: RESYNC: (1.133-1.135); FILE MERGED
2004/04/21 06:58:35 hjs 1.124.4.3: RESYNC: (1.124-1.133); FILE MERGED
2004/01/29 15:41:40 hjs 1.124.4.2: #i8252# chng. resmgr creation parameters from LanguageType to ::com::sun::star::lang::Locale
2003/12/10 18:07:32 hjs 1.124.4.1: #i8252# set UILocale at startup
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 99 |
1 files changed, 46 insertions, 53 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index f42e716b2d50..8dbbfc0f57fc 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1,10 +1,10 @@ -/************************************************************************ +/************************************************************************* * * $RCSfile: app.cxx,v $ * - * $Revision: 1.140 $ + * $Revision: 1.141 $ * - * last change: $Author: rt $ $Date: 2004-06-17 11:55:41 $ + * last change: $Author: hjs $ $Date: 2004-06-25 12:39:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,7 @@ #include "ssoinit.hxx" #include "configinit.hxx" #include "lockfile.hxx" +#include "testtool.hxx" #include "checkinstall.hxx" #include "cmdlinehelp.hxx" #include "userinstall.hxx" @@ -169,9 +170,6 @@ #ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_ #include <com/sun/star/task/XJobExecutor.hpp> #endif -#ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_ -#include <com/sun/star/task/XJob.hpp> -#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif @@ -184,9 +182,6 @@ #include <com/sun/star/java/XJavaVM.hpp> -#ifndef _TOOLS_TESTTOOLLOADER_HXX_ -#include <tools/testtoolloader.hxx> -#endif #ifndef _SOLAR_H #include <tools/solar.h> #endif @@ -361,12 +356,15 @@ ResMgr* Desktop::GetDesktopResManager() // Use VCL to get the correct language specific message as we // are in the bootstrap process and not able to get the installed // language!! +/* LanguageType aLanguageType = LANGUAGE_DONTKNOW; Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLanguageType ); AllSettings as = GetSettings(); as.SetUILanguage(aLanguageType); SetSettings(as); +*/ + Desktop::pResMgr = ResMgr::CreateResMgr( U2S( aMgrName )); } } @@ -1291,7 +1289,7 @@ void Desktop::Main() // there is no other instance using our data files from a remote host RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" ); m_pLockfile = new Lockfile; - if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) { + if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check()) { // Lockfile exists, and user clicked 'no' return; } @@ -1331,17 +1329,16 @@ void Desktop::Main() SetSplashScreenProgress(15); // create title string - sal_Bool bCheckOk = sal_False; - LanguageType aLanguageType = LANGUAGE_DONTKNOW; + sal_Bool bCheckOk = sal_False; String aMgrName = String::CreateFromAscii( "iso" ); aMgrName += String::CreateFromInt32(SUPD); // current build version - ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLanguageType ); + ResMgr* pLabelResMgr = ResMgr::CreateResMgr( U2S( aMgrName )); if ( !pLabelResMgr ) { // no "iso" resource -> search for "ooo" resource aMgrName = String::CreateFromAscii( "ooo" ); aMgrName += String::CreateFromInt32(SUPD); // current build version - pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLanguageType ); + pLabelResMgr = ResMgr::CreateResMgr( U2S( aMgrName )); } String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, pLabelResMgr ) ) : String(); delete pLabelResMgr; @@ -1400,44 +1397,29 @@ void Desktop::Main() AllSettings aSettings( Application::GetSettings() ); - LanguageType eUILanguage = LanguageSelection::getLanguageType(); - aSettings.SetUILanguage( eUILanguage ); + LanguageSelection langselect; + OUString aUILocaleString = LanguageSelection::getLanguageString(); + sal_Int32 nIndex = 0; + OUString aLanguage = aUILocaleString.getToken( 0, '-', nIndex); + OUString aCountry = aUILocaleString.getToken( 0, '-', nIndex); + OUString aVariant = aUILocaleString.getToken( 0, '-', nIndex); + + ::com::sun::star::lang::Locale aUILocale( aLanguage, aCountry, aVariant ); + + aSettings.SetUILocale( aUILocale ); LanguageType eLanguage = SvtSysLocaleOptions().GetLocaleLanguageType(); aSettings.SetLanguage( eLanguage ); Application::SetSettings( aSettings ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" ); - aMgrName = String::CreateFromAscii("ofa"); - aMgrName += String::CreateFromInt32(SOLARUPD); // aktuelle Versionsnummer - ResMgr* pOffResMgr = ResMgr::CreateResMgr(U2S(aMgrName)); - Resource::SetResManager( pOffResMgr ); - - // create service for loadin SFX (still needed in startup) - Reference < XInterface >( xSMgr->createInstance( - DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); - - // initialize test-tool library (if available) - tools::InitTestToolLib(); - - // License Dialog - Reference< XJob > xLicense(xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.framework.License" ))), UNO_QUERY ); - if (xLicense.is()) + // if we need to display the dialog, we need to do it here + if (!pCmdLineArgs->IsQuickstart() && !Desktop::CheckOEM()) { - sal_Bool bAccepted = sal_False; - Any aResult = xLicense->execute(Sequence< NamedValue >()); - if ( !((aResult >>= bAccepted) && bAccepted)) - { - Reference< XDesktop > xDesktop( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop"))),UNO_QUERY); - xDesktop.is() && xDesktop->terminate(); - return; // License was declined, exit bootstrap routine - } + //Application::PostUserEvent( STATIC_LINK( 0, Desktop, AsyncTerminate ) ); + return; } - SetSplashScreenProgress(50); - // Backing Component if (pCmdLineArgs->IsEmpty() && SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) { ::desktop::Desktop::bSuppressOpenDefault = sal_True; @@ -1446,7 +1428,6 @@ void Desktop::Main() OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); if (xDesktopFrame.is()) { - SetSplashScreenProgress(60); Reference< XFrame > xBackingFrame; Reference< ::com::sun::star::awt::XWindow > xContainerWindow; @@ -1455,14 +1436,13 @@ void Desktop::Main() xContainerWindow = xBackingFrame->getContainerWindow(); if (xContainerWindow.is()) { - SetSplashScreenProgress(70); Sequence< Any > lArgs(1); lArgs[0] <<= xContainerWindow; Reference< XController > xBackingComp( xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), UNO_QUERY); - SetSplashScreenProgress(80); + if (xBackingComp.is()) { Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); @@ -1470,9 +1450,7 @@ void Desktop::Main() // Because the backing component set the property "IsBackingMode" of the frame // to true inside attachFrame(). But setComponent() reset this state everytimes ... xBackingFrame->setComponent(xBackingWin, xBackingComp); - SetSplashScreenProgress(90); xBackingComp->attachFrame(xBackingFrame); - CloseSplashScreen(); xContainerWindow->setVisible(sal_True); Window* pCompWindow = VCLUnoHelper::GetWindow(xBackingFrame->getComponentWindow()); @@ -1505,7 +1483,11 @@ void Desktop::Main() return; } */ - SetSplashScreenProgress(55); + + aMgrName = String::CreateFromAscii("ofa"); + aMgrName += String::CreateFromInt32(SOLARUPD); // aktuelle Versionsnummer + ResMgr* pOffResMgr = ResMgr::CreateResMgr(U2S(aMgrName)); + Resource::SetResManager( pOffResMgr ); SvtFontSubstConfig().Apply(); @@ -1514,14 +1496,13 @@ void Desktop::Main() aAppearanceCfg.SetApplicationDefaults( this ); SvtAccessibilityOptions aOptions; aOptions.SetVCLSettings(); - SetSplashScreenProgress(60); Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); sal_Bool bTerminateRequested = sal_False; // Preload function depends on an initialized sfx application! - SetSplashScreenProgress(70); + SetSplashScreenProgress(75); sal_Bool bUseSystemFileDialog; if ( pCmdLineArgs->IsHeadless() ) @@ -1537,11 +1518,24 @@ void Desktop::Main() // use system window dialogs Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); + // initialize test-tool library (if available) + InitTestToolLib(); SetSplashScreenProgress(80); if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() ) InitializeQuickstartMode( xSMgr ); + // create service for loadin SFX (still needed in startup) + try + { + Reference < XInterface >( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); + } + catch ( com::sun::star::uno::Exception& e ) + { + FatalError( MakeStartupErrorMessage(e.Message) ); + return; + } + // Create TypeDetection service to support feature "increase startup performance for loading filter config". // Its not an one-instance service any longer. But it shares a singleton cache instance internaly. // On the other side the feature of concurrent write access on these TypeDetection service instance @@ -1609,7 +1603,7 @@ void Desktop::Main() DeregisterServices(); - tools::DeInitTestToolLib(); + DeInitTestToolLib(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "-> dispose path/language options" ); delete pLanguageOptions; @@ -1803,7 +1797,6 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, pvoid ) RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::OpenClients_Impl" ); OpenClients(); - // CloseStartupScreen(); CloseSplashScreen(); |