Kaydet (Commit) 4fe56f3b authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Merge the --invisible and --headless options

No need to have both.

Change-Id: Ibd2f9f6d352ffb52bf43f4e1a4f69f60a60458ff
üst 72927f81
...@@ -439,8 +439,7 @@ void FatalError(const OUString& sMessage) ...@@ -439,8 +439,7 @@ void FatalError(const OUString& sMessage)
static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine) static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine)
{ {
return rCmdLine.IsInvisible() || return rCmdLine.IsHeadless() ||
rCmdLine.IsHeadless() ||
rCmdLine.IsQuickstart(); rCmdLine.IsQuickstart();
} }
...@@ -1365,7 +1364,7 @@ int Desktop::Main() ...@@ -1365,7 +1364,7 @@ int Desktop::Main()
// there is no other instance using our data files from a remote host // there is no other instance using our data files from a remote host
m_xLockfile.reset(new Lockfile); m_xLockfile.reset(new Lockfile);
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() && if ( !rCmdLineArgs.IsHeadless() &&
!rCmdLineArgs.IsNoLockcheck() && !m_xLockfile->check( Lockfile_execWarning )) !rCmdLineArgs.IsNoLockcheck() && !m_xLockfile->check( Lockfile_execWarning ))
{ {
// Lockfile exists, and user clicked 'no' // Lockfile exists, and user clicked 'no'
...@@ -1501,7 +1500,7 @@ int Desktop::Main() ...@@ -1501,7 +1500,7 @@ int Desktop::Main()
true); true);
if ( !pExecGlobals->bRestartRequested ) if ( !pExecGlobals->bRestartRequested )
{ {
if ((!rCmdLineArgs.WantsToLoadDocument() && !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsQuickstart()) && if ((!rCmdLineArgs.WantsToLoadDocument() && !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsQuickstart()) &&
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
(!bExistsRecoveryData ) && (!bExistsRecoveryData ) &&
(!bExistsSessionData ) && (!bExistsSessionData ) &&
...@@ -1533,7 +1532,7 @@ int Desktop::Main() ...@@ -1533,7 +1532,7 @@ int Desktop::Main()
SetSplashScreenProgress(60); SetSplashScreenProgress(60);
#if ENABLE_TELEPATHY #if ENABLE_TELEPATHY
bool bListen = rCmdLineArgs.IsInvisible(); bool bListen = rCmdLineArgs.IsHeadless();
TeleManager::init( bListen ); TeleManager::init( bListen );
#endif #endif
...@@ -1550,7 +1549,7 @@ int Desktop::Main() ...@@ -1550,7 +1549,7 @@ int Desktop::Main()
SetSplashScreenProgress(80); SetSplashScreenProgress(80);
if ( !bTerminateRequested && !rCmdLineArgs.IsInvisible() && if ( !bTerminateRequested && !rCmdLineArgs.IsHeadless() &&
!rCmdLineArgs.IsNoQuickstart() ) !rCmdLineArgs.IsNoQuickstart() )
InitializeQuickstartMode( xContext ); InitializeQuickstartMode( xContext );
...@@ -1599,7 +1598,7 @@ int Desktop::Main() ...@@ -1599,7 +1598,7 @@ int Desktop::Main()
if ( !pExecGlobals->bRestartRequested ) if ( !pExecGlobals->bRestartRequested )
{ {
// if this run of the office is triggered by restart, some additional actions should be done // if this run of the office is triggered by restart, some additional actions should be done
DoRestartActionsIfNecessary( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() ); DoRestartActionsIfNecessary( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsNoQuickstart() );
Execute(); Execute();
} }
...@@ -2373,7 +2372,7 @@ void Desktop::OpenClients() ...@@ -2373,7 +2372,7 @@ void Desktop::OpenClients()
if ( xList->hasElements() ) if ( xList->hasElements() )
return; return;
if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || Application::AnyInput( VclInputFlags::APPEVENT ) ) if ( rArgs.IsQuickstart() || rArgs.IsHeadless() || Application::AnyInput( VclInputFlags::APPEVENT ) )
// soffice was started as tray icon ... // soffice was started as tray icon ...
return; return;
...@@ -2498,7 +2497,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) ...@@ -2498,7 +2497,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
createAcceptor(rAppEvent.GetStringData()); createAcceptor(rAppEvent.GetStringData());
break; break;
case ApplicationEvent::TYPE_APPEAR: case ApplicationEvent::TYPE_APPEAR:
if ( !GetCommandLineArgs().IsInvisible() ) if ( !GetCommandLineArgs().IsHeadless() )
{ {
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
...@@ -2552,7 +2551,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) ...@@ -2552,7 +2551,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
case ApplicationEvent::TYPE_OPEN: case ApplicationEvent::TYPE_OPEN:
{ {
const CommandLineArgs& rCmdLine = GetCommandLineArgs(); const CommandLineArgs& rCmdLine = GetCommandLineArgs();
if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) if ( !rCmdLine.IsHeadless() && !rCmdLine.IsTerminateAfterInit() )
{ {
ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest(
rCmdLine.getCwdUrl()); rCmdLine.getCwdUrl());
...@@ -2573,7 +2572,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) ...@@ -2573,7 +2572,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
case ApplicationEvent::TYPE_PRINT: case ApplicationEvent::TYPE_PRINT:
{ {
const CommandLineArgs& rCmdLine = GetCommandLineArgs(); const CommandLineArgs& rCmdLine = GetCommandLineArgs();
if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) if ( !rCmdLine.IsHeadless() && !rCmdLine.IsTerminateAfterInit() )
{ {
ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest(
rCmdLine.getCwdUrl()); rCmdLine.getCwdUrl());
...@@ -2596,13 +2595,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) ...@@ -2596,13 +2595,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
} }
break; break;
case ApplicationEvent::TYPE_QUICKSTART: case ApplicationEvent::TYPE_QUICKSTART:
if ( !GetCommandLineArgs().IsInvisible() ) if ( !GetCommandLineArgs().IsHeadless() )
{ {
// If the office has been started the second time its command line arguments are sent through a pipe // 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. // 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 // 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)!!! // application events to do this (they are executed inside main thread)!!!
// Don't start quickstart service if the user specified "--invisible" on the command line! // Don't start quickstart service if the user specified "--headless" on the command line!
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
css::office::Quickstart::createStart(xContext, true/*Quickstart*/); css::office::Quickstart::createStart(xContext, true/*Quickstart*/);
} }
...@@ -2648,8 +2647,7 @@ void Desktop::OpenSplashScreen() ...@@ -2648,8 +2647,7 @@ void Desktop::OpenSplashScreen()
{ {
const CommandLineArgs &rCmdLine = GetCommandLineArgs(); const CommandLineArgs &rCmdLine = GetCommandLineArgs();
// Show intro only if this is normal start (e.g. no server, no quickstart, no printing ) // Show intro only if this is normal start (e.g. no server, no quickstart, no printing )
if ( !rCmdLine.IsInvisible() && if ( !rCmdLine.IsHeadless() &&
!rCmdLine.IsHeadless() &&
!rCmdLine.IsQuickstart() && !rCmdLine.IsQuickstart() &&
!rCmdLine.IsMinimized() && !rCmdLine.IsMinimized() &&
!rCmdLine.IsNoLogo() && !rCmdLine.IsNoLogo() &&
......
...@@ -169,10 +169,6 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -169,10 +169,6 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{ {
m_minimized = true; m_minimized = true;
} }
else if ( oArg == "invisible" )
{
m_invisible = true;
}
else if ( oArg == "norestore" ) else if ( oArg == "norestore" )
{ {
m_norestore = true; m_norestore = true;
...@@ -181,7 +177,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -181,7 +177,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{ {
m_nodefault = true; m_nodefault = true;
} }
else if ( oArg == "headless" ) else if ( oArg == "invisible" ||
oArg == "headless" )
{ {
setHeadless(); setHeadless();
} }
...@@ -591,10 +588,8 @@ void CommandLineArgs::InitParamValues() ...@@ -591,10 +588,8 @@ void CommandLineArgs::InitParamValues()
m_minimized = false; m_minimized = false;
m_norestore = false; m_norestore = false;
#ifdef LIBO_HEADLESS #ifdef LIBO_HEADLESS
m_invisible = true;
m_headless = true; m_headless = true;
#else #else
m_invisible = false;
m_headless = false; m_headless = false;
#endif #endif
m_quickstart = false; m_quickstart = false;
......
...@@ -57,7 +57,6 @@ class CommandLineArgs: private boost::noncopyable ...@@ -57,7 +57,6 @@ class CommandLineArgs: private boost::noncopyable
// Access to bool parameters // Access to bool parameters
bool IsMinimized() const { return m_minimized;} bool IsMinimized() const { return m_minimized;}
bool IsInvisible() const { return m_invisible;}
bool IsNoRestore() const { return m_norestore;} bool IsNoRestore() const { return m_norestore;}
bool IsNoDefault() const { return m_nodefault;} bool IsNoDefault() const { return m_nodefault;}
bool IsHeadless() const { return m_headless;} bool IsHeadless() const { return m_headless;}
...@@ -111,7 +110,7 @@ class CommandLineArgs: private boost::noncopyable ...@@ -111,7 +110,7 @@ class CommandLineArgs: private boost::noncopyable
// Special analyzed states (does not match directly to a command line parameter!) // Special analyzed states (does not match directly to a command line parameter!)
bool IsEmpty() const { return m_bEmpty;} bool IsEmpty() const { return m_bEmpty;}
void setHeadless() { m_headless = true; m_invisible = true; } void setHeadless() { m_headless = true; }
private: private:
void ParseCommandLine_Impl( Supplier& supplier ); void ParseCommandLine_Impl( Supplier& supplier );
...@@ -120,7 +119,6 @@ class CommandLineArgs: private boost::noncopyable ...@@ -120,7 +119,6 @@ class CommandLineArgs: private boost::noncopyable
boost::optional< OUString > m_cwdUrl; boost::optional< OUString > m_cwdUrl;
bool m_minimized; bool m_minimized;
bool m_invisible;
bool m_norestore; bool m_norestore;
bool m_headless; bool m_headless;
bool m_quickstart; bool m_quickstart;
......
...@@ -52,7 +52,6 @@ namespace desktop ...@@ -52,7 +52,6 @@ namespace desktop
"Options:\n"; "Options:\n";
const char aCmdLineHelp_left[] = const char aCmdLineHelp_left[] =
"--minimized \n"\ "--minimized \n"\
"--invisible \n"\
"--norestore \n"\ "--norestore \n"\
"--quickstart \n"\ "--quickstart \n"\
"--nologo \n"\ "--nologo \n"\
...@@ -73,13 +72,12 @@ namespace desktop ...@@ -73,13 +72,12 @@ namespace desktop
"-n \n"; "-n \n";
const char aCmdLineHelp_right[] = const char aCmdLineHelp_right[] =
"keep startup bitmap minimized.\n"\ "keep startup bitmap minimized.\n"\
"no startup screen, no default document and no UI.\n"\
"suppress restart/restore after fatal errors.\n"\ "suppress restart/restore after fatal errors.\n"\
"starts the quickstart service\n"\ "starts the quickstart service\n"\
"don't show startup screen.\n"\ "don't show startup screen.\n"\
"don't check for remote instances using the installation\n"\ "don't check for remote instances using the installation\n"\
"don't start with an empty document\n"\ "don't start with an empty document\n"\
"like invisible but no user interaction at all.\n"\ "no startup screen, no default document and no user interaction.\n"\
"show this message and exit.\n"\ "show this message and exit.\n"\
"display the version information.\n"\ "display the version information.\n"\
"create new text document.\n"\ "create new text document.\n"\
......
...@@ -819,7 +819,7 @@ void OfficeIPCThread::execute() ...@@ -819,7 +819,7 @@ void OfficeIPCThread::execute()
cProcessed.reset(); cProcessed.reset();
pRequest->pcProcessed = &cProcessed; pRequest->pcProcessed = &cProcessed;
// Print requests are not dependent on the --invisible cmdline argument as they are // Print requests are not dependent on the --headless cmdline argument as they are
// loaded with the "hidden" flag! So they are always checked. // loaded with the "hidden" flag! So they are always checked.
pRequest->aPrintList = aCmdLineArgs->GetPrintList(); pRequest->aPrintList = aCmdLineArgs->GetPrintList();
bDocRequestSent |= !pRequest->aPrintList.empty(); bDocRequestSent |= !pRequest->aPrintList.empty();
...@@ -827,10 +827,10 @@ void OfficeIPCThread::execute() ...@@ -827,10 +827,10 @@ void OfficeIPCThread::execute()
pRequest->aPrinterName = aCmdLineArgs->GetPrinterName(); pRequest->aPrinterName = aCmdLineArgs->GetPrinterName();
bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() ); bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() );
if ( !rCurrentCmdLineArgs.IsInvisible() ) if ( !rCurrentCmdLineArgs.IsHeadless() )
{ {
// Read cmdline args that can open/create documents. As they would open a window // Read cmdline args that can open/create documents. As they would open a window
// they are only allowed if the "--invisible" is currently not used! // they are only allowed if the "--headless" is currently not used!
pRequest->aOpenList = aCmdLineArgs->GetOpenList(); pRequest->aOpenList = aCmdLineArgs->GetOpenList();
bDocRequestSent |= !pRequest->aOpenList.empty(); bDocRequestSent |= !pRequest->aOpenList.empty();
pRequest->aViewList = aCmdLineArgs->GetViewList(); pRequest->aViewList = aCmdLineArgs->GetViewList();
......
...@@ -34,7 +34,6 @@ static struct { ...@@ -34,7 +34,6 @@ static struct {
/* no splash */ /* no splash */
{ "nologo", 1, 0, 0, 0, NULL }, { "nologo", 1, 0, 0, 0, NULL },
{ "headless", 1, 0, 0, 0, NULL }, { "headless", 1, 0, 0, 0, NULL },
{ "invisible", 1, 0, 0, 0, NULL },
{ "quickstart", 1, 0, 0, 0, NULL }, { "quickstart", 1, 0, 0, 0, NULL },
{ "minimized", 1, 0, 0, 0, NULL }, { "minimized", 1, 0, 0, 0, NULL },
{ "convert-to", 1, 0, 0, 0, NULL }, { "convert-to", 1, 0, 0, 0, NULL },
......
...@@ -7,7 +7,7 @@ libreoffice \- LibreOffice office suite ...@@ -7,7 +7,7 @@ libreoffice \- LibreOffice office suite
[\fB\-\-accept\=\fIaccept\-string\fR] [\fB\-\-base\fR] [\fB\-\-calc\fR] [\fB\-\-accept\=\fIaccept\-string\fR] [\fB\-\-base\fR] [\fB\-\-calc\fR]
[\fB\-\-convert\-to\fR output_file_extension[:output_filter_name] [\-\-outdir output_dir] \fIfile\fR]... [\fB\-\-convert\-to\fR output_file_extension[:output_filter_name] [\-\-outdir output_dir] \fIfile\fR]...
[\fB\-\-display \fIdisplay\fR] [\fB\-\-draw\fR] [\fB\-\-global\fR] [\fB\-\-headless\fR] [\fB\-\-display \fIdisplay\fR] [\fB\-\-draw\fR] [\fB\-\-global\fR] [\fB\-\-headless\fR]
[\fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR] [\fB\-\-impress\fR] [\fB\-\-invisible\fR] [\fB\-\-infilter="<filter>"\fR] [\fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR] [\fB\-\-impress\fR] [\fB\-\-infilter="<filter>"\fR]
[\fB\-\-math\fR] [\fB\-\-minimized\fR] [\fB\-n \fIfile\fR]... [\fB\-\-nodefault\fR] [\fB\-\-math\fR] [\fB\-\-minimized\fR] [\fB\-n \fIfile\fR]... [\fB\-\-nodefault\fR]
[\fB\-\-nolockcheck\fR] [\fB\-\-nologo\fR] [\fB\-\-norestore\fR] [\fB\-\-nolockcheck\fR] [\fB\-\-nologo\fR] [\fB\-\-norestore\fR]
[\fB\-o \fIfile\fR]... [\fB\-p \fIfile\fR...] [\fB\-o \fIfile\fR]... [\fB\-p \fIfile\fR...]
...@@ -90,13 +90,12 @@ Starts with a new Global document. ...@@ -90,13 +90,12 @@ Starts with a new Global document.
.TP .TP
\fB\-\-headless\fR \fB\-\-headless\fR
Starts in "headless mode", which allows using the application without user a Starts in invisible or "headless" mode, which allows using the application without user a
interface. interface.
This special mode can be used when the application is controlled by external This special mode can be used when the application is controlled by external
clients via the API. clients via the API.
It implies \-\-invisible and strictly ignores any GUI environment.
\-\-quickstart does not work with this parameter. \-\-quickstart does not work with this parameter.
.TP .TP
...@@ -107,18 +106,6 @@ Lists LibreOffice command line parameters. ...@@ -107,18 +106,6 @@ Lists LibreOffice command line parameters.
\fB\-\-impress\fR \fB\-\-impress\fR
Starts with a new Impress document. Starts with a new Impress document.
.TP
\fB\-\-invisible\fR
Starts in invisible mode.
Neither the start\-up logo nor the initial program window will be visible.
LO can be controlled and documents and dialogs can be opened via the API.
When started with this parameter, it can only be quit using the taskmanager (Windows)
or the kill command (UNIX based systems).
\-\-quickstart does not work with this parameter.
.TP .TP
\fB\-\-infilter="<filter>"\fR \fB\-\-infilter="<filter>"\fR
Force an input filter type if possible. Force an input filter type if possible.
...@@ -204,7 +191,7 @@ If a file name contains spaces, then it must be enclosed in quotation marks. ...@@ -204,7 +191,7 @@ If a file name contains spaces, then it must be enclosed in quotation marks.
Starts LO with it's quick starter. Starts LO with it's quick starter.
\fB\-\-quickstart disable the quick starter. \fB\-\-quickstart disable the quick starter.
Does not work with \-\-invisible or \-\-headless. Does not work with \-\-headless.
.TP .TP
\fB\-\-show \fIImpress file\fR... \fB\-\-show \fIImpress file\fR...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment