Commit Graph

139 Commits

Author SHA1 Message Date
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
Rasmus Jonsson d8ac2a046b Qt: Re-highlight packet bytes when re-selecting packet tree item
Emit the fieldSelected signal when the currently selected dissection
tree item is clicked. This causes the corresponding bytes in the
packet bytes tab to be re-selected.

Change-Id: I9168163f6734ef05ed3196c291a813125d8e86c6
Reviewed-on: https://code.wireshark.org/review/36303
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-03-09 18:38:17 +00:00
Stig Bjørlykke a2dc713c11 Qt: Fix Copy Description from context menu
Fix Copy->Description from context menu in Packet List and
Packet Dialog. This was broken in gf6534b8a.

Align MainWindow::actionEditCopyTriggered() using the same procedure.

Improve ProtoTree::ctxCopyVisibleItems().

Bug: 16323
Change-Id: I564b73c027019bc59629aa84098db8f307e92d40
Reviewed-on: https://code.wireshark.org/review/36339
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-09 04:47:54 +00:00
Peter Wu 55f83324ef Qt: simplify decode_as_ action in the packet details view
Use the "create_new" property convention similar to PacketList. Fix a
"QWidget::insertAction: Attempt to insert null action" warning in the
packet dialog while at it.

Change-Id: I29b3b113aba92634b1b9a3427e2313fca30633eb
Reviewed-on: https://code.wireshark.org/review/36023
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-05 04:34:36 +00:00
Stig Bjørlykke e816edd1ea Qt: Add a missing separator in packet tree context menu
The packet tree context menu for Copy should have a separator after
the "As Filter" entry. This is a regression from a previous refactoring.

Change-Id: Ie43ae71019608d28af0eed8490aab654c7e6d6f1
Reviewed-on: https://code.wireshark.org/review/35802
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-01-14 09:48:52 +00:00
Orgad Shaneh 0442f7a2c3 UI: Fix compilation with Qt 5.14
Change-Id: I8adae4609ff2857cb12bc803839ebb2c6afbd264
Reviewed-on: https://code.wireshark.org/review/35517
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-21 20:25:51 +00:00
Gerald Combs f6953e378a Qt: Remove a couple of private variables.
ByteViewText and ProtoTree only use mono_font_ in setMonospaceFont, so
there's not much use in declaring it private in each case.

Change-Id: I3ad986052f6e013988ce851420f7f6e7b47b7ea8
Reviewed-on: https://code.wireshark.org/review/35255
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-11-28 22:54:46 +00:00
Roland Knall 57d4161a66 Qt: Remove unneeded method
This is no longer needed, as it is handled by setMonospaceFont

Change-Id: I9834bcd1a188cd6f1cb8ad1abe568a9a50d831bc
Reviewed-on: https://code.wireshark.org/review/35253
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-28 15:54:37 +00:00
Peter Wu 2d12ec67a3 Qt: fix erratic expansion of tree item when switching packets
ProtoTree::setRootNode() is designed to update the model with the new
packet tree, and additionally expand tree items in its view. When the
current selected packet is changed, it must use this method to ensure
that collapsed trees are properly expanded. Fix this regression.

It was not entirely clear that framesSelected can no longer use previous
state, so document it explicitly. Remove the call to QTreeView::reset(),
it ends up calling QAbstractItemView::reset() which touches the
selection model that refers invalidated proto_node memory. The reset
function of the view is automatically called the model is reset, so the
call was not needed anyway.

Test: open test/captures/tls13-rfc8446.pcap, expand TLS, TLS Record, and
select "Content Type". Change from frame 1 to 2, and then 3. Observe
that the expanded state remains constant with no flickering. In frame 3,
observe that the tree remains expanded even if no item is selected.

Change-Id: I0c820711f1a62aa51ac100f8ac5c89265c51eb18
Fixes: v3.3.0rc0-6-gcfee0f8082 ("Qt: Remove frameSelect signal")
Reviewed-on: https://code.wireshark.org/review/35230
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-28 14:13:57 +00:00
Peter Wu 07a1753d44 Qt: focus the correct field when switching packets
Instead of just visually marking a field after switching packets, make
sure that it is also focused such that arrow up/down keys select the
expected fields instead of the root node (the Frame layer).

Change-Id: Ic16462198fb2189496f0cceeb5a5e885673636d2
Reviewed-on: https://code.wireshark.org/review/35236
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-27 06:35:13 +00:00
Roland Knall c55dd79d2c Qt: Further cleanup goToPacket
Change-Id: Idf98deb3f7c34adff8e58ea243c63aa094234f46
Reviewed-on: https://code.wireshark.org/review/35181
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 15:28:23 +00:00
Roland Knall cfee0f8082 Qt: Remove frameSelect signal
As all frameSelect signals now transport a QList<int> of selected
frames, use this instead

