From b59616c9ab85b0f58c0318f62e39f197932a712b Mon Sep 17 00:00:00 2001 From: Andrew Timmins Date: Mon, 26 Jul 2004 20:13:45 +0000 Subject: [project @ 2004-07-26 20:13:45 by atimmins] Updated to support new config options (homepage, open on startup). Bug fixes with new config pane window (sticky selected radio icon bug!). Also includes up-to-date French templates. svn path=/import/netsurf/; revision=1150 --- riscos/dialog.c | 20 ++++++++++++++++++++ riscos/gui.c | 14 +++++++++++--- riscos/gui.h | 5 +++++ riscos/menus.c | 15 +++++++++++++++ riscos/options.h | 11 ++++++++--- riscos/window.c | 11 +++++++++++ 6 files changed, 70 insertions(+), 6 deletions(-) (limited to 'riscos') 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; -- cgit v1.2.3