Commit Graph

103 Commits

Author SHA1 Message Date
Stig Bjørlykke 44a615e854 Qt: Give a directory to wsApp->setLastOpenDir()
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.
2021-06-07 13:52:59 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
Gerald Combs 9b07412277 Qt: Add a packet diagram view.
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>
2020-08-10 18:17:50 +00:00
Gerald Combs 82032fe375 Qt+Windows: Remove the DBAR check.
Remove the check for Dell Backup and Recovery. The check was hacky and
obnoxious. At this point it's hopefully safe to assume systems with DBAR
installed are either running Windows 7 and no longer supported or have
upgraded to a safer version.

Change-Id: I458172885870edc34ec707a7748280e0eeed59b9
Reviewed-on: https://code.wireshark.org/review/35815
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>
2020-01-15 04:48:04 +00:00
Jim Young 8fbe28b1f0 profiles: Try to better sync on disk config state
Profile specific column settings are split across the `preferences'
file and the `recent' file.  At any given moment the GUI column
settings held within the `preferences' file and the `recent' file
may be inconsistent with one another and with the GUI itself. These
inconsistencies occur because of when the GUI chooses to write
config changes to disk.

If Wireshark is not shutdown gracefully (for example when killed
or should crash) the column preferences saved on disk may not be
consistent between the current profile's `preferences` and `recent`
files and the most recently used profile may not be recorded within
the `recent_common' file. On restarting Wireshark these config file
inconsistencies can lead to unexpected artifacts.

Normally the column config state saved within the current profile's
`preferences' and `recent` files are made consistent when a
different profile is selected or when Wireshark is closed
gracefully.

This patch set attempts to improve the constancy of the on disk
config state with the GUI state by invoking the functions to write
the `recent' and `recent_common' files in a more timely manner.

Fix a typo while here.

Change-Id: I2af9d9eb2dcf9cc0d422e9840aa05f4f6b1aa086
Reviewed-on: https://code.wireshark.org/review/35407
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-16 05:34:28 +00:00
Roland Knall c55dd79d2c Qt: Further cleanup goToPacket
Change-Id: Idf98deb3f7c34adff8e58ea243c63aa094234f46
Reviewed-on: https://code.wireshark.org/review/35181
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 15:28:23 +00:00
Gerald Combs 02057200fd macOS: Add support for automatic updates using Sparkle.
Add support for automatic updates using the Sparkle framework. Add
FindSparkle.cmake and associated CMake plumbing. Add a public key and
other info to Info.plist.in. Add ui/macosx/sparkle_bridge.{h,m}, which
wraps the Sparkle API. Make code that's specific to WinSparkle
Windows-only.

Add Sparkle installation steps to the macos-setup scripts. Sparkle
prints a warning if your bundle is unsigned (which is the case during
development) so disable installing it by default.

Updating here takes a long time. We might be able to fix that by
shipping our DSYMs separately.

Change-Id: I6cc6671db5657dadc514bda6bf6e1c8bbc9468a5
Reviewed-on: https://code.wireshark.org/review/35090
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-15 18:39:04 +00:00
Roland Knall 3c8c392b9d Qt: Cleanup push/pop Infos
Currently push pop is propagated by a massive load of signals
which partly are also propagated through parent objects.

This moves the status handling to WiresharkApplication, also
pathlining future moves to move status to different classes or
use additional methods of status information

Change-Id: Ibcb2c98688f1adf40dce1483f336596ef992bb06
Reviewed-on: https://code.wireshark.org/review/35071
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-12 22:03:23 +00:00
Tomasz Moń f67eccedd9 Qt: Do not spin unnecessary additional event loops
Show the dialogs asynchronously so no new event loops are created. This
not only simplifies stack traces (reduces the nesting level) but also
prevents hard to debug problems (eg. Bug 15743) from happening.

