aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/byte_view_tab.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-03-31Fix byte pane not showing up in Packet dialogPeter Wu1-2/+6
When a packet dialog is being constructed, the layout is apparently not fixed yet and the byte view is technically not visible. Fix the hidden byte pane by not hiding it when it is not (yet) visible. Bug: 11760 Change-Id: I0494fa16a5ed89ff31f934ba682a6bb884cc0e2e Reviewed-on: https://code.wireshark.org/review/14713 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-23Qt: Select matching tree item and bytes in Find PacketStig Bjørlykke1-14/+4
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>
2015-07-31Fix binary data copying.Gerald Combs1-3/+5
As the QClipboard::setMimeData documentation says, "Ownership of the data is transferred to the clipboard." Allocate the mime data object accordingly. Note the results of trying to paste into hex editors on Windows. Frhed works. Hex Editor Neo and HxD do not. Change-Id: I46691ba95bf1f5c38817cd42ded73e8e67e4ee97 Reviewed-on: https://code.wireshark.org/review/9837 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-30Packet list and detail context menu updates.Gerald Combs1-0/+156
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-06-25Make sure the byte view maintains visibility.Gerald Combs1-1/+2
In ByteViewTab::clear, make sure we stay hidden or visible as appropriate. Bug: 11313 Change-Id: I12fa5169e840dbc4d27b6525fe6be72e13acce5d Reviewed-on: https://code.wireshark.org/review/9155 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-24Remove another batch of deprecated tvb_length callsEvan Huus1-1/+1
Change-Id: Icfdde38e40cca05d0705a081153a4ea3e8782ee7 Reviewed-on: https://code.wireshark.org/review/9086 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-05-30Qt: Always draw a byte view.Gerald Combs1-1/+6
When we clear the ByteViewTab add an placeholder ByteViewText. Change-Id: I9fbcd7e609c084d5724a30f80aa141b59ab1c0a1 Reviewed-on: https://code.wireshark.org/review/8688 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-04-07Byte view tab (Qt): Fix Dead Store (Dead assignement/Dead increment) warning ↵Alexis La Goutte1-22/+0
found by Clang Remove unused bmask variable Change-Id: I44613f1d949dbaf8e559b3bfb2196609d821c4f3 Reviewed-on: https://code.wireshark.org/review/7496 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-08Qt: fix heap use-after-free wrt. data sourcesPeter Wu1-0/+2
When a different packet is changed, the packet scoped memory for tvbuff is freed before clearing data source tabs. This results in heap-use-after free when resizeEvent is called as a result of clearing tabs for data sources. Avoid resize events by hiding the tabs. Caught with ASAN: ==18816==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060004cd970 at pc 0x7fffebf46618 bp 0x7fffffffbb10 sp 0x7fffffffbb00 READ of size 4 at 0x6060004cd970 thread T0 #0 0x7fffebf46617 in tvb_captured_length epan/tvbuff.c:423 #1 0x773062 in ByteViewText::updateScrollbars() ui/qt/byte_view_text.cpp:489 #2 0x76f307 in ByteViewText::resizeEvent(QResizeEvent*) ui/qt/byte_view_text.cpp:197 ... #24 0x9f2348 in ByteViewText::~ByteViewText() ui/qt/byte_view_text.h:46 #25 0x9f23f5 in ByteViewText::~ByteViewText() ui/qt/byte_view_text.h:46 #26 0x76b9d6 in ByteViewTab::clear() ui/qt/byte_view_tab.cpp:54 #27 0x5de685 in PacketList::selectionChanged(QItemSelection const&, QItemSelection const&) ui/qt/packet_list.cpp:477 ... freed by thread T0 here: ... #5 0x53d763 in cf_select_packet file.c:3827 #6 0x5ddfa5 in PacketList::selectionChanged(QItemSelection const&, QItemSelection const&) ui/qt/packet_list.cpp:454 #7 0x7fffe58ec980 (/usr/lib/libQt5Widgets.so.5+0x3bc980) #8 0x7fffe4d55dd6 in QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) (/usr/lib/libQt5Core.so.5+0x23fdd6) ... Change-Id: I9c1c01398713389de58259d13ebbaddd2d6e5c52 Reviewed-on: https://code.wireshark.org/review/7589 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-05Qt: Constify a bunch of strings.Gerald Combs1-1/+1
Change-Id: I601e429408fc042fc5b18a4750d40e260da47f43 Reviewed-on: https://code.wireshark.org/review/7535 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-24Qt: Fix a crash when changing the layout.Gerald Combs1-0/+4
Freeze and thaw the packet list when changing the layout. This has the side effect of clearing the proto tree and byte view, which avoids reading a bad tvb pointer. Note that we might want to add a cleanup callback to free_data_sources. Save and restore the current row. Add CaptureFile::currentRow. Fix a couple of comparisons in PacketList. Change-Id: I26f9b97ae5a7cdb4fb6e5e6e675570884900e995 Reviewed-on: https://code.wireshark.org/review/7337 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-12Qt: Add the "new packet" window^Wdialog^Wwindow.Gerald Combs1-0/+2
Allow persistence across files. Preserve the use of "window" even though we're really a dialog. Update ByteViewTab and ProtoTree to support multiple instances. Remove the need for a cast in frame_data. Add more forward declarations. Change-Id: I50d3d9d1455b8ecc158a37218f9e41fe696d5ae2 Reviewed-on: https://code.wireshark.org/review/7086 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-27Qt: ByteViewText hover information.Gerald Combs1-0/+1
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-24Qt: Refactor ByteViewText.Gerald Combs1-2/+0
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-09-23Qt: Add zoom and column resize actions.Gerald Combs1-0/+9
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-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-08-06Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=51174
2013-01-30Copy over r47277 from ui/gtk.Gerald Combs1-1/+7
svn path=/trunk/; revision=47364
2013-01-05Break out preference type names, type descriptions, stringGerald Combs1-1/+0
representations, and default status out of write_prefs and into their own routines. Split the corresponding custom preference write callbacks. Fix an apparent memory leak in the hidden column callback. Add an initial preferences dialog to the Qt port. Use the new preference routines to implement an "Adavanced" page similar to the "about:config" page available in many web browsers. Standard pages will hopefully follow soon. Remove some QDebug includes and make sure our QTreeWidgets have uniform row heights set. svn path=/trunk/; revision=46942
2012-11-06Show the byte view when we select a packet. Update some method andGerald Combs1-2/+9
variable names. svn path=/trunk/; revision=45953
2012-10-31Remove unused variable.Evan Huus1-9/+3
svn path=/trunk/; revision=45842
2012-10-30Get rid of a couple of unused variables. Other minor cleanup.Gerald Combs1-5/+4
svn path=/trunk/; revision=45839
2012-10-30Update the Qt byte view widget to reflect the recent changes in the GTK+Gerald Combs1-12/+101
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-09-04Add modelines for Qtshark fileAlexis La Goutte1-0/+13
svn path=/trunk/; revision=44766
2012-08-19Add automatic tree expansion. Get rid of some unnecessary void * casts.Gerald Combs1-4/+2
Fix a couple of compilation warnings. svn path=/trunk/; revision=44587
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-03-07Add i18n to QtSharkAlexis La Goutte1-1/+1
The goal is only to translate the Gui (Not dissector) Actually, there is only a french translation. To try, (if you are not French) launch qtshark with LANG=fr ./qtshark (in ui/qt folder) Missing some feature : * Add preference to select (force) your language * Some Gui Text, it no available for translation * Documentation about how to translate (Coming soon...) * Your translation ! svn path=/trunk/; revision=41389
2012-01-04Add initial support for Qt along with a "ui" subdirectory.Gerald Combs1-0/+92
svn path=/trunk/; revision=40378