Commit Graph

168 Commits

Author SHA1 Message Date
Gerald Combs a748eac808 Qt: Make sure we redraw the far overlay.
Make sure we redraw the far overlay image when we unmark all packets.

Change-Id: Ib94af9029ee5c0a8e29a27c3b8aa8c84608fb9f6
Reviewed-on: https://code.wireshark.org/review/15266
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-05-05 15:46:45 +00:00
Martin Kaiser 90eea14044 qt: don't declare dp_ratio for Qt < 5.1
this avoids warnings about unused variables

Change-Id: I0ee033f90c1387615ffc167161e53f4293d89763
Reviewed-on: https://code.wireshark.org/review/15195
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-01 14:16:54 +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
Alexis La Goutte 6d197f742f packet_list: fix Called C++ object pointer is null found by Clang Analyzer
Change-Id: Ie1a16973e94f09eeacea770936f9a9b4ab82b01d
Reviewed-on: https://code.wireshark.org/review/14838
Reviewed-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>
2016-04-08 06:12:24 +00:00
Peter Wu fd4808fbec Qt: Remember selected item in packet tree
Previously, changing a packet in the packet list would lose the
currently selected field item in the packet tree. After this patch, this
issue no longer occurs because the selected field is focussed again.

The approach is to remember the header field ID on the path from a field
to its root. Limitations of the current simple approach is that multiple
fields/trees under a tree might result in the wrong selection. This is
better than nothing though.

This patch greatly helps analyzing a capture file which has the same
format, except that I need to check a data source for decrypted data.
Previously I would have to scroll down and select the field to see the
data source which also made it impossible to quickly switch between
packets and compare them.

Change-Id: Ic113ca9245fd9faa10f91182794c50cfde8d10f4
Reviewed-on: https://code.wireshark.org/review/14697
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-04-02 21:17:35 +00:00
Gerald Combs bb48c859c9 Qt: Normalize timerEvents
Make our timerEvent code more consistent. Make sure we use timer IDs and
that we call our base class timerEvent everywhere.

Change-Id: Ib67daa459a8a2f9b67487c3952b7b35c7f162f7e
Reviewed-on: https://code.wireshark.org/review/14480
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-03-21 22:10:21 +00:00
Stig Bjørlykke b5ac91399c Qt: Select matching tree item and bytes in Find Packet
Highlight the matching tree item and matching packet bytes when
doing a Find Packet.  Added cf->search_len to correctly highlight
the matching bytes when doing a regex search.

Bug: 12157
Change-Id: I84fbdb9b43be4355e24aff3cf5f8850f1119e2bf
Reviewed-on: https://code.wireshark.org/review/14086
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-02-23 18:30:48 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Michael Mann 1fed5fef9a Add HTTP Follow stream
This automatically detects and decompresses HTTP along a TCP stream through the use of taps.

Bug: 3528
Change-Id: I8ab832d509700d0da8eabf3c3e514d8511c598d3
Reviewed-on: https://code.wireshark.org/review/13009
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-03 13:36:18 +00:00
Michael Mann 5e4bbcda98 Refactor GUI dependencies out of color_filters.[ch] and move it to epan directory.
This also moved color.h into color_filters.h

Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e
Reviewed-on: https://code.wireshark.org/review/12831
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-28 18:33:41 +00:00
Michal Labedzki 9bb3f6be4c Qt: Add missing multi-field column validation
GTK already has it, but Qt forgot about it, so multi-field custom column
works ok if previously saved in GTK-shark. Invalid validation prevent from
modifying and saving multi-field custom column in Qt version.

While at it, rename "custom field" to "custom fields" to ensure
we think about multi-field custom column.

Change-Id: I99588150ccb38be11b75f5dd5b0f6443e7055ebb
Reviewed-on: https://code.wireshark.org/review/12685
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-12-20 08:21:02 +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
Stig Bjørlykke 5133221a19 Qt: Apply recent column widths when columns changed
When changing columns in the preferences or when removing a column
from the packet list header menu we need to apply recent column
widths to preserve the remaining columns widths.

Change-Id: Ie5c074722424b5cee31af3b6953ab1b026ba7fa5
Reviewed-on: https://code.wireshark.org/review/12575
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-12 22:15:39 +00:00
michal.orynicz 2f2c8788a9 Fix crash caused by nullptr in packet_list
Fix crash caused by nullptr returned from proto_registrar_get_byname
in packet_list.cpp

