diff options
author | James Bursa <james@netsurf-browser.org> | 2004-03-08 00:03:58 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-03-08 00:03:58 +0000 |
commit | 7d9bf053b4ca97fd25359d7ea063d9233ed5c63a (patch) | |
tree | d36c4fc2379648c57f7ef3c2045b4153de82dbbd /riscos/gui.c | |
parent | 1237e077c7c2acfe3a5d6dfc997115839b418db8 (diff) | |
download | netsurf-7d9bf053b4ca97fd25359d7ea063d9233ed5c63a.tar.gz netsurf-7d9bf053b4ca97fd25359d7ea063d9233ed5c63a.tar.bz2 |
[project @ 2004-03-08 00:03:58 by bursa]
Implement Accept-Language option.
svn path=/import/netsurf/; revision=591
Diffstat (limited to 'riscos/gui.c')
-rw-r--r-- | riscos/gui.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/riscos/gui.c b/riscos/gui.c index 18ddfbb5e..49bf78daf 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -132,25 +132,30 @@ void gui_init(int argc, char** argv) char theme_fname[256]; os_error *error; - LOG(("starting hourglass")); xhourglass_start(1); - LOG(("reading choices")); + LOG(("reading choices")); options_read("Choices:WWW.NetSurf.Choices"); - LOG(("choosing language")); + LOG(("choosing language")); ro_gui_choose_language(); - LOG(("grabbing NetSurf$Dir from the environment")); NETSURF_DIR = getenv("NetSurf$Dir"); sprintf(path, "<NetSurf$Dir>.Resources.%s.Messages", option_language); LOG(("Loading messages from '%s'", path)); messages_load(path); + messages_load("<NetSurf$Dir>.Resources.LangNames"); LOG(("done")); - task_handle = wimp_initialise(wimp_VERSION_RO38, "NetSurf", - (wimp_message_list*) &task_messages, 0); + error = xwimp_initialise(wimp_VERSION_RO38, "NetSurf", + (wimp_message_list*) &task_messages, 0, + &task_handle); + if (error) { + LOG(("xwimp_initialise failed: 0x%x: %s", + error->errnum, error->errmess)); + exit(EXIT_FAILURE); + } /* Issue a *Desktop to poke AcornURI into life */ if (getenv("NetSurf$Start_URI_Handler")) @@ -209,8 +214,11 @@ void ro_gui_choose_language(void) if (2 < strlen(option_language)) option_language[2] = 0; sprintf(path, "<NetSurf$Dir>.Resources.%s", option_language); - if (is_dir(path)) + if (is_dir(path)) { + if (!option_accept_language) + option_accept_language = strdup(option_language); return; + } free(option_language); option_language = 0; } @@ -237,6 +245,8 @@ void ro_gui_choose_language(void) else option_language = strdup("en"); assert(option_language); + if (!option_accept_language) + option_accept_language = strdup(option_language); } |