[project @ 2003-06-05 00:31:03 by jmb]

Put Choices file in Choices:NetSurf.Choices

svn path=/import/netsurf/; revision=157
This commit is contained in:
John Mark Bell 2003-06-05 00:31:03 +00:00
parent 0e0637ce27
commit 5a51bd5819
3 changed files with 20 additions and 23 deletions

View File

@ -22,4 +22,4 @@ NetSurf is an open-source web browser for RISC OS. Its aim is to bring HTML 4 an
Getting Started Getting Started
=============== ===============
Double click on the NetSurf application and the NetSurf icon will appear in the iconbar. To open a browser window left click on the icon. Detailed documentation can be found by following links from the default page that loads. Double click on the NetSurf application and the NetSurf icon will appear in the iconbar. To open a browser window left click on the icon. Detailed documentation can be found by following links from the default page that loads and also in the Docs directory.

View File

@ -1,16 +0,0 @@
# General options - for any platform
# Proxy
USE_HTTP:N
HTTP_PROXY:http://www-cache.freeserve.co.uk
HTTP_PORT:8080
# RISC OS specific options
# Browser
RO_MOUSE_GESTURES:N
RO_TEXT_SELECTION:Y
RO_FORM_ELEMENTS:Y
RO_SHOW_TOOLBAR:Y
RO_SHOW_PRINT:N
# Theme
RO_THEME:Clear

View File

@ -1,7 +1,10 @@
#include "netsurf/desktop/options.h" #include "netsurf/desktop/options.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "oslib/messagetrans.h" #include "oslib/messagetrans.h"
#include "oslib/osfile.h"
#include "netsurf/utils/log.h" #include "netsurf/utils/log.h"
#include "netsurf/utils/utils.h"
struct options OPTIONS; struct options OPTIONS;
@ -53,13 +56,19 @@ const char* yesno(int q)
void options_write(struct options* opt, char* filename) void options_write(struct options* opt, char* filename)
{ {
char* fn; char* fn, *dir;
FILE* f; FILE* f;
dir = "<Choices$Write>.NetSurf";
fn = strdup(dir);
strcat(fn, ".");
if (filename == NULL) if (filename == NULL)
fn = (char*) "<NetSurf$Dir>.Choices"; strcat(fn, "Choices");
else else
fn = filename; strcat(fn, filename);
xosfile_create_dir(dir, 0);
f = fopen(fn, "w"); f = fopen(fn, "w");
if (f != NULL) if (f != NULL)
@ -78,12 +87,14 @@ void options_write(struct options* opt, char* filename)
fprintf(f, "\n# Theme\n"); fprintf(f, "\n# Theme\n");
fprintf(f, "RO_THEME:%s\n", opt->theme); fprintf(f, "RO_THEME:%s\n", opt->theme);
} }
fclose(f);
} }
void options_init(struct options* opt) void options_init(struct options* opt)
{ {
opt->http = 0; opt->http = 0;
opt->http_proxy = NULL; opt->http_proxy = strdup("http://www-cache.freeserve.co.uk");
opt->http_port = 8080; opt->http_port = 8080;
opt->use_mouse_gestures = 0; opt->use_mouse_gestures = 0;
opt->allow_text_selection = 1; opt->allow_text_selection = 1;
@ -101,11 +112,13 @@ void options_read(struct options* opt, char* filename)
char* fn; char* fn;
int size; int size;
fn = "Choices:NetSurf.";
LOG(("Testing filename")); LOG(("Testing filename"));
if (filename == NULL) if (filename == NULL)
fn = "<NetSurf$Dir>.Choices"; fn = "Choices:NetSurf.Choices";
else else
fn = filename; strcat(fn, filename);
LOG(("Getting file info")); LOG(("Getting file info"));
if (xmessagetrans_file_info(fn, &flags, &size) != NULL) if (xmessagetrans_file_info(fn, &flags, &size) != NULL)