diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-09-04 22:19:42 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-09-04 22:19:42 +0000 |
commit | ea9847f52cdc8fb0b08bb6ba2ca3259e1441b277 (patch) | |
tree | 94413e015393f4aca22fd79d3fa870c2d2cf0e99 /gtk2 | |
parent | d8535d9b62dd6dadda54b0267c18e578eb5fa8ec (diff) |
Enable rpcstat in the gtk2 gui
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6184 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk2')
-rw-r--r-- | gtk2/main.c | 31 | ||||
-rw-r--r-- | gtk2/menu.c | 6 |
2 files changed, 35 insertions, 2 deletions
diff --git a/gtk2/main.c b/gtk2/main.c index 1b64ba7deb..2757484101 100644 --- a/gtk2/main.c +++ b/gtk2/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.1 2002/08/31 09:55:21 oabad Exp $ + * $Id: main.c,v 1.2 2002/09/04 22:19:42 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -134,6 +134,7 @@ #include "ui_util.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" +#include "../tap.h" #ifdef WIN32 #include "capture-wpcap.h" @@ -1210,6 +1211,21 @@ set_autostop_criterion(const char *autostoparg) } #endif +gpointer +update_thread(gpointer data _U_) +{ + while(1){ + struct timeval tv1, tv2; + gettimeofday(&tv1, NULL); + draw_tap_listeners(FALSE); + do{ + g_thread_yield(); + gettimeofday(&tv2, NULL); + }while(tv2.tv_sec<(tv1.tv_sec+2)); + } + return NULL; +} + /* And now our feature presentation... [ fade to music ] */ int main(int argc, char *argv[]) @@ -1351,6 +1367,19 @@ main(int argc, char *argv[]) exit(0); } + /* if we have thread support via glib2 try to start the low level + thread to update applications asynchronously + */ + if(GLIB_MAJOR_VERSION>=2){ +#ifdef G_THREADS_ENABLED + GThread *ut; + g_thread_init(NULL); + gdk_threads_init(); + ut=g_thread_create(update_thread, NULL, FALSE, NULL); + g_thread_set_priority(ut, G_THREAD_PRIORITY_LOW); +#endif + } + /* Set the current locale according to the program environment. * We haven't localized anything, but some GTK widgets are localized * (the file selection dialogue, for example). diff --git a/gtk2/menu.c b/gtk2/menu.c index 5b109440cc..fe8e8d241f 100644 --- a/gtk2/menu.c +++ b/gtk2/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.1 2002/08/31 09:55:22 oabad Exp $ + * $Id: menu.c,v 1.2 2002/09/04 22:19:42 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -59,6 +59,7 @@ #include <epan/plugins.h> #include "tcp_graph.h" #include <epan/epan_dissect.h> +#include "gtk2-rpcstat.h" GtkWidget *popup_menu_object; @@ -172,6 +173,9 @@ static GtkItemFactoryEntry menu_items[] = {"/_Tools/TCP Stream Analysis/RTT Graph", NULL, GTK_MENU_FUNC (tcp_graph_cb), 3, NULL, NULL }, {"/Tools/_Summary", NULL, GTK_MENU_FUNC(summary_open_cb), 0, NULL, NULL }, {"/Tools/Protocol Hierarchy Statistics", NULL, GTK_MENU_FUNC(proto_hier_stats_cb), 0, NULL, NULL }, + {"/Tools/Statistics", NULL, NULL, 0, "<Branch>", NULL }, + {"/Tools/Statistics/ONC-RPC", NULL, NULL, 0, "<Branch>", NULL }, + {"/Tools/Statistics/ONC-RPC/RTT", NULL, GTK_MENU_FUNC(gtk2_rpcstat_cb), 0, NULL, NULL }, {"/_Help", NULL, NULL, 0, "<LastBranch>", NULL }, {"/Help/_Help", NULL, GTK_MENU_FUNC(help_cb), 0, "<StockItem>", GTK_STOCK_HELP }, {"/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL }, |