Change-Id: I85821a1403839a5baca504b40efce0ede2f1e0cb
Reviewed-on: https://code.wireshark.org/review/34646
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>
2019-10-01 03:53:46 +00:00
Mikael Kanstrup b08003309b Remove the periodic interface update in wireless toolbar
The wireless toolbar retrieves the full list of network interfaces
every 1.5 seconds to keep its list of interfaces updated. This
not only adds unnecessary load on the system it also generates
plenty of netlink traffic. When capturing packets on nlmon
interfaces they are flooded with packets generated by Wireshark
itself making it hard to understand the traffic that's really present
on the system.

Remove the periodic interface update and instead listen to network
interface change events and update only when something has changed.

The wireless toolbar need to know all when wireless interfaces are
added/removed, not only whether an interface is 'up' or not so
iface_monitor changes were also necessary.

Bug: 15576
Change-Id: I8fb19fd919dfef1b6b35bf48790b105ecd2b60a8
Reviewed-on: https://code.wireshark.org/review/32350
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-08 07:30:04 +00:00
Peter Wu ad71a91540 Qt: expose CaptureEvent definition for MOC
All WiresharkDialog instances have a "captureEvent(CaptureEvent)" method
that requires the definition of "CaptureEvent" from capture_file.h.
By luck, this definition is available for CMake builds due to the
generated MOC headers being included in the right order, but this cannot
be relied on. On an autotools build with less luck:

    main_status_bar.moc.cpp: In static member function ‘static void MainStatusBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’:
    main_status_bar.moc.cpp:241:86: error: invalid use of incomplete type ‘class CaptureEvent’
             case 28: _t->captureEventHandler((*reinterpret_cast< CaptureEvent(*)>(_a[1]))); break;

Create a new header file to limit exposure of the CaptureFile class.

Change-Id: I4ab609f13b9438797e39e7b98f367da35536979b
Fixes: v2.9.0rc0-186-g57bf7e4347 ("Qt: Fix memory leak for CaptureEvent")
Reviewed-on: https://code.wireshark.org/review/27003
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18 12:06:21 +00:00
Roland Knall 57bf7e4347 Qt: Fix memory leak for CaptureEvent
Make the argument to the events a non-memory object

Change-Id: I46d8c24415aa2bc48b2a2d3b1fccffa6956d08b5
Reviewed-on: https://code.wireshark.org/review/26671
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-17 13:16:46 +00:00
Gerald Combs bbe5fc1028 Epan+Qt: Invalidate cached column strings.
Add col_data_changed, which checks to see if we have updated column
info. Add col_append_frame_number, which adds a frame number and sets
col_data_changed. Call col_append_frame_number instead of
col_append_fstr from some dissectors.

Add PacketListRecord::invalidateAllRecords, which invalidates any cached
record data. Add PacketListModel::invalidateAllColumnStrings which calls
invalidateAllRecords and signals that our data has changed. Call
invalidateAllColumnStrings when we have new name resolution or column
information.

Bug: 11414
Bug: 11468
Change-Id: I2671594a722f4f9436fe1df84d43489a148e0cee
Reviewed-on: https://code.wireshark.org/review/26373
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-15 12:19:23 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Stig Bjørlykke 55e74ba841 Qt: Write recent before applying profile changes
The selected profile may be renamed in apply_profile_changes()
so write the recent file before renaming the directory to ensure that
we reload the latest changes.

Change-Id: I8988a00647926d93b0a1903090aadc8c61f1a34e
Reviewed-on: https://code.wireshark.org/review/25516
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-31 04:53:39 +00:00
Gerald Combs 3efcc9bd53 Qt: Create byte views at the proper zoom level.
Add a zoomed argument to WiresharkApplication::monospaceFont so that we
can easily fetch the font at its current zoom level. Set the zoomed font
when we create new ByteViewTexts.

