Commit Graph

89 Commits

Author SHA1 Message Date
Stig Bjørlykke d50bd39b85 Qt: Cleanup deletion of CopyFromProfileMenu
Set the push button as parent to the profile list menu so it will
be deleted when that parent is destroyed.

Change-Id: Ide4a234e039a3e27d9ee4732a3800906c80be173
Reviewed-on: https://code.wireshark.org/review/31446
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-09 04:23:35 +00:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Stig Bjørlykke 75c370fe54 Qt: Refactor copy from profile widget
Refactor CopyFromProfile class from Button to Menu to make it
usable for existing buttons, both QPushButton and QToolButton.

Change-Id: I7d23b4225dbe45f961fb05e73dbb4dd51e6f8ea1
Reviewed-on: https://code.wireshark.org/review/30083
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-10-08 21:07:49 +00:00
Stig Bjørlykke d7cf0086fc Qt: Add copy from another profile for IO Graphs
Add a new button to the IO Graphs dialog to copy entries from
another profile. Add a clear all button to easily remove all
existing entries before copying.

Change-Id: I66cb27163663e5f2223d0dd3f8566f0fbebb553c
Reviewed-on: https://code.wireshark.org/review/30043
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-07 05:37:48 +00:00
Stig Bjørlykke af392b873a Qt: Call createIOGraph() when duplicating an existing IO Graph
Call createIOGraph() when adding a new graph by duplicating
an existing to actually create the new graph.

This is a regression from g5b3e3ee5.

Change-Id: If1d8e4386a44dc4867d75fbad2d9ebb2e4b22307
Reviewed-on: https://code.wireshark.org/review/30034
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-06 06:09:31 +00:00
Stig Bjørlykke 75c46e80bf Qt: Add copy from another profile in UAT dialogs
Add a new button to UAT dialogs to copy entries from another profile.

Change-Id: I641ba764d8738f738466529d74d4a21ff13075a0
Reviewed-on: https://code.wireshark.org/review/30028
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-10-05 12:38:32 +00:00
Guy Harris 9b731e2b32 Add a tap "finish" callback, called when a listener is removed.
Change-Id: Ic6c23dbd39d1adf8f730f1c866e409f731947475
Reviewed-on: https://code.wireshark.org/review/28786
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-21 00:51:13 +00:00
Guy Harris 874c978bbc Use the file *base* name for statistics graphs etc..
For example, if the file is foo.pcap, make the default name for a saved
PDF of some graph be foo.pdf, as it was prior to 2.6, not foo.pcap.pdf.

Change-Id: Ide99c9c7fa1f3d16f829e731f968a209fbb52b8d
Reviewed-on: https://code.wireshark.org/review/28624
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 00:31:45 +00:00
Guy Harris 9655acc757 fileTitle -> fileDisplayName.
That more closely matches the name of the file.h routine that it uses.

Change-Id: Ia206fb8331f4f3ad8035da9f6137ad2428d53a49
Reviewed-on: https://code.wireshark.org/review/28589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-04 02:09:04 +00:00
Guy Harris d76db1de78 CaptureFile.fileTitle() is for display, not for file name processing.
Don't use CaptureFile.fileTitle() if you're constructing a pathname; use
it only if you're constructing a window title.

Change-Id: I40f225ddb07be2f7dc3ae03108dae816846f20c7
Reviewed-on: https://code.wireshark.org/review/28582
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-03 22:41:18 +00:00
Jakub Zawadzki de447c1544 sharkd: add support for io graph.
Change-Id: I8d23a2b55024e2ef8c644dcef9176c7e3050a703
Reviewed-on: https://code.wireshark.org/review/27376
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-31 18:43:50 +00:00
Gerald Combs 62999cc677 Windows: Make sure more native dialogs handle HiDPI.
Add a WiresharkFileDialog class, which is a thin wrapper around a few
QFileDialog functions that sets per-monitor v2 DPI awareness before
showing native dialogs and resets the awareness context afterward.
Use it where we call QFileDialog::getXXX.

Change-Id: Ib711a70aa94b693a2515804a729f666ea7fbd673
Reviewed-on: https://code.wireshark.org/review/27568
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-16 04:22:20 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +00:00
Peter Wu f2aa1cbdec Qt: fix remaining CaptureEvent signal connections
Converted all remaining "CaptureEvent *" to "CaptureEvent" using:

    sed -e 's/CaptureEvent *\*/CaptureEvent/g' $(git grep -le 'CaptureEvent *\*') -i

