Skip to content

Commit

Permalink
Update to endpoint talkers,
Browse files Browse the repository at this point in the history
endpoint talkers now have an extra submenu on the popup where one can select :
Colorize Conversation.
This opens up the create color filter dialog with the filter preset to the
selected conversation.

svn path=/trunk/; revision=8637
  • Loading branch information
Ronnie Sahlberg committed Oct 7, 2003
1 parent fcee96a commit 0897a7c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 8 deletions.
40 changes: 34 additions & 6 deletions gtk/color_dlg.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* color_dlg.c
* Definitions for dialog boxes for color filters
*
* $Id: color_dlg.c,v 1.26 2003/08/27 22:55:51 guy Exp $
* $Id: color_dlg.c,v 1.27 2003/10/07 10:07:47 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
Expand Down Expand Up @@ -46,7 +46,7 @@
#include "compat_macros.h"
#include "file_dlg.h"

static GtkWidget* colorize_dialog_new(void);
static GtkWidget* colorize_dialog_new(char *filter);
static void add_filter_to_list(gpointer filter_arg, gpointer list_arg);
static void color_filter_up_cb(GtkButton *button, gpointer user_data);
static void color_filter_down_cb(GtkButton *button, gpointer user_data);
Expand All @@ -60,6 +60,7 @@ static void remember_selected_row(GtkTreeSelection *sel, gpointer list);
#endif
static void color_destroy_cb(GtkButton *button, gpointer user_data);
static void destroy_edit_dialog_cb(gpointer filter_arg, gpointer dummy);
static void create_new_color_filter(GtkButton *button, char *filter);
static void color_new_cb(GtkButton *button, gpointer user_data);
static void color_edit_cb(GtkButton *button, gpointer user_data);
static void color_delete_cb(GtkWidget *widget, gpointer user_data);
Expand Down Expand Up @@ -120,7 +121,20 @@ color_display_cb(GtkWidget *w _U_, gpointer d _U_)
reactivate_window(colorize_win);
} else {
/* Create a new "Colorize Display" dialog. */
colorize_win = colorize_dialog_new();
colorize_win = colorize_dialog_new(NULL);
}
}

/* this opens the colorize dialogue and presets the filter string */
void
color_display_with_filter(char *filter)
{
if (colorize_win != NULL) {
/* There's already a color dialog box active; reactivate it. */
reactivate_window(colorize_win);
} else {
/* Create a new "Colorize Display" dialog. */
colorize_win = colorize_dialog_new(filter);
}
}

Expand All @@ -147,7 +161,7 @@ int color_marked_count(void)

/* Create the "Apply Color Filters" dialog. */
static GtkWidget*
colorize_dialog_new (void)
colorize_dialog_new (char *filter)
{
GtkWidget *color_win;
GtkWidget *dlg_vbox;
Expand Down Expand Up @@ -508,6 +522,12 @@ colorize_dialog_new (void)

dlg_set_cancel(color_win, color_cancel);

if(filter){
/* if we specified a preset filter string, open the new dialog and
set the filter */
create_new_color_filter(GTK_BUTTON(color_new), filter);
}

return color_win;
}

Expand Down Expand Up @@ -950,7 +970,7 @@ color_import_cb(GtkButton *button, gpointer user_data )
/* Create a new filter in the list, and pop up an "Edit color filter"
dialog box to edit it. */
static void
color_new_cb(GtkButton *button, gpointer user_data _U_)
create_new_color_filter(GtkButton *button, char *filter)
{
color_filter_t *colorf;
GtkWidget *color_filters;
Expand All @@ -967,7 +987,7 @@ color_new_cb(GtkButton *button, gpointer user_data _U_)
gtk_clist_unselect_all (GTK_CLIST(color_filters));
#endif

colorf = new_color_filter("name", "filter"); /* Adds at end! */
colorf = new_color_filter("name", filter); /* Adds at end! */

color_add_colorf(color_filters, colorf);

Expand All @@ -979,6 +999,14 @@ color_new_cb(GtkButton *button, gpointer user_data _U_)
#endif
}

/* Create a new filter in the list, and pop up an "Edit color filter"
dialog box to edit it. */
static void
color_new_cb(GtkButton *button, gpointer user_data _U_)
{
create_new_color_filter(button, "filter");
}

/* Pop up an "Edit color filter" dialog box to edit an existing filter. */
static void
color_edit_cb(GtkButton *button, gpointer user_data _U_)
Expand Down
3 changes: 2 additions & 1 deletion gtk/color_dlg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* color_dlg.h
* Definitions for dialog boxes for color filters
*
* $Id: color_dlg.h,v 1.3 2003/08/18 21:27:10 sahlberg Exp $
* $Id: color_dlg.h,v 1.4 2003/10/07 10:07:47 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
Expand All @@ -26,6 +26,7 @@
#ifndef __COLOR_DLG_H__
#define __COLOR_DLG_H__

void color_display_with_filter(char *filter);
void color_display_cb(GtkWidget *w, gpointer d);
int color_marked_count(void);
void color_add_filter_cb (color_filter_t *colorf, gpointer arg);
Expand Down
27 changes: 26 additions & 1 deletion gtk/endpoint_talkers_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* endpoint_talkers_table 2003 Ronnie Sahlberg
* Helper routines common to all endpoint talkers tap.
*
* $Id: endpoint_talkers_table.c,v 1.21 2003/10/07 09:30:34 sahlberg Exp $
* $Id: endpoint_talkers_table.c,v 1.22 2003/10/07 10:07:47 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
Expand Down Expand Up @@ -316,6 +316,7 @@ ett_click_column_cb(GtkCList *clist, gint column, gpointer data)
2: Find Frame
3: Find Next
4: Find Previous
5: Colorize Conversation
filter_type:
0: Selected
1: Not Selected
Expand Down Expand Up @@ -530,6 +531,10 @@ ett_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callba
/* find previous */
find_previous_next_frame_with_filter(str, TRUE);
break;
case 5:
/* colorize conversation */
color_display_with_filter(str);
break;
}

}
Expand Down Expand Up @@ -855,6 +860,26 @@ static GtkItemFactoryEntry ett_list_menu_items[] =
ett_select_filter_cb, 4*65536+0*256+7, NULL, NULL),
ITEM_FACTORY_ENTRY("/Find Frame/Find Previous/ANY --> EP2", NULL,
ett_select_filter_cb, 4*65536+0*256+8, NULL, NULL),
/* Colorize Conversation */
ITEM_FACTORY_ENTRY("/Colorize Conversation", NULL, NULL, 0, "<Branch>", NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 <-> EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 --> EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+1, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 <-- EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+2, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 <-> ANY", NULL,
ett_select_filter_cb, 5*65536+0*256+3, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 --> ANY", NULL,
ett_select_filter_cb, 5*65536+0*256+4, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/EP1 <-- ANY", NULL,
ett_select_filter_cb, 5*65536+0*256+5, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/ANY <-> EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+6, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/ANY <-- EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+7, NULL, NULL),
ITEM_FACTORY_ENTRY("/Colorize Conversation/ANY --> EP2", NULL,
ett_select_filter_cb, 5*65536+0*256+8, NULL, NULL),


};
Expand Down

0 comments on commit 0897a7c

Please sign in to comment.