Commit Graph

137 Commits

Author SHA1 Message Date
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
Gerald Combs 1514fe06cd Show the current selection in the overlay scrollbar.
Change-Id: Ie92b7ae170938eac71ede751d9067e1d47293092
Reviewed-on: https://code.wireshark.org/review/9750
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-23 00:24:08 +00:00
Gerald Combs e30a0ff765 Add manual name address resolution.
Make it an editor frame instead of a dialog similar to the column editor
and prototocol preference editor.

Change-Id: If1a0cdf02dcab0eca98e8d39c94a3c2fe236df5a
Reviewed-on: https://code.wireshark.org/review/9743
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-21 22:43:05 +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 d2acb04b4c Add the RTP Stream Analysis dialog.
Combine the GTK+ RTP Stream Analysis and RTP Graph Analysis dialogs into
one. Yell at the user less. Disable the Analyze RTP Stream menu item if
we don't have an RTP stream selected.

There are a *lot* of moving parts in this dialog. I've tested with the
few RTP captures I have but it's by no means complete.

"To do" items are listed at the top of rtp_analysis.cpp.

Change-Id: Id503977f069bebc46cc68bc749f0c9cbf4d37bf6
Reviewed-on: https://code.wireshark.org/review/9650
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-16 00:30:14 +00:00
Gerald Combs 0744e677d3 Check for a valid pointer when ignoring a frame.
Change-Id: I1a4a6b3f729c818a68bee1b6b8de3778130252a4
Reviewed-on: https://code.wireshark.org/review/9652
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-15 23:05:41 +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 39a2d9468b Fixup packet list selection.
Be less aggressive about resetting the packet list model so that we
retain our selection when (un)coloring packets or rebuilding columns.

Correctly enable a colorization menu item while we're here.

Change-Id: I8d1c8f26dbb8a814b8344b609695b77632006e4b
Reviewed-on: https://code.wireshark.org/review/9608
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-12 19:59:58 +00:00
Joerg Mayer 21754f43e1 Starting to get rid of Q_UNUSED declarations for unused function parameters.
The official C++ way is to leave out the variable name instead. This has the
advantage to be reliable: In one case a variable declared unused was later
used.

Change-Id: I1c96636f7fa7a621d1594d1e9cacaec75c561faa
Reviewed-on: https://code.wireshark.org/review/9532
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-07 06:29:31 +00:00
Gerald Combs 0b0100befa Fixup the packet list navigation action behavior.
Change-Id: I124fe3c3755556e81c65443b8b9744a89394dc70
Reviewed-on: https://code.wireshark.org/review/9218
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-29 17:22:34 +00:00
Michael Mann da09a1bfd8 Take all epan_column_info members that always get allocated to "number of columns" to share their own data structure.
Change-Id: Ib982662db6cf68730a7d121eac60d9bc5ae67429
Reviewed-on: https://code.wireshark.org/review/9195
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-29 02:11:04 +00:00
Gerald Combs d7b286c794 Qt: Be less aggressive about reselecting packets.
Don't reselect the current row in redrawVisiblePackets. That routine is
called in quite a few places, including ones where we don't want to
automatically scroll to the current packet.

Change-Id: Ia29a832235c0e260d8b17f1ce76745047700537b
Reviewed-on: https://code.wireshark.org/review/9064
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-23 18:23:12 +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 76a5465cf0 Qt: Fix packet deselection.
When no packets are selected, clear the related item delegate, packet
detail, and byte view. Also, don't crash.

Bug: 10529
Change-Id: I1f46d0d60d060d517f1ee2f8b5a9124bc1fad00e
Reviewed-on: https://code.wireshark.org/review/8470
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-15 16:07:29 +00:00
Gerald Combs 294706a1bf Fix packet list font zooming.
Change-Id: I376fc3b41e9ebbe1353527d8d3bbf8d4b86cc29a
Reviewed-on: https://code.wireshark.org/review/8463
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14 18:04: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 4a37dfc57e Qt: Add the correct column width padding.
When applying recent column widths, add the correct padding in the
right place.

