Commit Graph

6660 Commits

Author SHA1 Message Date
Stig Bjørlykke b668d0a9d5 Qt: Support ampersand in funnel menu and button
An ampersand in the menu item or a button is used as shortcut, so
use "&&" to get a real ampersand.


(cherry picked from commit c84681aca2)
2020-12-09 10:14:35 +00:00
Stig Bjørlykke d5ea403f8d Qt: Fix packet bytes hover rectangle position
For Qt 5.11 and newer use horizontalAdvance() instead of boundingRect().width()
to calculate the width of a QString to position the hover rectangle position,
and to select which byte(s) to highlight.

Closes #17033.

(cherry picked from commit cb3b469d7f)
2020-12-09 09:54:16 +00:00
John Thacker db14720d63 qt+export objects: Don't sort the header in with the content types
The Export Objects Content-Type filter combobox should not sort the
header of "All Content-Types" in with the list of content types, but
should ensure that it is always the first item, especially as the first
item position is used to show all content. This is particularly an issue
in some localizations; e.g., すべてのコンテントタイプ alphabetizes
after actual content types. Fixes bug #17048


(cherry picked from commit 2d8dd9ed4f)
2020-12-04 08:30:54 +00:00
Orgad Shaneh 29e59a0e20 Qt: fix Qt 5.15 deprecation warning
QFont::ForceIntegerMetrics is deprecated.
2020-11-30 14:51:45 +00:00
Guy Harris 899899533c PacketListRecord: add an ensureColorized() method and use it.
Don't call the columnString() and discard the result in order to force
colorization; instead, add a separate method to force colorization and
use that.

This avoids the need to choose a column; we were using 1 as the column
number, but column numbers are zero-origin, so that's column 2, which
isn't guaranteed to exist (a crash ensued if it didn't).


(cherry picked from commit 58aea1de62)
2020-11-20 22:52:22 +00:00
Gerald Combs df635a196b [Automatic update for 2020-11-15]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-15 19:12:07 +00:00
Gerald Combs 2714dd9e6f [Automatic update for 2020-11-08]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-08 09:25:29 +00:00
Uli Heilmeier b3de664f2b QT: progress UI: Fix TextLabel string to loading
Change TextLabel to Loading for progress UI
Fixes: wireshark/wireshark#16987


(cherry picked from commit 48c09fe046)
2020-11-04 19:59:50 +00:00
Chuck Craft 5497552ab1 win32: fix MR180 - broke "-i -" input pipe
(cherry picked from commit 44241f694e)
2020-11-02 13:52:36 +00:00
Gerald Combs 746cf80cce [Automatic update for 2020-11-01]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-01 17:35:58 +00:00
Gerald Combs a1909f2343 Qt: Add a recent item for packet diagram field values.
Fixes #16957.


(cherry picked from commit b1d18e41db)
2020-10-28 20:22:45 +00:00
Gerald Combs f49d6000a7 Qt: Fix saving+restoring frozen packet list rows.
Use the packet list selection model to save and restore selected rows
when freezing and thawing. Fixes #16770.


(cherry picked from commit 1c2fd68e26)
2020-10-28 18:14:24 +00:00
Guy Harris 928f32e85c Add a new record type REC_TYPE_SYSTEMD_JOURNAL.
Systemd journal entries aren't file-type-specific; they're found in both
systemd journal entry blocks in pcapng files and in systemd journal
export files.  Give it a record type, for use with both file types.

This fixes #16955.

It also means that you can open a systemd journal export file and save
it as a pcapng file.


(cherry picked from commit 889e0d5cb6)
2020-10-28 04:16:42 +00:00
Guy Harris 9837703a11 dumpcap: fix the macOS "no permission to capture" message.
The macOS installer works differently from the way it did when that
message was written (it's now a drag-install for Wireshark, with
separate installers for ChmodBPF and for files to add the Wireshark
binary directory to the default $PATH), and the macOS main screen now
offers a "click this to install" link, running the ChmodBPF installer,
if the user doesn't have permissions to capture.  Update the message
to reflect that (although that's wrong if you directly run dumpcap or
run it via TShark - this needs to be cleaned up in some fashion).

Fix a capitalization error while we're at it.

In the code that generates the main screen message to which the dumpcap
message refers, add a comment saying that, if the main screen message
changes, dumpcap's message should also be updated.


(cherry picked from commit 4fd7983b04)
2020-10-27 09:15:06 +00:00
Guy Harris ce22707c35 Impose limits on the number of records we read.
Start the limit at 2^32-1, as we use a guint32 to store the frame
number.

With Qt prior to Qt 6, lower the limit to 53 million packets; this
should fix issue #16908.


(cherry picked from commit 639891651f)
2020-10-27 05:45:12 +00:00
Guy Harris b45aad9be2 Apparently, WS_WIKI_URL() can work in Qt C++ code.
(cherry picked from commit 32b64c1694)
2020-10-27 05:05:51 +00:00
Stig Bjørlykke fe86435dd7 Qt: Avoid crash on ProtoTree item deselect
Handle the case of deselecting a ProtoTree item.


