Commit Graph

45 Commits

Author SHA1 Message Date
Peter Wu 8f35d6ff90 Qt: allow Packet Bytes view to be shrinked
Even if a packet has only one or two lines for the byte view, Qt
autoresizing insists to require a minimum of 5.5 lines (or 7.5 lines for
packets without multiple data sources). Remove this artificial
requirement and allow the packet bytes view to be resized to show
nothing (except for possible data sources tabs).

This makes it easier to fit more packets and details for screenshots.

Change-Id: I3ea997b9effa8292b396dc2ceb2ab1c35cead410
Reviewed-on: https://code.wireshark.org/review/20342
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-03 04:58:09 +00:00
Stig Bjørlykke 26e62dfad0 Qt: Fix -Wshorten-64-to-32 warnings
Fix some warnings when building with -Wshorten-64-to-32 flag for
C++ code.

Fixes for warnings from QList, QTimer and QVector has been pushed
upstream, so some time we may be able to enable this flag for C++.

Change-Id: Iae7457f9afc469c63f3edbe23dbf272b5c6c9e5e
Reviewed-on: https://code.wireshark.org/review/20310
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>
2017-02-28 11:41:32 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls
to QVariant conversions with VariantPointer where necessary

Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec
Reviewed-on: https://code.wireshark.org/review/19611
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 16:04:00 +00:00
Gerald Combs d0fa82b825 Qt: Clean up the byte view hover highlight.
Rename the text highlight enum "HighlightMode" to make its use and
intent more clear. Add a mode for the offset highlight instead of using
a separate variable. Use our palette to draw the hover highlight colors.
Add a note about colors to the Developer's Guide.

Change-Id: I488b2512a5058e17eb5b49c8ac55616100f32fbc
Reviewed-on: https://code.wireshark.org/review/18953
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-11-26 14:41:40 +00:00
Gerald Combs 9941cc5f7d Fix up coding style in ByteViewText.
As WSDG 12.2.2.1 says, use trailing_underscore_ convention for member
variables.

Change-Id: I7d6dbcce3908aefc167cdc6ee1d054a2f5f5a072
Reviewed-on: https://code.wireshark.org/review/17756
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-09-18 00:23:35 +00:00
João Valverde 2c38a05d01 Qt: Add hovered byte lock on left-click
Allows marking/unmarking a single byte in the bytes view pane.

Ping-Bug: 11547
Change-Id: I574ad7c6218eb08018094ea92ba79b69dbe4b45d
Reviewed-on: https://code.wireshark.org/review/16563
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-22 13:41:41 +00:00
Stig Bjørlykke 07ab40ebef Qt: Update scrollbars when change byte view format
Update scrollbars when changing display format between hex and
bits view because the height of the phane will change.

Change-Id: I81556c8dbdfb0a34f6c97e76834646a40aed62bb
Reviewed-on: https://code.wireshark.org/review/16336
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-07-08 08:55:34 +00:00
Dario Lombardo 5c11909f4d Qt: add initializers (CID 1249475).
Change-Id: Ic001c0dfab1e82c66473d6ca15633aaa57520659
Reviewed-on: https://code.wireshark.org/review/16294
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-05 12:14:44 +00:00
Gerald Combs 3bb019f095 Qt: Fixup byte view context menus
Shorten text similar to other context menus.

Change-Id: I8806ed4dddb6fc3c51ddbd4150d9090f5b2ca787
Reviewed-on: https://code.wireshark.org/review/16238
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: Michael Mann <mmann78@netscape.net>
2016-07-02 15:04:55 +00:00
Gerald Combs 250f248fd9 Qt: Add ASCII+EBCDIC actions to the byte view context menu.
Add actions to switch between ASCII and EBCDIC, similar to the hex and
bits items.

Bug: 5298
Change-Id: Ib601ac6e89411e6482f3e4172726e16a08fdbd2b
Reviewed-on: https://code.wireshark.org/review/16225
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-01 06:02:31 +00:00
Gerald Combs b8201aef9d Qt: Main window tab behavior.
Make the main window tab order more closely match the GTK+ UI. Draw a
focus rect in the byte view text while we're here.

Change-Id: I04212c14ea7f0d6865b709533246760adc02f45a
Reviewed-on: https://code.wireshark.org/review/15862
Petri-Dish: Anders Broman <a.broman58@gmail.com>
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>
2016-06-13 18:44:26 +00:00
Jaap Keuter 74484c6ebf Apply the prefix operator to iterators.
Prefix operators are supposed to be more efficient with iterators,
so lets use them instead of postfix operators.

