There is no need for nesting event loops when showing menus. Show menus
asynchronously to limit possibilities of hard to debug problems related
to re-entering event loop.
After selecting field values to be shown or not shown
residues of the former diagram may reside until the next
scroll event. This updates the viewport to trigger the
paintEvent earlier.
Fixes#17997
Rename the main_window class and UIC files to wireshark_main_window and
the MainWindow class to WiresharkMainWindow. Copy wireshark_main_window
/ WiresharkMainWindow to logwolf_main_window / LogwolfMainWindow.
Remove the Wireless menu from Logwolf.
Move WiresharkApplication.{cpp,h} to MainApplication.{cpp,h}. Add back
WiresharkApplication as a thin superclass of MainApplication, similar to
LogsharkApplication. Change all of our wsApp references to mainApp. We
will likely have to change many or most of them back, but that's a
commit for another time.
This reverts commit c2edb44a9a.
While we should definitely avoid leaking memory, this runs up against
the Qt code's assumption that it will always have valid epan data.
Fixes#17590.
Fixes#17719.
Set PacketDiagram as parent of QGraphicsScene so the scene is destroyed
together with PacketDiagram.
Dynamically allocate WiresharkApplication and explicitly call its
destructor when no longer needed. This results in deletion of
FunnelAction objects created in register_menu_cb() and QAction objects
created in TapParameterDialog::registerDialog(). For some reason, when
breakpoint was set inside WiresharkApplication destructor it would not
get triggered on exit, and so the child objects would get reported as
memory leaks.
Delete main window and application only after epan_cleanup(). This makes
lua plugins actually call ops during cleanup (e.g. destroy_text_window)
and makes it possible to free the memory allocated in FunnelStatistics
constructor.
Use wsApp->setLastOpenDirFromFilename() to convert a filename
to a directory name before calling wsApp->setLastOpenDir().
This will ensure to always store a directory instead of a filename
in the recent gui.fileopen_remembered_dir.
Run
$ gsed -i -e 's/\(tr *(.*".*\)" *UTF8_HORIZONTAL_ELLIPSIS/\1…"/' $( ag -l 'tr *\(.*" *UTF8_HORIZONTAL_ELLIPSIS' )
$ gsed -i -e 's/\(tr *( *\)UTF8_HORIZONTAL_ELLIPSIS *"/\1"…/' $( ag -l 'tr *\( *UTF8_HORIZONTAL_ELLIPSIS *"' )
in ui/qt. As discussed in #16812, the UTF8_ macros were required at one
time because we only allowed ASCII in our source code. However, that
requirement has since been relaxed and Qt's translation framework
doesn't handle concatenating strings and macros very well.
QGraphicsScene::clear() doesn't reset the scene's the size and scroll
position. This is useful when we switch between packets, but we should
do a hard reset when switching between captures.
Gap items have a null field_info pointer, so set "Unknown" as the
default representation string and fill it in after we've established
that field_info is valid. Closes#16851.
FT_NONE items all have the name "Text Item" which makes it look
poor in the packet diagram.
For these fields, switch to use ->representation insead of ->name
to make these fields look more meaningful.
SMB2 is a protocol that consists of two FT_NONE expansions,
one for the Header and a second for the actual Command.
This makes packet diagram show this much nicer.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
FieldInformationGraphicsItem's constructor allocates a FieldInformation
which is never freed.
Opening MTP3 statistics for any capture file causes memory leaks.
Indirect leak of 1120 byte(s) in 10 object(s) allocated from:
#0 0x55e32cf19a42 in operator new(unsigned long)
#1 0x7f4cca598661 in QObject::QObject(QObject*)
#2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...
Indirect leak of 400 byte(s) in 10 object(s) allocated from:
#0 0x55e32cf19a42 in operator new(unsigned long) ...
#1 0x55e32d5fce04 in FieldInformationGraphicsItem::FieldInformationGraphicsItem(...)
#2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...
Add a FieldInformationGraphicsItem destructor and delete FieldInformation there.
The PacketDiagram widget prints debugging information about items that
it skips and resizes. Make this conditional, similar to what we do
elsewhere.
Bug: 16769
Change-Id: Id7fbedbdac6096cbca8d997688d489eac4729f52
Reviewed-on: https://code.wireshark.org/review/38121
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Add a new top-level view that shows each packet as a series of diagrams
similar to what you'd find in a networking textook or an RFC.
Add proto_item_set_bits_offset_len so that we can display some diagram
fields correctly.
Bugs / to do:
- Make this a separate dialog instead of a main window view?
- Handle bitfields / flags
Change-Id: Iba4897a5bf1dcd73929dde6210d5483cf07f54df
Reviewed-on: https://code.wireshark.org/review/37497
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>