fixup issues with new options API merge

This commit is contained in:
Vincent Sanders 2013-05-28 16:44:46 +01:00
parent fcc61ea374
commit a92e5930ff
17 changed files with 46 additions and 45 deletions

View File

@ -238,7 +238,7 @@ void gui_set_clipboard(const char *buffer, size_t length,
{
if(!(PushChunk(iffh, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN)))
{
if(nsoption_bool(utf8_clipboard))
if(nsoption_bool(clipboard_write_utf8))
{
if(!(PushChunk(iffh, 0, ID_CSET, 32)))
{
@ -254,7 +254,7 @@ void gui_set_clipboard(const char *buffer, size_t length,
}
if(!(PushChunk(iffh, 0, ID_CHRS, IFFSIZE_UNKNOWN))) {
if(nsoption_bool(utf8_clipboard)) {
if(nsoption_bool(clipboard_write_utf8)) {
WriteChunkBytes(iffh, buffer, length);
} else {
if(utf8_to_local_encoding(buffer, length, &text) == UTF8_CONVERT_OK) {

View File

@ -881,10 +881,10 @@ void ami_font_setdevicedpi(int id)
{
DisplayInfoHandle dih;
struct DisplayInfo dinfo;
ULONG ydpi = nsoption_int(amiga_ydpi);
ULONG xdpi = nsoption_int(amiga_ydpi);
ULONG ydpi = nsoption_int(screen_ydpi);
ULONG xdpi = nsoption_int(screen_ydpi);
nscss_screen_dpi = INTTOFIX(nsoption_int(amiga_ydpi));
nscss_screen_dpi = INTTOFIX(nsoption_int(screen_ydpi));
if(id && (nsoption_int(monitor_aspect_x) != 0) && (nsoption_int(monitor_aspect_y) != 0))
{

View File

@ -131,6 +131,8 @@
#include <math.h>
#include <string.h>
define AMINS_SCROLLERPEN NUMDRIPENS
#define NSA_KBD_SCROLL_PX 10
/* Extra mouse button defines to match those in intuition/intuition.h */
@ -668,10 +670,10 @@ void ami_openscreen(void)
if (nsoption_charp(use_pubscreen) == NULL)
{
if((nsoption_charp(modeid)) &&
(strncmp(nsoption_charp(modeid), "0x", 2) == 0))
if((nsoption_charp(screen_modeid)) &&
(strncmp(nsoption_charp(screen_modeid), "0x", 2) == 0))
{
id = strtoul(nsoption_charp(modeid), NULL, 0);
id = strtoul(nsoption_charp(screen_modeid), NULL, 0);
}
else
{
@ -687,8 +689,8 @@ void ami_openscreen(void)
char *modeid = malloc(20);
id = screenmodereq->sm_DisplayID;
sprintf(modeid, "0x%lx", id);
nsoption_set_charp(modeid, modeid);
nsoption_write(current_user_options);
nsoption_set_charp(screen_modeid, modeid);
nsoption_write(current_user_options, NULL, NULL);
}
FreeAslRequest(screenmodereq);
}
@ -3196,7 +3198,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
CLICKTAB_Labels, &g->shared->tab_list,
TAG_DONE);
if(nsoption_bool(new_tab_active))
if(nsoption_bool(new_tab_is_active))
{
RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],g->shared->win,NULL,
CLICKTAB_Current,g->tab,
@ -3209,7 +3211,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->shared->tabs++;
g->shared->next_tab++;
if(nsoption_bool(new_tab_active)) ami_switch_tab(g->shared,false);
if(nsoption_bool(new_tab_is_active)) ami_switch_tab(g->shared,false);
ami_update_buttons(g->shared);

View File

@ -435,9 +435,10 @@ void ami_gui_opts_open(void)
screennamedisabled = TRUE;
}
if((nsoption_charp(modeid)) && (strncmp(nsoption_charp(modeid),"0x",2) == 0))
if((nsoption_charp(screen_modeid)) &&
(strncmp(nsoption_charp(screen_modeid),"0x",2) == 0))
{
screenmodeid = strtoul(nsoption_charp(modeid),NULL,0);
screenmodeid = strtoul(nsoption_charp(screen_modeid),NULL,0);
}
if(nsoption_bool(http_proxy))
@ -743,7 +744,7 @@ void ami_gui_opts_open(void)
GA_ID, GID_OPTS_PTROS,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_PTROS],
GA_Selected, nsoption_bool(use_os_pointers),
GA_Selected, nsoption_bool(os_mouse_pointers),
CheckBoxEnd,
LayoutEnd, // mouse
CHILD_WeightedHeight,0,
@ -1163,7 +1164,7 @@ void ami_gui_opts_open(void)
GA_ID, GID_OPTS_TAB_ACTIVE,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_TAB_ACTIVE],
GA_Selected, !nsoption_bool(new_tab_active),
GA_Selected, !nsoption_bool(new_tab_is_active),
CheckBoxEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_TAB_LAST] = CheckBoxObject,
GA_ID, GID_OPTS_TAB_LAST,
@ -1274,7 +1275,7 @@ void ami_gui_opts_open(void)
GA_ID, GID_OPTS_CLIPBOARD,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_CLIPBOARD],
GA_Selected, nsoption_bool(utf8_clipboard),
GA_Selected, nsoption_bool(clipboard_write_utf8),
CheckBoxEnd,
LayoutEnd, // clipboard
CHILD_WeightedHeight, 0,
@ -1590,7 +1591,7 @@ void ami_gui_opts_use(bool save)
{
char *modeid = malloc(20);
sprintf(modeid,"0x%lx", id);
nsoption_set_charp(modeid, modeid);
nsoption_set_charp(screen_modeid, modeid);
}
GetAttr(GA_Selected,gow->objects[GID_OPTS_WIN_SIMPLE],(ULONG *)&data);
@ -1614,9 +1615,9 @@ void ami_gui_opts_use(bool save)
GetAttr(GA_Selected,gow->objects[GID_OPTS_PTROS],(ULONG *)&data);
if (data) {
nsoption_set_bool(use_os_pointers, true);
nsoption_set_bool(os_mouse_pointers, true);
} else {
nsoption_set_bool(use_os_pointers, false);
nsoption_set_bool(os_mouse_pointers, false);
}
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_PROXY],(ULONG *)&data);
@ -1667,7 +1668,7 @@ void ami_gui_opts_use(bool save)
nsoption_set_bool(animate_images, true);
}
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_DPI_Y],(ULONG *)&nsoption_int(amiga_ydpi));
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_DPI_Y],(ULONG *)&nsoption_int(screen_ydpi));
ami_font_setdevicedpi(id); // id set above
GetAttr(GETFONT_TextAttr,gow->objects[GID_OPTS_FONT_SANS],(ULONG *)&data);
@ -1740,9 +1741,9 @@ void ami_gui_opts_use(bool save)
GetAttr(GA_Selected,gow->objects[GID_OPTS_TAB_ACTIVE],(ULONG *)&data);
if (data) {
nsoption_set_bool(new_tab_active, false);
nsoption_set_bool(new_tab_is_active, false);
} else {
nsoption_set_bool(new_tab_active, true);
nsoption_set_bool(new_tab_is_active, true);
}
GetAttr(GA_Selected,gow->objects[GID_OPTS_TAB_LAST],(ULONG *)&data);
@ -1784,9 +1785,9 @@ void ami_gui_opts_use(bool save)
GetAttr(GA_Selected,gow->objects[GID_OPTS_CLIPBOARD],(ULONG *)&data);
if (data) {
nsoption_set_bool(utf8_clipboard, true);
nsoption_set_bool(clipboard_write_utf8, true);
} else {
nsoption_set_bool(utf8_clipboard, false);
nsoption_set_bool(clipboard_write_utf8, false);
}
GetAttr(GA_Selected,gow->objects[GID_OPTS_CONTEXTMENU],(ULONG *)&data);
@ -1868,7 +1869,7 @@ void ami_gui_opts_use(bool save)
}
if(save == true) {
nsoption_write(current_user_options);
nsoption_write(current_user_options, NULL, NULL);
ami_font_savescanner(); /* just in case it has changed and been used only */
}