Change-Id: If8324bf7c926585e964a11b27817f73d444beec4
Reviewed-on: https://code.wireshark.org/review/11558
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-12-08 12:26:12 +00:00
Gerald Combs 5f00849b97 Qt: Set the packet list width when we apply recent column widths.
Instead of messing with stretchLastSection, simply widen the packet list
to the sum of our column widths. Do this whenever recent column widths
are applied instead of only when the packet list is shown.

Bug: 11849
Ping-Bug: 11738
Change-Id: If8f8c9a89da08387bbce38c663bbbe1d8f7e649a
Reviewed-on: https://code.wireshark.org/review/12455
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-07 13:58:18 +00:00
Gerald Combs bdf8034fb1 Qt: Disable setStretchLastSection in the packet list.
QTreeView sets the stretchLastSection property of its header by default.
In our case this means that if the sum of our recent column widths
exceeds the width of the packet list viewport QHeaderView will shrink
the last column to fit.

Disable setStretchLastSection. We want its behavior when our columns are
too narrow so check for that in ::showEvent and temporarily enable it
there.

Bug: 11738
Change-Id: Ia4aad63e4f4bf899891bcebb7032dc5ebeb74cc7
Reviewed-on: https://code.wireshark.org/review/12392
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-12-03 05:17:19 +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
Pascal Quantin 62b03da49a Fix display of bytes as EBCDIC
MSVC compiler does not support properly setting an enum being part of a bit field.
For example the following code:
pinfo->fd->flags.encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
changes pinfo->fd->flags.encoding from 0x0 to 0xfffffffe instead of 0x1
Let's put back an unsigned int definition (like it is in master-1.12 branch) and add explicit casts where required

Bug: 11787
Change-Id: Idae0140fb6c172f1b3dbf10baefc8cfb00128f4c
Reviewed-on: https://code.wireshark.org/review/12220
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:39:09 +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 9601a4f724 Qt: Save preferences when hide/show columns
To preserve the hide/show column settings between switching profiles
the settings have to be saved.

Change-Id: I6f72b2980be149676e1c1099a604c8c6d0d995bf
Reviewed-on: https://code.wireshark.org/review/12109
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-24 19:13:45 +00:00
Stig Bjørlykke 9851bed7a4 Qt: Fix column resolve names
Reset columns when resolve names column menu item is toggled,
and save preferences to preserve the setting.

We should probably have functions to redraw only one column.

Change-Id: I52dce8d104ab9bedd11edc5d200ab85154243cb5
Reviewed-on: https://code.wireshark.org/review/12077
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-23 20:35:23 +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
Pascal Quantin 17e088ba0e Qt: save columns position before freezing
It allows to restore them properly in thaw()

Bug: 11737
Change-Id: Ibee6ee701ab64019ee03666c652c232770b3bb74
Reviewed-on: https://code.wireshark.org/review/11999
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: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-22 17:29:06 +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
João Valverde c00420efa2 Move utf8_entities.h to wsutil
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0
Reviewed-on: https://code.wireshark.org/review/10786
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 14:34:53 +00:00
Peter Wu 1d0532fee5 qt: warn when jumping to an invalid packet number
I was confused when double-clicking a packet number did not work. It
turns out that the display filter was hiding the destination.

Check the packet number for sanity, just like GTK+ does.

Change-Id: If50b2a3091a468f880b42fd2385f1b74c30d2f2b
Reviewed-on: https://code.wireshark.org/review/10700
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-09-30 12:40:06 +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 50ff8ae0c7 Qt: Add idle dissection.
Features such as sorting and scroll bar colorization require
fully-dissected packets. We currently do dissection at the wrong time --
*after* the user clicks on a packet list column header or moves the
scrollbar.

Add a timer + slot that dissects packets when the UI is idle so that our
packets are at least partially dissected when we need them.

Change-Id: I024c590af2250d67404a520f118e46ec0c49cd71
Reviewed-on: https://code.wireshark.org/review/10593
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-21 15:40:29 +00:00
Pascal Quantin cdc1b1ef8e Qt: flush visible rows before trying to select one
Otherwise you end up with a 'End of capture exceeded' popup when calling rescan_packets() with only a few packets in the capture

Change-Id: Idb387ce95f1d22b934e735c350ea0c117763d89a
Reviewed-on: https://code.wireshark.org/review/10567
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-18 17:46:16 +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
Gerald Combs 565a953f24 Don't invalidate the column cache when we filter packets.
Limit PacketListModel::recreateVisibleRows to checking for packets that
passed the display filter. Remove the call to resetColumns, which
invalidates the column string cache.

