aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-01-17 21:48:51 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-01-17 21:48:51 +0000
commit421737d2104115d62ab2196f58eb7c6a183df171 (patch)
tree131cad42447c0d1415a375f95257e86964115bdf /gtk/main.c
parent1f8699cca920bf54ac43877fdcb5e72e0415846b (diff)
downloadwireshark-421737d2104115d62ab2196f58eb7c6a183df171.tar.gz
wireshark-421737d2104115d62ab2196f58eb7c6a183df171.tar.bz2
wireshark-421737d2104115d62ab2196f58eb7c6a183df171.zip
add first implementation of context relevant calls to the protocol specific wiki pages. I've commented out the items in menu.c, so this (hopefully) won't break the current release run. We might think about further steps after the release is out.
However, if someone (already) want's to try out right now, you simply have to remove the comments in menu.c around line 430 svn path=/trunk/; revision=13091
Diffstat (limited to 'gtk/main.c')
-rw-r--r--gtk/main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/main.c b/gtk/main.c
index 87032f4125..d86c09c0ed 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -138,6 +138,7 @@
#include "about_dlg.h"
#include "help_dlg.h"
#include "decode_as_dlg.h"
+#include "webbrowser.h"
/*
@@ -277,6 +278,30 @@ match_selected_ptree_cb(GtkWidget *w, gpointer data, MATCH_SELECTED_E action)
}
+void
+selected_ptree_info_cb(GtkWidget *widget, gpointer data)
+{
+ int field_id;
+ gchar *selected_proto_url;
+
+
+ if (cfile.finfo_selected) {
+ /* convert selected field to protocol abbreviation */
+ /* XXX - could this conversion be simplified? */
+ field_id = cfile.finfo_selected->hfinfo->id;
+ /* if the selected field isn't a protocol, get it's parent */
+ if(!proto_registrar_is_protocol(field_id)) {
+ field_id = proto_registrar_get_parent(cfile.finfo_selected->hfinfo->id);
+ }
+
+ /* open wiki page with protocol abbreviation */
+ selected_proto_url = g_strdup_printf("http://wiki.ethereal.com/%s", proto_registrar_get_abbrev(field_id));
+ browser_open_url(selected_proto_url);
+ g_free(selected_proto_url);
+ }
+}
+
+
static gchar *
get_text_from_packet_list(gpointer data)
{