Commit Graph

7324 Commits

Author SHA1 Message Date
Roland Knall 4b9d152767 Qt: Auto apply "Limit to display filter"
If a display filter had been applied during the opening
of the conversation or endpoint dialog, automatically check
the entry for "Limit to display filter" to ensure that
the filtered result is being shown, as expected by the user.
2022-06-07 14:38:58 +02:00
Jakub Jirutka 3187fbbd61 Qt: Fix segfault when some ICU codec is not available
$ gdb --args wireshark
    (gdb) run
    Starting program: /usr/bin/wireshark
    [New LWP 10363]
    [New LWP 10364]
     ** (wireshark:10356) 13:13:14.137941 [GUI WARNING] -- codecForName: ucnv_open failed ISO-8859-2 U_FILE_ACCESS_ERROR
    (gdb) bt
    Thread 1 "wireshark" received signal SIGSEGV, Segmentation fault.
    0x00005555557b1959 in MainWindow::findTextCodecs (this=0x7fffecdfd390) at wireshark-3.6.5/ui/qt/main_window.cpp:2029
    2029            QString key = codec->name().toUpper();
    (gdb) bt
    #0  0x00005555557b1959 in MainWindow::findTextCodecs (this=0x7fffecdfd390) at wireshark-3.6.5/ui/qt/main_window.cpp:2029
    #1  0x00005555557b4ce3 in MainWindow::MainWindow (this=this@entry=0x7fffecdfd390, parent=parent@entry=0x0) at wireshark-3.6.5/ui/qt/main_window.cpp:362
    #2  0x000055555564f0af in main (argc=<optimized out>, qt_argv=0x7fffffffe748) at wireshark-3.6.5/ui/qt/main.cpp:725

See https://gitlab.alpinelinux.org/alpine/aports/-/issues/13814 for more
information.

Conflicts (cherry-picked from 635286ce):
	ui/qt/main_window.cpp
2022-06-05 17:01:04 -07:00
Jaap Keuter fe4210029a Qt: Reword menu item Seconds Since Beginning of Capture 2022-06-05 23:55:59 +00:00
John Thacker 9d716d793c Follow Stream: Allow using spin boxes with no packets visible
It's only necessary to check that cap_file_.capFile()->edt is
not NULL if use_stream_index is FALSE.

This prevents failure and an inaccurate error message about the
capture file being invalid when using the spinbox to cycle through
a stream when all packets are filtered out.(E.g., Follow a stream,
append to the filter looking for something, no packets match, try to
go to the next stream.)
2022-06-05 22:19:39 +00:00
João Valverde 2939c6d0dc Version info: Do not show plugin count
Plugin count is dependant on initialization order and showing
zero plugins loaded can be misleading.
2022-06-05 21:31:36 +00:00
Gerald Combs 5cd591129f epan: Convert remaining conversation code to elements.
Convert the address+port conversation code to element lists. Make our
conversation keys element lists. Document more of the conversation API.

Update the Conversation Hash Table dialog to use the new API.

