Commit Graph

23 Commits

Author SHA1 Message Date
Chuck Craft 8c79fa5e1b Qt: add display filter - invalid new filter syntax 2021-06-07 13:36:20 +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
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Roland Knall 69b41e4d1e Qt: Ensure only valid input for DisplayFilter
Allow only valid inputs to be given for the name of a DisplayFilter.
Specifically adding a quotation mark is not allowed

Change-Id: I10454a2d23db1e0ef08148571d2762a3285e5ab8
Reviewed-on: https://code.wireshark.org/review/35006
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-06 19:19:40 +00:00
Roland Knall 6d2791485d Qt: Allow drag/drop of filter buttons in dialog
Allow the drag/drop of filter buttons in the dialog

Change-Id: Ie2d5987ecdb626a8f12e8f17e6967f937bdf4648
Reviewed-on: https://code.wireshark.org/review/34885
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-29 19:44:15 +00:00
Roland Knall 2cccb26bc4 Qt: Implement FilterListModel
Change-Id: I365281a709ded644fc8d6ccfce5870a000221a3b
Reviewed-on: https://code.wireshark.org/review/34856
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-28 15:08:06 +00:00
Roland Knall a53545c0c8 Qt: Add macro for g_list_next for C++
Using a simple (type *) cast on g_list_next results in a warning
with modern compilers "old-style cast"

Adding a warning for g_list_next and data access to avoid the warning

A good overview why reinterpret_cast has been used can be found here:

https://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-const-cast-and-reinterpret-cast-be-used

It is a 1:1 replacement in this case, but does not use any of the new
cast styles and therefore should be used with caution.

Change-Id: I989f237afc39aaf40133a788b1c0bbd7a51bf974
Reviewed-on: https://code.wireshark.org/review/34284
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-30 13:37:25 +00:00
Gerald Combs 7b557088e9 Qt: Convert the rest of the preference dialog list buttons.
We no longer use the old icon names, so remove their aliases from
stock_icons.qrc.

Ping-Bug: 15511
Change-Id: If3c5e2b95825207a401e12607fcb94cdcc8a51c8
Reviewed-on: https://code.wireshark.org/review/33689
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-21 23:51:49 +00:00
Stig Bjørlykke e1fc60ddae Qt: Add back pathLabel in some dialogs
Add the pathLabel for Coloring Rules, Decode As, Display Filters
and Capture Filter. Put the absolute file path into the pathLabel
if the file exists. This aligns with UAT dialogs and frames.

Change-Id: I72bd06e31bab220de0a0ef8df99df9a4daed667c
Reviewed-on: https://code.wireshark.org/review/30089
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-10 04:46:28 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +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
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Roland Knall ee699eb720 Qt: Move all utility widgets to widgets subdirectory
Move all utility widgets to the widgets subdirectory and
add separate source_group for their files

Correct some alphabetization in ui/qt/CMakeLists.txt noticed
during compare.

Change-Id: I2d664edc2b32f126438fb673ea53a5ae94cd43d1
Reviewed-on: https://code.wireshark.org/review/22531
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11 21:30:29 +00:00
Guy Harris 7d5ce06cbe Pull the error reporting into {read,save}_filter_list.
Change-Id: I4d9582661f2f1728d400eeb2a1b1dea98f32ce7f
Reviewed-on: https://code.wireshark.org/review/20982
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 17:57:52 +00:00
Guy Harris 77cad8561c Move the filter file reading code to libui.
It doesn't belong in libwireshark, as it doesn't affect dissection, but
it *does* belong in libui, as it's helper code for the UIs.

Change-Id: I8a5e0640a299a08e9ec1917dd253197438ebfdbc
Reviewed-on: https://code.wireshark.org/review/20974
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 04:25:52 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
Add GeometryStateDialog class to handle load and save dialog geometry.
The QDialog class name will be used as window name.  For shared
classes the UAT name or the statistics title or abbr will be used.

Change-Id: I5a019598307fb3861518f41e733de834788184d8
Reviewed-on: https://code.wireshark.org/review/14139
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-28 18:25:50 +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
Mike78 ef752689da Allow/Create an option to use "capture filter" labels defined in wireshark GUI from CLI
Move ui/filters.[ch] to filter_files.[ch] because dumpcap is using functionality.

Bug: 8091
Change-Id: I195c82fc023f97d6f331b8718c45a2d83d30faea
Reviewed-on: https://code.wireshark.org/review/5925
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-27 13:40:24 +00:00
Guy Harris e9dd7c8bd4 Label the filter in the file open dialog as a "read filter".
This matches what the Windows file open dialog says, and also should
help prevent people thinking that it's a display filter, so that you can
clear it and see all the packets in the file.

I leave translations to native speakers.

Bug: 11708
Change-Id: I060816357bf7958d516429d09708a7ce16d609c5
Reviewed-on: https://code.wireshark.org/review/11877
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-16 19:01:12 +00:00
Gerald Combs 0e9389bb47 Display filter edit updates.
Have the bookmark button operate on saved display filters, similar to
the "Filter:" button in the GTK+ UI. Expose the saved display filter
list via a popup menu.

Update the display filter icons. Make the "Apply" button wider. Remove
the old icon assets.

Add a StockIconToolButton class along with note explaining why it's
necessary.

Rename the "Filter Bookmarks" preference to "Filter Shortcuts".
Suggestion for a better name are welcome.

Change-Id: I0082d3f01b017253fa75e51cbff9beb17c41a209
Reviewed-on: https://code.wireshark.org/review/10390
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-09-06 01:43:21 +00:00
Martin Kaiser 534d1d5eae Qt: use <> for including the generated ui_*.h files
this should make Visual Studio pick up the generated include files
from the build directory instead of the source directory (which may
contain lefovers from an in-tree build)

Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b
Reviewed-on: https://code.wireshark.org/review/9129
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 17:11:19 +00:00
Gerald Combs c2b713c093 Qt: Add the capture and display filter dialog.
Use a single overloaded dialog, similar to the GTK+ UI.

Change-Id: If85db14a7101770f115bef725f5145e0010c518d
Reviewed-on: https://code.wireshark.org/review/8776
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-05 19:19:46 +00:00