Change-Id: I1888e45a4df997920aebde9706ca0ae803bdba03
Reviewed-on: https://code.wireshark.org/review/35176
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 10:59:05 +00:00
Roland Knall c8b0968c77 Qt: Drag and drop label text changed
The name was used instead of the filter

Change-Id: Id27d7ac45ecc9487183b33d56bea3f99290ce410
Reviewed-on: https://code.wireshark.org/review/35121
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 23:17:34 +00:00
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Roland Knall b3f240dbf8 Qt: Multiselection in PacketList
This implements multi-selection for the PacketList. It
allows multiple lines to be selected, and either drag/drop
them to a text editor or use Ctrl/Cmd+C to copy the content
to a clipboard.

Opening the context menu disables the selection, and it
does not change the underlying currently selection. This is
done on purpose, as multi-selection is a copy-task only
functionality at this point

Export & Print work as expected, exporting just the selected
items. Same goes for the copy menu, which has the additional
entries for copying the list elements

Bug: 14612
Change-Id: I77960aa1ab1d172a21abfa469baac0cd57f9f9d9
Reviewed-on: https://code.wireshark.org/review/35073
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 12:20:29 +00:00
Roland Knall 013e87a8fd Qt: Remove DisplayFilterMimeData
Make the mimetype for the display filter more generic, so that external
programs can attach to Wireshark and users can drag and drop display
filters to the program

Change-Id: Id78b4dff7883e3dab879a31aad07f577d8cc4ee3
Reviewed-on: https://code.wireshark.org/review/34936
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-11-04 11:39:48 +00:00
Peter Wu d2a660d805 QUIC: Add Follow QUIC Stream support to Qt and tshark
The QUIC transport protocol provides a stream, similar to HTTP/2. Make
it possible to look at the stream contents. This can be helpful while
HTTP/3 support is not yet complete.

Known issues that will be addressed in the future:

 - If a single packet contains multiple streams, then Follow QUIC Stream
   will wrongly include data from streams other than the selected one.
   This is tracked by bug 16093 and affects HTTP/2 as well.

 - The Substream index menu does not properly filter for available
   stream numbers. If a non-existing stream is selected, then changing
   to another (potentially valid) index results in the "Capture file
   invalid." error. As workaround, clear the display filter first.

 - Follow Stream always selects Stream ID 0 instead of the first or
   currently selected stream field in a packet. Users should manually
   update the stream index as needed.

Change-Id: I5866be380d58c96f0a71a29abdbd1be20ae3534a
Ping-Bug: 13881
Reviewed-on: https://code.wireshark.org/review/34694
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-04 04:36:09 +00:00
Alexander Gryanko 9fff62e2a8 Qt, http2: Add Follow HTTP/2 Stream functionality
The HTTP/2 protocol multiplexes a single TCP connection into multiple
independent streams. The Follow TCP output can interleave multiple
HTTP/2 streams, making it harder to analyze a single HTTP/2 stream.

Add the ability to select HTTP/2 Streams within a TCP stream.
Internally, the HTTP/2 dissector now stores the known Stream IDs in a
set for every TCP session which allows an amortized O(n) lookup time for
the previous/next/max Stream ID.

[Peter: make the dissector responsible for clamping the HTTP/2 Stream ID
instead of the Qt code, that should permit future optimizations.]

Change-Id: I5d78f29904ae8f227ae36e1a883155c0ed719200
Reviewed-on: https://code.wireshark.org/review/32221
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexander Gryanko <xpahos@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-09-22 05:29:30 +00:00
Peter Wu 29be7f9d9a Qt, docs, ieee1905: fix some spelling errors
The spelling error for "Desription" in the context menu was very
obvious. The others were found by scanning the output of:

    grep -Po '<source>\K.*(?=</source>)' wireshark_en.ts

Change-Id: I4b95236c82f76828a115d59d7c8e0b853eae1d26
Reviewed-on: https://code.wireshark.org/review/34582
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-09-21 08:33:58 +00:00
Stig Bjørlykke a4da8e22c9 Qt: Fix PacketTree copy Value
Use edt from cap_file_ in case this is valid.

This is a regression from 806bef47a2.

Change-Id: I60150f50056b63346a1510505ffca22347ad4ba0
Reviewed-on: https://code.wireshark.org/review/34491
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-09-10 12:00:55 +00:00
Roland Knall f6534b8a97 Qt: ProtoTree combine menus
The menu for a prototree when opened from a packetdialog was
different than the one opened underneath packetlist. Those
two are now the same.

