diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-10-25 23:16:56 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-10-25 23:16:56 +0000 |
commit | 7a2de9f471d1057ff5f90cb450ae9fe44cc7648a (patch) | |
tree | 0d1c8b1bc1691a1edc12de27ac412aece8f5ffec /ui | |
parent | 95f484a91ee34ea3caa2c325170e52d0bf07489b (diff) | |
download | wireshark-7a2de9f471d1057ff5f90cb450ae9fe44cc7648a.tar.gz |
More sequence dialog updates.
Draw item labels and port numbers. Update the hint text. Make items
selectable. Resize fonts similar to the GTK+ version. Add scrollbars.
Update the cursor. Use pango_layout_set_ellipsize() in the GTK+ code.
Fixup comments.
svn path=/trunk/; revision=52855
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/graph_analysis.c | 28 | ||||
-rw-r--r-- | ui/gtk/graph_analysis.h | 2 | ||||
-rw-r--r-- | ui/qt/sequence_diagram.cpp | 65 | ||||
-rw-r--r-- | ui/qt/sequence_diagram.h | 1 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.cpp | 162 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.h | 13 | ||||
-rw-r--r-- | ui/qt/sequence_dialog.ui | 48 | ||||
-rw-r--r-- | ui/qt/tcp_stream_dialog.cpp | 1 | ||||
-rw-r--r-- | ui/tap-sequence-analysis.c | 10 | ||||
-rw-r--r-- | ui/tap-sequence-analysis.h | 2 |
10 files changed, 286 insertions, 46 deletions
diff --git a/ui/gtk/graph_analysis.c b/ui/gtk/graph_analysis.c index 3856f71a40..3fbd82722d 100644 --- a/ui/gtk/graph_analysis.c +++ b/ui/gtk/graph_analysis.c @@ -77,6 +77,9 @@ #define BOTTOM_Y_BORDER 2 #define COMMENT_WIDTH 400 #define TIME_WIDTH 150 +#if !PANGO_VERSION_CHECK(1,6,0) +#define MAX_FRAME_LABEL 20 +#endif /****************************************************************************/ /* Reset the user_data structure */ @@ -443,12 +446,6 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) user_data->dlg.items[current_item].fd = gai->fd; user_data->dlg.items[current_item].port_src = gai->port_src; user_data->dlg.items[current_item].port_dst = gai->port_dst; - /* Add "..." if the length is 50 characters */ - if (strlen(gai->frame_label) > 48) { - gai->frame_label[48] = '.'; - gai->frame_label[47] = '.'; - gai->frame_label[46] = '.'; - } user_data->dlg.items[current_item].frame_label = gai->frame_label; user_data->dlg.items[current_item].time_str = gai->time_str; user_data->dlg.items[current_item].comment = gai->comment; @@ -783,9 +780,6 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) draw_arrow(user_data->dlg.pixmap_main, color_p, end_arrow, top_y_border+current_item*ITEM_HEIGHT+ITEM_HEIGHT-7-(HEIGHT_ARROW/2), LEFT_ARROW); #endif /* draw the frame comment */ - g_snprintf(label_string, MAX_LABEL, "%s", user_data->dlg.items[current_item].frame_label); - pango_layout_set_text(layout, label_string, -1); - pango_layout_get_pixel_size(layout, &label_width, &label_height); if (start_arrow<end_arrow) { arrow_width = end_arrow-start_arrow; label_x = arrow_width/2+start_arrow; @@ -794,6 +788,18 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) arrow_width = start_arrow-end_arrow; label_x = arrow_width/2+end_arrow; } +#if PANGO_VERSION_CHECK(1,6,0) + pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); + pango_layout_set_width(layout, arrow_width * PANGO_SCALE); + pango_layout_set_text(layout, user_data->dlg.items[current_item].frame_label, -1); +#else + if (g_snprintf(label_string, MAX_FRAME_LABEL, "%s", user_data->dlg.items[current_item].frame_label) > MAX_FRAME_LABEL) { + memcpy(&label_string[MAX_FRAME_LABEL-4], "...", 3); + } + pango_layout_set_text(layout, label_string, -1); +#endif +g_warning("= layout width: %d: %s", pango_layout_get_width(layout), pango_layout_get_text(layout)); + pango_layout_get_pixel_size(layout, &label_width, &label_height); if ((int)left_x_border > ((int)label_x-(int)label_width/2)) label_x = left_x_border + label_width/2; @@ -815,6 +821,10 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data) cr = NULL; } #endif +#if PANGO_VERSION_CHECK(1,6,0) + pango_layout_set_width(layout, -1); +#endif + /* draw the source port number */ g_snprintf(label_string, MAX_LABEL, "(%i)", user_data->dlg.items[current_item].port_src); pango_layout_set_text(small_layout, label_string, -1); diff --git a/ui/gtk/graph_analysis.h b/ui/gtk/graph_analysis.h index c734ae32d5..5ff759d025 100644 --- a/ui/gtk/graph_analysis.h +++ b/ui/gtk/graph_analysis.h @@ -46,7 +46,7 @@ typedef struct _display_items { guint16 port_dst; gchar *frame_label; /**< the label on top of the arrow */ gchar *time_str; /**< timestamp */ - gchar *comment; /**< a comment that appears at the left of the graph */ + gchar *comment; /**< a comment that appears at the right of the graph */ guint16 conv_num; /**< the conversation number, each conversation will be colored */ guint16 src_node; /**< this is used by graph_analysis.c to identify the node */ guint16 dst_node; /**< a node is an IP address that will be displayed in columns */ diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp index 27a1e9e388..d5161e0146 100644 --- a/ui/qt/sequence_diagram.cpp +++ b/ui/qt/sequence_diagram.cpp @@ -23,7 +23,7 @@ #include "sequence_diagram.h" -#include <epan/addr_resolv.h> +#include "epan/addr_resolv.h" #include <QFont> #include <QFontMetrics> @@ -81,8 +81,9 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis * comment_axis_->grid()->setVisible(false); QFont comment_font = comment_axis_->tickLabelFont(); + comment_font.setPointSizeF(comment_font.pointSizeF() * 0.75); comment_axis_->setTickLabelFont(comment_font); - comment_axis_->setSelectedTickLabelFont(QFont(comment_font.family(), comment_font.pointSize(), QFont::Bold)); + comment_axis_->setSelectedTickLabelFont(QFont(comment_font.family(), comment_font.pointSizeF(), QFont::Bold)); // frame_label // port_src -----------------> port_dst @@ -93,6 +94,7 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis * void SequenceDiagram::setData(seq_analysis_info_t *sainfo) { data_->clear(); + WSCPSeqData new_data; double cur_key = 0.0; QVector<double> key_ticks, val_ticks; @@ -109,7 +111,8 @@ void SequenceDiagram::setData(seq_analysis_info_t *sainfo) key_ticks.append(cur_key); key_labels.append(sai->time_str); - com_labels.append(com_fm.elidedText(sai->comment, Qt::ElideRight, elide_w)); + + com_labels.append(com_fm.elidedText(sai->frame_label, Qt::ElideRight, elide_w)); cur_key++; } @@ -118,6 +121,9 @@ void SequenceDiagram::setData(seq_analysis_info_t *sainfo) for (unsigned int i = 0; i < sainfo_->num_nodes; i++) { val_ticks.append(i); val_labels.append(get_addr_name(&(sainfo_->nodes[i]))); + if (i % 2 == 0) { + val_labels.last().append("\n"); + } } keyAxis()->setTickVector(key_ticks); keyAxis()->setTickVectorLabels(key_labels); @@ -127,11 +133,27 @@ void SequenceDiagram::setData(seq_analysis_info_t *sainfo) comment_axis_->setTickVectorLabels(com_labels); } +seq_analysis_item_t *SequenceDiagram::itemForPosY(int ypos) +{ + double key_pos = qRound(key_axis_->pixelToCoord(ypos)); + + if (key_pos >= 0 && key_pos < data_->size()) { + return data_->value(key_pos).value; + } + return NULL; +} + double SequenceDiagram::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { - Q_UNUSED(pos); - Q_UNUSED(onlySelectable); Q_UNUSED(details); + Q_UNUSED(onlySelectable); + + double key_pos = qRound(key_axis_->pixelToCoord(pos.y())); + + if (key_pos >= 0 && key_pos < data_->size()) { + return 1.0; + } + return -1.0; } @@ -151,20 +173,47 @@ void SequenceDiagram::draw(QCPPainter *painter) if (sai->src_node > sai->dst_node && (sai->src_node < value_axis_->range().lower || sai->dst_node > value_axis_->range().upper)) { continue; } - double ah_size = (QFontMetrics(comment_axis_->tickLabelFont()).height() / 5) - * ((sai->src_node < sai->dst_node) ? 1 : -1); + + QFontMetrics cfm(comment_axis_->tickLabelFont()); + int dir_mul = (sai->src_node < sai->dst_node) ? 1 : -1; + double ah_size = (cfm.height() / 5) * dir_mul; + QPointF arrow_start(coordsToPixels(cur_key, sai->src_node)); QPointF arrow_end(coordsToPixels(cur_key, sai->dst_node)); - QLineF arrow_line(coordsToPixels(cur_key, sai->src_node), arrow_end); + QLineF arrow_line(arrow_start, arrow_end); QPolygonF arrow_head; arrow_head << QPointF(arrow_end.x() - (ah_size*3), arrow_end.y() - ah_size) << arrow_end << QPointF(arrow_end.x() - (ah_size*3), arrow_end.y() + ah_size); + if (mainPen().style() != Qt::NoPen && mainPen().color().alpha() != 0) { + double en = cfm.height() / 2.0; + painter->setBrush(mainPen().color()); painter->setPen(mainPen()); painter->drawLine(arrow_line); painter->drawPolygon(arrow_head); + + painter->setFont(comment_axis_->tickLabelFont()); + double comment_start = (sai->src_node < sai->dst_node) + ? arrow_start.x() : arrow_end.x(); + double arrow_width = (arrow_end.x() - arrow_start.x()) * dir_mul; + QString arrow_label = cfm.elidedText(sai->frame_label, Qt::ElideRight, arrow_width); + QPointF text_pt(comment_start + ((arrow_width - cfm.width(arrow_label)) / 2), + arrow_start.y() - (en / 2)); + + painter->drawText(text_pt, arrow_label); + + if (sai->port_src && sai->port_dst) { + QString port_num = QString::number(sai->port_src); + text_pt = QPointF(arrow_start.x() - en - (cfm.width(port_num) * dir_mul), + arrow_start.y() + (en / 2)); + painter->drawText(text_pt, port_num); + + port_num = QString::number(sai->port_dst); + text_pt.setX(arrow_end.x() - en + (cfm.width(port_num) * dir_mul)); + painter->drawText(text_pt, port_num); + } } } } diff --git a/ui/qt/sequence_diagram.h b/ui/qt/sequence_diagram.h index b491b0e236..4dcb25c65a 100644 --- a/ui/qt/sequence_diagram.h +++ b/ui/qt/sequence_diagram.h @@ -66,6 +66,7 @@ public: // void setWidth(double width); void setData(seq_analysis_info_t *sainfo); // void setData(const QVector<double> &key, const QVector<double> &value); + seq_analysis_item_t *itemForPosY(int ypos); // non-property methods: // void addData(const WSCPSeqDataMap &dataMap); diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp index fb27b87475..186d8dd9c9 100644 --- a/ui/qt/sequence_dialog.cpp +++ b/ui/qt/sequence_dialog.cpp @@ -24,32 +24,40 @@ #include "sequence_dialog.h" #include "ui_sequence_dialog.h" +#include "epan/addr_resolv.h" + #include "wsutil/nstime.h" #include <QFontMetrics> +#include <QPoint> #include <QDebug> // To do: -// - Fix horizontal scrolling +// - Implement controls +// - Make reset button "apply"? // - Save as -// - Sequence item labels -// - Scroll bars -// - Selection +// - Add UTF8 to text dump +// - Fix scroll bar ranges +// - Context menu +// - Selection highlighting // - Keyboard shortcuts // - ... SequenceDialog::SequenceDialog(QWidget *parent, capture_file *cf, SequenceType type) : QDialog(parent), ui(new Ui::SequenceDialog), - cap_file_(cf) + cap_file_(cf), + num_items_(0), + packet_num_(0), + node_label_w_(20) { ui->setupUi(this); QCustomPlot *sp = ui->sequencePlot; - seq_diagram_ = new SequenceDiagram(ui->sequencePlot->yAxis, ui->sequencePlot->xAxis2, - ui->sequencePlot->yAxis2); + seq_diagram_ = new SequenceDiagram(sp->yAxis, sp->xAxis2, sp->yAxis2); sp->addPlottable(seq_diagram_); + sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis); sp->xAxis->setVisible(false); sp->xAxis2->setVisible(true); @@ -59,6 +67,7 @@ SequenceDialog::SequenceDialog(QWidget *parent, capture_file *cf, SequenceType t sp->setInteractions(QCP::iRangeDrag); + ui->gridLayout->setSpacing(0); connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange))); memset (&seq_analysis_, 0, sizeof(seq_analysis_)); @@ -79,6 +88,14 @@ SequenceDialog::SequenceDialog(QWidget *parent, capture_file *cf, SequenceType t resize(parent->width(), parent->height() * 4 / 5); } + connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int))); + connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int))); + connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange))); + connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange))); + connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*))); + connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*))); + connect(sp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*))); + fillDiagram(); } @@ -106,20 +123,130 @@ void SequenceDialog::resizeEvent(QResizeEvent *event) resetAxes(true); } +void SequenceDialog::mouseReleaseEvent(QMouseEvent *event) +{ + mouseReleased(event); +} + +void SequenceDialog::hScrollBarChanged(int value) +{ + if (qAbs(ui->sequencePlot->xAxis2->range().center()-value/100.0) > 0.01) { + ui->sequencePlot->xAxis2->setRange(value/100.0, ui->sequencePlot->xAxis2->range().size(), Qt::AlignCenter); + ui->sequencePlot->replot(); + } +} + +void SequenceDialog::vScrollBarChanged(int value) +{ + if (qAbs(ui->sequencePlot->yAxis->range().center()-value/100.0) > 0.01) { + ui->sequencePlot->yAxis->setRange(value/100.0, ui->sequencePlot->yAxis->range().size(), Qt::AlignCenter); + ui->sequencePlot->replot(); + } +} + +void SequenceDialog::xAxisChanged(QCPRange range) +{ + ui->horizontalScrollBar->setValue(qRound(range.center()*100.0)); + ui->horizontalScrollBar->setPageStep(qRound(range.size()*100.0)); +} + +void SequenceDialog::yAxisChanged(QCPRange range) +{ + ui->verticalScrollBar->setValue(qRound(range.center()*100.0)); + ui->verticalScrollBar->setPageStep(qRound(range.size()*100.0)); +} + +void SequenceDialog::diagramClicked(QMouseEvent *event) +{ + QCustomPlot *sp = ui->sequencePlot; + +// if (event->button() == Qt::RightButton) { +// // XXX We should find some way to get streamPlot to handle a +// // contextMenuEvent instead. +// ctx_menu_.exec(event->globalPos()); +// } else if (mouse_drags_) { + if (sp->axisRect()->rect().contains(event->pos())) { + sp->setCursor(QCursor(Qt::ClosedHandCursor)); + } + on_actionGoToPacket_triggered(); +// } else { +// if (!rubber_band_) { +// rubber_band_ = new QRubberBand(QRubberBand::Rectangle, ui->streamPlot); +// } +// rb_origin_ = event->pos(); +// rubber_band_->setGeometry(QRect(rb_origin_, QSize())); +// rubber_band_->show(); +// } +} + +void SequenceDialog::mouseMoved(QMouseEvent *event) +{ + QCustomPlot *sp = ui->sequencePlot; + Qt::CursorShape shape = Qt::ArrowCursor; + if (event) { + if (event->buttons().testFlag(Qt::LeftButton)) { + shape = Qt::ClosedHandCursor; + } else { + if (sp->axisRect()->rect().contains(event->pos())) { + shape = Qt::OpenHandCursor; + } + } + } + sp->setCursor(QCursor(shape)); + + packet_num_ = 0; + QString hint; + if (event) { + seq_analysis_item_t *sai = seq_diagram_->itemForPosY(event->pos().y()); + if (sai) { + packet_num_ = sai->fd->num; + hint = QString("Packet %1: %2").arg(packet_num_).arg(sai->comment); + } + } + + if (hint.isEmpty()) { + hint += QString("%1 nodes, %2 items").arg(seq_analysis_.num_nodes).arg(num_items_); + } + + hint.prepend("<small><i>"); + hint.append("</i></small>"); + ui->hintLabel->setText(hint); +} + +void SequenceDialog::mouseReleased(QMouseEvent *event) +{ + Q_UNUSED(event); + if (ui->sequencePlot->cursor().shape() == Qt::ClosedHandCursor) { + ui->sequencePlot->setCursor(QCursor(Qt::OpenHandCursor)); + } +} + void SequenceDialog::fillDiagram() { QCustomPlot *sp = ui->sequencePlot; sequence_analysis_list_free(&seq_analysis_); sequence_analysis_list_get(cap_file_, &seq_analysis_); - sequence_analysis_get_nodes(&seq_analysis_); + num_items_ = sequence_analysis_get_nodes(&seq_analysis_); seq_diagram_->setData(&seq_analysis_); + + QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont()); + node_label_w_ = 0; + for (guint i = 0; i < seq_analysis_.num_nodes; i++) { + int label_w = vfm.width(get_addr_name(&(seq_analysis_.nodes[i]))); + if (node_label_w_ < label_w) { + node_label_w_ = label_w; + } + } + node_label_w_ = (node_label_w_ * 3 / 4) + one_em_; // ui->sequencePlot->rescaleAxes(); - sp->replot(); + ui->horizontalScrollBar->setRange(0, seq_analysis_.num_nodes * 100); + ui->verticalScrollBar->setRange(0, (num_items_ + 1) * 100); + + mouseMoved(NULL); resetAxes(); -// tracer_->setGraph(base_graph_); // XXX QCustomPlot doesn't seem to draw any sort of focus indicator. sp->setFocus(); @@ -128,14 +255,16 @@ void SequenceDialog::fillDiagram() void SequenceDialog::resetAxes(bool keep_lower) { QCustomPlot *sp = ui->sequencePlot; - double top_pos = -1.0; + double top_pos = -1.0, left_pos = 0.0; if (keep_lower) { top_pos = sp->yAxis->range().lower; + left_pos = sp->xAxis2->range().lower; } - sp->xAxis->moveRange(sp->xAxis->range().lower * -1); + double range_ratio = sp->xAxis2->axisRect()->width() / node_label_w_; + sp->xAxis2->setRange(left_pos, range_ratio + left_pos); - double range_ratio = sp->yAxis->axisRect()->height() / one_em_; + range_ratio = sp->yAxis->axisRect()->height() / (one_em_ * 1.5); sp->yAxis->setRange(top_pos, range_ratio + top_pos); sp->replot(); @@ -145,3 +274,10 @@ void SequenceDialog::on_resetButton_clicked() { resetAxes(); } + +void SequenceDialog::on_actionGoToPacket_triggered() +{ + if (cap_file_ && packet_num_ > 0) { + emit goToPacket(packet_num_); + } +} diff --git a/ui/qt/sequence_dialog.h b/ui/qt/sequence_dialog.h index f6a5e15de8..44f213d5c1 100644 --- a/ui/qt/sequence_dialog.h +++ b/ui/qt/sequence_dialog.h @@ -59,16 +59,29 @@ public slots: protected: void showEvent(QShowEvent *event); void resizeEvent(QResizeEvent *event); + void mouseReleaseEvent(QMouseEvent *event); private slots: + void hScrollBarChanged(int value); + void vScrollBarChanged(int value); + void xAxisChanged(QCPRange range); + void yAxisChanged(QCPRange range); + void diagramClicked(QMouseEvent *event); + void mouseMoved(QMouseEvent *event); + void mouseReleased(QMouseEvent *event); + void on_resetButton_clicked(); + void on_actionGoToPacket_triggered(); private: Ui::SequenceDialog *ui; SequenceDiagram *seq_diagram_; capture_file *cap_file_; seq_analysis_info_t seq_analysis_; + int num_items_; + guint32 packet_num_; double one_em_; + int node_label_w_; void fillDiagram(); void resetAxes(bool keep_lower = false); diff --git a/ui/qt/sequence_dialog.ui b/ui/qt/sequence_dialog.ui index 041738cb04..bf497d3989 100644 --- a/ui/qt/sequence_dialog.ui +++ b/ui/qt/sequence_dialog.ui @@ -15,14 +15,35 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QCustomPlot" name="sequencePlot" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>1</verstretch> - </sizepolicy> - </property> - </widget> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QCustomPlot" name="sequencePlot" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>1</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QScrollBar" name="verticalScrollBar"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QScrollBar" name="horizontalScrollBar"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QFrame" name="frame"/> + </item> + </layout> </item> <item> <widget class="QLabel" name="hintLabel"> @@ -159,6 +180,17 @@ </widget> </item> </layout> + <action name="actionGoToPacket"> + <property name="text"> + <string>Go To Packet Under Cursor</string> + </property> + <property name="toolTip"> + <string>Go to packet currently under the cursor</string> + </property> + <property name="shortcut"> + <string>G</string> + </property> + </action> </widget> <customwidgets> <customwidget> diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp index c54d463f2d..f76e09fc27 100644 --- a/ui/qt/tcp_stream_dialog.cpp +++ b/ui/qt/tcp_stream_dialog.cpp @@ -794,7 +794,6 @@ QRectF TCPStreamDialog::getZoomRanges(QRect zoom_rect) void TCPStreamDialog::graphClicked(QMouseEvent *event) { - Q_UNUSED(event) QCustomPlot *sp = ui->streamPlot; if (event->button() == Qt::RightButton) { diff --git a/ui/tap-sequence-analysis.c b/ui/tap-sequence-analysis.c index 01e6962aa3..16d5d63ffc 100644 --- a/ui/tap-sequence-analysis.c +++ b/ui/tap-sequence-analysis.c @@ -115,17 +115,17 @@ seq_analysis_frame_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U if (colinfo != NULL) { if (protocol != NULL) { - sai->frame_label = g_strdup_printf("%.19s", colinfo); + sai->frame_label = g_strdup(colinfo); sai->comment = g_strdup_printf("%s: %s", protocol, colinfo); } else { - sai->frame_label = g_strdup_printf("%.19s", colinfo); - sai->comment = g_strdup_printf("%s", colinfo); + sai->frame_label = g_strdup(colinfo); + sai->comment = g_strdup(colinfo); } } else { /* This will probably never happen...*/ if (protocol != NULL) { - sai->frame_label = g_strdup_printf("%.19s", protocol); - sai->comment = g_strdup_printf("%s", protocol); + sai->frame_label = g_strdup(protocol); + sai->comment = g_strdup(protocol); } } diff --git a/ui/tap-sequence-analysis.h b/ui/tap-sequence-analysis.h index 18057db49d..8ae893a117 100644 --- a/ui/tap-sequence-analysis.h +++ b/ui/tap-sequence-analysis.h @@ -59,7 +59,7 @@ typedef struct _seq_analysis_item { guint16 port_dst; gchar *frame_label; /**< the label on top of the arrow */ gchar *time_str; /**< timestamp */ - gchar *comment; /**< a comment that appears at the left of the graph */ + gchar *comment; /**< a comment that appears at the right of the graph */ guint16 conv_num; /**< the conversation number, each conversation will be colored */ gboolean display; /**< indicate if the packet is displayed or not in the graph */ guint16 src_node; /**< this is used by graph_analysis.c to identify the node */ |