Call PacketListModel::resetColumns from PacketList::columnsChanged.
Along with invalidating the column string cache, this triggers a widget
update which means we shouldn't need to call recreateVisibleRows or
redrawVisiblePackets. Remove them.

Change-Id: Ic25f139e2c2f8cdebb2a868ccda7eb4127a3013c
Ping-Bug: 11324
Ping-Bug: 11514
Reviewed-on: https://code.wireshark.org/review/10491
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-13 18:52:19 +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 91d863cc16 Qt: Fix use-after-free pattern
This fixes crashes due to use of deallocated memory in:
- Export Packet Dissections
- Merge Capture Files
- Edit Packet Comment

Change-Id: I3dab8c0735eb5e642d6a4580d20bc3c81cf1345b
Reviewed-on: https://code.wireshark.org/review/10392
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:30:02 +00:00
Gerald Combs f19a173a84 Speed up column sorting.
The GTK+ UI sequentially dissects and caches column strings for all rows
before sorting a column. Do the same in the Qt UI, which can improve
performance considerably.

Don't colorize packets when sorting in the Qt UI unless it's necessary.

When sorting in the Qt UI, let the user cancel the initial packet
dissection.  Note that we'll need to replace std::sort in order to
cancel out of sorting.

Use a pre-allocated and pre-compiled GRexex when we prime columns. Note
that we probably shouldn't parse a regular expression there.

Cache the last result of proto_registrar_get_byname.

Note performance hot spots elsewhere in the code.

To do:

GeoIP in packet-ip.c is pretty slow.

Bug: 11467
Change-Id: Ib34038fee08ef0319261faeffc4eca01e52f4bd3
Reviewed-on: https://code.wireshark.org/review/10275
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-28 02:54:20 +00:00
Michal Labedzki 037524490d Qt/Minimap: Fix for Qt < 4.8
I hope it is quite right solution.

Change-Id: Ia9c883a832ddd03985eda37a9b344c4d7c8135e2
Reviewed-on: https://code.wireshark.org/review/10091
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-18 07:55:24 +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
Evan Huus 7c46b25927 qt: fix scrollbar crash applying conv. filter
When applying a conversation filter via context menu on the packet list,
something triggers the scrollbar to redraw when it has a maximum value of 0,
leading to a div-by-0. Guard against that (for now) though there may be a better
long-term fix.

Change-Id: I5fa0cac3e67f50a6c603a6fa10b117de5540d444
Reviewed-on: https://code.wireshark.org/review/9850
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-02 18:57:48 +00:00
Gerald Combs 5336c9aabc More spacing fixups.
Make spacing more consistent.

Change-Id: I8980a84ca70660057016985299b0f95761076893
Reviewed-on: https://code.wireshark.org/review/9835
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-31 19:23:01 +00:00
Gerald Combs da07c62bd0 More context menu updates.
Add "Follow" and "Export Packet Bytes" to the packet detail context
menu. Remove duplicate SCTP menu. Remove redunant action text.

Change-Id: If69815dc774806e267fbd71aa390b0af6f3b0d14
Reviewed-on: https://code.wireshark.org/review/9829
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-30 21:12:42 +00:00
Gerald Combs 9603db48d1 Make copy menu item names more consistent.
Change-Id: Ia7b2a87ba9ad843dfa9200d69eeb94275a3dc0bb
Reviewed-on: https://code.wireshark.org/review/9827
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-30 19:36:26 +00:00
Gerald Combs 549b8f08e8 Add a missing menu item.
Add "Copy as Filter" to the packet list context menu. Remove completed
item comments.

Change-Id: I1e2d9ebcff2fb36918d3e7525690cfb105cb1b13
Reviewed-on: https://code.wireshark.org/review/9826
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-30 19:25:10 +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
Gerald Combs da5eba636a Fix QCocoaMenu errors.
In PacketList and ProtoTree, create our own QMenus instead of stealing
actions from the main window. This only fixes the errors listed in bug
10890. Add "to do" items for other bugs.

Bug: 10890
Change-Id: I1c7ce8e4b863de95b2836e0cdcfb25824fe21edd
Reviewed-on: https://code.wireshark.org/review/9760
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-23 20:37:50 +00:00
Gerald Combs a5f7b84dba Fixup selected packet arithmetic.
Or, "I can mathing" if you prefer meme-based commit messages.

Change-Id: I8fd1db0e2a1e99525191ae6b33115ef8e38ab2f4
Reviewed-on: https://code.wireshark.org/review/9758
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-23 18:23:35 +00:00