From 78181f7d4e516aff3c826459beab8ace5edc2e65 Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sat, 19 Nov 2011 21:59:46 +0000 Subject: Config to enable external hotlist app to be launched via toolbar and menus. svn path=/trunk/netsurf/; revision=13150 --- riscos/hotlist.c | 17 +++++++++++++++++ riscos/options.h | 7 +++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'riscos') diff --git a/riscos/hotlist.c b/riscos/hotlist.c index a01fb0307..e60dc8464 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -197,6 +197,23 @@ void ro_gui_hotlist_postinitialise(void) void ro_gui_hotlist_open(void) { + os_error *error; + char command[2048]; + + if (option_external_hotlists && option_external_hotlist_app != NULL && + *option_external_hotlist_app != '\0') { + snprintf(command, sizeof(command), "Filer_Run %s", + option_external_hotlist_app); + error = xos_cli(command); + + if (error == NULL) + return; + + LOG(("xos_cli: 0x%x: %s", error->errnum, error->errmess)); + warn_user("Failed to launch external hotlist: %s", + error->errmess); + } + tree_set_redraw(ro_treeview_get_tree(hotlist_window.tv), true); ro_gui_hotlist_toolbar_update_buttons(); diff --git a/riscos/options.h b/riscos/options.h index a83644f72..463a6fa56 100644 --- a/riscos/options.h +++ b/riscos/options.h @@ -65,6 +65,7 @@ extern char *option_theme_save; extern bool option_thumbnail_iconise; extern bool option_interactive_help; extern bool option_external_hotlists; +extern char *option_external_hotlist_app; #define EXTRA_OPTION_DEFINE \ bool option_use_mouse_gestures = false;\ @@ -103,7 +104,8 @@ char *option_theme_path = 0; \ char *option_theme_save = 0; \ bool option_thumbnail_iconise = true; \ bool option_interactive_help = true; \ -bool option_external_hotlists = false; +bool option_external_hotlists = false; \ +char *option_external_hotlist_app = 0; #define EXTRA_OPTION_TABLE \ { "use_mouse_gestures", OPTION_BOOL, &option_use_mouse_gestures },\ @@ -142,6 +144,7 @@ bool option_external_hotlists = false; { "theme_save", OPTION_STRING, &option_theme_save }, \ { "thumbnail_iconise", OPTION_BOOL, &option_thumbnail_iconise }, \ { "interactive_help", OPTION_BOOL, &option_interactive_help }, \ -{ "external_hotlists", OPTION_BOOL, &option_external_hotlists } +{ "external_hotlists", OPTION_BOOL, &option_external_hotlists }, \ +{ "external_hotlist_app", OPTION_STRING, &option_external_hotlist_app } #endif -- cgit v1.2.3