diff --git a/epan/color_filters.h b/epan/color_filters.h index 8618b150da..b90f9fd285 100644 --- a/epan/color_filters.h +++ b/epan/color_filters.h @@ -60,6 +60,13 @@ typedef struct _color_filter { void *color_edit_dlg_info; /* if filter is being edited, ptr to req'd info. GTK+ only. */ } color_filter_t; +inline static unsigned int +color_t_to_rgb(const color_t *color) { + return (((color->red >> 8) << 16) + | ((color->green >> 8) << 8) + | (color->blue >> 8)); +} + /** A color filter was added (while importing). * (color_filters.c calls this for every filter coming in) * diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp index 5e625e114d..bc69a55ea9 100644 --- a/ui/qt/sequence_diagram.cpp +++ b/ui/qt/sequence_diagram.cpp @@ -264,7 +264,10 @@ void SequenceDiagram::draw(QCPPainter *painter) fg_pen.setColor(sel_pal.color(QPalette::HighlightedText)); bg_color = sel_pal.color(QPalette::Highlight); selected_key_ = cur_key; - } else { + } else if (sainfo_->type == SEQ_ANALYSIS_ANY) { + fg_pen.setColor(QColor().fromRgb(sai->fg_color)); + bg_color = QColor().fromRgb(sai->bg_color); + } else { // SEQ_ANALYSIS_VOIP, SEQ_ANALYSIS_TCP fg_pen.setColor(Qt::black); bg_color = ColorUtils::sequenceColor(sai->conv_num); } diff --git a/ui/tap-sequence-analysis.c b/ui/tap-sequence-analysis.c index 6e8770bc72..2f95447395 100644 --- a/ui/tap-sequence-analysis.c +++ b/ui/tap-sequence-analysis.c @@ -29,6 +29,7 @@ #include "tap-sequence-analysis.h" #include "epan/addr_resolv.h" +#include "epan/color_filters.h" #include "epan/packet.h" #include "epan/tap.h" #include "epan/proto_data.h" @@ -108,6 +109,9 @@ seq_analysis_frame_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U sai->frame_number = pinfo->num; + sai->bg_color = color_t_to_rgb(&pinfo->fd->color_filter->bg_color); + sai->fg_color = color_t_to_rgb(&pinfo->fd->color_filter->fg_color); + sai->port_src=pinfo->srcport; sai->port_dst=pinfo->destport; sai->protocol = g_strdup(port_type_to_str(pinfo->ptype)); @@ -238,7 +242,7 @@ seq_analysis_tcp_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, sai->comment = g_strdup_printf("Seq = %u",tcph->th_seq); sai->line_style = 1; - sai->conv_num = 0; + sai->conv_num = (guint16) tcph->th_stream; sai->display = TRUE; g_queue_push_tail(sainfo->items, sai); diff --git a/ui/tap-sequence-analysis.h b/ui/tap-sequence-analysis.h index fbebd2acbb..e505940720 100644 --- a/ui/tap-sequence-analysis.h +++ b/ui/tap-sequence-analysis.h @@ -58,7 +58,9 @@ typedef struct _seq_analysis_item { gchar *frame_label; /**< the label on top of the arrow */ gchar *time_str; /**< timestamp */ gchar *comment; /**< a comment that appears at the right of the graph */ - guint16 conv_num; /**< the conversation number, each conversation will be colored */ + guint16 conv_num; /**< The conversation number. Used for coloring VoIP calls. */ + unsigned fg_color; /**< Foreground color, 0xRRGGBB. Qt only. */ + unsigned bg_color; /**< Background color, 0xRRGGBB. Qt only. */ gboolean display; /**< indicate if the packet is displayed or not in the graph */ guint src_node; /**< this is used by graph_analysis.c to identify the node */ guint dst_node; /**< a node is an IP address that will be displayed in columns */