Change-Id: I3090e4954c5cb67db47c88e2874b1a8ac52aa2cd
Reviewed-on: https://code.wireshark.org/review/15546
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-08 03:44:36 +00:00
Peter Wu 68ec6735e1 Qt: highlight hovered byte
Make it easier to link the hex with ascii bytes. The background color
will become yellow for bytes with the mouse focus.

Bug: 11547
Change-Id: Iab87e598a302ecf7bb7b37cd6ad55ea291c02b82
Reviewed-on: https://code.wireshark.org/review/14716
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>
2016-04-18 16:41:20 +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 2997178795 Qt: Plug memory leak in ByteViewText.
Each time we create a ByteViewText, which is twice when a packet is
selected, the menu items leaks.  Ensure we clear the items when done.

Change-Id: Idf0c7b82bf241120dd4c42ba85c56c0a2bf8db46
Reviewed-on: https://code.wireshark.org/review/12826
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-22 20:43:02 +00:00
Pascal Quantin 47a4c8f395 Qt: use recent.gui_bytes_view preference to remember bits / byte view
While we are at it, let's centralize bytes_view_type definition

Bug: 11903
Change-Id: I606c779a8efaea668db1b440d3ae0336e6e3fc67
Reviewed-on: https://code.wireshark.org/review/12706
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>
2015-12-18 06:46:46 +00:00
Gerald Combs 8e8db9b917 Qt: Explicitly set the byte view painter font.
Set the painter font at the beginning of each paintEvent. It looks like
we either aren't calling setFont at the right time or the
QAbstractScrollArea viewport sometimes ignores its parent font.

Bug: 11594
Change-Id: Id4484f6b990be112bbc5728d5ad0e31a74a60201
Reviewed-on: https://code.wireshark.org/review/11231
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-23 23:25:13 +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
Joerg Mayer 0619ed241c Finish removal of Q_UNUSED.
Todo: qcustomplot via upstream

Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf
Reviewed-on: https://code.wireshark.org/review/9547
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-07 22:17:22 +00:00
Alexis La Goutte 0ebbb60279 Byte view text (Qt): Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I507b27bbf3c2877517cc9613ada1b182becfa98f
Reviewed-on: https://code.wireshark.org/review/7495
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-02 19:02:24 +00:00
Gerald Combs 3e5c0bffa2 Qt: Fix packet detail and byte view scrolling
Make sure we call scrollToByte ByteViewText::setFieldHighlight.
Explicitly scroll to our selected QTreeWidgetItem in
ByteViewText::mousePressEvent.

Bug: 11013
Change-Id: I0a6381f6760ed48a4f496be8a06b1e56faa5a05b
Reviewed-on: https://code.wireshark.org/review/7416
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-02-26 17:22:43 +00:00
Gerald Combs 451f7f04d5 Qt: Better protocol highlight colors.
Use the "Window" palette colors for protocol-level highlighting.

Change-Id: Ife55d70041aa12110a00782d790be0d747b32562
Reviewed-on: https://code.wireshark.org/review/4979
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-29 00:16:01 +00:00
Gerald Combs 84f0ce4e23 Qt: Add bits display support to the byte view.
Add todo items for showing and hiding the offset, hex/bits, and
ASCII/EBCDIC sections and adding UTF-8 support.

Change-Id: Ia40faf3f939ef1a8fca6fac827057bd89045482a
Reviewed-on: https://code.wireshark.org/review/4949
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-27 17:33:05 +00:00
Gerald Combs 1c159818fd Qt: ByteViewText hover information.
When the user hovers over a byte view field, highlight it and show a
description in the status bar.

Add a "byte" status bar context and fix a label stack pop bug.

Keep proto_find_field_from_offset from matching generated items.
Otherwise hovering and selecting finds things like GeoIP entries and
checksum validation information. This affects the GTK+ UI as well.

Change-Id: Ic81c0d8159510a72d30c41f961807d8a48d05e16
Reviewed-on: https://code.wireshark.org/review/4943
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-27 02:05:13 +00:00
Gerald Combs 155c939bb9 Use better theme-derived colors. Switch back to AlternateBase for
protocol-level highlighting.

Change-Id: I3de3442885b93093c3a4f5341080713a2039cd4c
Reviewed-on: https://code.wireshark.org/review/4933
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-26 00:30:57 +00:00
Gerald Combs 1a45f1848f More offset color adjustments.
Change-Id: I52cf406443988624fb0e4a9e180963c599c8b91d
Reviewed-on: https://code.wireshark.org/review/4928
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-25 20:06:35 +00:00
Gerald Combs 3d2ec1613b Qt: ByteViewText fixups.
Calculate our X coordinate using floating point arithmetic. This should
hopefully fix the wierd subpixel text shifting for some font sizes.

