diff --git a/!NCNetSurf/Resources/en/Templates,fec b/!NCNetSurf/Resources/en/Templates,fec index 455e2c101..c9c9a875e 100644 Binary files a/!NCNetSurf/Resources/en/Templates,fec and b/!NCNetSurf/Resources/en/Templates,fec differ diff --git a/!NCNetSurf/Resources/fr/Templates,fec b/!NCNetSurf/Resources/fr/Templates,fec index 455e2c101..78746568e 100644 Binary files a/!NCNetSurf/Resources/fr/Templates,fec and b/!NCNetSurf/Resources/fr/Templates,fec differ diff --git a/!NetSurf/Resources/en/Templates,fec b/!NetSurf/Resources/en/Templates,fec index a775010e1..402102193 100644 Binary files a/!NetSurf/Resources/en/Templates,fec and b/!NetSurf/Resources/en/Templates,fec differ diff --git a/!NetSurf/Resources/fr/Templates,fec b/!NetSurf/Resources/fr/Templates,fec index 6f97d6893..f522f27fb 100644 Binary files a/!NetSurf/Resources/fr/Templates,fec and b/!NetSurf/Resources/fr/Templates,fec differ diff --git a/desktop/browser.c b/desktop/browser.c index a3480a1d1..fabd7ab4e 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -4,6 +4,7 @@ * http://www.opensource.org/licenses/gpl-license * Copyright 2003 Phil Mellor * Copyright 2004 James Bursa + * Copyright 2004 Andrew Timmins */ /** \file diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 507840454..b38f198a1 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -4,6 +4,7 @@ * http://www.opensource.org/licenses/gpl-license * Copyright 2003 Phil Mellor * Copyright 2004 James Bursa + * Copyright 2004 Andrew Timmins */ #include @@ -13,7 +14,11 @@ #include "netsurf/utils/config.h" #include "netsurf/content/fetch.h" #include "netsurf/content/fetchcache.h" -#include "netsurf/desktop/options.h" +#ifdef riscos + #include "netsurf/riscos/options.h" +#else + #include "netsurf/desktop/options.h" +#endif #include "netsurf/desktop/netsurf.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/gui.h" @@ -38,12 +43,27 @@ static void lib_init(void); int main(int argc, char** argv) { + char url[80]; + int length; + netsurf_init(argc, argv); #ifdef WITH_KIOSK_BROWSING browser_window_create("file://Docs/Intro_En", NULL); #endif + if (option_open_browser_at_startup == true){ + if (!(option_homepage_url == NULL)){ + browser_window_create(option_homepage_url, NULL); + } + else { + if ((length = snprintf(url, sizeof(url), + "file://Docs/intro_%s", + option_language)) >= 0 && length < (int)sizeof(url)) + browser_window_create(url, NULL); + } + } + while (!netsurf_quit) netsurf_poll(); diff --git a/riscos/dialog.c b/riscos/dialog.c index 2449fb011..0f48448c4 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -537,6 +537,16 @@ void ro_gui_dialog_open_config(void) wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT << wimp_CHILD_TS_EDGE_SHIFT)) { LOG(("Unable to open config proxy pane window")); } + + /* Always reset the selected panes to the default option */ + ro_gui_set_icon_selected_state(dialog_config, ICON_CONFIG_PROXY, + true); + ro_gui_set_icon_selected_state(dialog_config, ICON_CONFIG_BROWSER, + false); + ro_gui_set_icon_selected_state(dialog_config, ICON_CONFIG_THEME, + false); + ro_gui_set_icon_selected_state(dialog_config, ICON_CONFIG_MISC, + false); } /** @@ -952,6 +962,12 @@ void set_browser_choices(void) { ro_gui_set_icon_string(dialog_config_br, ICON_CONFIG_BR_ALANG, language_name(option_accept_language ? option_accept_language : "en")); + ro_gui_set_icon_string(dialog_config_br, ICON_CONFIG_BR_HOMEPAGE_URL, + option_homepage_url); + + ro_gui_set_icon_selected_state(dialog_config_br, ICON_CONFIG_BR_OPENBROWSER, + option_open_browser_at_startup); + } @@ -962,6 +978,10 @@ void set_browser_choices(void) { void get_browser_choices(void) { option_font_size = font_size; option_font_min_size = font_min_size; + option_homepage_url = ro_gui_get_icon_string(dialog_config_br, + ICON_CONFIG_BR_HOMEPAGE_URL); + option_open_browser_at_startup = ro_gui_get_icon_selected_state(dialog_config_br, + ICON_CONFIG_BR_OPENBROWSER); } diff --git a/riscos/gui.c b/riscos/gui.c index 90e73096a..3ee556698 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -807,10 +807,18 @@ void ro_gui_icon_bar_click(wimp_pointer *pointer) char url[80]; int length; - if ((length = snprintf(url, sizeof(url), + /* Open the homepage based on our the user options. */ + if (!(option_homepage_url == NULL)){ + browser_window_create(option_homepage_url, NULL); + } + else { + if ((length = snprintf(url, sizeof(url), "file://Docs/intro_%s", option_language)) >= 0 && length < (int)sizeof(url)) - browser_window_create(url, NULL); + browser_window_create(url, NULL); + } + + } else if (pointer->buttons == wimp_CLICK_ADJUST) { /* I've no idea what the correct way to scan for keys is when in the desktop, so I've used os_byte to scan directly. This may cause some @@ -995,7 +1003,7 @@ void ro_msg_dataload(wimp_message *message) url = ro_gui_url_file_parse(message->data.data_xfer.file_name); else if (file_type == 0xfaf || file_type == 0xf78 || - file_type == 0xf83 || + file_type == 0xf83 || file_type == 0x695 || file_type == 0xaff || file_type == 0xb60 || diff --git a/riscos/gui.h b/riscos/gui.h index 152da4826..9d23ef1e5 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -284,6 +284,11 @@ void ro_gui_debugwin_redraw(wimp_draw *redraw); #define ICON_CONFIG_BR_LANG_PICK 12 #define ICON_CONFIG_BR_ALANG 15 #define ICON_CONFIG_BR_ALANG_PICK 16 +#define ICON_CONFIG_BR_HOMEPAGE_URL 20 +#define ICON_CONFIG_BR_HOMEPAGE_CURRENT 21 +#define ICON_CONFIG_BR_HOMEPAGE_DEFAULT 22 +#define ICON_CONFIG_BR_HOMEPAGE_BLANK 23 +#define ICON_CONFIG_BR_OPENBROWSER 24 #define ICON_CONFIG_PROX_OK 0 #define ICON_CONFIG_PROX_CANCEL 1 diff --git a/riscos/menus.c b/riscos/menus.c index 651962416..65577c5d4 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -571,6 +571,8 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i) void ro_gui_menu_selection(wimp_selection *selection) { + char url[80]; + int length; wimp_pointer pointer; wimp_window_state state; os_error *error; @@ -720,6 +722,19 @@ void ro_gui_menu_selection(wimp_selection *selection) case MENU_NAVIGATE: switch (selection->items[1]) { case 0: /* Home */ + + /* Open the homepage based on our the user options. */ + + if (!(option_homepage_url == NULL)){ + browser_window_create(option_homepage_url, NULL); + } + else { + if ((length = snprintf(url, sizeof(url), + "file://Docs/intro_%s", + option_language)) >= 0 && length < (int)sizeof(url)) + browser_window_create(url, NULL); + } + break; case 1: /* Back */ history_back(current_gui->bw, diff --git a/riscos/options.h b/riscos/options.h index 8e6f1d4fa..6b6d1a60f 100644 --- a/riscos/options.h +++ b/riscos/options.h @@ -45,6 +45,8 @@ extern bool option_background_images; extern bool option_background_blending; extern bool option_buffer_animations; extern bool option_buffer_everything; +extern char *option_homepage_url; +extern bool option_open_browser_at_startup; #define EXTRA_OPTION_DEFINE \ bool option_use_mouse_gestures = false;\ @@ -75,7 +77,9 @@ int option_minimum_gif_delay = 10; \ bool option_background_images = true; \ bool option_background_blending = true; \ bool option_buffer_animations = true; \ -bool option_buffer_everything = false; +bool option_buffer_everything = false; \ +char *option_homepage_url =0;\ +bool option_open_browser_at_startup = false; #define EXTRA_OPTION_TABLE \ { "use_mouse_gestures", OPTION_BOOL, &option_use_mouse_gestures },\ @@ -106,6 +110,7 @@ bool option_buffer_everything = false; { "background_images", OPTION_BOOL, &option_background_images }, \ { "background_blending", OPTION_BOOL, &option_background_blending }, \ { "buffer_animations", OPTION_BOOL, &option_buffer_animations }, \ -{ "buffer_everything", OPTION_BOOL, &option_buffer_animations } - +{ "buffer_everything", OPTION_BOOL, &option_buffer_animations }, \ +{ "homepage_url", OPTION_STRING, &option_homepage_url }, \ +{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup } #endif diff --git a/riscos/window.c b/riscos/window.c index 0c451934e..0aeaa7c8a 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1258,10 +1258,21 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar) ro_gui_open_help_page("docs"); return true; + case wimp_KEY_F5: /* Refresh. */ + browser_window_reload(g->bw, false); + return true; + case wimp_KEY_F6: /* Help. */ ro_gui_hotlist_show(); return true; + case wimp_KEY_F7: /* Toggle fullscreen browsing. */ + + + + return true; + + case wimp_KEY_F8: /* View source. */ ro_gui_view_source(content); return true;