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);
}
/* 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
#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
#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)