From d3276dfbafa0c18dcb6c62b57f619da152f23584 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 1 Apr 2010 17:44:42 +0000 Subject: [PATCH] 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 --- amiga/dist/Install | 8 ++++---- amiga/dist/NetSurf.guide | 6 ++++-- amiga/gui.c | 17 ++++++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/amiga/dist/Install b/amiga/dist/Install index d05edab13..a0879eccd 100755 --- a/amiga/dist/Install +++ b/amiga/dist/Install @@ -470,10 +470,10 @@ ; Unfortunately saving URL prefs overwrites the markers making it ; necessary to ask whether the user wants to add NetSurf to launch-handler. (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/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"http://%s*\"\"") - (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"*\"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/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=\"URL=*\"http://%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=\"URL=*\"http://www.%s*\"\"") ) ) diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index d824eb008..5cec3dd0e 100755 --- a/amiga/dist/NetSurf.guide +++ b/amiga/dist/NetSurf.guide @@ -23,12 +23,14 @@ http://www.netsurf-browser.org @endnode @node cli "Command line options" -NetSurf URL +NetSurf URL/K,FORCE/S 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 @node options "Options file" diff --git a/amiga/gui.c b/amiga/gui.c index 71c7b4074..42117e49c 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -532,12 +532,11 @@ void ami_openscreenfirst(void) static void gui_init2(int argc, char** argv) { struct browser_window *bw = NULL; - long rarray[] = {0,0}; struct RDArgs *args; - STRPTR template = "URL,FORCE/S"; STRPTR temp_homepage_url = NULL; BOOL notalreadyrunning; - + STRPTR template = "URL/K,FORCE/S"; + long rarray[] = {0,0}; enum { A_URL, @@ -550,16 +549,17 @@ static void gui_init2(int argc, char** argv) 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(args = ReadArgs(template,rarray,NULL)) { + if(notalreadyrunning && (option_startup_no_window == false)) + ami_openscreenfirst(); + if(rarray[A_URL]) { temp_homepage_url = (char *)strdup(rarray[A_URL]); + if(notalreadyrunning) { 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; char fullpath[1024]; + if(notalreadyrunning && (option_startup_no_window == false)) + ami_openscreenfirst(); + for(i=0,wbarg=WBenchMsg->sm_ArgList;ism_NumArgs;i++,wbarg++) { if(i==0) continue; @@ -684,7 +687,7 @@ int main(int argc, char** argv) ami_messages_load(messages); - netsurf_init(&argc, argv, "PROGDIR:Resources/Options", messages); + netsurf_init(&argc, &argv, "PROGDIR:Resources/Options", messages); gui_init(argc, argv);