Commit Graph

76 Commits

Author SHA1 Message Date
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
Stig Bjørlykke d8565d8f1b Qt: Keep auto-scroll when starting a new capture
Avoid turning off actionGoAutoScroll when going to the first packet
when starting a new capture.

Bug: 14257
Change-Id: I676139696cf4917b779c5fd390d7a22fb373a6b5
Reviewed-on: https://code.wireshark.org/review/25568
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-02-02 18:38:11 +00:00
Michael Mann d239da264c Convert preference dialog to use more models.
Convert Advanced view and Modules view to use a single base model,
loading the preferences once and then filter and display what they
need with QSortFilterProxyModel derived classes.

Convert the PreferencePane "types" to just strings.  This allows
a more straightforward relationship between the "special" modules
that need custom widgets for preference manipulation and it also
removes dependency on preferences_dialog.h for many files.

Change-Id: I091deb3061564aa4d1564e9ca1c792715961b083
Reviewed-on: https://code.wireshark.org/review/25134
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-04 21:20:59 +00:00
Roland Knall e3329cdc31 Qt: Remove duplicate copy actions
Remove the final copy actions from MainWindow and use DataPrinter instead.
This way, MainWindow no longer is involved in copying data, and the actions
purely are defined by DataPrinter

Change-Id: Ib70ad6394dee501bb2c8d58c9d174a0eb04b47de
Reviewed-on: https://code.wireshark.org/review/25031
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-28 11:26:25 +00:00
Michael Mann 76d7b7a519 Qt: Add menu option to remove all packet comments
Bug: 14186
Change-Id: I8793078ea50379b2f9697787e6b7a8ab2d9e3e0e
Reviewed-on: https://code.wireshark.org/review/24558
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-23 20:45:41 +00:00
Roland Knall e13e2df9a1 Qt: Rename packetSelection to frameSelected
In order to consolidate the interfaces between certain parts of the UI,
the signal emitted after a frame change has occured, has to include the
number of the frame. This led to two signals for frame change, and therefore
packetSelection is to be removed.

Change-Id: I24e0e0890291d2243935b0c48387beb66904bfa3
Reviewed-on: https://code.wireshark.org/review/24377
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 17:18:44 +00:00
Roland Knall 8a6ea0e454 Qt: Further cleanup ByteView
This further separates ByteView and the rest of the system.

Using FieldInformation and DataPrinter, this is the final cleanup
of the ByteViewTab

Change-Id: If41521167527cf5664c2564cdd0d45fea0f3f612
Reviewed-on: https://code.wireshark.org/review/22783
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 20:20:31 +00:00
Roland Knall 02e80019f2 Qt: Create models directory
Following the move for widgets and utils directory, moving models
and delegates to the utils directory. Guidelines for this directory are:

 - Implementation of a model
 - Implementation of a delegate
 - Utility class for data storage used by a model

Note: additionally all includes affected by this move have been changed
to absolute path includes, instead of relative ones.

Change-Id: I3bb868af7d3570437682b722a0cd46c906628570
Reviewed-on: https://code.wireshark.org/review/22790
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 12:22:04 +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
Stig Bjørlykke be4dbf840b Qt: Turn off auto scroll when going to a packet
When going to a packet (first, last, next, prev and specific) during
capture we must turn off auto scroll to let the packet be shown
in the packet list.

Change-Id: If1c615eb4d422c3b4c0418114064f7a4a0b75b35
Reviewed-on: https://code.wireshark.org/review/22244
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20 02:26:04 +00:00
Jeff Morriss 4e46352657 Don't scroll back to the selected frame when we get name resolution updates.
With live or large capture files and asynchronous name resolution this can
cause serious scrolling issues as the name resolutions come in.

Bug: 12074
Change-Id: I1a5cca410c0608927b32e9e7107885370caf14d7
Reviewed-on: https://code.wireshark.org/review/22245
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20 02:24:31 +00:00
Gerald Combs 8e76cfbf54 Qt: Add selection history navigation.
Add the ability to move back and forth in the packet selection history
similar to GTK+. Update the documentation accordingly.