Change-Id: I1293f206e37bb798247b1ac4b314fdfe88d4c55c
Reviewed-on: https://code.wireshark.org/review/25371
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>
2018-01-21 14:19:10 +00:00
Roland Knall d5d815189d Qt: Redesign signal/slot concept of capture_file
This is in preparation to make it easier for other classes
to get the right signals from the capture file. Also the decision
on what signals to listen to now resides with the final classes,
not main window, and it no longer needs to be changed if the
statusbar or wsapp needs additional signals.

Change-Id: If366d42b07dc822636404ac44ba2306ec4418b4e
Reviewed-on: https://code.wireshark.org/review/24941
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-12-23 09:41:46 +00:00
Gerald Combs 889aacae6e Qt: Update our recent status sooner at startup.
Update our recent file status as soon as we read recent_common.

Run recent stats updates in the global thread pool.

Revert 15a97b5986 since it's no longer needed.

Change-Id: If1b08ea640dfcad26affab5d20c80c90fbf133f2
Reviewed-on: https://code.wireshark.org/review/24862
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>
2017-12-17 08:04:03 +00:00
Gerald Combs db740987ff Qt: Add and use qUtf8Printable.
Qt 5.4 introduced qUtf8Printable, a convenience macro for converting
QString to a UTF-8 const char *. Add a compatibility definition and
start using it.

Change-Id: I3cf88611b1ed1a34082cb2ba82394954e2e6c461
Reviewed-on: https://code.wireshark.org/review/24828
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-14 20:26:52 +00:00
João Valverde 7540ac6938 Move the protocol registration routines back into libwireshark
Follow-up to b695b3e2f7.

Change-Id: I7e36519f2c3806c1205d05437671325080974257
Reviewed-on: https://code.wireshark.org/review/24524
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-21 20:21:50 +00:00
Gerald Combs 658578a5b9 Qt: Initialize QMimeDatabase in a worker thread.
As part of its initialization, QMimeDatabase parses the freedesktop.org
shared-mime-info database, which is a large-ish (2 - 4 MB) XML file.
This takes about 85 - 90 ms here.

We first access QMimeDatabase in our startup sequence when we load the
normal and capture application icons. Create a worker thread that
initializes QMimeDatabase as early as possible and load load the normal
and capture icons as late as possible.

Change-Id: I27e3d65d8ee1308a62d12d3ff7e1b95f82c2e75a
Reviewed-on: https://code.wireshark.org/review/24471
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-17 20:26:27 +00:00
Roland Knall 8a6ea0e454 Qt: Further cleanup ByteView
This further separates ByteView and the rest of the system.

Using FieldInformation and DataPrinter, this is the final cleanup
of the ByteViewTab

Change-Id: If41521167527cf5664c2564cdd0d45fea0f3f612
Reviewed-on: https://code.wireshark.org/review/22783
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 20:20:31 +00:00
Mikael Kanstrup 5a99830e21 Qt: Free dynamic menu actions at shutdown
Some menu actions registered at startup are not freed at shutdown
making Valgrind complain. Fix by clearing the lists holding them
and making sure all actions have a parent to free them.

Bug: 14071
Change-Id: I8d99d062d394a7262b0f9b7ddea4ed71049636ac
Reviewed-on: https://code.wireshark.org/review/23793
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-05 04:21:46 +00:00
Gerald Combs f86f54eb90 Qt: SimpleDialog fixes and updates.
Add WiresharkApplication::mainWindow and use it to move the C
simple_dialog routines to simple_dialog.cpp.

In SimpleDialog, make sure our checkbox is initialized. Don't store our
parent widget (which might go away) in a static variable, just use
wsApp->mainWindow(). Make sure we use check boxes only in Qt 5.2 or
later.

Bug: 13275
Change-Id: I72a9715c59f2efd50f722197f416179e87bb6a8b
Reviewed-on: https://code.wireshark.org/review/22805
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>
2017-07-27 11:41:10 +00:00
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in
libwsutil, and rename files and routines appropriately, as they don't
only handle errors any more.

Have a routine read_enabled_and_disabled_protos() that reads all the
files that enable or disable protocols or heuristic dissectors, enables
and disables them based on the contents of those files, and reports
errors itself (as warnings) using the new "report a warning message"
routine.  Fix that error reporting to report separately on the disabled
protocols, enabled protocols, and heuristic dissectors files.

Have a routine to set up the enabled and disabled protocols and
heuristic dissectors from the command-line arguments, so it's done the
same way in all programs.

If we try to enable or disable an unknown heuristic dissector via a
command-line argument, report an error.

Update a bunch of comments.

Update the name of disabled_protos_cleanup(), as it cleans up
information for disabled *and* enabled protocols and for heuristic
dissectors.

Support the command-line flags to enable and disable protocols and
heuristic dissectors in tfshark.

Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df
Reviewed-on: https://code.wireshark.org/review/20966
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08 20:40:08 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Gerald Combs a5a8fce06e Qt: Warn the user about DBAR 1.8 on Windows.
At startup, dig through the registry looking for shell extensions. If
any of them match known Dell Backup and Recovery DLL names and the DLL
version matches 1.8.*.*, show the user a warning dialog.

This is a bit extreme but I'm not sure what else to do. Dell is a popular
computer manufacturer and bug reports keep trickling in.

Change-Id: I6d1bd6c56850279356570154d231b07facb30cff
Bug: 12036
Ping-bug: 12701
Ping-bug: 13414
Reviewed-on: https://code.wireshark.org/review/16861
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>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-16 16:58:12 +00:00
Stig Bjørlykke c01cdd4e47 Qt: Reset Default profile support
Add support for resetting the Default profile by deleting it in
the Profile Dialog.  All profile files will be deleted and all
other files will be kept.

Change-Id: I795a6db3ee7b2c29e7aba461183e6cc411798b75
Reviewed-on: https://code.wireshark.org/review/20097
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-14 18:15:12 +00:00
Dario Lombardo 9ced31a2d7 filter_list: add cleanup function and call it on exit.
Change-Id: I51d8074cc5a63d4fd3af8852df120d6b4163217f
Reviewed-on: https://code.wireshark.org/review/19942
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10 13:34:56 +00:00
Roland Knall d66ee141af Qt: Signal number of active captures
Adds a signal, which emits the number of active captures

Change-Id: I637106294e331e7fc7607f6fd7704492e22fa7ac
Reviewed-on: https://code.wireshark.org/review/19799
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-26 08:28:29 +00:00
Gerald Combs 795f4eb106 Qt+Win32: Make software updates more friendly.
Add WinSparkle can_shutdown and shutdown_request callbacks which are
called prior to running the installer. Reject updates when we have
unsaved information. Add notes about possible improvements.

Ping-Bug: 9687
Ping-Bug: 12989
Change-Id: Ia126244b311417aa3105ea8136f186adc2745445
Reviewed-on: https://code.wireshark.org/review/19244
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>
2016-12-20 14:18:14 +00:00
Gerald Combs 414c132458 Qt: Handle retranslation events in the main window.
Update most (but not all) of the main status bar text when the user
changes the language setting.

Try to distinguish between recent preferences and recent captures more
clearly.

Change-Id: I5278a503178fe3620a25b185742688f957dc30f4
Ping-Bug: 11307
Reviewed-on: https://code.wireshark.org/review/9575
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-11-10 13:25:20 +00:00
Roland Knall 961b05315d WelcomeUI: Make Open and Capture clickable
Make the texts "Open" and "Capture" clickable, and have them open
the FileOpen and CaptureOptions dialogs respectively

Change-Id: I2a3efbc4cdf160aa0b4efc6496d09228affbff46
Reviewed-on: https://code.wireshark.org/review/18303
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-20 05:09:58 +00:00
Roland Knall 4a4698259c WiresharkApplication: Add signal emitter for Interface Changes
Change-Id: I468ef9462aa91d02c5568cec0d08081a2b3840bb
Reviewed-on: https://code.wireshark.org/review/18269
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-18 14:46:39 +00:00
Stig Bjørlykke 4ed3518c05 Qt: Added option to Remove from recent files list
Change-Id: If87e1bf4796d45582bc2490720683e4072971f56
Reviewed-on: https://code.wireshark.org/review/17804
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-19 20:49:01 +00:00
Gerald Combs 974a530f8e Qt: Conversation and Endpoint dialog performance tweaks.
Generate column text dynamically. This keeps us from having to iterate
over our tree items each time we receive updates.

Set the uniformRowHeights property.

Stop automatically resizing columns after 200 items.

Fixup name resolution behavior. Disable the checkbox if host name
resolution is disabled.

Change-Id: Ib2fef604d6ee9e39a8b1edd72d58d0cb02d3bb64
Reviewed-on: https://code.wireshark.org/review/16110
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>
2016-06-26 06:08:57 +00:00
Gerald Combs b47aca5fd1 Minor UI locale updates.
Qt: Call setlocale before commandline_early_options so that we get
proper "-v" output, similar to the GTK+ UI.

GTK+: Call setlocale once at startup.

Bug: 11960
Change-Id: I3c3a196b9d94fc768e1085200891bc8d67e21a08
Reviewed-on: https://code.wireshark.org/review/16132
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: João Valverde <j@v6e.pt>
2016-06-25 15:56:34 +00:00
Michael Mann 9b5b4443cf Refactor command-line handling of GUI options.
Both GTK and Qt both use the same command-line options, so refactor
the parsing and (possibly) applying of those arguments to a single
location.

Ping-Bug: 12546
Change-Id: Ib31e576c509c5d3d21c33d3247640d9f9c68661b
Reviewed-on: https://code.wireshark.org/review/16006
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-19 05:56:45 +00:00
Stig Bjørlykke 3c1d05d5a0 Qt: Enable capture filter bookmarks
Update the code handling capture filter bookmarks and enable the
bookmark button and clear button in CaptureFilterEdit().

Disable the apply button (which starts a capture) for now.

Bug: 11836
Change-Id: Ia33cbb8c9bb839be037112eef26daf744c4ea8f8
Reviewed-on: https://code.wireshark.org/review/13568
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-28 21:56:43 +00:00
Stig Bjørlykke 7fdf4ceaa6 Qt: Update display filter bookmarks when list changed
Recreate the display filter bookmarks menu only when the list
has changed, not every time the display filter changes.

The list changes when removing an entry from the menu and
when changing the list in the "Manage Display Filters" dialog.

Save the list when removing an entry from the menu.

Change-Id: Icd08e0a80085cca55c0e63177d45abe4902c7c3e
Reviewed-on: https://code.wireshark.org/review/13567
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-28 18:28:30 +00:00
Stig Bjørlykke ebdaace002 Lua: Added reload_lua_plugins
This makes it possible to trigger reloading Lua plugins from
within a Lua plugin.  This can be used when having a plugin to
update local plugins from a external source.

Renamed reload() to reload_packets() to clarify what's reloaded,
and added a alias (marked as obsoleted) from reload().

Change-Id: I4e529992af5f651613950329e73718dbda317d2e
Reviewed-on: https://code.wireshark.org/review/13024
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-01-11 07:43:36 +00:00
Pascal Quantin bfe73e3ad7 Qt: save custom colors in recent_common file
This allows to save colors across sessions for systems other than
OSX that do not provide a system wide color picker

While we are at it, let's stop reading the recent file twice at startup

Bug: 11888
Change-Id: I69ff14d699d8111fe6a8bdac0157fcd115a60c2b
Reviewed-on: https://code.wireshark.org/review/12659
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-16 06:53:24 +00:00
Stig Bjørlykke bfcd1e6514 Qt: Reset preferences when reloading Lua plugins
Reading configuration files may duplicate some entries, so ensure
we reset preferences before reloading.

