Commit Graph

37 Commits

Author SHA1 Message Date
John Thacker a25bcce10a Qt: Only autoset display filter when dialog is opened
Autoset "Limit to display filter" if a display filter is
present when the dialog is open, but do not re-enable it each
time the widget is updated, if the user has unchecked it.

[skip ci]

Fix #18461
2023-01-14 13:17:02 -05:00
John Thacker 4484736366 Qt: Set small text for ExpertInfoDialog filter
ElidedLabel has its own method to set small text and italicize.
After !9261, any HTML that is passed into it appears escaped,
which we don't want.
2023-01-14 12:19:45 -05:00
Jim Young 11990f258d Qt: Add ProgressFrame to the Expert Information dialog 2022-10-31 14:15:18 +00:00
Roland Knall 212abb7efe Qt: Autoset limit to display filter for expert dialog
Autoset the "Limit to display filter" if a display filter
was present, when the dialog was opened
2022-06-12 15:30:12 +00:00
Gerald Combs 80de95ca71 Qt: Split MainApplication out from WiresharkApplication.
Move WiresharkApplication.{cpp,h} to MainApplication.{cpp,h}. Add back
WiresharkApplication as a thin superclass of MainApplication, similar to
LogsharkApplication. Change all of our wsApp references to mainApp. We
will likely have to change many or most of them back, but that's a
commit for another time.
2022-04-04 09:39:27 -07:00
Gerald Combs f7e5fb6952 Qt: Fix various missing prototype warnings.
Fix some noisy documentation bugs while we're here.
2021-04-16 22:25:22 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +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 01a32a54a0 Qt: fix invalid member access within expert info dialog
Opening a context menu in the expert dialog resulted in an UBSAN warning
because ExpertInfoModel::data is invoked with a proxy model index. Rely
on the proxy to perform this mapping (change filterActionTriggered to
avoid direct model access while at it).

Change-Id: Id399f44b954b87d7d4dd0341fbedb391ab1b13da
Fixes: v2.5.0rc0-1966-gb0112e60ad ("Add a model to use for Expert Info dialog.")
Reviewed-on: https://code.wireshark.org/review/27025
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-20 07:46:00 +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
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
Michael Mann 0b88544b07 Fix memory leaks in Expert Info dialog
Models and children weren't deleted which leaked memory all over the place.

Change-Id: I961016b2501ad8cc8c75cf5fa5b0c86756a29382
Reviewed-on: https://code.wireshark.org/review/24858
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-16 15:41:21 +00:00
Michael Mann b0112e60ad Add a model to use for Expert Info dialog.
With the model (and proxy), the following features were added/fixed.
1. Expert severities can be filtered by type
2. Search filter expanded to include summary, protocol and column info
3. Expert info starts with all items collapsed.
4. Context menus for collapse/expand all

Bug: 11753
Bug: 13831
Bug: 13842
Change-Id: I8e89c7be441e1f08e18915ef8805609e5c5d0bd1
Reviewed-on: https://code.wireshark.org/review/22458
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-13 16:07:07 +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
Mikael Kanstrup a17bbc1841 qt: Fix some leaked menu objects
Calling QPushButton.setMenu and QMenu.addMenu does not transfer ownership
of the menu. Fix some leaks by letting "receiving" object act parent
for the menu object.

Bug: 14071
Change-Id: Id4edaf895503ef5dd4597eac99c2cdd6ad09b2ff
Reviewed-on: https://code.wireshark.org/review/23600
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-09-20 05:48:06 +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
Michael Mann d4d30faeb8 Promote Expert preference UAT to main preference tree.
"Expert" has been treated as a protocol "internally", but I
doubt users would consider it one.  Since the only preference
is a UAT, just make it its own leaf off of the main preference
tree (similar to Filter Expressions UAT) and not have it buried
with all of the protocols.

Change-Id: I385314d8791440e6ced3dbd71305ee75bc373e52
Reviewed-on: https://code.wireshark.org/review/22580
Reviewed-by: Michael Mann <mmann78@netscape.net>
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>
2017-07-11 08:40:13 +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
Dario Lombardo edf0b5cb9a qt: add initializer to ExpertPacketTreeWidgetItem (CID 1362746).
Change-Id: I8ca154907e01fb40affb9e5f5a0aaf55921c95db
Reviewed-on: https://code.wireshark.org/review/15926
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-06-15 18:07:40 +00:00
Pascal Quantin 40a3cbfca5 Qt: fix crash when opening Expert Info dialog
g6ff19ff tried to access cinfo by following a chain of pointers from
expert_info. Access cinfo from cap_file_, which is more reliable. While
we are at it, let's explicitly check the pointer validity.

Change-Id: I0da72c5b1d2230a49c125a1b57c81c3115c4f2fb
Reviewed-on: https://code.wireshark.org/review/15901
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-06-14 21:24:39 +00:00
Gerald Combs 6ff19fff9d Qt: Add the Info column contents to Expert Info.
When "group by summary" is enabled, packet items contain a packet number
followed by a lot of empty space. Fill it with the contents of the Info
column.

Set the first column title to "Severity" or "Packet" depending on the
item selection.

