Commit Graph

287 Commits

Author SHA1 Message Date
João Valverde c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
João Valverde 35c06ad742 CMake: Fix Qt -Werror compilation flag
All source files should have COMPILE_FLAGS applied, not just
ui/qt/*.cpp.

This fixes setting -Werror on the Qt build, since that is
the only custom C++ compilation flag we are using at the moment.
2022-10-04 17:08:31 +00:00
Tomasz Moń 18e08d04d1
Qt: Setup GLib mainloop when needed
GLib watches and timeouts require GLib mainloop iterations. If the GLib
mainloop is not running, then GLib watches and timeouts won't trigger.
Back in the GTK+ days, then GLib mainloop was running on all systems.
Since the Qt transition, GLib mainloop only runs on Linux when Qt does
support it and environment variable QT_NO_GLIB=1 is not set.

Start polling GLib mainloop in separate thread if Qt is not running GLib
mainloop. Note that only the polling is handled in separate thread, the
dispatch and thus all user callbacks execute in the main thread.

Running GLib mainloop when needed enables full GLib functionality on all
platforms and thus allows us to simplify our code by using GLib platform
specific code.
2022-07-24 20:57:18 +02:00
Roland Knall a4f25e5115 Qt: Redesign TrafficTree Dialogs UI
The new UI should better group functionality and as well as better
showing which taps are available and can be used.
2022-06-14 09:36:30 +00:00
Roland Knall b06c1c451c Qt: Make TrafficTable detachable
Allow the endpoint and conversation dialogs to have detachable
tabs. At the same time move the tree functionality to a subclass
to better be able to handle the context menu when detached.

Right now, still a lot of tree stuff is in the tabwidget, but
could be moved to the tree for the future
2022-06-04 21:28:05 +02:00
Roland Knall 9edf06383a Qt: Move most Contextmenu stuff to TrafficTree
Create a new class, which handles the context menu stuff for
the traffic data, as well as remove unnecessary signals used
by the sub-dialogs.
2022-06-04 15:57:02 +02:00
Roland Knall cb56345175 Qt: Move Traffic Tables to Model/View
The current model makes it very hard to extend the traffic tables
with new functionality. For instance, having a total view column
additionally to the normal columns when filtered.

This change removes the QTreeWidget and moves to a more generic
approach using QAbstractListModel elements.

It is implemented in thtree parts:
- ATapDataModel implements the basic collection and handling of
  the tap data information, as well as updating if new data is
  becoming available
- EndpointDataModel / ConversationDataModel handles the display
  and representation of the data
- Implementing TrafficTab as a TabWidget which will handle the
  adding/removing of new protocol tabs
2022-06-01 11:26:22 +02:00
João Valverde ee7094d34c CMake: Fix typo 2022-05-25 23:46:01 +01:00
John Thacker 75f31638f2 Apply 1 suggestion(s) to 1 file(s) 2022-05-23 16:27:18 +00:00
Gerald Combs 349787051e CMake+Qt: Fix our Resource Compiler arguments.
We pass "--format-version 1" to rcc. If it's compiled with Zstandard we
need to pass "-compress-algo zlib" as well.
Fixes #18100.
2022-05-23 16:27:18 +00:00
Roland Knall acdda8eb6b Qt: Fix File Path editor in table
The current situation in UatDelegate as well as PathChooserDelegate leads to issues, where Wireshark crashes if the button is clicked. This is due to the UI not correctly positioning the button inside the cell.

This change implements a widget, which will serve as cell content, handling all relations with choosing the file, but also properly handling the size and geometry of said cell content, therefore no longer leading to crashes and cleaning up code at the same time, as duplicate methods are being removed.

Fixes #17789, #17819, #18088
2022-05-16 09:54:08 +00:00
Gerald Combs d8008cb89e Qt: Split MainWindow into WiresharkMainWindow and LogwolfMainWindow.
Rename the main_window class and UIC files to wireshark_main_window and
the MainWindow class to WiresharkMainWindow. Copy wireshark_main_window
/ WiresharkMainWindow to logwolf_main_window / LogwolfMainWindow.

Remove the Wireless menu from Logwolf.
2022-04-04 09:39:27 -07: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 e482b375f2 Rename the "image" directory to "resources".
The "image" directory contains resource compiler assets and other
application resources, so name it "resources."
2022-03-09 02:07:51 +00:00
John Thacker 939972800e Strip Headers: Add separate menu dialog, tshark help
Add a separate menu for Strip Headers (similar to Export PDU, but exporting
to an encapsulation other than WIRESHARK_UPPER_PDU everything for
that encapsulation). Add to the usage output of tshark for the "-U"
option which encapsulation a export tap will produce.
2022-02-25 20:29:16 -05:00
Gerald Combs 4605ad2ed7 CMake: Clean up the Qt CMakeLists.txt
Sort each of our file lists and remove a duplicate item. Make our
indentaion consistent.
2021-12-23 10:32:55 -08:00
Gerald Combs 3d369c01cc CMake+Qt: Fix a version check. 2021-12-08 08:26:27 -08:00
Gerald Combs 49e1576c31 CMake+Qt: Add a version check for QT5_ADD_TRANSLATION.
Passing options to QT5_ADD_TRANSLATION requires Qt >= 5.11.

https://github.com/qt/qttools/blob/5.11/src/linguist/Qt5LinguistToolsMacros.cmake
https://github.com/qt/qttools/blob/5.10/src/linguist/Qt5LinguistToolsMacros.cmake
2021-12-05 16:30:44 -08:00
Gerald Combs 6ef2b48fc0 CMake+Qt: Run lrelease in silent mode. 2021-12-04 17:46:29 +00:00
Joerg Mayer 24a364f762 Get CMake to successfully work with Qt6
Of course it still fails in the compile phase, but only for some
of the ui/qt/ files.

Wireshark with Qt5 still compiles and runs.

To do the build invoke cmake with the following settings added:
export CMAKE_PREFIX_PATH=:${MY_QT6_PREFIX}/lib/cmake
cmake -DUSE_qt6=ON ...

Independently of this patch there is lots of Qt-stuff in
CMakeLists.txt that needs review/cleanup:
- Some of the stuff can probably be solved in a less hacky way:
  + There seemed to be a way for QT6 to provide the required c++-standard,
    but in the end I could not find it.
  + Once we have a working Qt6 codebase, we may get rid of the USE_qt6
    flag and just test for Qt6Core first and if not present check for
    Qt5Core.
- All comments that match /qt ?[4-6]/i need reviewing/cleaning up.
- The changes in this patch have been tested to work on all machines
  that are my mac (macos 12.0.1, XCode 13.1, Intel, GPL-Qt6.2.1 with only
  the macos package selected, cmake 3.21.4)

Add ui/qt/qt6-migration-links.txt for some possibly helpful links
2021-11-24 10:31:16 +00:00
Alexis La Goutte 2ee06d3fef Qt: Add Turkey translation
Thanks to Serkan ÖNDER
2021-08-25 14:06:50 +00:00
Peter Wu 67d37da79a CMake: fix macOS build when both Qt5 and Qt6 are installed again
See v3.5.0rc0-1614-g785657d9b8 for the earlier fix and context.

Fixes: v3.5.0rc0-2496-g9b78a42855 ("CMake: Fixup qtui's includes.")
2021-07-22 13:25:02 +02:00
Gerald Combs 9b78a42855 CMake: Fixup qtui's includes.
Add ${MINIZIP_INCLUDE_DIRS} to qtui's includes instead of every
target's. Make more includes SYSTEM PRIVATE.
2021-07-14 17:33:18 -07:00
Gerald Combs 2c62e2eb3f CMake: Set Qt autogen properties for Wireshark.
It looks like multi-configuration generators (notably MSBuild) need
Qt autogen properties set on the wireshark target as well as qtui. Do
so unconditionally in both cases. (We were doing so conditionally for
qtui before.)
2021-05-14 07:55:25 +00:00
Gerald Combs 826e03c9f4 CMake: Apply AUTO{MOC,UIC,RCC} more selectively.
Set CMAKE_AUTO{MOC,UIC,RCC} if we're running CMake 3.20.0 or 3.20.1 in
order to work around CMake issue 22085, otherwise set the AUTOMOC,
AUTOUIC, and AUTORCC properties for the qtui target. The latter is
preferred since it keeps us from running Qt's meta-object, user
interface, or resource compilers on code outside of ui/qt. Ping #17314.
2021-05-06 19:14:15 -07:00
Jirka Novak 54b7886a5e RTP Player: Memory consumption improvements
Audio for play is now decoded and stored without silence parts.

Changes:
- ui/qt/utils/rtp_audio_file.cpp created to handle silence skipping
- ui/qt/rtp_audio_stream.cpp refactored to support it
- Fixed issue with exporting streams: File synchronized export was missing
leading silence.
- No line is shown in waveform graph if there is silence
2021-04-25 19:34:52 +02:00
Tomasz Moń 4bd5830cda CMake: Add ENABLE_VLD option for MSVC
Calling cmake with -DENABLE_VLD=ON when building with Visual Studio,
results in debug configuration being linked to Visual Leak Detector.
By default, Visual Leak Detector outputs the leak summary to Visual
Studio debug window. When ENABLE_VLD is active, VLD is linked to all
wireshark libraries and executables.
2021-04-10 21:53:59 +00:00
Gerald Combs a80ea46ff7 CMake: Enable AUTO{MOC,UIC,RCC} according to our CMake version.
As noted in be2b0fc810, we need to set CMAKE_AUTO* before searching for
Qt packages when using 3.20.0 and later. However, this fails if we're
using CMake 3.9.6 or earlier. Set CMAKE_AUTO* where needed depending on
our CMake version.

Ping #17314.
2021-03-31 20:02:18 +00:00
Gerald Combs be2b0fc810 CMake: Enable AUTO{MOC,UIC,RCC} earlier.
Enable CMAKE_AUTOMOC, CMAKE_AUTOUIC, and CMAKE_AUTORCC before searching
for Qt packages. This is apparently required for CMake 3.20.0 and later.
Fixes #17314.
2021-03-26 20:48:22 +00:00
Jirka Novak ce786ed265 Rtp player: It is possible to select multiple rows in stream's list and graph
Changes:
- It is possible to select multiple streams in list and in graph
- Select All/None/Invert implemented in list of streams and in graph
- Indication of "Selected" stream redesigned in graph
- Mouse hovering shows related row/wave
- All operations adapted to multiselection
2021-03-09 16:49:09 +00:00
Gerald Combs 4fd5224ecf CMake: Use target_include_directores more.
The include_directories documentation at
https://cmake.org/cmake/help/latest/command/include_directories.html
says:

"Note: Prefer the target_include_directories() command to add include
 directories to individual targets and optionally propagate/export them
 to dependents."

Switch from include_directories to target_include_directories in a bunch
of places.

Add "SYSTEM" to the remaining external include_directories calls in
order to minimize our compiler warning blast radius.
2021-02-18 06:34:46 +00:00
Gerald Combs 270c8ed746 CMake: Make sure system headers are treated as such.
Use target_include_directories instead of include_directories in a few
places as recommended at

https://cmake.org/cmake/help/latest/command/include_directories.html

Doing so lets us mark a bunch of dependency includes SYSTEM PRIVATE, in
particular LIBXML2_INCLUDE_DIRS. On macOS this keeps us from triggering
the nullability warnings described at

https://www.wireshark.org/lists/wireshark-dev/202004/msg00056.html

(This might also keep the Visual Studio code analyzer from complaining
about various Qt headers, but I haven't tested this.)
2021-02-15 08:31:08 +00:00
Jirka Novak 7e063b6070 RTP Player dialog improved
Functional changes:
  Audio routing information is now stored in audio stream and not in table. It
is handled by separate utils/rtp_audio_routing.cpp class which is able to
convert it between mono/stereo etc.
  There is new utils/rtp_audio_routing_filter.cpp class which is able to
route mono audio stream to any audio channel.
  Sample file separated from audio stream file - sample file is generated only
during recap. So when we need new waveform, we just use existing sample file
and no recap required - it is much faster.
  Audio stream exports just mono audio. Mono audio is then expanded to stereo
and correct channel by AudioRoutingFilter during play as required. So when
audio routing is changed, no recap and no audio export is required.
  When audio stream is muted, no audio is produced nor played.
  Most of signals between RtpPlayerDialog and RtpAudioStream were removed.
Start/Pause/Stop is processed in RtpPlayDialog (just for non muted streams).
Play possition is not received from every playing stream but from independent
silence stream.
  Added Mute/Unmute function.

Optimalization:
  When audio routing is changed, just graphs are updated. No retap nor audio
decoding is required.
  When TOD is changed, just graphs are updated. No retap nor audio decoding is
required.
2021-02-09 18:10:14 +00:00
Gerald Combs 7ab6440416 Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for
checkAddTextCalls, which was removed in e2735ecfdd.

Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in
main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp.

Rename "index"es in packet-usb-hid.c.
2020-09-05 07:41:29 +00:00
Guy Harris d5fe2d494c wsutil: define HAVE_LIBGCRYPT_AEAD in wsutil/wsgcrypt.h.
It's used in a number of source files; don't force each of them to test
GCRYPT_VERSION_NUMBER independently.

Make sure every file that uses HAVE_LIBGCRYPT_AEAD includes
wsutil/wsgcrypt.h.

Also do some other definitions that are based on the libgcrypt version
there as well.

This requires that the Qt UI code be given the include directory for
libgcrypt, as the follow stream code includes
epan/dissectors/packet-quic.h, which includes wsutil/wsgcrypt.h to get
HAVE_LIBGCRYPT_AEAD defined, and wsutil/wsgcrypt.h includes <gcrypt.h>.

Change-Id: I9cb50f411f5b2b6b9e28a38bfd901f4a66d9cc8f
Reviewed-on: https://code.wireshark.org/review/38116
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-08-11 02:30:04 +00:00
Gerald Combs 9b07412277 Qt: Add a packet diagram view.
Add a new top-level view that shows each packet as a series of diagrams
similar to what you'd find in a networking textook or an RFC.

Add proto_item_set_bits_offset_len so that we can display some diagram
fields correctly.

Bugs / to do:
  - Make this a separate dialog instead of a main window view?
  - Handle bitfields / flags

Change-Id: Iba4897a5bf1dcd73929dde6210d5483cf07f54df
Reviewed-on: https://code.wireshark.org/review/37497
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>
2020-08-10 18:17:50 +00:00
Guy Harris 464d5688cc Don't build code to handle capturing if we don't have pcap.
Only build the capture information dialog if we're going to support
capturing; otherwise, that dialog never pops up.

Don't include ui/capture.h in ui/qt/wireshark_application.cpp if we
don't have pcap, either; it's not needed, and breaks compilation.

Change-Id: If9a52239fd2c81c37663be8044ecd67f4569d61b
Reviewed-on: https://code.wireshark.org/review/36585
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-03-26 08:33:50 +00:00
Gerald Combs d832145366 Qt: Add Spanish (es) translation assets.
Add an initial "es" Qt translation file and an accompanying flag image.
The image came from

https://en.wikipedia.org/wiki/File:Flag_of_Spain.svg

and is in the public domain.

(We already had a debian/po/es.po.)

Change-Id: I5378ad2cbffb2267389fc8ae6af6d591071e0144
Reviewed-on: https://code.wireshark.org/review/35620
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-03 08:27:21 +00:00
Peter Wu 5cfd8bca95 CMake: fix CMake 3.16 warning about CMP0071
Prevent a file from being processed by moc/uic as it is not needed. This
addresses a new CMake warning "Policy CMP0071 is not set: Let AUTOMOC
and AUTOUIC process GENERATED files."

Change-Id: I8ed458099cdf29472dad29168786cf16b95595fa
Reviewed-on: https://code.wireshark.org/review/35468
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-17 00:10:26 +00:00
Gerald Combs 997e21d1e9 Qt: Rename the Capture Interfaces dialog to Capture Options.
Rename Capture Interfaces to Capture Options to match its main menu
item. "Options" also more closely matches what the dialog actually does.

Fixup a help item URL while we're here.

Change-Id: Iec8bdfc9f7ae6fc4fd9e97bb366b63cff139f3a6
Reviewed-on: https://code.wireshark.org/review/35294
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>
2019-12-03 03:16:16 +00:00
Roland Knall 2cccb26bc4 Qt: Implement FilterListModel
Change-Id: I365281a709ded644fc8d6ccfce5870a000221a3b
Reviewed-on: https://code.wireshark.org/review/34856
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-28 15:08:06 +00:00
Roland Knall 6820e3515a Qt: Fix Column Preferences
The current implementation has some serious bugs. e.g. if an added
column is moved, existing columns disappear. Also, if new columns
are being added, existing columns may disappear. This moves the column
preferences to a Movel/View concept and implements necessary checks
to ensure, that such an issue cannot occur

Change-Id: I73810812180e2fbed4d2fe67316f190aba82c719
Reviewed-on: https://code.wireshark.org/review/34819
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-20 22:20:38 +00:00
Roland Knall 743f8598cd Qt: Rework Resolved Addresses dialog
This is a refactoring/redesign of the "Resolved Addresses" dialog,
allowing for sorting/filtering and searching within the addresses
and ports.

Change-Id: I5071e92ff699323b6c93fc533eeaf92e0db334de
Reviewed-on: https://code.wireshark.org/review/34398
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-01 09:02:51 +00:00
Roland Knall a9fc3681f6 Qt: Move CopyFrom from menu to button
Move the CopyFromProfile implementation from a menu to a button
to ease integration in existing code

Change-Id: I4fb4e952e89665eda99d162e891ac6d3516a6f02
Reviewed-on: https://code.wireshark.org/review/34266
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-26 06:34:31 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Stig Bjørlykke 8dcde280c2 CMake: Use tab for indentation
Change-Id: I9d08443169f6b0b87c37ff20babffee1e6769ae7
Reviewed-on: https://code.wireshark.org/review/34009
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-07-18 20:37:36 +00:00
Roland Knall 390071ed0b Qt: Import Profile information
Allow easy import of profiles. Profiles must be stored inside
a zip file, with no additional hierarchy.

Change-Id: I0ae77460c20ef6b3e447906e671b0cefa6b9b032
Reviewed-on: https://code.wireshark.org/review/33881
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-17 18:25:11 +00:00
Roland Knall 4e7ac431a5 Qt: Move Profile Dialog to Model/View
Move the profile dialog to a model/view based concept. Display and
ordering works now, but nothing much else.

Add possibility to filter for profiles, as well as group filters.

Change-Id: I4740ad5aa10feeb31192f8131fb1204f5dca7232
Reviewed-on: https://code.wireshark.org/review/25141
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-11 04:49:02 +00:00
Roland Knall 9ad5dc26dd Qt: Move widgets to sub-directory
General code cleanup

Change-Id: Ic99fc24b8f8c6142a7ec46f535f8d5b896236390
Reviewed-on: https://code.wireshark.org/review/33769
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-01 06:55:45 +00:00
Dario Lombardo 1af6e1f860 tap: add credentials tap.
This new tap collects credentials (username and paassword)
from the dissectors.

So far, few dissectors have been instrumented:
- http (basic auth)
- http (header auth)
- ftp
Others can be instrumented as well using the same technique.

Tshark has a new option (-z credentials) and Wireshark a new
"tools" menu: the documentation has been updated accordingly.

Change-Id: I2d0d96598c85bb3ea4fb5ec090dd8dc28b481fc9
Reviewed-on: https://code.wireshark.org/review/33453
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-06-26 07:09:54 +00:00