netsurf_init expects a char ***, not a char **

Change command template so URL is a keyword.  This avoids the platform code
re-interpreting core options (eg -v as a URL).
Move screen open code slightly so "NetSurf ?" shows the template visibly, rather than
opening an empty screen and the user not knowing what is happening.

svn path=/trunk/netsurf/; revision=10224
This commit is contained in:
Chris Young 2010-04-01 17:44:42 +00:00
parent 0194e4bb55
commit d3276dfbaf
3 changed files with 18 additions and 13 deletions

8
amiga/dist/Install vendored
View File

@ -470,10 +470,10 @@
; Unfortunately saving URL prefs overwrites the markers making it ; Unfortunately saving URL prefs overwrites the markers making it
; necessary to ask whether the user wants to add NetSurf to launch-handler. ; necessary to ask whether the user wants to add NetSurf to launch-handler.
(working "Adding NetSurf to launch-handler config") (working "Adding NetSurf to launch-handler config")
(p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"file:///%s*\"\"") (p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"file:///%s*\"\"")
(p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"http://%s*\"\"") (p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://%s*\"\"")
(p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"https://%s*\"\"") (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"https://%s*\"\"")
(p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"http://www.%s*\"\"") (p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://www.%s*\"\"")
) )
) )

View File

@ -23,12 +23,14 @@ http://www.netsurf-browser.org
@endnode @endnode
@node cli "Command line options" @node cli "Command line options"
NetSurf URL NetSurf URL/K,FORCE/S
Where: Where:
URL = address of page to open on startup. URL = Address of page to open on startup
FORCE = Force new instance of NetSurf to open
Note that there may be other generic options which can also be specified.
@endnode @endnode
@node options "Options file" @node options "Options file"

View File

@ -532,12 +532,11 @@ void ami_openscreenfirst(void)
static void gui_init2(int argc, char** argv) static void gui_init2(int argc, char** argv)
{ {
struct browser_window *bw = NULL; struct browser_window *bw = NULL;
long rarray[] = {0,0};
struct RDArgs *args; struct RDArgs *args;
STRPTR template = "URL,FORCE/S";
STRPTR temp_homepage_url = NULL; STRPTR temp_homepage_url = NULL;
BOOL notalreadyrunning; BOOL notalreadyrunning;
STRPTR template = "URL/K,FORCE/S";
long rarray[] = {0,0};
enum enum
{ {
A_URL, A_URL,
@ -550,16 +549,17 @@ static void gui_init2(int argc, char** argv)
search_web_provider_details(option_search_provider); search_web_provider_details(option_search_provider);
if(notalreadyrunning && (option_startup_no_window == false))
ami_openscreenfirst();
if(argc) // argc==0 is started from wb if(argc) // argc==0 is started from wb
{ {
if(args = ReadArgs(template,rarray,NULL)) if(args = ReadArgs(template,rarray,NULL))
{ {
if(notalreadyrunning && (option_startup_no_window == false))
ami_openscreenfirst();
if(rarray[A_URL]) if(rarray[A_URL])
{ {
temp_homepage_url = (char *)strdup(rarray[A_URL]); temp_homepage_url = (char *)strdup(rarray[A_URL]);
if(notalreadyrunning) if(notalreadyrunning)
{ {
bw = browser_window_create(temp_homepage_url, 0, 0, true,false); bw = browser_window_create(temp_homepage_url, 0, 0, true,false);
@ -582,6 +582,9 @@ static void gui_init2(int argc, char** argv)
int first=0,i=0; int first=0,i=0;
char fullpath[1024]; char fullpath[1024];
if(notalreadyrunning && (option_startup_no_window == false))
ami_openscreenfirst();
for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++) for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
{ {
if(i==0) continue; if(i==0) continue;
@ -684,7 +687,7 @@ int main(int argc, char** argv)
ami_messages_load(messages); ami_messages_load(messages);
netsurf_init(&argc, argv, "PROGDIR:Resources/Options", messages); netsurf_init(&argc, &argv, "PROGDIR:Resources/Options", messages);
gui_init(argc, argv); gui_init(argc, argv);