Bug: 11175
Change-Id: I5a6fe7975764ddc5d9024d8839a837579b2bf799
Ping-Bug: 11179
Reviewed-on: https://code.wireshark.org/review/8456
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-13 20:41:51 +00:00
Gerald Combs 84db6a661d Fix an error found by Valgrind.
Change-Id: I9f0adac70129c90b4bf1e678bece6c6b8b8b4b75
Reviewed-on: https://code.wireshark.org/review/8455
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-13 19:04:51 +00:00
Gerald Combs a7fcfeaca3 Qt: Add packet list navigation checks.
Add sanity checks to go{First,Last,Next,Previous}Packet.

Bug: 11085
Change-Id: I6c33ea314720935aa1881257e9f32732134eec31
Reviewed-on: https://code.wireshark.org/review/8433
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-12 18:39:57 +00:00
Gerald Combs 341f2cee6b Qt: Packet list fixes.
When updating the monospace font, don't apply it to PacketList itself.
On Windows and Linux here it sets the header font as well.

Add the item delegate width to the column size hint. This correctly
resizes column 0 on Windows. It seems to add extra space on OS X and
Linux, unfortunately.

Change-Id: I294cd9868fe00144b896636be65896e8557ab208
Reviewed-on: https://code.wireshark.org/review/8402
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-11 19:24:11 +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
Michal Labedzki 80939682f9 Qt: Fix overloaded CPU
QTreeView also use timerEvent() to do something... so call its overloaded
method and make CPU happy again.

Bug: 11035
Change-Id: I405c8c2763ae0b96c0483aedcb314a5f259e76a1
Reviewed-on: https://code.wireshark.org/review/7696
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-03-15 18:50:20 +00:00
Peter Wu ad1b3ee110 Qt: enable autoscroll on initial capture start
The capture timer was never enabled on capture start or disabled on
capture stop. This is now implemented.

Bug: 10601
Change-Id: Iae23a952986a2c5dddf92b6ac0d1f1bc1c83719c
Reviewed-on: https://code.wireshark.org/review/7582
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-12 16:33:56 +00:00
Gerald Combs 5ab8490088 Qt: Allow multiple lines in the packet list.
Remove the setUniformRowHeights(true) call in the PacketList
constructor. This means that the packet list now calculates its height
by querying the Qt::SizeHintRole for every item instead of simply
multiplying item_height * number_of_rows.

Implement SizeHintRole in PacketListModel::data so that size
calculations aren't unbearably slow. We don't have any row text until an
item is drawn (via DisplayRole), so items with multiple lines end up
being rendered twice. Note where we make assumptions on line heights.

Although we call gtk_tree_view_set_fixed_height_mode() in the GTK+ UI we
don't have this problem there. GTK+ is apparently less strict about
enforcing row heights.

Bug: 10924
Change-Id: I98e9f4f5f321c2e03f18498e0a7e7556f88792a1
Reviewed-on: https://code.wireshark.org/review/7430
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-12 16:29:58 +00:00
Peter Wu 758ee3dc89 Qt: fix use of uninitialized variable
Fixes error reported by UBSan:

    ui/qt/packet_list.cpp:537:13: runtime error: load of value 190, which is not a valid value for type 'bool'

The method is apparently called earlier for other timers, resulting in
an error on startup. Initialize rows_inserted_ to avoid warnings when
the event is triggered later.

Change-Id: Iad919d79264ff1c3c17c9458c869d584234fcd5d
Reviewed-on: https://code.wireshark.org/review/7575
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-03-08 21:54:52 +00:00
Gerald Combs 394d23ed7b Qt: Automatic scrolling shouldn't select the last packet.
If packet_list_moveto_end does anything it should scroll, not select. Make
it a no-op for the time being.

Change-Id: I149815c8f9e50e95a4a77b91b7582c44eed6db4b
Ping-Bug: 10601
Reviewed-on: https://code.wireshark.org/review/7564
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-06 20:21:22 +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