summaryrefslogtreecommitdiff
path: root/riscos/global_history.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/global_history.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/global_history.c')
-rw-r--r--riscos/global_history.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/riscos/global_history.c b/riscos/global_history.c
index 4b2352289..2f4f8a1b5 100644
--- a/riscos/global_history.c
+++ b/riscos/global_history.c
@@ -47,12 +47,6 @@
#include "utils/url.h"
#include "utils/utils.h"
-static void ro_gui_global_history_menu_prepare(wimp_w window, wimp_menu *menu);
-static bool ro_gui_global_history_menu_select(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-static void ro_gui_global_history_menu_warning(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-
/* The RISC OS global history window, toolbar and treeview data */
static struct ro_global_history_window {
@@ -167,6 +161,9 @@ void ro_gui_global_history_open(void)
bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer)
{
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
if (global_history_window.toolbar->editor != NULL) {
ro_gui_theme_toolbar_editor_click(global_history_window.toolbar,
pointer);
@@ -206,13 +203,6 @@ bool ro_gui_global_history_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;
}
@@ -228,31 +218,34 @@ void ro_gui_global_history_menu_prepare(wimp_w window, wimp_menu *menu)
{
bool selection;
- selection = ro_treeview_has_selection(global_history_window.tv);
+ if (menu != global_history_window.menu && menu != tree_toolbar_menu)
+ return;
+
+ if (menu == global_history_window.menu) {
+ selection = ro_treeview_has_selection(global_history_window.tv);
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TREE_SELECTION, !selection);
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TREE_CLEAR_SELECTION, !selection);
+ ro_gui_menu_set_entry_shaded(global_history_window.menu,
+ TREE_SELECTION, !selection);
+ ro_gui_menu_set_entry_shaded(global_history_window.menu,
+ TREE_CLEAR_SELECTION, !selection);
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TOOLBAR_BUTTONS,
+ ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
+ }
+
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
(global_history_window.toolbar == NULL ||
global_history_window.toolbar->editor));
- ro_gui_menu_set_entry_ticked(global_history_window.menu,
- TOOLBAR_BUTTONS,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
(global_history_window.toolbar != NULL &&
(global_history_window.toolbar->display_buttons ||
(global_history_window.toolbar->editor))));
- ro_gui_menu_set_entry_shaded(global_history_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
global_history_window.toolbar == NULL);
- ro_gui_menu_set_entry_ticked(global_history_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
(global_history_window.toolbar != NULL &&
global_history_window.toolbar->editor));
-
- ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
}
/**