aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/tcp_graph.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-15 14:18:22 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-15 14:18:22 +0000
commitf0e31fa1adb933a3ede9dd8344621f2fc128baf4 (patch)
treefe780ffc83ba2c73fe9d2d66b881b23eb89db5c5 /gtk/tcp_graph.c
parent4091f6b6c96743ae7fa85158eeb880471bd45c28 (diff)
Add the TCPGraph for UIManager.
Note sensitivity remains to be fixed. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37154 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/tcp_graph.c')
-rw-r--r--gtk/tcp_graph.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c
index 18513d1dee..0fa588d7dd 100644
--- a/gtk/tcp_graph.c
+++ b/gtk/tcp_graph.c
@@ -589,7 +589,47 @@ static void unset_busy_cursor(GdkWindow *w)
gdk_window_set_cursor(w, NULL);
gdk_flush();
}
+#ifdef MAIN_MENU_USE_UIMANAGER
+void tcp_graph_cb (GtkAction *action, gpointer user_data)
+{
+ struct segment current;
+ struct graph *g;
+ const gchar *name;
+ guint graph_type;
+
+ name = gtk_action_get_name (action);
+ if(strcmp(name, "Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens") == 0){
+ graph_type = GRAPH_TSEQ_STEVENS;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace") == 0){
+ graph_type = GRAPH_TSEQ_TCPTRACE;
+ }else if(strcmp(name, "StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph") == 0){
+ graph_type = GRAPH_THROUGHPUT;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph") == 0){
+ graph_type = GRAPH_RTT;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph") == 0){
+ graph_type = GRAPH_WSCALE;
+ }
+
+ debug(DBS_FENTRY) puts ("tcp_graph_cb()");
+
+ if (! (g = graph_new()))
+ return;
+ refnum++;
+ graph_initialize_values (g);
+
+ g->type = graph_type;
+ if (!select_tcpip_session (&cfile, &current)) {
+ return;
+ }
+
+ graph_segment_list_get(g);
+ create_gui(g);
+ /* display_text(g); */
+ graph_init_sequence(g);
+
+}
+#else
static void tcp_graph_cb (GtkWidget *w _U_, gpointer data, guint callback_action /*graph_type*/ _U_)
{
struct segment current;
@@ -615,7 +655,7 @@ static void tcp_graph_cb (GtkWidget *w _U_, gpointer data, guint callback_action
/* display_text(g); */
graph_init_sequence(g);
}
-
+#endif
static void create_gui (struct graph *g)
{
debug(DBS_FENTRY) puts ("create_gui()");
@@ -4327,6 +4367,8 @@ static gboolean tcp_graph_selected_packet_enabled(frame_data *current_frame, epa
void
register_tap_listener_tcp_graph(void)
{
+#ifdef MAIN_MENU_USE_UIMANAGER
+#else
register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (Stevens)", REGISTER_STAT_GROUP_UNSORTED,
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(0));
register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (tcptrace)", REGISTER_STAT_GROUP_UNSORTED,
@@ -4337,4 +4379,6 @@ register_tap_listener_tcp_graph(void)
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(3));
register_stat_menu_item("TCP Stream Graph/Window Scaling Graph", REGISTER_STAT_GROUP_UNSORTED,
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(GRAPH_WSCALE));
+#endif
+
}