mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 21:46:57 +03:00
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:
parent
0194e4bb55
commit
d3276dfbaf
8
amiga/dist/Install
vendored
8
amiga/dist/Install
vendored
@ -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*\"\"")
|
||||
)
|
||||
)
|
||||
|
||||
|
6
amiga/dist/NetSurf.guide
vendored
6
amiga/dist/NetSurf.guide
vendored
@ -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"
|
||||
|
17
amiga/gui.c
17
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;i<WBenchMsg->sm_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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user