Change-Id: I746414cbc10c206ddf47669856f329b9e0202a0d
Reviewed-on: https://code.wireshark.org/review/12496
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-10 14:08:58 +00:00
Stig Bjørlykke 6b7da34b4b Qt: Check display filter when changing profile
The Display Filter Macros may have changed and if a macro is currently
used in the display filter then cf_redissect_packets() will bail
out in an assert if trying to apply an invalid filter.

Change-Id: I842016360672d76d190454ce80ccc7604f2075b3
Reviewed-on: https://code.wireshark.org/review/12388
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-12-03 04:54:50 +00:00
Gerald Combs 2496aed28e Qt: Don't update the recent list while capturing.
If a recent file is on a network share we'll create traffic which can
show up in the capture.

This doesn't fix the issue entirely, e.g. if you're capturing in one
instance of Wireshark and have another one open. The proper fix in that
case is to switch to QFileSystemWatcher as described at the top of
::WiresharkApplication.

Ping-Bug: 11546
Change-Id: If21f1bb213fe1d862c09b1b2edd78c8baf983461
Reviewed-on: https://code.wireshark.org/review/10774
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-10-05 02:58:28 +00:00
Gerald Combs b4e972b729 Fix a bunch of leaks found by Valgrind.
Change-Id: I8862ed15d354aee487bacd80ab5fb4918423287e
Reviewed-on: https://code.wireshark.org/review/10487
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-11 20:37:09 +00:00
Gerald Combs 374439daa1 Don't emit app signals from dialogs.
Emitting PacketDissectionChanged from a dialog on can render the main
window unusable on OS X. A workaround for this was added to the
preferences dialog in g8fc2327. Generalize the workaround and use it
elsewhere.

Fix the "Enabled Protocols" action name while we're here.

Bug: 11361
Bug: 11448
Change-Id: I89e98daaaedc877d3b13b0d33b6f3be033e323d7
Reviewed-on: https://code.wireshark.org/review/10271
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-26 22:02:19 +00:00
Stig Bjørlykke ecc4f756bd Added Reload Lua plugins.
This is initial support for reloading Lua plugins without
restarting the application.

Still todo:
- Deregister FileHandlers
- Support deregister ProtoField with existing abbrev (same_name_hfinfo)
- Add a progress dialog when reloading many plugins
- Search for memory leakages in wslua functions

Change-Id: I48870d8741251705ca15ffe1068613fcb0cb18c1
Reviewed-on: https://code.wireshark.org/review/5028
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 12:09:07 +00:00
Gerald Combs a8faa04234 Qt: Add dynamic menu support.
Generalize the dynamic menu code and make it possible to connect
multiple types of actions to their corresponding slots.

Change-Id: Ib915ad5a666310e2a6e366fada006336820d1653
Reviewed-on: https://code.wireshark.org/review/9568
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-09 00:05:51 +00:00
Gerald Combs e91ca72a44 Qt: Add initial Lua support.
Add a FunnelStatistics class, which is the main interface between the Qt
UI and the Funnel API.

Add FunnelTextDialog, which implements the text_window, ProgDlg, menu,
and other routines. Add FunnelStringDialog, which implements dlg_new.

We currently only support "Tools" menu items (MENU_TOOLS_UNSORTED, aka
REGISTER_TOOLS_GROUP_UNSORTED). Add a disabled placeholder to the
"Tools" menu in case we don't load any scripts.

Use "struct progdlg" instead of needlessly casting to
funnel_progress_window_t.

To do:
- Add support for MENU_STAT_UNSORTED, MENU_STAT_GENERIC, etc.
- Make the firewall config generator a Lua script?
- Add FunnelGraphDialog? It seems like it would be useful to
  make QCustomPlot accessible to Lua scripts.

Ping-Bug: 9845
Change-Id: Iefff02e9032ed1853666f7902509ed08b431e7a7
Reviewed-on: https://code.wireshark.org/review/9523
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-07 20:49:30 +00:00