Add alpha blending convenience routines to ColorUtils. Use them to
create the offset colors. The button color palette wasn't working very
well under Ubuntu.

Use QFontMetricsF::lineSpacing for our line height.

Note that we don't support the BOLD gui.hex_dump_highlight_style
preference. Leave a hint for anyone wishing to do so. Comment out
related code for now.

Change-Id: Ief77c9c8d00e05560cae6ecd781bd309027f6f5a
Reviewed-on: https://code.wireshark.org/review/4927
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-25 19:39:36 +00:00
Gerald Combs ceff4edbf0 Qt: Refactor ByteViewText.
Instead of subclassing QTextEdit and filling it with the entire contents
of our tvbuff, subclass QAbstractScrollArea and draw text by hand only
when needed. The new code should be *much* faster.

Some code based on QHexView by Even Teran
(https://code.google.com/p/qhexview/).

To do:
- Finish the bit view implementation.

Change-Id: Ie44de6870d80711cd44324521a17ab76bcefe5e5
Reviewed-on: https://code.wireshark.org/review/4922
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-24 22:58:46 +00:00
Gerald Combs 31e86998fb Qt: Add zoom and column resize actions.
Plumb signals and slots for changing the text size in the main window.
Remove the bold font code from WiresharkApplication. It was only used in
ByteViewText. Adjust the icons a bit.

Bug: When we change the font preferences the packet list stops drawing
cached strings. I haven't been able to track down the cause.

Change-Id: I609d740c9f26265628fa4b7de1b75b0e56651387
Reviewed-on: https://code.wireshark.org/review/4269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-23 22:32:53 +00:00
Hadriel Kaplan a6809ce9aa Fix bytes view pane showing non-ASCII chars
The bytes view pane in Qt is showing non-ASCII characters in the right-hand
side.  That's because the code is using isprint(), which is locale specific
and frequently includes non-ascii charscters such as the copyright symbol and
such. I wouldn't care, except some of those non-ASCII characters affects
the font height and makes it looks sloppy (the display output is set to a
fixed *width* font, but not fixed height font apparently).

Change-Id: Idd471c5fb769d3d67aa08bc507d168e686d48098
Reviewed-on: https://code.wireshark.org/review/548
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-07 13:05:39 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Evan Huus ced8abb125 Reduce the scope of one variable definition slightly.
svn path=/trunk/; revision=46361
2012-12-03 23:15:59 +00:00
Gerald Combs ad4dc9dfcd Add a comment about improving performance.
svn path=/trunk/; revision=45956
2012-11-06 23:49:26 +00:00
Gerald Combs 8865f925c2 Fix our offset calculation.
svn path=/trunk/; revision=45954
2012-11-06 22:17:06 +00:00
Gerald Combs 32074376ac Show the byte view when we select a packet. Update some method and
variable names.

svn path=/trunk/; revision=45953
2012-11-06 21:49:16 +00:00
Gerald Combs 101e9755c7 Try to speed up rendering.
svn path=/trunk/; revision=45841
2012-10-30 22:25:37 +00:00
Gerald Combs 12dfeadbbf Get rid of a couple of unused variables. Other minor cleanup.
svn path=/trunk/; revision=45839
2012-10-30 20:24:08 +00:00
Gerald Combs 0a28fb8f6a Update the Qt byte view widget to reflect the recent changes in the GTK+
byte view.

Move the packet_char_enc enum from packet.h to frame_data.h. Make the
encoding flag a packet_char_enc and make it one bit.

Get rid of the "cfile" global in a few places. C++-ize some of the font
code. Clean up some variable names.

svn path=/trunk/; revision=45838
2012-10-30 19:21:24 +00:00
Alexis La Goutte 42ace71553 Add modelines for Qtshark file
svn path=/trunk/; revision=44766
2012-09-04 08:18:31 +00:00
Jörg Mayer 11b1de0cdf Fixes for warnings: unused-but-set-variable
svn path=/trunk/; revision=44628
2012-08-23 10:30:37 +00:00
Gerald Combs 2b21eff0d9 Add automatic tree expansion. Get rid of some unnecessary void * casts.
Fix a couple of compilation warnings.

svn path=/trunk/; revision=44587
2012-08-19 20:47:11 +00:00
Gerald Combs bc1b0fd21d Try not to print funny characters.
svn path=/trunk/; revision=43685
2012-07-12 23:39:25 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Gerald Combs 41c54f9e5d Remove or mark unused variables.
svn path=/trunk/; revision=40599
2012-01-20 00:01:53 +00:00
Gerald Combs 23a520237b Add initial support for Qt along with a "ui" subdirectory.
svn path=/trunk/; revision=40378
2012-01-04 22:13:01 +00:00