summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2007-10-10 21:22:36 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2007-10-10 21:22:36 +0000
commit08ea9e706bef92eb60efaf38937e8864466cf3fa (patch)
tree429d305e3fc11c8e670a29079eea5cf6d37d3a4b /riscos
parentcab5913aeee8a96ef32a331c1843e06349c23405 (diff)
downloadnetsurf-08ea9e706bef92eb60efaf38937e8864466cf3fa.tar.gz
netsurf-08ea9e706bef92eb60efaf38937e8864466cf3fa.tar.bz2
Allow interactive help to be turned off (implement 1793020)
svn path=/trunk/netsurf/; revision=3631
Diffstat (limited to 'riscos')
-rw-r--r--riscos/help.c9
-rw-r--r--riscos/menus.c13
-rw-r--r--riscos/options.h7
3 files changed, 23 insertions, 6 deletions
diff --git a/riscos/help.c b/riscos/help.c
index 3319c92ea..fb0aa97de 100644
--- a/riscos/help.c
+++ b/riscos/help.c
@@ -31,6 +31,7 @@
#include "riscos/gui.h"
#include "riscos/help.h"
#include "riscos/menus.h"
+#include "riscos/options.h"
#include "riscos/theme.h"
#include "riscos/treeview.h"
#include "riscos/wimp.h"
@@ -99,6 +100,10 @@ void ro_gui_interactive_help_request(wimp_message *message) {
os_error *error;
const char *auto_text;
int i;
+
+ /* check we aren't turned off */
+ if (!option_interactive_help)
+ return;
/* only accept help requests */
if ((!message) || (message->action != message_HELP_REQUEST))
@@ -315,6 +320,10 @@ void ro_gui_interactive_help_start(void) {
char *help_start;
wimp_t task = 0;
os_error *error;
+
+ /* don't launch a second copy of anything */
+ if (ro_gui_interactive_help_available())
+ return;
/* launch <Help$Start> */
help_start = getenv("Help$Start");
diff --git a/riscos/menus.c b/riscos/menus.c
index 03fd23619..60568626b 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -1421,7 +1421,12 @@ bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
0, 0, true);
return true;
case HELP_LAUNCH_INTERACTIVE:
- ro_gui_interactive_help_start();
+ if (!ro_gui_interactive_help_available()) {
+ ro_gui_interactive_help_start();
+ option_interactive_help = true;
+ } else {
+ option_interactive_help = !option_interactive_help;
+ }
return true;
/* history actions */
@@ -1784,11 +1789,11 @@ void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
/* help actions */
case HELP_LAUNCH_INTERACTIVE:
- result = ro_gui_interactive_help_available();
- ro_gui_menu_set_entry_shaded(current_menu,
- action, result);
+ result = ro_gui_interactive_help_available()
+ && option_interactive_help;
ro_gui_menu_set_entry_ticked(current_menu,
action, result);
+ ro_gui_save_options();
break;
/* history actions */
diff --git a/riscos/options.h b/riscos/options.h
index 510147032..8510e5803 100644
--- a/riscos/options.h
+++ b/riscos/options.h
@@ -62,6 +62,7 @@ extern char *option_recent_save;
extern char *option_theme_path;
extern char *option_theme_save;
extern bool option_thumbnail_iconise;
+extern bool option_interactive_help;
#define EXTRA_OPTION_DEFINE \
bool option_use_mouse_gestures = false;\
@@ -98,7 +99,8 @@ char *option_recent_path = 0; \
char *option_recent_save = 0; \
char *option_theme_path = 0; \
char *option_theme_save = 0; \
-bool option_thumbnail_iconise = true;
+bool option_thumbnail_iconise = true; \
+bool option_interactive_help = true;
#define EXTRA_OPTION_TABLE \
{ "use_mouse_gestures", OPTION_BOOL, &option_use_mouse_gestures },\
@@ -135,6 +137,7 @@ bool option_thumbnail_iconise = true;
{ "recent_save", OPTION_STRING, &option_recent_save }, \
{ "theme_path", OPTION_STRING, &option_theme_path }, \
{ "theme_save", OPTION_STRING, &option_theme_save }, \
-{ "thumbnail_iconise", OPTION_BOOL, &option_thumbnail_iconise }
+{ "thumbnail_iconise", OPTION_BOOL, &option_thumbnail_iconise }, \
+{ "interactive_help", OPTION_BOOL, &option_interactive_help }
#endif