From d2b113ec937d709e45ed1bd278a074f26529d295 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 12 Oct 2010 15:32:09 +0100 Subject: Implement unix quick-starter Kendy's standalone unix-quick-starter, with tweaks to make it conditionally compiled, and load png images with the new branding layout from Michael. Fixes to the soffice shell-script to not run pagein for a 2nd start --- desktop/source/app/app.cxx | 36 ++++++++++++++++++++++------------ desktop/source/app/cmdlineargs.cxx | 16 ++++++++++++++- desktop/source/app/cmdlineargs.hxx | 3 +++ desktop/source/app/officeipcthread.cxx | 9 ++++++--- 4 files changed, 48 insertions(+), 16 deletions(-) (limited to 'desktop/source/app') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 36d5d203de..1a1afcc298 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -740,6 +740,13 @@ void Desktop::Init() } } +void Desktop::InitFinished() +{ + RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::InitFinished" ); + + CloseSplashScreen(); +} + void Desktop::DeInit() { RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::DeInit" ); @@ -1546,6 +1553,7 @@ void Desktop::Main() OpenSplashScreen(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main } OpenSplashScreen" ); + SetSplashScreenProgress(10); { UserInstall::UserInstallError instErr_fin = UserInstall::finalize(); if ( instErr_fin != UserInstall::E_None) @@ -1561,7 +1569,7 @@ void Desktop::Main() } // refresh path information utl::Bootstrap::reloadData(); - SetSplashScreenProgress(25); + SetSplashScreenProgress(20); } Reference< XMultiServiceFactory > xSMgr = @@ -1579,7 +1587,7 @@ void Desktop::Main() { RegisterServices( xSMgr ); - //SetSplashScreenProgress(15); + SetSplashScreenProgress(25); #ifndef UNX if ( pCmdLineArgs->IsHelp() ) { @@ -1617,7 +1625,7 @@ void Desktop::Main() // Read the common configuration items for optimization purpose if ( !InitializeConfiguration() ) return; - //SetSplashScreenProgress(20); + SetSplashScreenProgress(30); // set static variable to enabled/disable crash reporter retrieveCrashReporterState(); @@ -1678,10 +1686,10 @@ void Desktop::Main() #endif SetDisplayName( aTitle ); -// SetSplashScreenProgress(30); + SetSplashScreenProgress(35); RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" ); pPathOptions.reset( new SvtPathOptions); -// SetSplashScreenProgress(40); + SetSplashScreenProgress(40); // pLanguageOptions = new SvtLanguageOptions(sal_True); // SetSplashScreenProgress(45); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" ); @@ -1779,7 +1787,7 @@ void Desktop::Main() OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); if (xDesktopFrame.is()) { - // SetSplashScreenProgress(60); + SetSplashScreenProgress(60); Reference< XFrame > xBackingFrame; Reference< ::com::sun::star::awt::XWindow > xContainerWindow; @@ -1796,7 +1804,7 @@ void Desktop::Main() Reference< XController > xBackingComp( xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), UNO_QUERY); - // SetSplashScreenProgress(80); + SetSplashScreenProgress(80); if (xBackingComp.is()) { Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); @@ -1836,7 +1844,7 @@ void Desktop::Main() return; } */ -// SetSplashScreenProgress(55); + SetSplashScreenProgress(55); SvtFontSubstConfig().Apply(); @@ -1845,7 +1853,7 @@ void Desktop::Main() aAppearanceCfg.SetApplicationDefaults( this ); SvtAccessibilityOptions aOptions; aOptions.SetVCLSettings(); -// SetSplashScreenProgress(60); + SetSplashScreenProgress(60); if ( !bRestartRequested ) { @@ -1859,7 +1867,7 @@ void Desktop::Main() // use system window dialogs Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); - // SetSplashScreenProgress(80); + SetSplashScreenProgress(80); if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ) @@ -3196,14 +3204,18 @@ void Desktop::OpenSplashScreen() else if ( pCmdLine->IsWeb() ) aAppName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "web" )); + // Which splash to use + OUString aSplashService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.SplashScreen" )); + if ( pCmdLine->GetStringParam( CommandLineArgs::CMD_STRINGPARAM_SPLASHPIPE ).getLength() ) + aSplashService = OUString::createFromAscii("com.sun.star.office.PipeSplashScreen"); + bVisible = sal_True; Sequence< Any > aSeq( 2 ); aSeq[0] <<= bVisible; aSeq[1] <<= aAppName; m_rSplashScreen = Reference( comphelper::getProcessServiceFactory()->createInstanceWithArguments( - OUString::createFromAscii("com.sun.star.office.SplashScreen"), - aSeq), UNO_QUERY); + aSplashService, aSeq), UNO_QUERY); if(m_rSplashScreen.is()) m_rSplashScreen->start(OUString::createFromAscii("SplashScreen"), 100); diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 7f3d141f85..9552c843b8 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -527,6 +527,11 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True ); return sal_True; } + else if ( aArgStr.Copy(0, 13).EqualsIgnoreCaseAscii( "-splash-pipe=" )) + { + AddStringListParam_Impl( CMD_STRINGPARAM_SPLASHPIPE, aArgStr.Copy( 13 ) ); + return sal_True; + } #ifdef MACOSX /* #i84053# ignore -psn on Mac Platform dependent #ifdef here is ugly, however this is currently @@ -680,6 +685,14 @@ void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue ) m_aBoolParams[eParam] = bNewValue; } +const rtl::OUString& CommandLineArgs::GetStringParam( StringParam eParam ) const +{ + osl::MutexGuard aMutexGuard( m_aMutex ); + + OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) ); + return m_aStrParams[eParam]; +} + sal_Bool CommandLineArgs::IsMinimized() const { osl::MutexGuard aMutexGuard( m_aMutex ); @@ -980,7 +993,8 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const { osl::MutexGuard aMutexGuard( m_aMutex ); - return m_eArgumentCount == NONE || + return m_eArgumentCount == NONE || + ( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_SPLASHPIPE ].getLength() )) || ( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_ACCEPT ].getLength() )) || ( ( m_eArgumentCount == ONE ) && m_aBoolParams[ CMD_BOOLPARAM_PSN ] ); } diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index f357dad523..4ef302e12f 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -77,6 +77,7 @@ class CommandLineArgs enum StringParam // must be zero based! { CMD_STRINGPARAM_PORTAL, + CMD_STRINGPARAM_SPLASHPIPE, CMD_STRINGPARAM_ACCEPT, CMD_STRINGPARAM_UNACCEPT, CMD_STRINGPARAM_USERDIR, @@ -128,6 +129,8 @@ class CommandLineArgs // generic methods to access parameter void SetBoolParam( BoolParam eParam, sal_Bool bNewValue ); + const rtl::OUString& GetStringParam( StringParam eParam ) const; + // Access to bool parameters sal_Bool IsMinimized() const; sal_Bool IsInvisible() const; diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 854646ef4d..059e594943 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -223,11 +223,14 @@ OfficeIPCThread* OfficeIPCThread::pGlobalOfficeIPCThread = 0; namespace { struct Security : public rtl::Static {}; } ::osl::Mutex* OfficeIPCThread::pOfficeIPCThreadMutex = 0; - +// Turns a string in aMsg such as file://home/foo/.libreoffice/3 +// Into a hex string of well known length ff132a86... String CreateMD5FromString( const OUString& aMsg ) { - // PRE: aStr "file" - // BACK: Str "ababab....0f" Hexcode String +#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL + fprintf (stderr, "create md5 frim '%s'\n", + (const sal_Char *)rtl::OUStringToOString (aMsg, RTL_TEXTENCODING_UTF8)); +#endif rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 ); if ( handle > 0 ) -- cgit v1.2.3