Describe an alternative key type and data structure at the top of
conversation.c.
2022-06-05 19:05:33 +00:00
Gerald Combs 729b4d3b69 [Automatic update for 2022-06-05]
Update manuf, services enterprise numbers, translations, and other items.
2022-06-05 16:40:02 +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 05759d3ec5 Qt: Better handle retapping for traffic tables
Retapping can have some side-effects and was done in
an overflowing way. Reducing the number of times retapping
is required and done, and also giving control for taps
reload to TrafficTab
2022-06-03 10:25:15 +02:00
Roland Knall fc505eed29 Qt: Fix coverity warnings for TrafficView 2022-06-02 16:50:31 +00:00
John Thacker ea2ddd40f5 Qt: Fix leak in CaptureFileDialog
Instead of instantiating CaptureFileDialog with a reference to
the filter (which means allocating a new empty QString when using
it for Save As and Export Packets, which don't use a filter), pass
the filter reference into the open and merge functions.

This plugs a memory leak that happened each time the Save As or
Export Packets dialog was created.
2022-06-02 12:31:01 +00:00
Roland Knall f725bbef5e Qt: Minor changes to TrafficTrees
Move the corner button to a QToolButton and put it in a widget
to better handle size constraints. Also fix some fallthroughs
and remove unneeded code
2022-06-02 12:30:41 +02:00
Stig Bjørlykke 335795ab16 Qt: Fix build withouth MaxMindDB 2022-06-02 08:56:22 +02:00
Roland Knall dd9e4fd3fa Qt: Fix warning for TrafficData 2022-06-01 20:21:53 +02:00
Roland Knall 7306d7681a Qt: Save Trafficdata as raw
Allow the option to save the data from the traffic dialogs
as raw data and enable it as the default option for 4.0. The
option to display the data with pretty formatting is still
available.
2022-06-01 11:51:39 +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
Gerald Combs 48ff21b573 [Automatic update for 2022-05-29]
Update manuf, services enterprise numbers, translations, and other items.
2022-05-29 17:20:25 +00:00
João Valverde ee7094d34c CMake: Fix typo 2022-05-25 23:46:01 +01:00
Gerald Combs 34d74031a9 epan+Qt: Add element tables to the ConversationHashTablesDialog.
Add get_conversation_hashtables() and use it to populate the
conversation hash tables dialog.
2022-05-25 19:09:12 +00:00
John Thacker 485aedf4e1 tap-iostat: Make a bunch of ints unsigned
Almost all the ints in tap-iostat are loop counters, numbers of columns
or rows, durations, lengths, widths, or magnitudes, all things that are
inherently unsigned. Make them unsigned.

This has the incidental effect of fixing an odd alloc-size-larger-than
error with gcc 12.1, which is afraid that if borderlen is signed that
g_malloc will somehow be called with value -1 (18446744071562067969):

Fix #18089
2022-05-24 20:27:04 -04: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
John Thacker e1a6913a2b qt: Ignore gcc 12.1 optimization bug with Qt
The Qt implicit casts from QByteArray to QString all use
size = -1, meaning to the end of the string.

This causes gcc 12.1 with -O2 to produce a very dubious stringop-overread
warning, by computing both sides of a branch even when it shouldn't:

/usr/include/qt5/QtCore/qstring.h:706:69: error: ‘size_t strlen(const char*)’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  706 |         return fromUtf8_helper(str, (str && size == -1) ? int(strlen(str)) : size);
      |                                                               ~~~~~~^~~~~

There's also a similar error with QByteArray.constData(), even though
isEmpty() should return True when the QByteArray is NULL.
(Adding isNull() prevents the warning but is redundant.)

Use DIAG_OFF and DIAG_ON to ignore the warning on GCC 12.1 and higher.
Fix #18090.
2022-05-23 12:14:03 +00:00
Gerald Combs c8fc8de3d4 [Automatic update for 2022-05-22]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-05-22 16:37:34 +00:00
Roland Knall 5a53e72c63 Qt: Row colors and resize
Set the row colors in the traffic dialogs to alternating for better
readibility and add a context menu option to resize the columns back
to content

Fixes #16189
2022-05-19 15:58:20 +02:00
Roland Knall 6913bff6cd Qt: Simplify traffic type selection
Remove unnecessary subclass and make the code easier to
manage in the future
2022-05-19 15:01:00 +02:00
Roland Knall 1cde1cc1f5 Qt: Move type selection to tab
Move the type selection to the tab selection bar, so that new
users may find it faster and easier
2022-05-19 09:31:17 +02:00
Roland Knall 3d4dfb829b Qt: Allow translation for traffic tables
Allow the headers of the conversations and endpoint statistic
dialog to be used with the Qt translation system
2022-05-18 22:46:53 +02:00
Roland Knall f5b5d2c3c9 Qt: Cleanup Traffic Table
Remote traffic_table_ui.? and move the JSON stuff into endpoint.

This is in preparation for larger work on both the conversation
table as well as the endpoint table, and to start using Qt code
in the UI where it should be used.
2022-05-18 19:50:14 +00:00
Roland Knall b4e041a619 Qt: Fix packet diagram cleanup
After selecting field values to be shown or not shown
residues of the former diagram may reside until the next
scroll event. This updates the viewport to trigger the
paintEvent earlier.

Fixes #17997
2022-05-17 11:37:33 +02:00
Roland Knall 9ba4847a13 Qt: Fix some pathSelection warnings 2022-05-16 19:53:27 +02:00
Roland Knall eca007e617 Qt: Speedup for Resolved Addresses Dlg
This is a small speedup for the ResolvedAddressesDialog. QString::arg
is a copy-by-call method as QString::append just extends the space
occupied by the string, leading to a major speed improvement.

Same goes for configuring the proxymodels first and then assigning the
data model as this will lead not to reorganization everytime
invalideFilter is being called
2022-05-16 15:07:47 +00:00
Roland Knall 28b917a72e extcap: Close pipe on windows properly
Windows implements so called CRT handlers, which will catch any
assertions happening inside so called crt routines and either
displays a debug dialog (Cancel, Retry, Ignore) or outright crashes
the application.

See
https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation?view=msvc-170
for an explanation of the behaviour.

Now, in the current situation here, close will detect (correctly)
that the pipe it is supposed to be closing is already closed. This
happens (again correctly) because it had been closed by the extcap
application.

The change added, checks for a closed pipe first, and if so just
returns -1 (as it should) silently without calling the CRT routine,
therefore not crashing
2022-05-16 14:48:37 +02: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 76423db8e0 Qt: Fix clazy-incorrect-emit warnings.
QAbstractItemModel::beginResetModel and endResetModel aren't signals, so
don't emit them. dataChanged is, so do.

Fixes clazy-incorrect-emit:
https://github.com/KDE/clazy/blob/master/docs/checks/README-incorrect-emit.md
2022-05-12 17:29:06 +00:00
Gerald Combs 7b749f5e15 Qt: Fix a version check.
Qt::endl was introduced in 5.14.
2022-05-11 09:21:41 -07:00
Roland Knall ad28888d2f Qt: Fix display filter read/write
Display filters on Windows where broken in such a way that the file was generated with empty lines and the wrong file delimiters.

Likewise, loading the file lead to issues when the formatting was not 100% match by the plattform being used

Fixes #18082
2022-05-11 12:22:29 +00:00
Roland Knall 4977e20ab2 Qt: Prevent remote interfaces to show up
Remote interfaces should not be displayed with local interfaces
as well as in the list of pipe interfaces
2022-05-10 20:00:02 +02:00
Roland Knall ae9e80a34d Qt: Fix proper preselection for remote interfaces 2022-05-10 14:52:27 +00:00
Roland Knall 5b59a38c3b Qt: Clean up remote management interface
Clean up a previous fix, which left the remtoe management interface
unloadable.

Fixes #18060
2022-05-10 16:26:37 +02:00
Roland Knall e43501cf9e qcustomsplot: revert for fix Clang Warnings[core.UndefinedBinaryOperatorResult]
The commit prevents compilation for Qt 6.3.0

This reverts commit 3afa8264cb.
2022-05-03 15:46:03 +02:00
Gerald Combs 2f31c09045 [Automatic update for 2022-05-01]
Update manuf, services enterprise numbers, translations, and other items.
2022-05-01 17:26:48 +00:00
Guy Harris 69e956d792 conversations, endpoints: sort resolved addresses as text.
If name resolution is enabled in the conversations and endpoints
dialogs, sort address columns by the resolved names, not by the
addresses; sorting them by address will give *very* unexpected results,
and not make it easier to look for addresses by name.
2022-04-30 19:37:50 -07:00
Gerald Combs 70bd130379 Fix "generated by" comments in configuration files.
Add get_configuration_namespace() and use it in code that writes
"generated by" comments at the top of various configuration files.

Update our Logwolf colorfilters.
2022-04-29 18:00:21 +00:00
Gerald Combs cfcfbbdd60 [Automatic update for 2022-04-24]
Update manuf, services enterprise numbers, translations, and other items.
2022-04-24 16:39:41 +00:00
Roland Knall aca0c5d175 Qt: Remove unrequired setTab
setTab(0) should not be required, as this belongs in the constructor as being
part of the general setup of the dialog itself. Outside code should not setup
the correct startview of the dialog.

(the problem exists in the first place, as the wrong tab may be selected via
the .ui file after editing that)
2022-04-22 17:05:29 +00:00
Roland Knall b9b1494cd1 Qt: Disable sorting for if acticity on default
Make the sorting for interface activity disabled by default
and enable it for interfaceFrame.
2022-04-22 14:29:17 +02:00
Roland Knall 374c5997da Qt: Remove unnecessary signal/slot
getPoints never worked in the new system therefore it is removed. SparkLineDelegate uses the underlying model to ensure the correct data being transmitted
2022-04-22 09:37:10 +00:00
Gerald Combs 4bb16383a3 macOS: Require Sparkle 2.
Remove our Sparkle 1 code. Fixes #18035.
2022-04-21 17:54:27 +00:00