Change-Id: If1fdc1e59b240c0588c292dc0f7f0a5f083c30e1
Reviewed-on: https://code.wireshark.org/review/20320
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-03 05:02:14 +00:00
Gerald Combs e150235ef1 Qt: Optionally restore our selected packet when thawing.
Stash the current row when we freeze the packet list. Make it possible
to restore it when thawing. Do so when the layout changes and when we
move a column.

Change-Id: I44cfb8bafcd4d49a46e1c89bf47aecf5ac139773
Reviewed-on: https://code.wireshark.org/review/19222
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-13 22:01:59 +00:00
Stig Bjørlykke 5b4ca98a54 Qt: Optimized setColumnVisibility() usage
Setting column visibility (show/hide columns) is only needed when
columns has changed and when show/hide from column popup menu.

Change-Id: Ia33d6fccab44443c453921fc2629bbf1d22efd01
Reviewed-on: https://code.wireshark.org/review/17781
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-22 07:59:43 +00:00
Gerald Combs b3e70f9a7e Qt: Refactor the packet list scroll bar.
Split OverlayScrollBar into parent and child scroll bar widgets. This
gives us two packet list scroll bars: a packet map, which draws and
operates on nearby packets and a normal scroll bar.

The packet map is drawn to the left of the child scroll bar. This gives
us more room to draw and doesn't obscure the scroll bar itself (which is
a problem on newer versions of Windows). When the user clicks on a
portion of the map, scroll to that part of the packet list.

Draw marked packet ticks over the normal scroll bar. Marked & ignored
are on the left, time references are on the right.

To do:

- Borrow more from packet fence and graph something (packet size? time
  delta?)

Change-Id: Ie952fcbd98fd0e047200f2279cb63227feabf5b1
Reviewed-on: https://code.wireshark.org/review/15046
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-04-28 17:18:41 +00:00
Stig Bjørlykke 720f57d000 ui: Code cleanup
Fixed code layout to use common style in the file.
Mostly whitespace changes.

Change-Id: Id37b57717a9e26248fad07322dff09b1d1f45ac2
Reviewed-on: https://code.wireshark.org/review/13504
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-23 23:15:54 +00:00
Stig Bjørlykke e73fc7e51e Qt: Removed applyRecentColumnWidths from recentFilesRead
Adjusting column widths from recent settings is only needed
when columns has changed.

Don't recreate the columns when changing timestamp options or
name resolution, only reset columns.

Change-Id: I4c9a9f63c34542935dd282188d98b2b5b013c5f3
Reviewed-on: https://code.wireshark.org/review/12579
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-13 18:50:53 +00:00
Pascal Quantin df83e45084 Qt: fix "go to packet" broken by g56625dd
Keeping auto scroll is required to update the row displayed.
Instead catch the mouse event and stop auto scroll only during that time.

Change-Id: Ibc5b0a4115192fc3e01e63c82e67761e5aed9d3b
Reviewed-on: https://code.wireshark.org/review/12235
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-28 07:44:25 +00:00
Pascal Quantin 56625dd456 Qt: remove automatic horizontal scrolling when selecting a row
QTreeView automatically scrolls so as to show as much as possible the content of the selected column.
Let's get rid of that.
Rename PacketList::setAutoScroll() so that it does not overload QAbstractItemView::setAutoscroll()

Change-Id: I09fb54f9b31c3025efddce6a4e709baaf107702d
Reviewed-on: https://code.wireshark.org/review/12225
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>
2015-11-27 18:49:53 +00:00
Stig Bjørlykke f5b816d4c9 Qt: Check zero recent column width
Hidden columns may have been stored with zero width, so ensure
we always check for this when fetching.

Change-Id: I625c05adccaf2d81198fdeeccf7feeb9a9eb82c2
Reviewed-on: https://code.wireshark.org/review/12196
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-27 05:29:08 +00:00
Stig Bjørlykke 4980d505f2 Qt: Use correct column width when switching profile
QTreeView::setColumnHidden() saves column width on hide and restores
column width on show.  When switching from a profile with hidden
columns to a profile where this columns are shown we get a
sectionResized() signal with the saved width from the old profile,
initiated from columnsChanged() -> setColumnVisibility().
We must avoid setting this as a new column width because this is
recent values from a old column layout.

In other cases we use setColumnVisibility() we don’t need to set
a new column width either, because we store the column width ourself.