Change-Id: I328d2890ec3b5e6672fa3fab22e85063e8309574
Fixes: v2.9.0rc0-186-g57bf7e4347 ("Qt: Fix memory leak for CaptureEvent")
Reviewed-on: https://code.wireshark.org/review/26985
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-17 16:40:13 +00:00
Roland Knall 57bf7e4347 Qt: Fix memory leak for CaptureEvent
Make the argument to the events a non-memory object

Change-Id: I46d8c24415aa2bc48b2a2d3b1fccffa6956d08b5
Reviewed-on: https://code.wireshark.org/review/26671
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-17 13:16:46 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Gerald Combs eda5c950b6 IO Graph: Add some vector checks.
Use Qvector::value in a few places instead of an array index.

Change-Id: I821ef4b16df919977739c12ccaa3b9c3d53f049c
Ping-bug: 14357
Reviewed-on: https://code.wireshark.org/review/25511
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-31 04:52:37 +00:00
Gerald Combs 682fe39422 Qt: Fixup a cast.
Change-Id: I25dbf6c91bd3ca1f16a01c937a3830010adcd197
Reviewed-on: https://code.wireshark.org/review/25373
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-18 18:56:16 +00:00
Gerald Combs 0aad2bbc36 Qt: I/O graph fixes.
Use Qt::DecorationRole when setting and getting a color and
Qt::CheckStateRole when setting and getting the check state of UatModel
items.

Add a default role for UatModel::data.

Convert between value strings and their respective values where needed.

Bug: 14317
Change-Id: Idd3eb773dc9944f982f6dbd7d49f73f4a60dd5a2
Reviewed-on: https://code.wireshark.org/review/25355
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
2018-01-18 05:16:18 +00:00
Michael Mann 777acc73da Apply new CaptureEvents to statistics dialogs.
Refactoring from If366d42b07dc822636404ac44ba2306ec4418b4e ignored
dialogs outside of the main window.  Searched for removed signals
from CaptureFile class and applied new CaptureEvent handling.

Change-Id: I9e0aaa0dc1c702ce04810d27c8f9273997f7ca30
Reviewed-on: https://code.wireshark.org/review/25007
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-27 08:08:10 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Peter Wu 35a1907fe6 iograph: Use default graph values if io_graphs UAT file doesn't pass validation
Change-Id: I70c8ca7b5b31d284a12220fc6ce2a764ea9fbe6b
Fixes: v2.5.0rc0-631-g5b3e3ee587 ("Use UAT model for I/O graph")
Reviewed-on: https://code.wireshark.org/review/23366
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-08 22:07:44 +00:00
Michael Mann 59e6c62893 io_graph_dialog.cpp: Remove graph_enabled_vs.
No longer necessary with model

Change-Id: If1516f264013fabe1211aa04fe054b15e235b36a
Reviewed-on: https://code.wireshark.org/review/23007
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-08 00:50:20 +00:00
Michael Mann 5b3e3ee587 Use UAT model for I/O graph
Convert from using TreeWidgetItems to UAT model/delegate.  More of the GUI
is "just handled" within the table.
Required to add support for "colors" and "protocol fields" to UAT types.
Also needed to add some hacks for "custom" UAT field handlers for
backwards compatibility with the existing UAT structure used.

Because UAT functionality was switched completely to the model, some
information in the table was "lost in translation" because the UATs
themselves aren't translated to other languages.

TODO:
2. Better "order of operations"?  A bunch of NULL/size checks needed to be added to prevent crashing.
Now with model/"view" should events/functions be reordered?

Bug: 13585
Change-Id: I2bbba78182317c4fada07b927c05d0c6f4cdc0fe
Reviewed-on: https://code.wireshark.org/review/22766
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-07 17:25:02 +00:00
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
Following the move for widgets directory, moving utils
to the utils directory. Guidelines for this directory are:

 - Generic use but not a widget
 - Utility functionality used by many classes
 
 Note: additionally all includes affected by this move have been changed
 to absolute path includes, instead of relative ones.

Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b
Reviewed-on: https://code.wireshark.org/review/22602
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:11:55 +00:00
Stig Bjørlykke 7f23b51868 Qt: Expand IO Graph text edit fields to column width
When editing a IO Graph the text edit field should fill the column.

Change-Id: Idb5c9a7004d9be1b82e645ae2c1a3430c9c9e5f7
Reviewed-on: https://code.wireshark.org/review/22626
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-07-16 19:39:56 +00:00
Stig Bjørlykke d5c8145f54 Qt: Set IO Graph display filter when having Y field
Calling setFilter() between setValueUnits() and setValueUnitField()
will fail when having "Y Field" because check_field_unit() fails
with inconsistent values.  The display filter will then be ignored.

Call setFilter() first to ensure filter_ is set before setting
value units.  setFilter() does not depend on the value unit when
used to set the display filter.