(cherry picked from commit a88d72dc8e)
2020-10-26 14:44:54 +00:00
Gerald Combs 38207edc52 [Automatic update for 2020-10-25]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-25 16:00:26 +00:00
John Thacker de81bd705a Export Objects: Don't double increment count
Don't double increment the count when saving all Export Objects,
which effectively halves the maximum number allowed.
(cherry picked from commit 56e19bec49)
2020-10-23 07:52:42 -04:00
Gerald Combs 8b80b9111a Qt: Fix QCustomPlot deprecation warnings.
Fix Qt 5.15 deprecation warnings in QCustomPlot, similar to 76d92ba7e7.

Use default flags constructors instead of 0.

Use QWheelEvent::angleDelta() instead of QWheelEvent::angle().

Use QWheelEvent::position() instead of QWheelEvent::pos().

Use date::startOfDay() instead of QDateTime(date).

Use QMultiMap instead of QMap where needed.
2020-10-22 07:19:14 +00:00
Gerald Combs 4955219d1a Qt: Add a filter button menu indicator.
Fixes #16918.
2020-10-20 17:49:20 +00:00
Chuck Craft 5b242d62b0 WIN32 logging: connect stdio earlier in main() 2020-10-20 13:49:27 +00:00
Gerald Combs 08c2a13892 [Automatic update for 2020-10-18]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-18 16:52:23 +00:00
Gerald Combs 5b8a54ab14 Qt: Add a dark mode warning background.
Add ColorUtils::warningBackground, which returns a theme-appropriate
background color for warnings. Use it where needed.
2020-10-16 23:12:17 +00:00
Roland Knall cfd9ffbb1b Qt: Show tooltips on submenu items
Tooltips should be shown on submenu entries

Closes !16912
2020-10-15 23:21:25 +00:00
Chuck Craft 90cd509d92 Consistent "Prepare as Filter" - menus and screenshots #16892 2020-10-15 09:18:56 +00:00
Guy Harris 793a57fae4 Give more detail for WTAP_ERR_INTERNAL when writing.
Report the file from which the record to be written came and the record
number within that file.
2020-10-14 00:01:49 -07:00
Guy Harris 6e6233521a Have WTAP_ERR_INTERNAL include an err_info string giving details.
That way, users won't just see "You got an internal error", the details
will be given, so they can report them in a bug.
2020-10-14 04:51:45 +00:00
Martin Kaiser 92e1b110f3 Qt: FieldFilterEdit: remove unused actions
The private members save_action_ and remove_action_ in class FieldFilterEdit
are not used. Remove them.

(It looks as if FieldFilterEdit was copied from DisplayFilterEdit, where
 those two actions are present and linked to slots...)
2020-10-14 03:53:45 +00:00
Guy Harris 63714518df Get rid of some debugging cruft accidentally checked in. 2020-10-13 14:39:55 -07:00
Guy Harris 16198291bc Fix file description in error message from cfile_dump_open_failure_message().
cfile_dump_open_failure_message() opens a file for output, not input, so
use output_file_description(), not input_file_description() (i.e., "-"
means "standard output", not "standard input").
2020-10-13 11:28:29 -07:00
Gerald Combs 02d91b67c5 [Automatic update for 2020-10-11]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-11 20:08:38 +00:00
Gerald Combs 511fa081df Qt: Handle dark mode in syntax highlighting.
Add ColorUtils::contrastingTextColor, which chooses an appropriate text
color from the current application palette for a given background.

Use it in SyntaxLineEdit and FontColorPreferencesFrame for each state
background color.

Fixes #15840.
2020-10-06 19:24:59 +00:00
Gerald Combs 9a3b1ad6bc [Automatic update for 2020-10-04]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-05 00:42:10 +00:00
Guy Harris 8a77692171 g_mallocate all strings returned from topic_action_url().
Callers assume it's been g_mallocated and attempt to free it.
2020-10-04 12:56:52 -07:00
Guy Harris 4a9c412218 Fix a Coverity complaint.
For all cases in topic_action_url(), set url and break out of the switch
statement.

For the default case, set the URL to WS_HOME_PAGE_URL - we should never
get there, as here's a g_assert_not_reached() call before that, but this
should squelch Coverity's complaint.

Should fix Coverity CID 1467697.
2020-10-04 00:59:48 -07:00
Guy Harris a883081b70 Update URLs pointing to the bug database.
Switch from bugs.wireshark.org to the GitLab issues list.
2020-10-03 07:54:12 -07:00
Guy Harris e013c5ec7f Clean up URLs.
Add ui/urls.h to define some URLs on various of our websites.  Use the
GitLab URL for the wiki.  Add a macro to generate wiki URLs.

Update wiki URLs in comments etc.