Don't store column width when hiding column (new_width == 0).
Restore column width when showing column because profiles may have
changed the packet_list layout.

Change-Id: I7e89c3477402ec6d621cd2015ee74b086f60d6cb
Reviewed-on: https://code.wireshark.org/review/12111
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-26 17:16:51 +00:00
Stig Bjørlykke 7324555c1f Qt: Fixed more column issues when changing profile.
When changing profile without a loaded capture file we have to rebuild
cap_file_->cinfo when a capture is loaded.

Bug: 11493
Change-Id: I9b561a360236056c104cfdb478b855fa550325e2
Reviewed-on: https://code.wireshark.org/review/12068
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-23 17:02:41 +00:00
Gerald Combs f5d7548497 Qt: Coloring Rules dialog fixups.
Insert new rules at the top. This matches the GTK+ UI behavior. Recolor
the packet list when we press "OK". Add a "to do" item about setting the
filter column width.

Change-Id: I2a9e58fe8642a89f12e1c34622b96613f3ec4c05
Reviewed-on: https://code.wireshark.org/review/11781
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-11-13 01:47:53 +00:00
Gerald Combs 9f8d00c174 Add preferences for related packets and the scroll bar minimap.
Add gui.packet_list_show_related and gui.packet_list_show_minimap.
Show_related enables and disables the related packet delegate.
Show_minimap enables and disables the minimap. Start calling it the
"intelligent scroll bar" since that's the best suggestion for a name
I've seen so far.

Leave them out of the Appearance preference pane for now.

Change-Id: I5869c446fda5c8e62d6b1e49a74d63ba3b117b0f
Reviewed-on: https://code.wireshark.org/review/11332
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-10-27 23:28:56 +00:00
Gerald Combs a0113a5eb3 Qt: fix time shift
Add a timeShifted signal to TimeShiftDialog and use it to update the
packet list and model. Add drawCurrentPacket to PacketList so that we
can do a more thorough job of redrawing the current packet and tree.

Bug: 11575
Change-Id: I960d8cdbf6872e3f71007cb4d2bbd5457f268257
Reviewed-on: https://code.wireshark.org/review/11068
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-19 17:41:12 +00:00
Gerald Combs 30ff173a87 Qt: Always make the packet list row heights uniform.
In tests here using GTK+ 2.24 and 3.10, GtkTreeView handles multi-line
items by adjusting the height for all rows, but only after the number of
multi-line items exceeds some sort of threshold. For a packet capture
which contains a few DNS packets and a lot of TCP packets, if I change
"Standard query" to "Standard\nquery" in packet-dns.c I get
single-height packet list items. If I change "[TCP segment of a
reassembled PDU]" to "[TCP segment of a\nreassembled PDU]" in
packet-tcp.c (which results in more multi-line column strings) I get
double-height packet list items.

The current Qt code initially sets the uniformRowHeights property then
falls back to variable row heights if we run across a multi-line column
string. This adds a lot of logic which can impact other functionality
(e.g. column widths) and recalculating row heights is painfully slow for
large numbers of packets.

Instead of trying to manage variable row heights, always enable
uniformRowHeights. Track the maximum newline count and trigger a row
height adjustment when it changes. This mimics the GTK+ UI behavior,
although it should be more reliable.

Note that we need to adjust some numbers in RelatedPacketDelegate.

Change-Id: I289e963b6f00338c4374e602fa3fc83d04554519
Ping-Bug: 11515
Ping-Bug: 10924
Reviewed-on: https://code.wireshark.org/review/10628
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-23 20:53:18 +00:00
Gerald Combs ae4d99b670 Packet list speedups.
beginInsertRows + endInsertRows is expensive. Instead of calling them
each time we add a packet to the list, queue up a list of visible packets
and flush it during the next UI update.

Assume that none of our column data has newlines. Enable
uniformRowHeights and only disable it when we need to. Note that this
requires further work.

Ping-Bug: 11515
Ping-Bug: 10924

Change-Id: Ifbdd2964b174247a4745d4889ebda5bf3b886ba4
Reviewed-on: https://code.wireshark.org/review/10553
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-09-17 19:37:48 +00:00
Stig Bjørlykke 47f5d41acd Qt: Fixed a resource leak in getFilterFromRowAndColumn
Found by coverity CID 1314608 and Apple Instruments.