Change-Id: Ibf2d37fddcce9fcf6febebfefa0b2518ae093737
Fixes: v2.3.0rc0-2930-g0ea51ad822 ("Qt: Fix uninitialized memory access in val_units_")
Reviewed-on: https://code.wireshark.org/review/22619
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-07-16 19:39:35 +00:00
Roland Knall ee699eb720 Qt: Move all utility widgets to widgets subdirectory
Move all utility widgets to the widgets subdirectory and
add separate source_group for their files

Correct some alphabetization in ui/qt/CMakeLists.txt noticed
during compare.

Change-Id: I2d664edc2b32f126438fb673ea53a5ae94cd43d1
Reviewed-on: https://code.wireshark.org/review/22531
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11 21:30:29 +00:00
Peter Wu 9b0b2c3d59 Qt: show relative time for the IO Graph in an appropriate unit
The GTK+ UI performs automatic formatting of the units (us, ms, s) based
on the magnitude of the value (for MIN/MAX/SUM calculations). Internally
the numbers are stored as integers (microseconds).

The Qt UI did not have this formatting feature yet and would therefore
display the values as-is (in microseconds). This patch rescales the Y
value and appends an appropriate label (s, ms or us).

With multiple graphs, rescaling is disabled completely for simplicity
(GTK+ would still try to find an appropriate unit prefix if there are
multiple time graphs).

Bug: 12828
Change-Id: I26ed68fc3497e06ac283a618fee8b673b1b0cf71
Reviewed-on: https://code.wireshark.org/review/21062
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-20 15:18:36 +00:00
Xiaochuan Sun d13c6d9628 remove unnecessary guint64 cast in IO graph
Change-Id: I35d666a5a9fb5813706c312334f1552703c9475c
Reviewed-on: https://code.wireshark.org/review/21214
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-19 04:51:08 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Peter Wu 023cf320eb Qt: support selecting the min/max packet from IO Graph
GTK+ supports selecting the first packet (via the "left mouse button")
and the last packet (via the "right mouse button") in an interval, and
Qt supports selecting the last packet of an interval. This patch enables
picking the packet matching the extreme value in Qt.

Bug: 12401
Change-Id: If0b7f2f1bf8c384ea0d68b5f5fae2d1e8b4b0ac2
Reviewed-on: https://code.wireshark.org/review/20769
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-05 09:27:32 +00:00
Peter Wu a5f9b4e06d Qt: fix tracer and selection of packet in IO Graph
Do not assume first graph in the list, pick the first visible graph.
This (1) fixes the tracer which would otherwise show a marker at an
non-obvious position that is not located on the graph and (2) fixes the
GoToPacket action when clicking on the graph.

Bug: 13537
Change-Id: I49d750102ad25c8539aa2e44fe1583cd535dd471
Reviewed-on: https://code.wireshark.org/review/20768
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-05 09:26:59 +00:00
Peter Wu 0ea51ad822 Qt: Fix uninitialized memory access in val_units_
Fixes the following UBSAN errors:

    ui/qt/io_graph_dialog.cpp:1720:75: runtime error: load of value 3200171710, which is not a valid value for type 'io_graph_item_unit_t'
        #0 0x5611f0b0cd1d in IOGraph::setFilter(QString const&) ui/qt/io_graph_dialog.cpp:1720:75
        #1 0x5611f0b737a1 in IOGraph::IOGraph(QCustomPlot*) ui/qt/io_graph_dialog.cpp:1682:5
        #2 0x5611f0afb3f3 in IOGraphDialog::addGraph(bool, QString, QString, int, IOGraph::PlotStyles, io_graph_item_unit_t, QString, int) ui/qt/io_graph_dialog.cpp:340:24
        #3 0x5611f0af7c19 in IOGraphDialog::IOGraphDialog(QWidget&, CaptureFile&) ui/qt/io_graph_dialog.cpp:289:13

    ui/qt/io_graph_dialog.cpp:1818:19: runtime error: load of value 3200171710, which is not a valid value for type 'io_graph_item_unit_t'
        #0 0x5611f0b1167e in IOGraph::setPlotStyle(int) ui/qt/io_graph_dialog.cpp:1818:19
        #1 0x5611f0b062ee in IOGraphDialog::syncGraphSettings(QTreeWidgetItem*) ui/qt/io_graph_dialog.cpp:420:10

    ui/qt/io_graph_dialog.cpp:1872:29: runtime error: load of value 3200171710, which is not a valid value for type 'io_graph_item_unit_t'
        #0 0x5611f0b13e6a in IOGraph::setValueUnits(int) ui/qt/io_graph_dialog.cpp:1872:29
        #1 0x5611f0b06640 in IOGraphDialog::syncGraphSettings(QTreeWidgetItem*) ui/qt/io_graph_dialog.cpp:422:10

