From 5a51bd5819ff5a9a07f7c3e0ee81d6505ab9dd41 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 5 Jun 2003 00:31:03 +0000 Subject: [project @ 2003-06-05 00:31:03 by jmb] Put Choices file in Choices:NetSurf.Choices svn path=/import/netsurf/; revision=157 --- !NetSurf/!Help | 2 +- !NetSurf/Choices,fff | 16 ---------------- riscos/options.c | 25 +++++++++++++++++++------ 3 files changed, 20 insertions(+), 23 deletions(-) delete mode 100644 !NetSurf/Choices,fff diff --git a/!NetSurf/!Help b/!NetSurf/!Help index e6ec7c0bb..73a51bfe2 100644 --- a/!NetSurf/!Help +++ b/!NetSurf/!Help @@ -22,4 +22,4 @@ NetSurf is an open-source web browser for RISC OS. Its aim is to bring HTML 4 an 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. \ No newline at end of file +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. \ No newline at end of file diff --git a/!NetSurf/Choices,fff b/!NetSurf/Choices,fff deleted file mode 100644 index cd08c7ff4..000000000 --- a/!NetSurf/Choices,fff +++ /dev/null @@ -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 diff --git a/riscos/options.c b/riscos/options.c index 26ae0f6bc..9c02ab908 100644 --- a/riscos/options.c +++ b/riscos/options.c @@ -1,7 +1,10 @@ #include "netsurf/desktop/options.h" #include +#include #include "oslib/messagetrans.h" +#include "oslib/osfile.h" #include "netsurf/utils/log.h" +#include "netsurf/utils/utils.h" struct options OPTIONS; @@ -53,13 +56,19 @@ const char* yesno(int q) void options_write(struct options* opt, char* filename) { - char* fn; + char* fn, *dir; FILE* f; + dir = ".NetSurf"; + fn = strdup(dir); + strcat(fn, "."); + if (filename == NULL) - fn = (char*) ".Choices"; + strcat(fn, "Choices"); else - fn = filename; + strcat(fn, filename); + + xosfile_create_dir(dir, 0); f = fopen(fn, "w"); if (f != NULL) @@ -78,12 +87,14 @@ void options_write(struct options* opt, char* filename) fprintf(f, "\n# Theme\n"); fprintf(f, "RO_THEME:%s\n", opt->theme); } + + fclose(f); } void options_init(struct options* opt) { opt->http = 0; - opt->http_proxy = NULL; + opt->http_proxy = strdup("http://www-cache.freeserve.co.uk"); opt->http_port = 8080; opt->use_mouse_gestures = 0; opt->allow_text_selection = 1; @@ -101,11 +112,13 @@ void options_read(struct options* opt, char* filename) char* fn; int size; + fn = "Choices:NetSurf."; + LOG(("Testing filename")); if (filename == NULL) - fn = ".Choices"; + fn = "Choices:NetSurf.Choices"; else - fn = filename; + strcat(fn, filename); LOG(("Getting file info")); if (xmessagetrans_file_info(fn, &flags, &size) != NULL) -- cgit v1.2.3