Use the #defined URL for the docs page in
WelcomePage::on_helpLabel_clicked; that removes the last user of
topic_online_url(), so get rid of it and swallow it up into
topic_action_url().
2020-10-02 20:13:42 -07:00
Gerald Combs d2da4c7afb Qt: Use … instead of UTF8_HORIZONTAL_ELLIPSIS in translated strings.
Run

$ gsed -i -e 's/\(tr *(.*".*\)" *UTF8_HORIZONTAL_ELLIPSIS/\1…"/' $( ag -l 'tr *\(.*" *UTF8_HORIZONTAL_ELLIPSIS' )
$ gsed -i -e 's/\(tr *( *\)UTF8_HORIZONTAL_ELLIPSIS *"/\1"…/' $( ag -l 'tr *\( *UTF8_HORIZONTAL_ELLIPSIS *"' )

in ui/qt. As discussed in #16812, the UTF8_ macros were required at one
time because we only allowed ASCII in our source code. However, that
requirement has since been relaxed and Qt's translation framework
doesn't handle concatenating strings and macros very well.
2020-10-01 06:40:14 +00:00
Gerald Combs c34bc0cf4c Qt: Handle palette changes in the packet diagram.
Handle ApplicationPaletteChange (e.g. dark / light mode switching)
events in the packet diagram. Add resetScene() and call it where needed.
2020-09-28 23:56:08 +00:00
Gerald Combs b7c0dc3cb1 Qt: Make sure the packet diagram always has a field value.
Have FieldInformation::toString return "[no value for field]" instead of
an empty string so that the packet diagram always has something to
display.
2020-09-28 12:14:14 -07:00
Gerald Combs d1f29ee338 Qt: Fix the packet diagram start offset arithmetic.
572c1ae5a3 introduced a bug that allowed for negative diagram item start
values. Fixup our arithmetic so that that doesn't happen.
2020-09-26 12:23:54 -07:00
Gerald Combs 8b9ec1b5a5 Qt: Reset the packet diagram between captures.
QGraphicsScene::clear() doesn't reset the scene's the size and scroll
position. This is useful when we switch between packets, but we should
do a hard reset when switching between captures.
2020-09-26 11:34:21 -07:00
Gerald Combs 572c1ae5a3 Qt: Collapse packet diagram items correctly.
Move our overlap and gap adjustments to the first pass and offset our
item start bits based on our collapsed length. Collapse 64-bit items
correctly.
2020-09-25 00:57:58 +00:00
Gerald Combs 3426b25621 Qt: Make sure the packet diagram's FT_NONE label exists.
Gap items have a null field_info pointer, so set "Unknown" as the
default representation string and fill it in after we've established
that field_info is valid. Closes #16851.
2020-09-15 19:40:35 +00:00
Ronnie Sahlberg 72921f8867 packet_diagram: use a better label for FT_NONE items
FT_NONE items all have the name "Text Item" which makes it look
poor in the packet diagram.
For these fields, switch to use ->representation insead of ->name
to make these fields look more meaningful.

SMB2 is a protocol that consists of two FT_NONE expansions,
one for the Header and a second for the actual Command.
This makes packet diagram show this much nicer.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2020-09-15 03:31:44 +00:00
Gerald Combs 3b9656780b Qt: Don't fill in the packet diagram if it's not visible.
Don't bother filling in our scene if the widget isn't visible.
2020-09-15 03:03:11 +00:00
Martin Kaiser adfded498a Qt: FieldInformationGraphicsItem: fix a memory leak
FieldInformationGraphicsItem's constructor allocates a FieldInformation
which is never freed.

Opening MTP3 statistics for any capture file causes memory leaks.

Indirect leak of 1120 byte(s) in 10 object(s) allocated from:
    #0 0x55e32cf19a42 in operator new(unsigned long)
    #1 0x7f4cca598661 in QObject::QObject(QObject*)
    #2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...

Indirect leak of 400 byte(s) in 10 object(s) allocated from:
    #0 0x55e32cf19a42 in operator new(unsigned long) ...
    #1 0x55e32d5fce04 in FieldInformationGraphicsItem::FieldInformationGraphicsItem(...)
    #2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...

Add a FieldInformationGraphicsItem destructor and delete FieldInformation there.
2020-09-14 21:51:11 +00:00
Gerald Combs 97a6146d81 Qt: Fixup packet diagram tick label placement.
Try to place the labels one space away from the nearest big tick mark.
2020-09-12 22:00:50 +00:00
Guy Harris 272502790b Add FT_STRINGZTRUNC.
FT_STRINGZPAD is for null-*padded* strings, where the field is in an
area of specified length, and, if the string is shorter than that
length, all bytes past the end of the string are NULs.

FT_STRINGZTRUNC is for null-*truncated* strings, where the field is in
an area of specified length and, if the string is shorter than that
length, there's a null character (which might be more than one byte, for
UCS-2, UTF-16, or UTF-32), and anything after that is not guaranteed to
have any particular value.

Use IS_FT_STRING() in some places rather than enumerating all the string
types, so that those places get automatically changed if the set of
string types changes.
2020-09-12 14:16:12 -07:00