aboutsummaryrefslogtreecommitdiffstats
path: root/gtk2
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-09-04 22:19:42 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-09-04 22:19:42 +0000
commitb08f943ac6a5eabc4bc578bd27fa81a2e4cd47d9 (patch)
tree94413e015393f4aca22fd79d3fa870c2d2cf0e99 /gtk2
parent77e51f9b1c03b1ffe50bffff9a859d2c216ea47f (diff)
Enable rpcstat in the gtk2 gui
svn path=/trunk/; revision=6184
Diffstat (limited to 'gtk2')
-rw-r--r--gtk2/main.c31
-rw-r--r--gtk2/menu.c6
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 },