Note that calling setFilter with an empty string is pretty useless,
especially since the filter is initialized later, so remove it.
The choice for IOG_ITEM_UNIT_FIRST is quite arbitrary and needed because
setValueUnits reads the "old" (uninitialized) value.

Change-Id: I32c65a30593cb718b838c0f324e0d1b0eaab90e5
Reviewed-on: https://code.wireshark.org/review/20767
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-30 22:28:01 +00:00
Michael Mann f5ed8a4306 Fix "warning C6246: Local declaration hides declaration of the same name in outer scope" warnings
Change-Id: I0dbf8d0236b163da568a173ccedc3072bd039caa
Reviewed-on: https://code.wireshark.org/review/20739
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-27 15:23:34 +00:00
Stig Bjørlykke e781fdd180 Qt: Fix heap-use-after-free when deleting IO graph
Deleting a IO graph item while editing a field will use the IOGraph
object so ensure we delete in correct order to avoid heap-use-after-free.

Bug: 13234
Change-Id: I6d0de21684f842fbd67c9b38fc6b75b81aec5518
Reviewed-on: https://code.wireshark.org/review/20456
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-09 09:22:45 +00:00
Stig Bjørlykke 26e62dfad0 Qt: Fix -Wshorten-64-to-32 warnings
Fix some warnings when building with -Wshorten-64-to-32 flag for
C++ code.

Fixes for warnings from QList, QTimer and QVector has been pushed
upstream, so some time we may be able to enable this flag for C++.

Change-Id: Iae7457f9afc469c63f3edbe23dbf272b5c6c9e5e
Reviewed-on: https://code.wireshark.org/review/20310
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-02-28 11:41:32 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls
to QVariant conversions with VariantPointer where necessary

Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec
Reviewed-on: https://code.wireshark.org/review/19611
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 16:04:00 +00:00
Dario Lombardo 805ddd1add uat: add a reset callback.
This function will free the resources allocated by the caller.

Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4
Reviewed-on: https://code.wireshark.org/review/19375
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-12 12:39:15 +00:00
Stig Bjørlykke 057b6bbd2e Qt: Set Close as default button
Set Close as default button in some statistics dialogs.

Change-Id: I82e17d27de256aabaec1633bb973c554eec907c3
Reviewed-on: https://code.wireshark.org/review/17685
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-14 06:25:22 +00:00
Michael Mann 5c1d58b482 Add field completion suggestions when adding a Display filter or Y Field to the IO Graph
Bug: 11899
Change-Id: I7cee36581dc773daa691dad10500124ab66520bc
Reviewed-on: https://code.wireshark.org/review/16023
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-20 01:26:53 +00:00
Pascal Quantin a383e692c8 Revert "tap: change glib functions to wmem."
This reverts commit 2e9f3c5d36.

It breaks the registration of codec, dissector and libwiretap plugins.

Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-19 10:47:10 +00:00
Dario Lombardo 2e9f3c5d36 tap: change glib functions to wmem.
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf
Reviewed-on: https://code.wireshark.org/review/15270
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-17 15:38:03 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
Add GeometryStateDialog class to handle load and save dialog geometry.
The QDialog class name will be used as window name.  For shared
classes the UAT name or the statistics title or abbr will be used.

Change-Id: I5a019598307fb3861518f41e733de834788184d8
Reviewed-on: https://code.wireshark.org/review/14139
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-28 18:25:50 +00:00
Jim Young 0fa13371d1 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>
2016-01-24 00:13:42 +00:00
Guy Harris a7f470fa24 More pinfo->fd->abs_ts to pinfo->abs_ts.
Change-Id: I70db0a345cc4c5c57c454371deb4f92f9ac4b9ac
Reviewed-on: https://code.wireshark.org/review/13501
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:58:56 +00:00
Stig Bjørlykke a18af795fa Qt: It's no translation for "%1 %2"
Change-Id: If50a19b34b5f1c0076fcee76e59a45c307a9b2db
Reviewed-on: https://code.wireshark.org/review/12456
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-07 02:55:51 +00:00
Gerald Combs 79f7edba15 Qt: Don't expose ColorUtils::graph_colors_.
Make graph_colors_ private and accessible via getters. Blind attempt at
fixing bug 11833.

Bug: 11833
Change-Id: I03b7e90c686374d2d0f046f7e5fe87e43939dc82
Reviewed-on: https://code.wireshark.org/review/12318
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-01 05:17:59 +00:00