From f185ffa2574e7687620e0cdeb8449d480504d0fa Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sat, 15 Dec 2012 16:59:00 +0000 Subject: Add Enable Javascript configuration to RO GUI. --- riscos/configure/con_content.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'riscos/configure') diff --git a/riscos/configure/con_content.c b/riscos/configure/con_content.c index a8e9f78b4..81537bcef 100644 --- a/riscos/configure/con_content.c +++ b/riscos/configure/con_content.c @@ -35,6 +35,7 @@ #define CONTENT_DEFAULT_BUTTON 8 #define CONTENT_CANCEL_BUTTON 9 #define CONTENT_OK_BUTTON 10 +#define CONTENT_NO_JAVASCRIPT 11 static void ro_gui_options_content_default(wimp_pointer *pointer); static bool ro_gui_options_content_ok(wimp_w w); @@ -50,12 +51,15 @@ bool ro_gui_options_content_initialise(wimp_w w) nsoption_bool(no_plugins)); ro_gui_set_icon_selected_state(w, CONTENT_TARGET_BLANK, nsoption_bool(target_blank)); + ro_gui_set_icon_selected_state(w, CONTENT_NO_JAVASCRIPT, + !nsoption_bool(enable_javascript)); /* initialise all functions for a newly created window */ ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_ADVERTISEMENTS); ro_gui_wimp_event_register_checkbox(w, CONTENT_BLOCK_POPUPS); ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_PLUGINS); ro_gui_wimp_event_register_checkbox(w, CONTENT_TARGET_BLANK); + ro_gui_wimp_event_register_checkbox(w, CONTENT_NO_JAVASCRIPT); ro_gui_wimp_event_register_button(w, CONTENT_DEFAULT_BUTTON, ro_gui_options_content_default); ro_gui_wimp_event_register_cancel(w, CONTENT_CANCEL_BUTTON); @@ -78,6 +82,8 @@ void ro_gui_options_content_default(wimp_pointer *pointer) false); ro_gui_set_icon_selected_state(pointer->w, CONTENT_TARGET_BLANK, true); + ro_gui_set_icon_selected_state(pointer->w, CONTENT_NO_JAVASCRIPT, + false); } bool ro_gui_options_content_ok(wimp_w w) @@ -93,6 +99,9 @@ bool ro_gui_options_content_ok(wimp_w w) nsoption_set_bool(target_blank, ro_gui_get_icon_selected_state(w, CONTENT_TARGET_BLANK)); + nsoption_set_bool(enable_javascript, + !ro_gui_get_icon_selected_state(w, CONTENT_NO_JAVASCRIPT)); + ro_gui_save_options(); return true; } -- cgit v1.2.3