diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-03-30 18:55:10 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-03-30 18:57:56 +0300 |
commit | 9efd80ac32a80656ed6482df69615227d12bc6d9 (patch) | |
tree | 003c67eb3283fd8a1a35942496bf4d88dc9c3e1a /desktop | |
parent | 61f1f6b4d65621d5c02e0c971c6ed51f6711fb63 (diff) |
Revert "Merge the --invisible and --headless options"
Stephan told about the intended use case for --invisible, and it does sound
like a plausible use case, so let's revert this.
"ah, now that I see 4fe56f3b9af814430a28a1880799f450fb8146b9: one use case
for invisible + !headless might be in workflows where external code keeps
a LO instance running and lets it pop up document windows, but you don't
want the initial start center thing
I think that's historically where the --invisible thing is coming from, now
that I vaguely remember again"
This reverts commit 4fe56f3b9af814430a28a1880799f450fb8146b9.
Change-Id: I17f535adee7e533abbee150b0ce5156ecf78c781
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 28 | ||||
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 9 | ||||
-rw-r--r-- | desktop/source/app/cmdlineargs.hxx | 4 | ||||
-rw-r--r-- | desktop/source/app/cmdlinehelp.cxx | 4 | ||||
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 6 | ||||
-rw-r--r-- | desktop/unx/source/args.c | 1 |
6 files changed, 32 insertions, 20 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cd15720a6419..bb352e2ed204 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -439,7 +439,8 @@ void FatalError(const OUString& sMessage) static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine) { - return rCmdLine.IsHeadless() || + return rCmdLine.IsInvisible() || + rCmdLine.IsHeadless() || rCmdLine.IsQuickstart(); } @@ -1364,7 +1365,7 @@ int Desktop::Main() // there is no other instance using our data files from a remote host m_xLockfile.reset(new Lockfile); - if ( !rCmdLineArgs.IsHeadless() && + if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoLockcheck() && !m_xLockfile->check( Lockfile_execWarning )) { // Lockfile exists, and user clicked 'no' @@ -1500,7 +1501,7 @@ int Desktop::Main() true); if ( !pExecGlobals->bRestartRequested ) { - if ((!rCmdLineArgs.WantsToLoadDocument() && !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsQuickstart()) && + if ((!rCmdLineArgs.WantsToLoadDocument() && !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsQuickstart()) && (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && (!bExistsRecoveryData ) && (!bExistsSessionData ) && @@ -1532,7 +1533,7 @@ int Desktop::Main() SetSplashScreenProgress(60); #if ENABLE_TELEPATHY - bool bListen = rCmdLineArgs.IsHeadless(); + bool bListen = rCmdLineArgs.IsInvisible(); TeleManager::init( bListen ); #endif @@ -1549,7 +1550,7 @@ int Desktop::Main() SetSplashScreenProgress(80); - if ( !bTerminateRequested && !rCmdLineArgs.IsHeadless() && + if ( !bTerminateRequested && !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() ) InitializeQuickstartMode( xContext ); @@ -1598,7 +1599,7 @@ int Desktop::Main() if ( !pExecGlobals->bRestartRequested ) { // if this run of the office is triggered by restart, some additional actions should be done - DoRestartActionsIfNecessary( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsNoQuickstart() ); + DoRestartActionsIfNecessary( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() ); Execute(); } @@ -2372,7 +2373,7 @@ void Desktop::OpenClients() if ( xList->hasElements() ) return; - if ( rArgs.IsQuickstart() || rArgs.IsHeadless() || Application::AnyInput( VclInputFlags::APPEVENT ) ) + if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || Application::AnyInput( VclInputFlags::APPEVENT ) ) // soffice was started as tray icon ... return; @@ -2497,7 +2498,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) createAcceptor(rAppEvent.GetStringData()); break; case ApplicationEvent::TYPE_APPEAR: - if ( !GetCommandLineArgs().IsHeadless() ) + if ( !GetCommandLineArgs().IsInvisible() ) { Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); @@ -2551,7 +2552,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) case ApplicationEvent::TYPE_OPEN: { const CommandLineArgs& rCmdLine = GetCommandLineArgs(); - if ( !rCmdLine.IsHeadless() && !rCmdLine.IsTerminateAfterInit() ) + if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( rCmdLine.getCwdUrl()); @@ -2572,7 +2573,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) case ApplicationEvent::TYPE_PRINT: { const CommandLineArgs& rCmdLine = GetCommandLineArgs(); - if ( !rCmdLine.IsHeadless() && !rCmdLine.IsTerminateAfterInit() ) + if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( rCmdLine.getCwdUrl()); @@ -2595,13 +2596,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) } break; case ApplicationEvent::TYPE_QUICKSTART: - if ( !GetCommandLineArgs().IsHeadless() ) + if ( !GetCommandLineArgs().IsInvisible() ) { // If the office has been started the second time its command line arguments are sent through a pipe // connection to the first office. We want to reuse the quickstart option for the first office. // NOTICE: The quickstart service must be initialized inside the "main thread", so we use the // application events to do this (they are executed inside main thread)!!! - // Don't start quickstart service if the user specified "--headless" on the command line! + // Don't start quickstart service if the user specified "--invisible" on the command line! Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); css::office::Quickstart::createStart(xContext, true/*Quickstart*/); } @@ -2647,7 +2648,8 @@ void Desktop::OpenSplashScreen() { const CommandLineArgs &rCmdLine = GetCommandLineArgs(); // Show intro only if this is normal start (e.g. no server, no quickstart, no printing ) - if ( !rCmdLine.IsHeadless() && + if ( !rCmdLine.IsInvisible() && + !rCmdLine.IsHeadless() && !rCmdLine.IsQuickstart() && !rCmdLine.IsMinimized() && !rCmdLine.IsNoLogo() && diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index d66a3063cc1e..9bbc36ffa29f 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -169,6 +169,10 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { m_minimized = true; } + else if ( oArg == "invisible" ) + { + m_invisible = true; + } else if ( oArg == "norestore" ) { m_norestore = true; @@ -177,8 +181,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { m_nodefault = true; } - else if ( oArg == "invisible" || - oArg == "headless" ) + else if ( oArg == "headless" ) { setHeadless(); } @@ -588,8 +591,10 @@ void CommandLineArgs::InitParamValues() m_minimized = false; m_norestore = false; #ifdef LIBO_HEADLESS + m_invisible = true; m_headless = true; #else + m_invisible = false; m_headless = false; #endif m_quickstart = false; diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 0d8b3626abdf..7b8c0da62dff 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -57,6 +57,7 @@ class CommandLineArgs: private boost::noncopyable // Access to bool parameters bool IsMinimized() const { return m_minimized;} + bool IsInvisible() const { return m_invisible;} bool IsNoRestore() const { return m_norestore;} bool IsNoDefault() const { return m_nodefault;} bool IsHeadless() const { return m_headless;} @@ -110,7 +111,7 @@ class CommandLineArgs: private boost::noncopyable // Special analyzed states (does not match directly to a command line parameter!) bool IsEmpty() const { return m_bEmpty;} - void setHeadless() { m_headless = true; } + void setHeadless() { m_headless = true; m_invisible = true; } private: void ParseCommandLine_Impl( Supplier& supplier ); @@ -119,6 +120,7 @@ class CommandLineArgs: private boost::noncopyable boost::optional< OUString > m_cwdUrl; bool m_minimized; + bool m_invisible; bool m_norestore; bool m_headless; bool m_quickstart; diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 5ebb929e2ea2..61694b8f2791 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -52,6 +52,7 @@ namespace desktop "Options:\n"; const char aCmdLineHelp_left[] = "--minimized \n"\ + "--invisible \n"\ "--norestore \n"\ "--quickstart \n"\ "--nologo \n"\ @@ -72,12 +73,13 @@ namespace desktop "-n \n"; const char aCmdLineHelp_right[] = "keep startup bitmap minimized.\n"\ + "no startup screen, no default document and no UI.\n"\ "suppress restart/restore after fatal errors.\n"\ "starts the quickstart service\n"\ "don't show startup screen.\n"\ "don't check for remote instances using the installation\n"\ "don't start with an empty document\n"\ - "no startup screen, no default document and no user interaction.\n"\ + "like invisible but no user interaction at all.\n"\ "show this message and exit.\n"\ "display the version information.\n"\ "create new text document.\n"\ diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index fad8a908f0fe..aec9b3c0f279 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -819,7 +819,7 @@ void OfficeIPCThread::execute() cProcessed.reset(); pRequest->pcProcessed = &cProcessed; - // Print requests are not dependent on the --headless cmdline argument as they are + // Print requests are not dependent on the --invisible cmdline argument as they are // loaded with the "hidden" flag! So they are always checked. pRequest->aPrintList = aCmdLineArgs->GetPrintList(); bDocRequestSent |= !pRequest->aPrintList.empty(); @@ -827,10 +827,10 @@ void OfficeIPCThread::execute() pRequest->aPrinterName = aCmdLineArgs->GetPrinterName(); bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() ); - if ( !rCurrentCmdLineArgs.IsHeadless() ) + if ( !rCurrentCmdLineArgs.IsInvisible() ) { // Read cmdline args that can open/create documents. As they would open a window - // they are only allowed if the "--headless" is currently not used! + // they are only allowed if the "--invisible" is currently not used! pRequest->aOpenList = aCmdLineArgs->GetOpenList(); bDocRequestSent |= !pRequest->aOpenList.empty(); pRequest->aViewList = aCmdLineArgs->GetViewList(); diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c index 2422aded64a0..34d3064abd16 100644 --- a/desktop/unx/source/args.c +++ b/desktop/unx/source/args.c @@ -34,6 +34,7 @@ static struct { /* no splash */ { "nologo", 1, 0, 0, 0, NULL }, { "headless", 1, 0, 0, 0, NULL }, + { "invisible", 1, 0, 0, 0, NULL }, { "quickstart", 1, 0, 0, 0, NULL }, { "minimized", 1, 0, 0, 0, NULL }, { "convert-to", 1, 0, 0, 0, NULL }, |