From 89c43c18320f82767af0979ac1260b93c5c55eed Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 19 Aug 2010 00:14:07 +0000 Subject: Add placeholder items for ^Z as Edit->Undo, shift-^Z as Edit->Redo, and ^A as Edit->Select All. Add more details about implementing Undo/Redo/Cut/Copy/Paste/Select All in the comment for the placeholder items. svn path=/trunk/; revision=33845 --- gtk/menus.c | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) (limited to 'gtk') diff --git a/gtk/menus.c b/gtk/menus.c index 8d67856d62..deec71893d 100644 --- a/gtk/menus.c +++ b/gtk/menus.c @@ -534,7 +534,27 @@ static GtkItemFactoryEntry menu_items[] = MATCH_SELECTED_REPLACE|MATCH_SELECTED_COPY_ONLY, NULL, NULL,}, #if 0 /* - * Un-#if this when we actually implement Cut/Copy/Paste. + * Un-#if this when we actually implement Cut/Copy/Paste for the + * packet list and packet detail windows. + * + * Note: when we implement Cut/Copy/Paste in those windows, we + * will almost certainly want to allow multiple packets to be + * selected in the packet list pane and multiple packet detail + * items to be selected in the packet detail pane, so that + * the user can, for example, copy the summaries of multiple + * packets to the clipboard from the packet list pane and multiple + * packet detail items - perhaps *all* packet detail items - from + * the packet detail pane. Given that, we'll also want to + * implement Select All. + * + * If multiple packets are selected, we would probably display nothing + * in the packet detail pane, just as we do if no packet is selected, + * and any menu items etc. that would pertain only to a single packet + * would be disabled. + * + * If multiple packet detail items are selected, we would probably + * disable all items that pertain only to a single packet detail + * item, such as some items in the status bar. * * XXX - the actions for these will be different depending on what * widget we're in; ^C should copy from the filter text widget if @@ -545,14 +565,33 @@ static GtkItemFactoryEntry menu_items[] = * the contents of selected protocol tree items to the clipboard, * e.g. the text copy would be the text displayed for those items), * etc.. + * + * Given that those menu items should also affect text widgets + * such as the filter box, we would again want Select All, and, + * at least for the filter box, we would also want Undo and Redo. + * We would only want Cut, Paste, Undo, and Redo for the packet + * list and packet detail panes if we support modifying them. */ - {"/Edit/Cut", "X", NULL, + {"/Edit/_Undo", "Z", NULL, + 0, "", GTK_STOCK_UNDO,}, + {"/Edit/_Redo", "Z", NULL, + 0, "", GTK_STOCK_REDO,}, + {"/Edit/", NULL, NULL, 0, "", NULL,}, + {"/Edit/Cu_t", "X", NULL, 0, "", GTK_STOCK_CUT,}, - {"/Edit/Copy", "C", NULL, + {"/Edit/_Copy", "C", NULL, 0, "", GTK_STOCK_COPY,}, - {"/Edit/Paste", "V", NULL, + {"/Edit/_Paste", "V", NULL, 0, "", GTK_STOCK_PASTE,}, -#endif + {"/Edit/", NULL, NULL, 0, "", NULL,}, + {"/Edit/Select _All", "A", NULL, 0, +#ifdef GTK_STOCK_SELECT_ALL /* first appeared in 2.10 */ + "", GTK_STOCK_SELECT_ALL, +#else + NULL, NULL, +#endif /* GTK_STOCK_SELECT_ALL */ + }, +#endif /* 0 */ {"/Edit/", NULL, NULL, 0, "", NULL,}, {"/Edit/_Find Packet...", "F", GTK_MENU_FUNC(find_frame_cb), 0, "", GTK_STOCK_FIND,}, {"/Edit/Find Ne_xt", "N", GTK_MENU_FUNC(find_next_cb), 0, NULL, NULL,}, @@ -576,7 +615,7 @@ static GtkItemFactoryEntry menu_items[] = {"/Edit/Un-Time Reference All Packets", "T", GTK_MENU_FUNC(new_packet_list_untime_reference_all_frames_cb), 0, NULL, NULL,}, {"/Edit/Find Next Time Reference", "N", GTK_MENU_FUNC(reftime_frame_cb), REFTIME_FIND_NEXT, NULL, NULL,}, {"/Edit/Find Previous Time Reference", "B", GTK_MENU_FUNC(reftime_frame_cb), REFTIME_FIND_PREV, NULL, NULL,}, -#else +#else /* NEW_PACKET_LIST */ /* * XXX - this should be changed to match the list used with the new * packet list, assuming we don't just drop the old packet list -- cgit v1.2.1