Change-Id: I57572287daa5a3b1de1f5bc8e95b382d5869af6e
Reviewed-on: https://code.wireshark.org/review/34395
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-30 13:37:34 +00:00
Roland Knall cd8f720251 Qt: Move Apply/Prepare to general QMenu handler
Also clarify the method by which the filter can be selected. From the
main menu only selected filters from a ProtoTree can be selected,
therefore the code for PacketList handling has been removed.

Change-Id: I5e5827d763ab3b25db14a384581f283238f96d28
Reviewed-on: https://code.wireshark.org/review/34384
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-29 07:51:45 +00:00
Roland Knall 9bd2eef45e Qt: Add Apply/Prepare to Packet Dialog
Add the possibility to apply/prepare a field entry to the packet
dialog.  This works also if the corresponding source file had
already been closed.

Bug: 3537
Change-Id: I448ad6d5cb37f2cbb2c2f649512b1f3e5acde2de
Reviewed-on: https://code.wireshark.org/review/34372
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-26 19:57:43 +00:00
Roland Knall c9361120f0 Qt: Remove unnecessary code for context menus
This code is no longer required, as context menus should
be bound to local events.

As for "Reloading LUA plugins" - the keyboard shortcut would
be able to trigger while the menu is open, except Qt explicitely
prevents that

Change-Id: Id18a3a17d62bae1ff547a6ef96772e12a2535219
Reviewed-on: https://code.wireshark.org/review/34371
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-26 19:57:24 +00:00
Roland Knall 3870e6c036 Qt: Make Apply/Prepare filter independent
The context menu should only use information readily available
at the point of creation. Copying actions from the mainwindow
introduces a bunch of synchronization and consistency issues.

This is a first step to move away from a centralized approach
of managing actions, towards a distributed approach. As a side
effect, this also solves the old issue of having the apply
items greyed out in context menu

Bug: 16001
Bug: 15323
Change-Id: I10c6df11cbab0a89386f5bf1d27759103df2a012
Reviewed-on: https://code.wireshark.org/review/34370
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-26 19:39:14 +00:00
Roland Knall 806bef47a2 Qt: Add a Contextmenu for the PacketDialog
Add a context menu for the packet dialog, including items for

* all the expand/collapse items
* copy information from the packet tree
* Wiki protocol page/filter field reference/protocol preferences

Change-Id: I165e03960cc07aefaa38acb9c97fe29d762a5e2e
Bug: 3537
Reviewed-on: https://code.wireshark.org/review/34111
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-28 22:25:38 +00:00
Jason Cohen 9900c86548 MacOS: Fix highlight color in dark mode, graphite highlight
Bug: 15885
Change-Id: I7921f84c05cad560b0673db951571f186adda3f4
Reviewed-on: https://code.wireshark.org/review/33775
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-06-30 18:38:03 +00:00
Roland Knall 17aacfae43 Qt: Drag-and-Dropping from ProtoTree copies whole field
If a DnD is initiated from the ProtoTree it actually copies the complete
text of the expanded tree elements. This can be dropped in any text-window
outside of Wireshark

Change-Id: Ia174bcf2f061ddb23439c3243149bb54a1ba89d9
Reviewed-on: https://code.wireshark.org/review/33630
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-06-16 22:28:26 +00:00
Stig Bjørlykke fc56f23303 Qt: Add hover style to packet list and proto tree
Highlight the row in packet list and proto tree when mouse hovers
above the row. This mimics the behaviour on Windows.

Change-Id: I28461f9d7740269bad39893597232fe775f77a86
Reviewed-on: https://code.wireshark.org/review/32619
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-02 03:30:15 +00:00
Gerald Combs cd95e197ca Start renaming SSL to TLS.
Rename the "ssl" protocol to "tls" and add an "ssl" alias. Prefer "TLS"
over "SSL" in user interface text and in the documentation.

Fix the test_tls_master_secret test while we're here.

Bug: 14922
Change-Id: Iab6ba2c7c4c0f8f6dd0f6d5d90fac5e9486612f8
Reviewed-on: https://code.wireshark.org/review/29649
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-09-13 22:37:52 +00:00
Martin Boye Petersen 7b37c5c180 Qt: Add null check for finfo and hfinfo
Adding the null check fixes a bug that made wireshark crash
when right clicking a subtree which doesn't have any preferences
and if none of the parents had one either.

The problem was introduced in commit 589413d877

