Commit Graph

28 Commits

Author SHA1 Message Date
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 11c58e78f7 Qt: More new-style signals+slot conversions. 2021-10-11 17:03:21 +00: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
Jirka Novak 8dd8491713 Qt framework: Dialogs are correctly notified when capture file was closed
The patch reintroduces WiresharkDialog::captureFileClosed() method and
calls captureFileClosing() and captureFileClosed() in right order.
Both methods call updateWidgets() at its end.

All dialogs were reviewed and captureFileClosing/Closed methods updated
when appropriate.
captureEvent() method in multiple dialogs changed to captureFileClosing/Closed
as it does same actions - looks like old style of detecting of capture
file closing.
2021-01-11 13:30:18 +00:00
Roland Knall a53545c0c8 Qt: Add macro for g_list_next for C++
Using a simple (type *) cast on g_list_next results in a warning
with modern compilers "old-style cast"

Adding a warning for g_list_next and data access to avoid the warning

A good overview why reinterpret_cast has been used can be found here:

https://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-const-cast-and-reinterpret-cast-be-used

It is a 1:1 replacement in this case, but does not use any of the new
cast styles and therefore should be used with caution.

Change-Id: I989f237afc39aaf40133a788b1c0bbd7a51bf974
Reviewed-on: https://code.wireshark.org/review/34284
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-30 13:37:25 +00:00
Michael Mann 96c52c1a0f Multicast Statistics Dialog: Clear list when redrawing
The multicast statistics tap provides a continually updating list which the draw function just has to iterate through.

Bug: 15271
Change-Id: I270e7ca9460ec9568756b6c8d98f4f17653c8cad
Reviewed-on: https://code.wireshark.org/review/30976
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-12-09 21:25:06 +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
Gerald Combs 1a52e085c1 Qt: Implement MulticastStatisticsDialog::treeItemData
Implement MulticastStatisticsDialog::treeItemData so that the "Copy"
button works.

Bug: 14477
Change-Id: I8e7ff2a41b0f14e600b0781c3a01e03270c26ae7
Reviewed-on: https://code.wireshark.org/review/26430
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-12 17:25:41 +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
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
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
Dario Lombardo 03ca5c0f6e Qt: add initializers (CID 1317257).
Change-Id: I61a63c187990b119b62e99871832913a0e3f75e4
Reviewed-on: https://code.wireshark.org/review/16323
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-08 07:01:20 +00:00
Benoit Grange ad52a36fb9 Qt: fix buffer alarm threshold parameter retrieval in multicast statistics dialog
Bug: 12309
Change-Id: Id67b676bfcb5b4497c48d4cd7ca7c8cc1cbda986
Reviewed-on: https://code.wireshark.org/review/14704
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>
2016-03-30 15:58:29 +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
Peter Wu 05121be1b4 Qt: reload after applying parameters in UDP multicast dialog
Noticed this message in stderr, started investigating:

    QObject::connect: No such signal MulticastStatisticsDialog::updateFilter(QString&,bool) in ui/qt/multicast_statistics_dialog.cpp:247
    QObject::connect:  (sender name:   'TapParameterDialog')
    QObject::connect:  (receiver name: 'TapParameterDialog')

Verified that after this patch, the "Max Burst" changes from "4/100ms"
to "1/1ms" when modifying "Burst measurement interval (ms)" from 100 to
1 using rtp-norm-transfer.pcap from the SampleCaptures wiki.

Change-Id: I803ff9e5a542a5fd3507b086f29628fbf5602784
Reviewed-on: https://code.wireshark.org/review/12228
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-28 07:54:27 +00:00
Peter Wu d7f1243670 Fix crash in UDP Multicast Streams dialog
Attempting to open the UDP Multicast Streams dialog in the GTK UI
triggers an instant crash (heap-buffer-overflow).

