diff options
author | Vincent Sanders <vince@kyllikki.org> | 2013-05-27 22:31:54 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2013-05-27 22:31:54 +0100 |
commit | 7a72fc803a6a7a607c853fae533622322337e981 (patch) | |
tree | 9750aa1b554caa6a95516260664033bf1e4bafc4 | |
parent | ae2f6ae3ed60a0e50f9aec06120ddc734b1e113a (diff) | |
download | netsurf-vince/options.tar.gz |
start amiga move to new option APIvince/options
-rw-r--r-- | amiga/gui.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/amiga/gui.c b/amiga/gui.c index bbd844441..d55949420 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -391,7 +391,13 @@ void ami_open_resources(void) //ami_help_init(NULL); } -void ami_set_options(void) +/** + * Set option defaults for amiga frontend + * + * @param defaults The option table to update. + * @return error status. + */ +static nserror ami_set_options(struct nsoption_s *defaults) { STRPTR tempacceptlangs; BPTR lock = 0; @@ -482,6 +488,8 @@ void ami_set_options(void) nsoption_set_bool(font_antialiasing, false); nsoption_set_bool(truecolour_mouse_pointers, false); #endif + + return NSERROR_OK; } void ami_amiupdate(void) @@ -543,13 +551,6 @@ nsurl *gui_get_resource_url(const char *path) return url; } -/* Documented in utils/nsoption.h */ -void gui_options_init_defaults(void) -{ - /* Set defaults for absent option strings */ - ami_set_options(); /* check options and set defaults where required */ -} - void gui_init(int argc, char** argv) { BPTR lock = 0; @@ -895,7 +896,7 @@ int main(int argc, char** argv) char temp[1024]; BPTR lock = 0; int32 user = 0; - + nserror ret; Object *splash_window = ami_gui_splash_open(); user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY); @@ -924,7 +925,18 @@ int main(int argc, char** argv) */ nslog_init(NULL, &argc, argv); - netsurf_init(&argc, &argv, current_user_options, messages); + /* user options setup */ + ret = nsoption_init(ami_set_options, &nsoptions, &nsoptions_default); + if (ret != NSERROR_OK) { + die("Options failed to initialise"); + } + nsoption_read(current_user_options, NULL); + nsoption_commandline(&argc, argv, NULL); + + ret = netsurf_init(messages); + if (ret != NSERROR_OK) { + die("NetSurf failed to initialise"); + } amiga_icon_init(); |