Change-Id: Ia5bbae0a58298f3e9d912e44f33589da1cbfacc9
Reviewed-on: https://code.wireshark.org/review/29455
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-07 08:33:51 +00:00
Stig Bjørlykke 589413d877 Qt: Improve fetching preferences from a tree item.
The special-case "text only" header field will not give preferences for the
selected protocol, so we have to traverse the parents to get a usable node.

Change-Id: I647f275839db337dedaeb67664402af1fe9f21c1
Reviewed-on: https://code.wireshark.org/review/29363
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-31 10:29:50 +00:00
Roland Knall 9e4f7dc50d Qt:Fix ProtoTree Copy
There was an issue, where siblings where not copied correctly.

Bug:14355
Change-Id: I31611a6731f3f4de6b204c7ee708e42f0b7b170c
Reviewed-on: https://code.wireshark.org/review/27802
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Kenneth Soerensen <knnthsrnsn@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-30 12:35:30 +00:00
Stig Bjørlykke 612fb778f5 Qt: Update frame selected in several cases
Ensure that frameSelected(0) is emitted when not having a proto tree
field selected because of:

 1. No match when trying to restore selected field
 2. Search selects a packet with no field to select
 3. Current packet is deselected

This will disable functionality which requires a selected field
and updates the status bar according to selected field.

Bug: 14658
Change-Id: I158fae4f26c02f718cee0030ef9e38b597876381
Reviewed-on: https://code.wireshark.org/review/27395
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-05-09 06:20:58 +00:00
Peter Wu f9522d8a23 Qt: fix crash on dragging in packet dialog
"packet_dialog.cpp" does not use setCaptureFile, resulting in a NULL
dereference while trying to obtain the dissection context. Apply a fix
similar to v2.5.1rc0-121-g9198448f9d (pass a fixed dissection context to
ProtoTree). Additionally, fix a memleak and correct documentation.

Why not add "proto_tree_->setCaptureFile(cap_file_.capFile())" in
PacketDialog? Well, it also uses "proto_tree_->setRootNode(edt_.tree)"
which means that "cf_->edt" would be different from "edt_". If that is
the case, then "proto_construct_match_selected_string" will not return a
filter for FT_NONE fields (see the call chain in proto.c).

Bug: 14620
Change-Id: I6eeaf32b650a2095e15f64bbe64b54cdd545c7a9
Fixes: v2.5.0rc0-1608-g4d6454e180 ("Qt: Drag n Drop Filter expression from Packet Tree")
Reviewed-on: https://code.wireshark.org/review/27160
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-26 16:41:34 +00:00
Gerald Combs 6208796b9e Qt: Disable collapsible children in the main window.
Set the childrenCollapsible property to false in the main window
splitters. Set the minimum size for the packet list, proto tree, and
byte views to a small (one em), consistent, and nonzero value. Otherwise
it's easy to inadvertently end up with a hidden main window view.

Bug: 14478
Change-Id: I07a352cf2cf0375829ae2e0cb53b2a7d717dbb7d
Reviewed-on: https://code.wireshark.org/review/26847
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2018-04-11 01:21:46 +00:00
Roland Knall 3a928f1f87 Qt: Remove checks for version below 5.2
This stops the main source from being buildable by Qt 4.x

Change-Id: I61edbae04ac2b3bf0ae8ee8e09d335083945c176
Reviewed-on: https://code.wireshark.org/review/26756
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-05 18:48:57 +00:00
Peter Wu c1b7c8f9d2 Qt: ensure field is visible on selection from bytes view
Ensure that a selected field (via selectedFieldChanged) becomes visible
in the packet details view when selected from the bytes view (or when
found via a search).

As making a field always visible seems a desirable feature (and in the
interest of simplifying preferences), enable this by default using the
smarter EnsureVisible hint.

Remove the associated preferences and mark them GTK+ only.

Change-Id: I05a918c1e09135c0b4e10f04024bff092756e55c
Fixes: v2.5.0rc0-2383-g6b2764a41e ("ProtoTree behavior fixes.")
Reviewed-on: https://code.wireshark.org/review/26509
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-18 00:30:49 +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
Gerald Combs ab202adb0a Proto tree: Update left arrow navigation behavior.
If the user presses the left arrow when a non-expaned proto tree item is
selected, jump to its parent item as described in the "Main Window
Navigation" section of the User's Guide..

Change-Id: Ie7478a2c292df9a225555f5539d7ba90ab5e132d
Reviewed-on: https://code.wireshark.org/review/25623
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-02-06 07:19:09 +00:00
Gerald Combs c84b0aeead Qt: More byte view and proto tree fixes.
47e1798762 broke byte view highlighting when selecting a proto tree
item. Switch back to emitting fieldSelected from selectionChanged. Force
a new selection in selectedFieldChanged, which does what we were trying
to do in 47e1798762.