Déjà vu. This is the same problem that plagued the RTP Streams dialog.
This patch is based on the fix in v1.99.3rc0-33-g2c65b33
(mcaststream_dlg_update confused GList vs. mcaststream_tapinfo_t).

After fixing that, the dialog crashed shortly after setting parameters
(heap-use-after-free). That fix is based on v1.99.10rc0-292-gb02a0ee
(after a retap, the old items were still present in the list).

Just that change was not enough as clearing the list still triggered a
signal, possibly because of the "changed" signal (while the RTP player
uses a selection setter function). Apply the patch based on
v1.99.10rc0-270-g01bd832 (disable selection while clearing).

Change-Id: I152bac6f954d8d1c5c20d6c7d56a196c3e20c681
Reviewed-on: https://code.wireshark.org/review/12227
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-11-27 21:15:11 +00:00
Uli Heilmeier 76dec3ba68 UDP Multicast Stats: Fixed typo
Change-Id: I98d6ef48448b32f57349facb2bbef538319c5da4
Reviewed-on: https://code.wireshark.org/review/11825
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-14 17:16:44 +00:00
Michal Labedzki 78978ec63f Qt: Protect against unintentional "no capture file" window status
If capture file was closed and we have some WiresharkDialogs opened,
then we still need to know filename of capture file
related to specific dialog.

Change-Id: I15f0e5176b87713bf747eead64021619d0bdf039
Reviewed-on: https://code.wireshark.org/review/11025
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
2015-10-27 16:45:19 +00:00
Alexis La Goutte 75d9167230 Multicast Statistics (Qt Dialog): Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Ie2802293576bf9edb28bccf7d464b5e687185096
Reviewed-on: https://code.wireshark.org/review/10223
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-24 18:05:48 +00:00
Gerald Combs 74177d90d3 Statistics dialog fixups.
Fix the "retap on show" behavior in TapParameterDialog. It was filling
in the tree when it shouldn't have.

Set the capture stop flag when WiresharkDialog closes.

Change-Id: I5e85f11cab32e8b958deabb58186a855b5fcaa84
Reviewed-on: https://code.wireshark.org/review/10186
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-22 01:29:06 +00:00
Gerald Combs dd2a2d432a Multicast and wireless lan statistics fixups.
Make sure "-z multicast,stat[,filter]" and "-z wlan,stat[,filter]" work.

Add some missing "-z" items to the man page.

Try to fix some MSVC++ warnings.

Change-Id: Ie18e5355d595e351f000f14d82781dcdf33141c3
Reviewed-on: https://code.wireshark.org/review/10184
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-21 17:13:11 +00:00
Gerald Combs 2ed3d91b45 Add the WLAN statistics dialog.
Instead of splitting the stats into two lists as with the GTK+ UI, add
everything to an expandable tree. This allows viewing nodes on more than
one network.

Rename the top-level Bluetooth menu item to Wireless and put the WLAN
stats dialog there.

The Qt UI matches SSIDs (WlanNetworkTreeWidgetItem::isMatch) a bit
differently than the GTK+ UI. Try to make the logic as plain as possible
since we'll likely have to update it in the future.

The addition of a custom BSSID address types means that we can't assume
that everything is AT_ETHER. Add routines for checking for broadcast
BSSIDs and comparing only the data portions of addresses.

Move PercentBarDelegate into its own module. Use it in
WlanStatisticsDialog.

Change-Id: Ie4214eb00671a890871380c4a07213ebfb7585c6
Reviewed-on: https://code.wireshark.org/review/10171
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-20 23:12:37 +00:00
Gerald Combs 0e8cc9ab0a UDP multicast stream dialog.
Add the UDP multicast stream dialog. Abuse TapParameterDialog a bit more
so that we can edit parameters.

Remove some unused struct members and an unused function.

Change-Id: I962c70344e792f0959527e4bcba8a20bd7e8acf9
Reviewed-on: https://code.wireshark.org/review/10084
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-18 20:17:20 +00:00