Change-Id: I264ce335bd8985946a097bb8f99f7c41c0eb027d
Reviewed-on: https://code.wireshark.org/review/10378
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-09-08 06:33:55 +00:00
Stig Bjørlykke 68c51724fe Qt: Always rebuild columns when fields changed
The columns must be recreated even if no capture file is loaded
because custom columns may have reference to deregistered fields.

Change-Id: I4ed7345b3200e5af211695f1a6511ee229d5f13c
Reviewed-on: https://code.wireshark.org/review/10076
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-17 19:45:44 +00:00
Gerald Combs 9fd3bcc25e Add an elide mode preference for the Qt packet list.
Change-Id: I081cc1e9b2a0eea7f0a3ef1157561c50beb4c4db
Reviewed-on: https://code.wireshark.org/review/9902
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-06 21:06:34 +00:00
Gerald Combs 16b048d34b Packet list and detail context menu updates.
Add some missing items to the packet list and detail "Copy" context
menus. Don't nest the "Copy" items so deeply. Add YAML to the supported
summary formats.

Note that "Copy as Binary" copies to the clipboard as
application/octet-stream, which is a) arguably correct, and b) not very
useful. Fixes welcome.

Enable and disable packet detail context menu items from a set of
booleans similar to the packet list.

Change-Id: Iaa931c766aa476c33f27de089e5c4dbaf9ce74d6
Ping-Bug: 9320
Bug: 10831
Reviewed-on: https://code.wireshark.org/review/9825
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-30 19:13:38 +00:00
Gerald Combs d6f59cd10f Main menu and packet list menu updates.
Enable and disable packet list-relasted menu items in one place. Add
"Colorize Conversation" items to the packet list context menu.

In the GTK+ UI we tend to disable entire menus, which makes their items
inaccessible. Try not to do that in the Qt UI so that menu items are
always visible even if they're disabled.

Remove commented items which are now complete.

Change-Id: I69b878b45334bf88014694b1bf016278fa55a94b
Reviewed-on: https://code.wireshark.org/review/9819
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-29 22:38:43 +00:00
Gerald Combs 01bc31cded Fixup packet list context menu behavior.
Add logic to setMenusForSelectedPacket for setting the enabled states
for the "Apply As" and "Prepare A" actions. Update the PacketList
context menu code to fill in the right filter at the right time.

Exit out of setMenusForSelectedTreeRow if the packet list has focus so
that we don't clobber the enabled states of various actions.

Take the "Apply As" and "Prepare A" context menu titles from their main
window counterparts. Remove actionApply_as_Filter and
actionPrepare_a_Filter.

Remove completed to-do items.

Change-Id: I8f6f538bb7786d8df02a999f3b449dfde640e847
Reviewed-on: https://code.wireshark.org/review/9810
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-07-27 23:26:04 +00:00
Michal Labedzki 1e487664bc Qt: Add option to back white line separator for packet list items
This uses one line (on bottom) of items and makes it white.
Seen in Wireshark on some configurations of GTK 2 on Linux,
so backports it to Qt for people who like it.

In my opinion it helps if you use packet list background colors
for frames and you have a lot of following frames with
the same background color.

Bug: 10954
Change-Id: Id8f58520d7224db4eb8181bcc04febd7416a8578
Reviewed-on: https://code.wireshark.org/review/7293
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-07-20 21:21:28 +00:00
Gerald Combs 255d53dfc1 Draw packet colors in the packet list scrollbar.
Inspired by (but not as fancy as) Packet Fence, an enhancement written
for Ethereal a loooong time ago by Martin Visser:

https://www.wireshark.org/lists/ethereal-dev/200011/msg00122.html

Several text editors call this a "minimap".

Color each scrollbar raster line to match the color of up to 7 packets.
Note in the comments why this number was chosen.

If we have any flagged frames (marked, ignored, time ref) indicate them
on either side of the scrolbar.

Handle HiDPI (retina) displays. This means that your window size depends
on the height of your scrollbar *and* your monitor resolution.

Qt's idea of the slider rect doesn't match up with the slider on OS X.
This might be local to my build -- I can replicate it Qt Creator.

