+ browser_open_url()
+ browser_open_data_file() svn path=/trunk/; revision=20223
This commit is contained in:
parent
303082812e
commit
aa235a4262
|
@ -64,32 +64,29 @@ typedef struct _funnel_ops_t {
|
|||
void (*set_editable)(funnel_text_window_t* win, gboolean editable);
|
||||
void (*destroy_text_window)(funnel_text_window_t* win);
|
||||
void (*add_button)(funnel_text_window_t* win, funnel_bt_t* cb, const gchar* label);
|
||||
#if 0
|
||||
funnel_node_t* (*new_tree_window)(const gchar* title, gchar** columns);
|
||||
funnel_node_t* (*add_node)(funnel_node_t* node, gchar** values);
|
||||
void (*remove_node)(funnel_node_t* node);
|
||||
void (*set_cell)(funnel_node_t* node, gchar* column, const gchar* text);
|
||||
|
||||
void (*set_filter)(const gchar* filter_string);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void (*new_dialog)(const gchar* title,
|
||||
const gchar** fieldnames,
|
||||
funnel_dlg_cb_t dlg_cb,
|
||||
void* data);
|
||||
|
||||
|
||||
|
||||
void (*logger)(const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const gchar *message,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
void (*retap_packets)(void);
|
||||
void (*copy_to_clipboard)(GString *str);
|
||||
void (*set_filter)(const char*);
|
||||
gboolean (*open_file)(const char* fname, const char* filter, char** error);
|
||||
void (*reload)(void);
|
||||
void (*apply_filter)(void);
|
||||
gboolean (*browser_open_url)(const gchar *url);
|
||||
void (*browser_open_data_file)(const gchar *filename);
|
||||
} funnel_ops_t;
|
||||
|
||||
|
||||
|
|
|
@ -101,6 +101,11 @@ if (gui_enabled()) then
|
|||
info("Console opened")
|
||||
end
|
||||
|
||||
register_menu("Lua/Evaluate",evaluate_lua,MENU_TOOLS)
|
||||
register_menu("Lua/Console",run_console,MENU_TOOLS)
|
||||
function wiki_page()
|
||||
browser_open_url("http://wiki.wireshark.org/Lua")
|
||||
end
|
||||
|
||||
register_menu("Lua/Evaluate", evaluate_lua, MENU_TOOLS)
|
||||
register_menu("Lua/Console", run_console, MENU_TOOLS)
|
||||
register_menu("Lua/Wiki", wiki_page, MENU_TOOLS)
|
||||
end
|
||||
|
|
|
@ -600,3 +600,40 @@ WSLUA_FUNCTION wslua_reload(lua_State* L) { /* reload the current capture file *
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
WSLUA_FUNCTION wslua_browser_open_url(lua_State* L) { /* open an url in a browser */
|
||||
#define WSLUA_ARG_browser_open_url_URL 1 /* The url. */
|
||||
const char* url = luaL_checkstring(L,WSLUA_ARG_browser_open_url_URL);
|
||||
|
||||
if (!ops->browser_open_url) {
|
||||
WSLUA_ERROR(browser_open_url, "does not work on TShark");
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
WSLUA_ARG_ERROR(browser_open_url,URL,"must be a string");
|
||||
}
|
||||
|
||||
ops->browser_open_url(url);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
WSLUA_FUNCTION wslua_browser_open_data_file(lua_State* L) { /* open an file in a browser */
|
||||
#define WSLUA_ARG_browser_open_data_file_FILENAME 1 /* The url. */
|
||||
const char* url = luaL_checkstring(L,WSLUA_ARG_browser_open_data_file_FILENAME);
|
||||
|
||||
if (!ops->browser_open_url) {
|
||||
WSLUA_ERROR(browser_open_data_file, "does not work on TShark");
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
WSLUA_ARG_ERROR(browser_open_data_file,FILENAME,"must be a string");
|
||||
}
|
||||
|
||||
ops->browser_open_data_file(url);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include "prefs_dlg.h"
|
||||
#include "file.h"
|
||||
#include "main.h"
|
||||
#include "webbrowser.h"
|
||||
|
||||
#include "gtkglobals.h"
|
||||
|
||||
|
@ -615,7 +616,9 @@ static const funnel_ops_t funnel_ops = {
|
|||
funnel_set_filter,
|
||||
funnel_open_file,
|
||||
funnel_reload,
|
||||
funnel_apply_filter
|
||||
funnel_apply_filter,
|
||||
browser_open_url,
|
||||
browser_open_data_file
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,9 @@ static const funnel_ops_t funnel_ops = {
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue