diff --git a/gtk/main.c b/gtk/main.c index c0d9acf6d3..075b08ffab 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -169,6 +169,11 @@ #include "../image/wsiconcap48.xpm" #endif #endif +#include "../image/expert_error.xpm" +#include "../image/expert_warn.xpm" +#include "../image/expert_note.xpm" +#include "../image/expert_chat.xpm" +#include "../image/expert_none.xpm" #ifdef HAVE_AIRPCAP #include @@ -234,6 +239,11 @@ static GtkWidget *info_bar; static GtkWidget *packets_bar = NULL; static GtkWidget *profile_bar = NULL; static GtkWidget *welcome_pane; +static GtkWidget *expert_info_error; +static GtkWidget *expert_info_warn; +static GtkWidget *expert_info_note; +static GtkWidget *expert_info_chat; +static GtkWidget *expert_info_none; static guint main_ctx, file_ctx, help_ctx, filter_ctx; static guint status_levels[NUM_STATUS_LEVELS]; static guint packets_ctx; @@ -1540,15 +1550,29 @@ set_display_filename(capture_file *cf) } /* statusbar */ -#if 0 - /* XXX - don't show the highest expert level unless the TCP checksum offloading is "solved" */ - status_msg = g_strdup_printf(" File: \"%s\" %s %02lu:%02lu:%02lu [Expert: %s]", - (cf->filename) ? cf->filename : "", size_str, - (long)cf->elapsed_time.secs/3600, - (long)cf->elapsed_time.secs%3600/60, - (long)cf->elapsed_time.secs%60, - val_to_str(expert_get_highest_severity(), expert_severity_vals, "Unknown (%u)")); -#endif + gtk_widget_hide(expert_info_error); + gtk_widget_hide(expert_info_warn); + gtk_widget_hide(expert_info_note); + gtk_widget_hide(expert_info_chat); + gtk_widget_hide(expert_info_none); + switch(expert_get_highest_severity()) { + case(PI_ERROR): + gtk_widget_show(expert_info_error); + break; + case(PI_WARN): + gtk_widget_show(expert_info_warn); + break; + case(PI_NOTE): + gtk_widget_show(expert_info_note); + break; + case(PI_CHAT): + gtk_widget_show(expert_info_chat); + break; + default: + gtk_widget_show(expert_info_none); + break; + } + status_msg = g_strdup_printf(" File: \"%s\" %s %02lu:%02lu:%02lu", (cf->filename) ? cf->filename : "", size_str, (long)cf->elapsed_time.secs/3600, @@ -3483,6 +3507,11 @@ void main_widgets_rearrange(void) { gtk_widget_ref(tv_scrollw); gtk_widget_ref(byte_nb_ptr); gtk_widget_ref(stat_hbox); + gtk_widget_ref(expert_info_error); + gtk_widget_ref(expert_info_warn); + gtk_widget_ref(expert_info_note); + gtk_widget_ref(expert_info_chat); + gtk_widget_ref(expert_info_none); gtk_widget_ref(info_bar); gtk_widget_ref(packets_bar); gtk_widget_ref(profile_bar); @@ -3597,6 +3626,11 @@ void main_widgets_rearrange(void) { #endif /* statusbar */ + gtk_box_pack_start(GTK_BOX(stat_hbox), expert_info_error, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(stat_hbox), expert_info_warn, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(stat_hbox), expert_info_note, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(stat_hbox), expert_info_chat, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(stat_hbox), expert_info_none, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(stat_hbox), status_pane_left, TRUE, TRUE, 0); gtk_paned_pack1(GTK_PANED(status_pane_left), info_bar, FALSE, FALSE); gtk_paned_pack2(GTK_PANED(status_pane_left), status_pane_right, TRUE, FALSE); @@ -4422,6 +4456,20 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs) OBJECT_SET_DATA(popup_menu_object, E_DFILTER_TE_KEY, filter_te); OBJECT_SET_DATA(popup_menu_object, E_MPACKET_LIST_KEY, packet_list); + /* expert status icons */ + expert_info_error = xpm_to_widget_from_parent(top_level, expert_error_xpm); + gtk_tooltips_set_tip(tooltips, expert_info_error, "Error is the highest expert info level", NULL); + expert_info_warn = xpm_to_widget_from_parent(top_level, expert_warn_xpm); + gtk_tooltips_set_tip(tooltips, expert_info_warn, "Warning is the highest expert info level", NULL); + expert_info_note = xpm_to_widget_from_parent(top_level, expert_note_xpm); + gtk_tooltips_set_tip(tooltips, expert_info_note, "Note is the highest expert info level", NULL); + expert_info_chat = xpm_to_widget_from_parent(top_level, expert_chat_xpm); + gtk_tooltips_set_tip(tooltips, expert_info_chat, "Chat is the highest expert info level", NULL); + expert_info_none = xpm_to_widget_from_parent(top_level, expert_none_xpm); + gtk_tooltips_set_tip(tooltips, expert_info_none, "No expert info", NULL); + gtk_widget_show(expert_info_none); + + /* info (main) statusbar */ info_bar = info_bar_new(); gtk_widget_show(info_bar); diff --git a/image/expert_chat.xpm b/image/expert_chat.xpm new file mode 100644 index 0000000000..cfacc2fe25 --- /dev/null +++ b/image/expert_chat.xpm @@ -0,0 +1,56 @@ +/* XPM */ +static char * expert_chat_xpm[] = { +"10 10 43 1", +" c None", +". c #383838", +"+ c #4D4D4D", +"@ c #808080", +"# c #979797", +"$ c #7D7D7D", +"% c #525252", +"& c #4E4E4E", +"* c #B3B3B3", +"= c #CECECE", +"- c #B4B4B4", +"; c #909090", +"> c #7E7E7E", +", c #565656", +"' c #868686", +") c #D6D6D6", +"! c #E4E4E4", +"~ c #B8B8B8", +"{ c #8C8C8C", +"] c #717171", +"^ c #424242", +"/ c #A5A5A5", +"( c #C7C7C7", +"_ c #C4C4C4", +": c #7A7A7A", +"< c #777777", +"[ c #8B8B8B", +"} c #A6A6A6", +"| c #9B9B9B", +"1 c #8A8A8A", +"2 c #7C7C7C", +"3 c #989898", +"4 c #595959", +"5 c #888888", +"6 c #929292", +"7 c #3A3A3A", +"8 c #5C5C5C", +"9 c #858585", +"0 c #9A9A9A", +"a c #4A4A4A", +"b c #464646", +"c c #606060", +"d c #585858", +" .. ", +" +@#$% ", +" &*=-;>, ", +" ')!~{$]^ ", +"./(_/':<, ", +".[}|12234 ", +" ,{5>>367 ", +" 8290;a ", +" bcd7 ", +" "}; diff --git a/image/expert_error.xpm b/image/expert_error.xpm new file mode 100644 index 0000000000..200790cb3f --- /dev/null +++ b/image/expert_error.xpm @@ -0,0 +1,68 @@ +/* XPM */ +static char * expert_error_xpm[] = { +"10 10 55 1", +" c None", +". c #000000", +"+ c #340403", +"@ c #9C221E", +"# c #DC1E19", +"$ c #A70E0B", +"% c #3F0404", +"& c #350403", +"* c #E45E58", +"= c #F88C88", +"- c #F4524A", +"; c #D4120E", +"> c #AC0E0A", +", c #4B0504", +"' c #A32A25", +") c #F8A29E", +"! c #FAC2BF", +"~ c #F65C54", +"{ c #CE110C", +"] c #AA0C08", +"^ c #8D0707", +"/ c #180101", +"( c #EA362F", +"_ c #F77E79", +": c #F77872", +"< c #F02E28", +"[ c #BD100B", +"} c #A30A08", +"| c #9A0B09", +"1 c #490605", +"2 c #C31814", +"3 c #F2302A", +"4 c #E82018", +"5 c #C8110C", +"6 c #A70C08", +"7 c #A60C09", +"8 c #E11A16", +"9 c #4E0807", +"0 c #490706", +"a c #C91410", +"b c #BE130E", +"c c #AC0D0A", +"d c #AA0E0B", +"e c #E21C17", +"f c #CE1E1A", +"g c #060000", +"h c #580605", +"i c #A20F0C", +"j c #B8120E", +"k c #E61B16", +"l c #CB1C18", +"m c #2B0403", +"n c #240202", +"o c #5E0A08", +"p c #4C0807", +" .. ", +" +@#$% ", +" &*=-;>, ", +" ')!~{]^/ ", +".(_:<[}|1 ", +".23456789 ", +" 0abcdefg ", +" hijklm ", +" nopg ", +" "}; diff --git a/image/expert_none.xpm b/image/expert_none.xpm new file mode 100644 index 0000000000..0127bf7b55 --- /dev/null +++ b/image/expert_none.xpm @@ -0,0 +1,16 @@ +/* XPM */ +static char * expert_none_xpm[] = { +"10 10 3 1", +" c None", +". c #000000", +"+ c #000200", +" ... ", +" . + ", +" . . ", +". + ", +". . ", +". . ", +" + + ", +" . . ", +" +..+ ", +" "}; diff --git a/image/expert_note.xpm b/image/expert_note.xpm new file mode 100644 index 0000000000..262a3596fa --- /dev/null +++ b/image/expert_note.xpm @@ -0,0 +1,68 @@ +/* XPM */ +static char * expert_note_xpm[] = { +"10 10 55 1", +" c None", +". c #000000", +"+ c #003733", +"@ c #2B9088", +"# c #24D0BD", +"$ c #0DA48D", +"% c #024034", +"& c #003935", +"* c #61DBD6", +"= c #92EEED", +"- c #62DCD6", +"; c #18CAB0", +"> c #0DA989", +", c #024C34", +"' c #319791", +") c #A2F4F4", +"! c #BFFAFA", +"~ c #6CDED8", +"{ c #1AC0A2", +"] c #149E79", +"^ c #0A8A62", +"/ c #001911", +"( c #3EDBD0", +"_ c #86EAE7", +": c #82E6E3", +"< c #42D6C9", +"[ c #1AAE88", +"} c #169467", +"| c #0B9874", +"1 c #024C3E", +"2 c #19BDB0", +"3 c #40DCD2", +"4 c #29D7C6", +"5 c #19BCA0", +"6 c #16986C", +"7 c #10A078", +"8 c #18DECF", +"9 c #02534E", +"0 c #034B41", +"a c #0FCAB6", +"b c #10BEA4", +"c c #0EA782", +"d c #0EA787", +"e c #1CDDCD", +"f c #1ECABE", +"g c #000606", +"h c #025B4B", +"i c #06A892", +"j c #0ABCA9", +"k c #18E4D7", +"l c #1CC7BC", +"m c #002D27", +"n c #002521", +"o c #03635D", +"p c #02514C", +" .. ", +" +@#$% ", +" &*=-;>, ", +" ')!~{]^/ ", +".(_:<[}|1 ", +".23456789 ", +" 0abcdefg ", +" hijklm ", +" nopg ", +" "}; diff --git a/image/expert_warn.xpm b/image/expert_warn.xpm new file mode 100644 index 0000000000..8c447f6ba1 --- /dev/null +++ b/image/expert_warn.xpm @@ -0,0 +1,68 @@ +/* XPM */ +static char * expert_warn_xpm[] = { +"10 10 55 1", +" c None", +". c #000000", +"+ c #323700", +"@ c #A39E17", +"# c #EAD10B", +"$ c #B28600", +"% c #422B00", +"& c #303900", +"* c #E7EE4E", +"= c #F2FE82", +"- c #FDFC40", +"; c #E2B200", +"> c #B67A00", +", c #4E2C00", +"' c #A8A91E", +") c #EFFE99", +"! c #F0FDBC", +"~ c #FAFA4B", +"{ c #DA9F00", +"] c #B36600", +"^ c #944E00", +"/ c #190900", +"( c #F5EC22", +"_ c #F2FE72", +": c #F6FE6B", +"< c #FBE81D", +"[ c #C88000", +"} c #AA5900", +"| c #A26400", +"1 c #4E3B00", +"2 c #CFBE08", +"3 c #FEF61E", +"4 c #F5DB0B", +"5 c #D49700", +"6 c #AF5E00", +"7 c #AF6C00", +"8 c #E8EA06", +"9 c #545400", +"0 c #4E4100", +"a c #D9BA00", +"b c #CD9F00", +"c c #B67600", +"d c #B57900", +"e c #EAE709", +"f c #CCD90D", +"g c #060400", +"h c #5D4800", +"i c #AE8D00", +"j c #C4AC00", +"k c #E9F107", +"l c #C9D50C", +"m c #2D2B00", +"n c #251E00", +"o c #626600", +"p c #4E5200", +" .. ", +" +@#$% ", +" &*=-;>, ", +" ')!~{]^/ ", +".(_:<[}|1 ", +".23456789 ", +" 0abcdefg ", +" hijklm ", +" nopg ", +" "};