Allow NetSurf to be opened from the CLI without a URL specified.

Add new switch FORCE which will force a new instance of NetSurf to open rather than
opening a new window in the already-running application (intended for debugging when
NetSurf has crashed)

svn path=/trunk/netsurf/; revision=10189
This commit is contained in:
Chris Young 2010-03-28 16:42:33 +00:00
parent 8effd1cb98
commit 74108d1e09
1 changed files with 13 additions and 4 deletions

View File

@ -549,15 +549,16 @@ void ami_openscreenfirst(void)
void gui_init2(int argc, char** argv)
{
struct browser_window *bw = NULL;
long rarray[] = {0};
long rarray[] = {0,0};
struct RDArgs *args;
STRPTR template = "URL/A";
STRPTR template = "URL,FORCE/S";
STRPTR temp_homepage_url = NULL;
BOOL notalreadyrunning;
enum
{
A_URL
A_URL,
A_FORCE
};
notalreadyrunning = ami_arexx_init();
@ -582,6 +583,12 @@ void gui_init2(int argc, char** argv)
free(temp_homepage_url);
}
}
if(rarray[A_FORCE])
{
notalreadyrunning = TRUE;
}
FreeArgs(args);
}
}
@ -679,7 +686,7 @@ void gui_init2(int argc, char** argv)
}
GetApplicationAttrs(ami_appid, APPATTR_Port, (ULONG)&applibport, TAG_DONE);
applibsig = (1L << applibport->mp_SigBit);
if(applibport) applibsig = (1L << applibport->mp_SigBit);
}
if(!bw && (option_startup_no_window == false))
@ -1627,6 +1634,8 @@ void ami_handle_applib(void)
struct ApplicationMsg *applibmsg;
struct browser_window *bw;
if(!applibport) return;
while((applibmsg=(struct ApplicationMsg *)GetMsg(applibport)))
{
switch (applibmsg->type)