Qt io_graph: Use Interval value when generating Y-axis label or legend
authorJim Young <jyoung@gsu.edu>
Tue, 24 Nov 2015 15:50:08 +0000 (10:50 -0500)
committerMichael Mann <mmann78@netscape.net>
Sun, 24 Jan 2016 00:13:42 +0000 (00:13 +0000)
commit0fa13371d19e1d33fc43a0d3be14bdb705e437e1
tree159067363abe7e36dc7a55efb671ec26a68c9102
parent9eda2fa063569c49ce238d6bbee023c91b46d879
Qt io_graph: Use Interval value when generating Y-axis label or legend

The I/O Graph allows the user to choose from several different Y-axis units.
Three of the selectable Y-axis units unconditionally imply a per-second
time unit (/s) regardless of the actual I/O Graph Interval value selected.
In addition the Y-axis label includes the “/s” as a suffix regardless of the
current Interval value.

This patch removes "/s" suffix from the Y-axis pick-list units.  This patch
also dynamically adds the selected Interval value to the Y-Axis label or
alternatively as the first line of the legend box that is displayed if the
various enabled graphs have differing Y-axis values.  For readability the
pick-list values for sub-second Interval values are changed to 1 ms, 10 ms
and 100 ms from the original pick-list values of 0.001 sec, 0.01 sec and
0.1 sec respectively.

To support adding a “Title” to the legend, the QCustomPlot widget is
augmented with “Legend Title” source authored by “David” as posted at:

  http://www.qcustomplot.com/index.php/support/forum/443

Note: This patch changes the valid Y-axis unit values stored within the
io_graphs preferences files.  Any io_graphs files having entries with the
now obsolete Y-Axis values of “Packets/s”, “Bytes/s” or “Bits/s“ will be
silently upgraded to “Packets”, "Bytes" and "Bits" respectively when
saved.

Bug: 11855
Change-Id: I503ff6dc20b09d90f087342084fb0db6e0080c7f
Reviewed-on: https://code.wireshark.org/review/12219
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
ui/qt/io_graph_dialog.cpp
ui/qt/qcustomplot.cpp
ui/qt/qcustomplot.h