aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/io_graph_dialog.cpp
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2019-11-05 13:36:18 +0000
committerRoland Knall <rknall@gmail.com>2019-11-05 15:50:50 +0000
commita218460e2241017423745281d59d81a6485678bf (patch)
treeef23a2188eef0f7991341e654dad04f79602a783 /ui/qt/io_graph_dialog.cpp
parent499d912f4b12c8121979f44b1a8b7551c17ee76b (diff)
Qt: IOGraph display filter graph added
Add a graph for the currently display filter if none exists, upon opening IOGraph Change-Id: Ic25b014484898dd1917b13f2616fd519e2e8183b Reviewed-on: https://code.wireshark.org/review/34984 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/io_graph_dialog.cpp')
-rw-r--r--ui/qt/io_graph_dialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index ca7f0fe6cc..f13131a3d8 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -286,7 +286,7 @@ static void io_graph_free_cb(void* p) {
} // extern "C"
-IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf) :
+IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter) :
WiresharkDialog(parent, cf),
ui(new Ui::IOGraphDialog),
uat_model_(NULL),
@@ -393,13 +393,22 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf) :
tracer_ = new QCPItemTracer(iop);
loadProfileGraphs();
+ bool filterExists = false;
if (num_io_graphs_ > 0) {
for (guint i = 0; i < num_io_graphs_; i++) {
createIOGraph(i);
+ if ( ioGraphs_.at(i)->filter().compare(displayFilter) == 0 )
+ filterExists = true;
}
+ if ( ! filterExists && displayFilter.length() > 0 )
+ addGraph(true, tr("Filtered packets"), displayFilter, ColorUtils::graphColor(num_io_graphs_),
+ IOGraph::psLine, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE);
} else {
addDefaultGraph(true, 0);
addDefaultGraph(true, 1);
+ if ( displayFilter.length() > 0 )
+ addGraph(true, tr("Filtered packets"), displayFilter, ColorUtils::graphColor(num_io_graphs_),
+ IOGraph::psLine, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE);
}
toggleTracerStyle(true);