Commit Graph

15 Commits

Author SHA1 Message Date
João Valverde 7fd4e2e542 Move ui/filter_files.[ch] to wsutil 2023-02-10 20:59:22 +00:00
João Valverde 967a3c3df9 Qt: Check field autocomplete for syntactical validity
Currently the autocompletion engine always suggests a protocol
field completion, even in places where it isn't syntactically
valid.

Fix that by compiling the preamble to the token under the cursor
and checking the returned error. If it is DF_ERROR_UNEXPECTED_END
that indicates a field or literal value was expected. Otherwise
a field replacement is not valid in this position.

Fixes #12811.
2022-12-01 22:50:09 +00:00
Gerald Combs f8d3ebe0e2 Qt: Handle qsizetype.
Qt 5.10 added qsizetype, aka an ssize_t and Qt 6 makes extensive use of
it. Add a compatibility typedef and use it where we can. Cast it away
where we can't.
2022-03-25 16:51:55 +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
Martin Kaiser 92e1b110f3 Qt: FieldFilterEdit: remove unused actions
The private members save_action_ and remove_action_ in class FieldFilterEdit
are not used. Remove them.

(It looks as if FieldFilterEdit was copied from DisplayFilterEdit, where
 those two actions are present and linked to slots...)
2020-10-14 03:53:45 +00:00
Stig Bjørlykke 4ac54e27b0 Qt: Fix status message issues in find packet search
Fix some status message and tooltip issues introduced when enabling
autocomplete on find packet search in g0162ba73.

1. Enable or disable completion only when search type is changed.
   This setting is used in checkDisplayFilter(), which used to be
   called *before* changing allowCompletion in updateWidgets(), and
   this was causing issues with wrong status messages.

2. Check filter (usually triggered by changes in the search line)
   or reset filter syntax (added by DisplayFilterEdit) when search
   type is changed. This will trigger an update of the status message
   and the tooltip.

3. Stop checking display filter if not doing completion (not display
   filter search). This will avoid setting a status message from a
   previous illegal display filter.

Ping-Bug: 16638
Change-Id: I1534d9494cc4d7b7a0583cb845c091ae709458ae
Reviewed-on: https://code.wireshark.org/review/38061
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-05 21:31:13 +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
Stig Bjørlykke a468623720 Qt: Include current word in filter completion list
Include the current word in the filter completion list to give the
user a more complete picture of what constitutes a valid single-token
protocol name.

Bug: 15431
Change-Id: I77cfc78f19623d9aefd4441a67ed3ae72068034e
Reviewed-on: https://code.wireshark.org/review/31654
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-22 04:27:06 +00:00
Gerald Combs 4f557ea164 Qt: Switch line edits to new-style signals and slots.
Switch SyntaxLineEdit, CaptureFilterEdit, DisplayFilterEdit,
FieldFilterEdit, and RangeSyntaxLineEdit to compile time signals and
slots.

Change-Id: I2fb26c04324997929436c3d920baa1bdc6056e44
Reviewed-on: https://code.wireshark.org/review/31162
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-12-22 06:32:18 +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 ddfc1d37cc Qt: Move utils to separate utils directory
Following the move for widgets directory, moving utils
to the utils directory. Guidelines for this directory are:

 - Generic use but not a widget
 - Utility functionality used by many classes
 
 Note: additionally all includes affected by this move have been changed
 to absolute path includes, instead of relative ones.

Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b
Reviewed-on: https://code.wireshark.org/review/22602
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:11:55 +00:00
Gerald Combs b0ac5f449d Remove some unneeded includes.
Change-Id: I513936a74fe96211153fdf35f1832608b2cd053d
Reviewed-on: https://code.wireshark.org/review/22617
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>
2017-07-14 04:49:28 +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