summaryrefslogtreecommitdiff
path: root/riscos/hotlist.c
diff options
context:
space:
mode:
authorSteve Fryatt <steve@stevefryatt.org.uk>2010-10-24 23:17:21 +0000
committerSteve Fryatt <steve@stevefryatt.org.uk>2010-10-24 23:17:21 +0000
commit3529ead319289f4effe798c9bee0da3f48d5c5b5 (patch)
tree7e56ee523a945187a93297c71a1a22bffa6191f9 /riscos/hotlist.c
parenta1194cd03ffca1ebe29275bdab7c03a441d554e1 (diff)
downloadnetsurf-3529ead319289f4effe798c9bee0da3f48d5c5b5.tar.gz
netsurf-3529ead319289f4effe798c9bee0da3f48d5c5b5.tar.bz2
Restore toolbar menus in RO treeview windows.
svn path=/trunk/netsurf/; revision=10908
Diffstat (limited to 'riscos/hotlist.c')
-rw-r--r--riscos/hotlist.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/riscos/hotlist.c b/riscos/hotlist.c
index 61202eaa2..4c2c084d2 100644
--- a/riscos/hotlist.c
+++ b/riscos/hotlist.c
@@ -48,12 +48,6 @@
#include "utils/utils.h"
#include "utils/url.h"
-static void ro_gui_hotlist_menu_prepare(wimp_w window, wimp_menu *menu);
-static bool ro_gui_hotlist_menu_select(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-static void ro_gui_hotlist_menu_warning(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-
/* The RISC OS hotlist window, toolbar and treeview data. */
static struct ro_hotlist {
@@ -181,6 +175,9 @@ void ro_gui_hotlist_open(void)
bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer)
{
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
if (hotlist_window.toolbar->editor != NULL) {
ro_gui_theme_toolbar_editor_click(hotlist_window.toolbar,
pointer);
@@ -226,14 +223,6 @@ bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer)
break;
}
-
- /* \todo -- We assume that the owning module will have attached a window menu
- * to our parent window. If it hasn't, this call will quietly fail.
- */
-
- if (pointer->buttons == wimp_CLICK_MENU)
- return ro_gui_wimp_event_process_window_menu_click(pointer);
-
return true;
}
@@ -249,31 +238,37 @@ void ro_gui_hotlist_menu_prepare(wimp_w window, wimp_menu *menu)
{
bool selection;
- selection = ro_treeview_has_selection(hotlist_window.tv);
+ if (menu != hotlist_window.menu && menu != tree_toolbar_menu)
+ return;
+
+ if (menu == hotlist_window.menu) {
+ selection = ro_treeview_has_selection(hotlist_window.tv);
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_SELECTION,
- !selection);
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_CLEAR_SELECTION,
- !selection);
+ ro_gui_menu_set_entry_shaded(hotlist_window.menu,
+ TREE_SELECTION, !selection);
+ ro_gui_menu_set_entry_shaded(hotlist_window.menu,
+ TREE_CLEAR_SELECTION, !selection);
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_BUTTONS,
+ ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
+ }
+
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar == NULL ||
hotlist_window.toolbar->editor != NULL));
- ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_BUTTONS,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar != NULL &&
(hotlist_window.toolbar->display_buttons ||
(hotlist_window.toolbar->editor != NULL))));
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
hotlist_window.toolbar == NULL);
- ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
(hotlist_window.toolbar != NULL &&
hotlist_window.toolbar->editor != NULL));
-
- ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
}
+
/**
* Handle submenu warnings for the hotlist menu
*