View File

@ -953,7 +953,7 @@ static void ami_menu_item_settings_snapshot(struct Hook *hook, APTR window, stru
static void ami_menu_item_settings_save(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
nsoption_write(current_user_options);
nsoption_write(current_user_options, NULL, NULL);
}
static void ami_menu_item_arexx_execute(struct Hook *hook, APTR window, struct IntuiMessage *msg)

View File

@ -193,7 +193,7 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(drag_save_data) return;
if(nsoption_bool(use_os_pointers))
if(nsoption_bool(os_mouse_pointers))
{
switch(shape)
{

View File

@ -389,7 +389,7 @@ static void __CDECL menu_savewin(short item, short title, void *data)
nsoption_set_int(window_height, rect.g_h);
nsoption_set_int(window_x, rect.g_x);
nsoption_set_int(window_y, rect.g_y);
nsoption_write((const char*)&options);
nsoption_write((const char*)&options, NULL, NULL);
}
}

View File

@ -113,8 +113,8 @@ static void save_settings(void)
{
apply_settings();
// Save settings
nsoption_write( (const char*)&options );
nsoption_read( (const char*)&options );
nsoption_write( (const char*)&options, NULL, NULL);
nsoption_read( (const char*)&options , NULL);
close_settings();
form_alert(1, "[1][Some options require an netsurf restart!][OK]");
deskmenu_update();

View File

@ -637,7 +637,7 @@ void gui_init(int argc, char** argv)
find_resource(buf, "Choices", "%/Choices");
LOG(("Using '%s' as Preferences file", buf));
options_file_location = strdup(buf);
nsoption_read(buf);
nsoption_read(buf, NULL);
/* check what the font settings are, setting them to a default font

View File

@ -274,7 +274,7 @@ void ro_gui_buffer_close(void)
_swix(Tinct_Plot, _IN(2) | _IN(3) | _IN(4) | _IN(7),
(char *)(buffer + 1),
clipping.x0, clipping.y0,
nsoption_int(fg_plot_style));
nsoption_int(plot_fg_quality));
else
xosspriteop_put_sprite_user_coords(osspriteop_PTR,
buffer, (osspriteop_id)(buffer + 1),

View File

@ -77,11 +77,11 @@ bool ro_gui_options_image_initialise(wimp_w w)
/* set the current values */
for (i = 0; (i < 4); i++) {
if ((unsigned int)nsoption_int(fg_plot_style) == tinct_options[i])
if ((unsigned int)nsoption_int(plot_fg_quality) == tinct_options[i])
ro_gui_set_icon_string(w, IMAGE_FOREGROUND_FIELD,
image_quality_menu->entries[i].
data.indirected_text.text, true);
if ((unsigned int)nsoption_int(bg_plot_style) == tinct_options[i])
if ((unsigned int)nsoption_int(plot_bg_quality) == tinct_options[i])
ro_gui_set_icon_string(w, IMAGE_BACKGROUND_FIELD,
image_quality_menu->entries[i].
data.indirected_text.text, true);
@ -252,8 +252,8 @@ void ro_gui_options_update_shading(wimp_w w)
bool ro_gui_options_image_ok(wimp_w w)
{
ro_gui_options_image_read(w,
(unsigned int *)&nsoption_int(bg_plot_style),
(unsigned int *)&nsoption_int(fg_plot_style));
(unsigned int *)&nsoption_int(plot_bg_quality),
(unsigned int *)&nsoption_int(plot_fg_quality));
nsoption_set_int(minimum_gif_delay,
ro_gui_get_icon_decimal(w, IMAGE_SPEED_FIELD, 2));

View File

@ -664,7 +664,7 @@ void ro_gui_dialog_close_persistent(wimp_w parent) {
void ro_gui_save_options(void)
{
nsoption_write("<NetSurf$ChoicesSave>");
nsoption_write("<NetSurf$ChoicesSave>", NULL, NULL);
}
bool ro_gui_dialog_zoom_apply(wimp_w w) {

View File

@ -965,7 +965,7 @@ void ro_gui_signal(int sig)
xhourglass_on();
xhourglass_colours(0x0000ffff, 0x000000ff, &old_sand, &old_glass);
nsoption_dump(stderr);
nsoption_dump(stderr, NULL);
/*rufl_dump_state();*/
#ifndef __ELF__

View File

@ -69,8 +69,8 @@ bool image_redraw(osspriteop_area *area, int x, int y, int req_width,
req_height *= 2;
width *= 2;
height *= 2;
tinct_options = background ? nsoption_int(bg_plot_style) :
nsoption_int(fg_plot_style);
tinct_options = background ? nsoption_int(plot_bg_quality) :
nsoption_int(plot_fg_quality);
switch (type) {
case IMAGE_PLOT_TINCT_ALPHA:
return image_redraw_tinct(header, x, y,

View File

@ -47,7 +47,6 @@
#include <stdbool.h>
#include "utils/errors.h"
typedef uint32_t colour;
/* allow targets to include any necessary headers of their own */
#define NSOPTION_BOOL(NAME, DEFAULT)

View File

@ -931,7 +931,7 @@ nsws_window_command(HWND hwnd,
nsoption_set_int(window_y, r.top);
nsoption_set_int(window_width, r.right - r.left);
nsoption_set_int(window_height, r.bottom - r.top);
nsoption_write(options_file_location);
nsoption_write(options_file_location, NULL, NULL);
break;
}

View File

@ -675,7 +675,6 @@ void nsws_prefs_dialog_init(HINSTANCE hinst, HWND parent)
win_perror("PropertySheet");
} else if (ret > 0) {
/* user saved changes */
nsoption_write(options_file_location);
nsoption_write(options_file_location, NULL, NULL);
}
}