forked from osmocom/wireshark
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>
This commit is contained in:
parent
499d912f4b
commit
a218460e22
|
@ -37,6 +37,8 @@ since version 3.1.0:
|
|||
* You can once again mark and unmark packets using the middle mouse button.
|
||||
This feature went missing around 2009 or so.
|
||||
* The Windows packages are now built using Microsoft Visual Studio 2019.
|
||||
* IOGraph automatically adds a graph for the selected display filter if no
|
||||
previous graph exists
|
||||
|
||||
The following features are new (or have been significantly updated)
|
||||
since version 3.0.0:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -130,7 +130,7 @@ class IOGraphDialog : public WiresharkDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit IOGraphDialog(QWidget &parent, CaptureFile &cf);
|
||||
explicit IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter = QString());
|
||||
~IOGraphDialog();
|
||||
|
||||
enum UatColumns { colEnabled = 0, colName, colDFilter, colColor, colStyle, colYAxis, colYField, colSMAPeriod, colMaxNum};
|
||||
|
|
|
@ -3131,7 +3131,12 @@ void MainWindow::on_actionStatisticsPacketLengths_triggered()
|
|||
// -z io,stat
|
||||
void MainWindow::statCommandIOGraph(const char *, void *)
|
||||
{
|
||||
IOGraphDialog *iog_dialog = new IOGraphDialog(*this, capture_file_);
|
||||
const DisplayFilterEdit *df_edit = qobject_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
|
||||
QString displayFilter;
|
||||
if ( df_edit )
|
||||
displayFilter = df_edit->text();
|
||||
|
||||
IOGraphDialog *iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter);
|
||||
connect(iog_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
|
||||
connect(this, SIGNAL(reloadFields()), iog_dialog, SLOT(reloadFields()));
|
||||
iog_dialog->show();
|
||||
|
|
Loading…
Reference in New Issue