Change-Id: Ia089d2d766ce37bab11e22d1a5721b4908935304
Reviewed-on: https://code.wireshark.org/review/8982
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
2015-07-16 22:57:31 +00:00
Gerald Combs 41ed7127a5 Qt: Frame flag updates.
Move frame flag (mark, ignore, ref_time) member functions from
PacketList to PacketListModel. They arguably belong there and we can
emit dataChanged to signal updates.

Rename some variables named "index" since they shadow a function name.

Change-Id: I9a731a76e4e63e562b561c29d13915278d5a7dbb
Reviewed-on: https://code.wireshark.org/review/9663
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-16 19:13:14 +00:00
Gerald Combs c305f08921 PacketList column fixes.
Add a columnsChanged slot to PacketList and move the column update code
from redrawVisiblePackets there. Make sure we call
packet_list_model_->recreateVisibleRows, which should fix the behavior
described in bug 11324. Call columnsChanged when we, uh, change columns.

Add a sectionMoved slot to handle column reordering.

Don't rebuild the column list when we update the widgets in the column
preferences frame.  Do enable and disable the "remove" button as needed.

Try to keep the user from removing all of the columns in both the packet
list and column preferences.

Left as an exercise for the reader: The GTK+ UI also fails when you
remove all of the columns via the preferences:

  packet_list.c:377:packet_list_sort_column: assertion failed: (col)

Bug: 11324
Change-Id: Id58cf98e42cbda9aa2fc370ea06b8bcc6098c8ca
Reviewed-on: https://code.wireshark.org/review/9591
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-07-13 02:36:41 +00:00
Gerald Combs 9c28594529 Add a preferences editor frame.
This replaces the single preference editor dialog in the GTK+ UI.

Change-Id: I10e030981e9f7d1ec121811593586b65cf0797c5
Reviewed-on: https://code.wireshark.org/review/8966
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-06-18 00:46:50 +00:00
Gerald Combs 26dacfc8c3 Qt: Add protocol preferences menus.
Add protocol preferences in the packet list and packet detail context
menus. Note that we need a PreferencesEditorFrame in the main window for
editing numeric and string preferences. For now we just show the prefs
dialog.

Change-Id: Ice0cc8e9bc25963cc14aa47698f042f2a73088d8
Reviewed-on: https://code.wireshark.org/review/8957
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-06-17 01:25:27 +00:00
Alexis La Goutte 3827c81473 Qt: Add Conversation Filter sub menu
Apply conversation filters using the new color_dissector_filters.[ch]
from g1f03180.

Change-Id: I2e535bb3d5b95fd26226422daf9f83c452a95e3c
Reviewed-on: https://code.wireshark.org/review/3558
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-29 21:25:09 +00:00
Gerald Combs 2156413bf9 Qt: Column preference fixes.
Don't call redrawVisiblePackets in PacketList::sectionResized. Otherwise
we trigger the crash in bug 11179. Call recent_set_column_width instead.

Clean up the slots called when column preferences change and when recent
column widths change.

Update our column visibility in redrawVisiblePackets.

Use recent_get_column_width when writing the recent file. columnWidth
doesn't return a valid value when we're not visible.

Bug: 11179.
Change-Id: I34ab93d944b341e42129a1c8ff94ba8f7ad4f5fc
Reviewed-on: https://code.wireshark.org/review/8457
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14 15:37:35 +00:00
Gerald Combs f77e02ccc6 Expert Info dialog.
Show all expert messages in a combined view. Group top-level items by a
(severity, group, protocol) tuple.

Let the user enable and disable messages via a check menu.

Add ProtoTree::goToField and expert_info_t.hf_index. Use them to jump to
what we hope is the afflicted item.

Enable the context menu only if the user has selected a packet item.

Add a free-form search field that matches expert summaries.

This differs from the GTK+ version but hopefully provides a smoother
workflow.

Bug: 10931
Change-Id: Ia12cb7c27cdea1634fa2798fb7e4c1b23bd16ad2
Reviewed-on: https://code.wireshark.org/review/8294
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-08 04:29:59 +00:00
Gerald Combs e55ac64077 Qt: Fix packet list column resizing.
The size hint changes in g5ab8490 broke packet list column resizing. Add
back a way to force the hinting necessary for sizeHintForColumn to work
properly.

