aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2010-06-13 14:55:11 +0000
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2010-06-13 14:55:11 +0000
commit958faf4a282a3423d715922533e2081e2a9f9df3 (patch)
treeac070b1d7f5a53ccc8d6af03de62fcdfb1ab9533
parent042a55a861ec4469cc165837ad2f4a988e2a66ef (diff)
Add Copy (to clipboard) to expert item popup menu.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33214 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--gtk/expert_comp_table.c17
-rw-r--r--gtk/filter_utils.h6
2 files changed, 21 insertions, 2 deletions
diff --git a/gtk/expert_comp_table.c b/gtk/expert_comp_table.c
index ad98118b57..66810cb626 100644
--- a/gtk/expert_comp_table.c
+++ b/gtk/expert_comp_table.c
@@ -331,6 +331,16 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
g_snprintf(str, sizeof(str), "http://www.google.com/search?hl=en&q=%s+'%s'", procedure->entries[0], procedure->entries[1]);
browser_open_url(str);
break;
+ case ACTION_COPY:
+ {
+ GString *copyString = g_string_sized_new(0);
+ g_string_printf(copyString, "%s: %s",
+ procedure->entries[0], procedure->entries[1]);
+ copy_to_clipboard(copyString);
+ g_string_free(copyString, TRUE);
+ }
+ break;
+
default:
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Can't find menu action - %u", action);
}
@@ -431,7 +441,12 @@ static GtkItemFactoryEntry error_list_menu_items[] =
/* Search Internet */
{"/Internet Search for Info Text", NULL,
- GTK_MENU_FUNC(error_select_filter_cb), CALLBACK_WEB_LOOKUP, NULL, NULL,}
+ GTK_MENU_FUNC(error_select_filter_cb), CALLBACK_WEB_LOOKUP, NULL, NULL,},
+
+ /* Copy item text (protocol plus summary)*/
+ {"/Copy", NULL,
+ GTK_MENU_FUNC(error_select_filter_cb), CALLBACK_COPY, NULL, NULL,},
+
};
#if 0
diff --git a/gtk/filter_utils.h b/gtk/filter_utils.h
index 3e5b921e12..f03bf71f5a 100644
--- a/gtk/filter_utils.h
+++ b/gtk/filter_utils.h
@@ -30,7 +30,9 @@
#define ACTION_FIND_NEXT 3
#define ACTION_FIND_PREVIOUS 4
#define ACTION_COLORIZE 5
-#define ACTION_WEB_LOOKUP 6
+#define ACTION_WEB_LOOKUP 6
+#define ACTION_COPY 7
+
/* Action type - says what to do with the filter */
#define ACTYPE_SELECTED 0
@@ -48,6 +50,8 @@
#define CALLBACK_FIND_PREVIOUS(type, extra) ((ACTION_FIND_PREVIOUS<<16) | ((type)<<8) | (extra))
#define CALLBACK_COLORIZE(type, extra) ((ACTION_COLORIZE<<16) | ((type)<<8) | (extra))
#define CALLBACK_WEB_LOOKUP (ACTION_WEB_LOOKUP<<16)
+#define CALLBACK_COPY (ACTION_COPY<<16)
+
/* Extract components of callback argument */
#define FILTER_ACTION(cb_arg) (((cb_arg)>>16) & 0xff)