Change-Id: Iff96ab2ec631300ec8f08e55019e191e88cff84a
Reviewed-on: https://code.wireshark.org/review/15814
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>
2016-06-13 13:13:59 +00:00
Alexis La Goutte 752a8eacff expert_info_dialog (Qt): fix Uninitialized members (UNINIT_CTOR) reported by Coverity (CID 1362692)
Change-Id: I1bc71ac7b9c08a9a5749aa9bc88863fa10eb27c7
Reviewed-on: https://code.wireshark.org/review/15848
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-12 21:10:54 +00:00
Gerald Combs 00d36c7888 Qt: Expert info grouping.
Add the ability to group expert info items by summary and enable it by
default. This more closely matches the GTK+ UI behavior.

Show matching item counts while we're here.

Bug: 12218
Change-Id: Ic02267da8435fb70015de8dd15e0ac46faabbee9
Reviewed-on: https://code.wireshark.org/review/15796
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-06-10 16:44:17 +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
Pascal Quantin ad36e1b43e Qt: deactivate "limit to display filter" checkbox when retapping
Bug: 11848
Bug: 11900
Change-Id: I39bc1f6d8006ee9c258c986a69b460cf99c7e65a
Reviewed-on: https://code.wireshark.org/review/12687
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-12-17 08:13:28 +00:00
Gerald Combs db760bf52e Qt: Allow Expert Information retapping.
The Expert Information dialog is open-ended. It adds a tap listener but
doesn't remove it, which is useful during live captures. Make sure we
add our second-level tree items each time taps are drawn and when
tapping is finished.

Change-Id: Ie06d60512644e540172f1b330b631db4e4e86897
Bug: 11644
Reviewed-on: https://code.wireshark.org/review/11407
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-29 20:10:53 +00:00
Gerald Combs e234ce8804 Rework tapping in Qt dialogs.
Add cf_cb_file_retap_started and cf_cb_file_retap_finished to file.[ch].
Add their associated signals to CaptureFile.

Add registerTapListener and removeTapListeners to WiresharkDialog, which
collect and automatically remove tap listeners. Add beginRetapPackets
and endRetapPackets, which can be used to wrap critical sections so that
we don't delete ourselves while tapping. Don't cancel tapping on close
in WiresharkDialog.

Use beginRetapPackets and endRetapPackets in WiresharkDialog and
FollowStreamDialog. We will likely need to add them elsewhere.

Update comments.

Change-Id: I1788a6ade0817c31aa3419216df96be5e36b2178
Reviewed-on: https://code.wireshark.org/review/10261
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-26 15:04:28 +00:00
Gerald Combs c57f58549c Fixup tap listener registration.
Make sure we run make-tap-reg.py on files that register tap
listeners.  Make sure Qt-specific registration routines start with
register_tap_listener_qt_.

Change-Id: Idca382180f475db71e4d1965a70ae4cc2fa4f9d5
Reviewed-on: https://code.wireshark.org/review/10074
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-17 20:47:58 +00:00
Gerald Combs 412f5b3716 Expert information dialog performance improvements.
Inserting QTreeWidgetItems individually is slow. This isn't a problem if
you only have a few items but the Expert Information dialog can have
thousands. Add "packet" tree items in groups, which should be much
faster. Note that we still add "group" tree items individually since
that gives us a nice progress indicator.

While we're here, make sure we show the dialog before tapping packets.

Bug: 11439
Change-Id: I8a182f4158d078cae5f42b8d1355414197f423e1
Reviewed-on: https://code.wireshark.org/review/10000
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 19:27:34 +00:00
Martin Kaiser 14c75250ab [Qt Expert Info dialogue] remove our tap listener when the dialogue is destroyed
if we don't do this, there'll be a dangling tap listener and we'll see a
crash when its reset method is called

this can be triggered by opening another expert info dialogue, this will
invoke cf_retap_packets() and reset_tap_listeners() which in turn calls
the reset method of each registered tap listener

Bug: 11432
Change-Id: I8fc13351666c875e1a3641f31bada8e80d167ab2
Reviewed-on: https://code.wireshark.org/review/9979
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-11 21:27:13 +00:00
Gerald Combs fdb85029fd Add ServiceResponseTimeDialog.
Add ServiceResponseTimeDialog as a subclass of TapParameterDialog,
similar to StatsTreeDialog. Add initial plumbing for statistics menu
items and command line invocation.

Don't append "..." to menu item names. Don't add menu icons. In each
case this avoids repetitive UI clutter.

Change-Id: I463b95c93090160bb81d2e80b16aad389dc0bd6c
Reviewed-on: https://code.wireshark.org/review/8864
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:09:13 +00:00
Martin Kaiser 534d1d5eae Qt: use <> for including the generated ui_*.h files
this should make Visual Studio pick up the generated include files
from the build directory instead of the source directory (which may
contain lefovers from an in-tree build)

Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b
Reviewed-on: https://code.wireshark.org/review/9129
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 17:11:19 +00:00
Gerald Combs f77e02ccc6 Expert Info dialog.
Show all expert messages in a combined view. Group top-level items by a
(severity, group, protocol) tuple.

Let the user enable and disable messages via a check menu.

Add ProtoTree::goToField and expert_info_t.hf_index. Use them to jump to
what we hope is the afflicted item.

Enable the context menu only if the user has selected a packet item.

Add a free-form search field that matches expert summaries.

This differs from the GTK+ version but hopefully provides a smoother
workflow.

Bug: 10931
Change-Id: Ia12cb7c27cdea1634fa2798fb7e4c1b23bd16ad2
Reviewed-on: https://code.wireshark.org/review/8294
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-05-08 04:29:59 +00:00