Fix a crash when edit settings if NetSurf is running on the WB screen

Rename use_pubscreen to make it clearer what the option is for
This commit is contained in:
Chris Young 2013-05-31 23:25:05 +01:00
parent 864762cbe6
commit 8b586b2d67
6 changed files with 18 additions and 18 deletions

View File

@ -455,13 +455,13 @@ STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__
{
cmd->ac_RC = 0;
if(nsoption_charp(use_pubscreen) == NULL)
if(nsoption_charp(pubscreen_name) == NULL)
{
strcpy(result,"NetSurf");
}
else
{
strcpy(result, nsoption_charp(use_pubscreen));
strcpy(result, nsoption_charp(pubscreen_name));
}
cmd->ac_Result = result;

2
amiga/dist/Install vendored
View File

@ -558,7 +558,7 @@
(help @textfile-help)
(dest #user-options)
(append "theme:" #theme "\n")
(append "use_pubscreen:Workbench\n")
(append "pubscreen_name:Workbench\n")
)
(if (= #hotlist-exist 0)

View File

@ -55,7 +55,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
{
const char *filetype = NULL;
if(strcmp(nsoption_charp(use_pubscreen), "Workbench")) return;
if(strcmp(nsoption_charp(pubscreen_name), "Workbench")) return;
switch(type)
{
@ -106,7 +106,7 @@ void ami_drag_save(struct Window *win)
ami_drag_icon_close(NULL);
ami_autoscroll = FALSE;
if(nsoption_charp(use_pubscreen) && (strcmp(nsoption_charp(use_pubscreen),"Workbench") == 0))
if(nsoption_charp(pubscreen_name) && (strcmp(nsoption_charp(pubscreen_name),"Workbench") == 0))
{
which = WhichWorkbenchObject(NULL,scrn->MouseX,scrn->MouseY,
WBOBJA_Type,&type,

View File

@ -690,7 +690,7 @@ void ami_openscreen(void)
compositing = ~0UL;
else compositing = nsoption_int(screen_compositing);
if (nsoption_charp(use_pubscreen) == NULL)
if (nsoption_charp(pubscreen_name) == NULL)
{
if((nsoption_charp(screen_modeid)) &&
(strncmp(nsoption_charp(screen_modeid), "0x", 2) == 0))
@ -739,15 +739,15 @@ void ami_openscreen(void)
}
else
{
nsoption_set_charp(use_pubscreen,
nsoption_set_charp(pubscreen_name,
strdup("Workbench"));
}
}
}
if (nsoption_charp(use_pubscreen) != NULL)
if (nsoption_charp(pubscreen_name) != NULL)
{
scrn = LockPubScreen(nsoption_charp(use_pubscreen));
scrn = LockPubScreen(nsoption_charp(pubscreen_name));
if(scrn == NULL)
{
@ -3275,9 +3275,9 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
ULONG addtabclosegadget = TAG_IGNORE;
ULONG iconifygadget = FALSE;
if (nsoption_charp(use_pubscreen) &&
if (nsoption_charp(pubscreen_name) &&
(locked_screen == TRUE) &&
(strcmp(nsoption_charp(use_pubscreen), "Workbench") == 0))
(strcmp(nsoption_charp(pubscreen_name), "Workbench") == 0))
iconifygadget = TRUE;
ami_create_menu(g->shared);

View File

@ -415,9 +415,9 @@ void ami_gui_opts_open(void)
return;
}
if(nsoption_charp(use_pubscreen))
if(nsoption_charp(pubscreen_name))
{
if(strcmp(nsoption_charp(use_pubscreen),"Workbench") == 0)
if(strcmp(nsoption_charp(pubscreen_name),"Workbench") == 0)
{
screenoptsselected = 1;
screennamedisabled = TRUE;
@ -694,7 +694,7 @@ void ami_gui_opts_open(void)
GA_ID, GID_OPTS_SCREENNAME,
GA_RelVerify, TRUE,
GA_Disabled,screennamedisabled,
STRINGA_TextVal, nsoption_bool(use_pubscreen),
STRINGA_TextVal, nsoption_charp(pubscreen_name),
STRINGA_BufferPos,0,
StringEnd,
LayoutEnd,
@ -1573,16 +1573,16 @@ void ami_gui_opts_use(bool save)
switch(data)
{
case 0:
nsoption_set_charp(use_pubscreen, strdup("\0"));
nsoption_set_charp(pubscreen_name, strdup("\0"));
break;
case 1:
nsoption_set_charp(use_pubscreen, (char *)strdup("Workbench"));
nsoption_set_charp(pubscreen_name, (char *)strdup("Workbench"));
break;
case 2:
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_SCREENNAME],(ULONG *)&data);
nsoption_set_charp(use_pubscreen, (char *)strdup((char *)data));
nsoption_set_charp(pubscreen_name, (char *)strdup((char *)data));
break;
}

View File

@ -27,7 +27,7 @@
NSOPTION_STRING(url_file, NULL)
NSOPTION_STRING(hotlist_file, NULL)
NSOPTION_STRING(use_pubscreen, NULL)
NSOPTION_STRING(pubscreen_name, NULL)
NSOPTION_STRING(screen_modeid, NULL)
NSOPTION_INTEGER(screen_compositing, -1)
NSOPTION_INTEGER(screen_ydpi, 85)