Clear our marked byte offset in the byte view when we mark a field. Emit
byteSelected whenever we click the mouse.

Don't highlight anything when a tree item is deselected. Deselect a tree
item if we click on something that's not a byte in the byte view.

Change-Id: Ibf419ccb005d69f733b2fe12ce674e1fe504bb96
Reviewed-on: https://code.wireshark.org/review/25541
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>
2018-02-01 14:04:25 +00:00
Gerald Combs 47e1798762 Qt: Byte view and proto tree fixes.
Select our byte field only when we enter marked / locked mode.

Emit fieldSelected from autoScrollTo so that we always set the marked
protocol.

Don't clobber the current index in saveSelectedField.

Change-Id: I967b20608f991a5f3e6a0979b1f702f874ce27b4
Reviewed-on: https://code.wireshark.org/review/25521
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>
2018-01-31 04:54:36 +00:00
Gerald Combs 145e3a5dc3 Qt: Proto tree fixes
Make sure ProtoTree::toString stops at the right place.

Don't emit fieldSelected when we're processing a context menu event. It
doesn't appear to be needed and it triggers unwanted automatic scrolling
when prefs.gui_auto_scroll_on_expand is enabled.

Change-Id: I351a6974d07aea6fdd3eb0b5c1975a1b8d8eb7da
Reviewed-on: https://code.wireshark.org/review/25396
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>
2018-01-21 14:20:32 +00:00
Gerald Combs 107a91a8cc Qt: Fix proto tree links and related frames.
Add FieldInformation::isLink and use it to style link items.

Add back a related frame information.

Get rid of rowsInserted() and just visit each tree node starting from
the root.

Change-Id: I0e7ef6b2e11d25465705adffbb77d6f6cfb2a435
Reviewed-on: https://code.wireshark.org/review/25342
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-16 18:55:24 +00:00
Gerald Combs 6b2764a41e ProtoTree behavior fixes.
Sync our expansion state for every node since we might have mixed
expanded/collapsed hierarchies.

Move the prefs.gui_auto_scroll_on_expand code from expand() to its own
function (autoScrollTo()).

Rename expand() and collapse() to syncExpanded() and syncCollapsed().
We can update tree_is_expanded without overriding our base class.

Ping-Bug: 14340
Change-Id: Ibf758809ea26dcc3f79bd0201168fae35d7cce8d
Reviewed-on: https://code.wireshark.org/review/25328
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>
2018-01-16 05:27:55 +00:00
Dario Lombardo 43833239fc Qt: change obsolete qVariantFromValue into QVariant::fromValue.
Change-Id: I767b06c0e316347cdb28b769f1032e6d44cba45b
Reviewed-on: https://code.wireshark.org/review/25321
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-15 12:20:32 +00:00
Gerald Combs 2f31016e6c Qt: Expand subtrees when a packet is selected.
ProtoTree::rowsInserted was expanding top-level items properly but not
subtrees. Make sure we do so.

Bug: 14340
Change-Id: I6c73fd09643b52d43014352816d0dd4838dbcb1d
Reviewed-on: https://code.wireshark.org/review/25316
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-15 08:41:23 +00:00
Gerald Combs 6f84e1b5f3 Qt: Fixup fieldSelected behavior.
Check the originating sender of fieldSelected in a couple of places so
that we don't re-emit it. This fixes an issue that was keeping the byte
view from marking the protocol.

Remove duplicate signal+slot connections in MainWindow.

Remove an unused member function.

Change-Id: Ia876bb4117d1e30a56f4c335a65f6976c8058f9d
Reviewed-on: https://code.wireshark.org/review/25077
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-31 08:48:22 +00:00
Gerald Combs e641846837 Qt: Add "Copy as…" to the byte view.
Make ByteViewText an IDataPrintable and add "Copy as…" context menu
actions. Remove some unused functions.

Bug: 14276
Change-Id: Ie48c7c9b016de19fd8978397d03d23e9a7fe247a
Reviewed-on: https://code.wireshark.org/review/24933
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-27 18:19:10 +00:00
Stig Bjørlykke 0b30fb239f Qt: Add new keyboard shortcuts
Add Ctrl+Shift+I for "Apply as Column"
Add Ctrl+Shift+O for "Show Packet Bytes"

Also added "Show Packet bytes" to the "Analyze" menu.

Change-Id: I03e39bf92c254cf33bef73b1356ad576c92241d2
Reviewed-on: https://code.wireshark.org/review/24906
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-12-20 08:39:47 +00:00