Add Copy (to clipboard) to expert item popup menu.
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 13 Jun 2010 14:55:11 +0000 (14:55 +0000)
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 13 Jun 2010 14:55:11 +0000 (14:55 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33214 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/expert_comp_table.c
gtk/filter_utils.h

index ad98118b572fe3ed4c45f888bd545138da3de0f1..66810cb6261f10515983283e01b72ac2c7982867 100644 (file)
@@ -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
index 3e5b921e1252b45f55f3cf70bbb33dcea57511dd..f03bf71f5a249259e040a7f845ca0f50e152efc1 100644 (file)
@@ -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)