Bug: 11067
Ping-Bug: 10924
Change-Id: Icd525200f7a88f2b6d22a3039cda98ad0527239e
Reviewed-on: https://code.wireshark.org/review/8334
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-05-07 20:15:29 +00:00
Gerald Combs f2b35a180f Qt: Add extra related packet indicator types.
Add the ability to set frame number types: none, request, or response.
Use the types to draw different related packet indicators in the packet
list.

Track the conversation in PacketListRecord. Use it to draw dashed lines
for unrelated frames.

Set frame number types for DNS and ICMP.

Instead of drawing a transparent QImage, alpha blend our foreground
color and draw directly in our painter. Blend more toward the foreground
color.

Add FRAMENUM_TYPE to checkAPIs.

Change-Id: I2495945bb436413e05d6ec697184a0b4fd5ad214
Reviewed-on: https://code.wireshark.org/review/7436
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-05 16:45:04 +00:00
Michal Labedzki 2d4817966e Qt: Automatically scroll the packet list.
Add an "Auto Scroll in Live Capture" action to the Go menu. It's in the
View menu in the GTK+ UI but it seems to make more sense as a navigation
item.

Use a timeout interval for automatic scrolling. I haven't run any tests
to see if this makes a difference but it would seem that the less
drawing we do during a high speed capture the better, particularly for
remote displays.

Update the x-stay-last icons.

Note that we might want to make prefs.capture_auto_scroll a "recent"
setting.

Mark auto_scroll_live and packet_list_check_end GTK+ only.

Bug: 10601
Co-authored-by: Gerald Combs <gerald@wireshark.org>
Change-Id: I645d27c0814f0e4a0d5b01ae68be366847e2522d
Reviewed-on: https://code.wireshark.org/review/7292
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-27 20:27:14 +00:00
Gerald Combs 30ed6a1d72 Qt: Apply recent settings.
Add PacketList::applyRecentColumnWidths which set the packet list
column widths from our recent settings. Make sure it gets called at
startup and when we change profiles.

Save the packet list header state so that we can restore it when we
reset the model (i.e. freezing and thawing) and load a new capture file.
Save the state when the user resizes a column. As a side effect this
works around a weird bug that adjusts the width of column 1 at an
inopportune time.

Add a profileChanging signal so that we can save the main window geometry
in each profile.

Get rid of MainWindow::configurationProfileChanged. It was unused.

Apply saved pane widths and heights. Note that we might want to add a
separate pair of recent settings for the Qt panes.

Use the last opened directory in the capture file dialog.

Git rid of some unneeded Q_UNUSEDs while we're here.

Bug: 10953
Change-Id: I812aff59818cf0b4d1598b580627d32728d2e9d7
Reviewed-on: https://code.wireshark.org/review/7247
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-24 09:58:03 +00:00
Gerald Combs c34ded4ae2 Qt/C++: Change a bunch of includes to forward declarations.
In theory this this should reduce compilation times. On my particular
system it makes no difference but hopefully it will elsewhere.

Change-Id: I570177d3ca4eec691c82d46b4dbbce74092aac1d
Reviewed-on: https://code.wireshark.org/review/7060
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-02-10 19:59:43 +00:00
Gerald Combs c8cad99515 Qt: Add the Coloring Rules dialog.
Merge in the old ColorDialog which was a placeholder for
color_filter_add_cb.

Change-Id: I48d188509f480b8514122b4011ac9d8790fcca10
Reviewed-on: https://code.wireshark.org/review/6996
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-02-07 00:30:30 +00:00
Gerald Combs 5fb2f27428 Qt: Add a context menu to the packet list header.
Don't carry over the sort items from the GTK+ UI (for now, at least).
Update some names. Add a column editor frame similar to the "Go to
Packet" and "Search" frames.

Change-Id: I1bd3834a26994de96894d2b7512bce2c19915c77
Reviewed-on: https://code.wireshark.org/review/6277
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-06 15:22:04 +00:00
Michal Labedzki 1af7c2b838 Qt: Simplify disabling entries in ContextMenu
We have direct access to every entry (action) in ContextMenu.
Use it instead of storing "actions" and checking its name.

Change-Id: I97a1723898409faf13280c5655b7738661ab594b
Reviewed-on: https://code.wireshark.org/review/5135
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-11-05 12:58:02 +00:00