aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models/uat_delegate.cpp
AgeCommit message (Collapse)AuthorFilesLines
2023-03-30UAT+Qt: Add dissector syntax line editJohn Thacker1-14/+2
Add a syntax line editor for dissector names, that validates and provides completion. Use it in the UAT configuration. It has been impossible to use the UAT to set a dissector with capital letters; change things so that does work. This doesn't display the description anywhere, but that would be nice too. A better fix for #18836.
2023-02-11UAT: Have a combobox for DissectorsJohn Thacker1-0/+20
Add a drop-down combobox for UATs, including User DLTs, that have a choice of dissectors. Make the combobox editable, which will provide suggestions, and pass things through to the existing UAT validation for dissectors. (It's a very long list, especially with 1717 entries, including 530 just from various BT GATT UUIDs, so being able to still type it in seems useful.) Dissectors are not protocols. Rename the UAT field from PROTO to DISSECTOR where used. Update the column names and long descriptions to use dissector instead of protocol in dissectors that used this. There may at some point be UATs that want protocols instead of dissectors, but that's not what the current behavior does and none of the current dissectors that use the existing types want. Update the documentation to use "dissector" instead of "protocol." Put the names of the actual current three Ethernet dissectors. Clarify that the "ip" dissector actually tries IPv4 and IPv6, instead of just IPv4. UAT entries are backwards and forwards compatible with versions without this change. Fix #18836.
2022-05-16Qt: Fix File Path editor in tableRoland Knall1-24/+33
The current situation in UatDelegate as well as PathChooserDelegate leads to issues, where Wireshark crashes if the button is clicked. This is due to the UI not correctly positioning the button inside the cell. This change implements a widget, which will serve as cell content, handling all relations with choosing the file, but also properly handling the size and geometry of said cell content, therefore no longer leading to crashes and cleaning up code at the same time, as duplicate methods are being removed. Fixes #17789, #17819, #18088
2021-11-26Qt: Use QRegularExpression instead of QRegExpTomasz Moń1-4/+4
Qt5 recommended to use QRegularExpression instead of QRegExp. Qt6 deprecated QRegExp and provides it in Qt5 compatibility module. QRegularExpression is generally faster and safer to use as the results are returned in separate QRegularExpressionMatch instead of modifying interal QRegExp object state.
2021-11-24Fix some of the compile errors when compiling with Qt6Joerg Mayer1-0/+1
This is basically applying c knowledge and Google to the compiler error messages. There is basically no understanding involved into what I was doing: - No idea why lots of #includes needed to be added for Qt6 - No idea how to actually fix the remaining problems, but it's a start Things that need to be done: - The AudioDeviceInfo thingy needs to be replaced by something new (as an interim solution another patch disables the audio player in Qt6). - GRegExp eventually needs to be replaced by QRegularExpression (available since Qt5.0, so development can be done in Qt5). - Solutions for the other problems like some methods no longer being available in Qt6 that have to sort of co-exist with Qt5.
2021-06-19Replace g_assert() with ws_assert()João Valverde1-1/+2
2021-04-20Qt: Fix various compiler warnings.Gerald Combs1-2/+2
Fix const-qual and missing-prototypes warnings found by Clang.
2021-03-08Remove modelines in ui/qt.Gerald Combs1-12/+0
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.
2020-12-04Qt: UAT editor column widths, italic pathnameChuck Craft1-0/+1
Closes #15968 #17059 - set width of pull down list so items are visible - allow user to resize columns in UAT editor - resize columns on open and changing data - if a UAT file does not exist, display the UAT name in lower right where pathname is displayed for files - pad pathname on right to account for right tilt of italic fonts Note: a future change may be to not resize columns where user has changed width.
2020-03-13Qt: Fill in our UAT delegate editor backgrounds.Gerald Combs1-34/+36
Set setAutoFillBackground(true) for a bunch of our editors where appropriate, similar to g4a2cd15aa5. Change-Id: Ic87275e3be90af55b8352eb4742559d526dec2b6 Reviewed-on: https://code.wireshark.org/review/36386 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-11-17Qt: Cleanup space inside parenthesesStig Bjørlykke1-2/+2
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-01-16Qt: IO Graph correct color selectionRoland Knall1-16/+16
The correct method of selection of colors is just using the QColorDialog not a specialized object. Implementing it just that way, to correct bug on Linux Bug: 15399 Change-Id: I3c4785d352888ec34c34534667c3f7df182f9fd7 Reviewed-on: https://code.wireshark.org/review/31465 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-12-24Qt: Switch models and DataPrinter to new-style signals and slots.Gerald Combs1-3/+3
Change-Id: I56ecf0486c19dbd7a330628f2fe36d0a2c11b5da Reviewed-on: https://code.wireshark.org/review/31187 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-05-01Fix comment end after SPDX identifierStig Bjørlykke1-1/+2
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-04-05Qt: Remove checks for version below 5.2Roland Knall1-7/+0
This stops the main source from being buildable by Qt 4.x Change-Id: I61edbae04ac2b3bf0ae8ee8e09d335083945c176 Reviewed-on: https://code.wireshark.org/review/26756 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-03-07Qt: Handle UAT editor dialogs explicitly.Michael Mann1-53/+9
QAbstractItemView assumes that editors are widgets, not windows. QAbstractItemView::edit calls QAbstractItemViewPrivate::openEditor, which simply calls show() and setFocus() on the editor widget. If that widget happens to be a native dialog, its event loop might not be processed. This is the case on macOS at least. Create widgets derived from QLineEdit that edit the value directly along with a button that can open the associated modal dialog. Install event filters so that we keep the correct tab behavior between fields of the UAT. Bug: 13958 Ping-Bug: 14031 Bug: 7761 Change-Id: Ie5f0a5cbde33bb9add8217029c2063a0bbfd804a Reviewed-on: https://code.wireshark.org/review/23015 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-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
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-02Qt: use SPDX identifiers.Dario Lombardo1-14/+1
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3 Reviewed-on: https://code.wireshark.org/review/25563 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-07Use UAT model for I/O graphMichael Mann1-4/+36
Convert from using TreeWidgetItems to UAT model/delegate. More of the GUI is "just handled" within the table. Required to add support for "colors" and "protocol fields" to UAT types. Also needed to add some hacks for "custom" UAT field handlers for backwards compatibility with the existing UAT structure used. Because UAT functionality was switched completely to the model, some information in the table was "lost in translation" because the UATs themselves aren't translated to other languages. TODO: 2. Better "order of operations"? A bunch of NULL/size checks needed to be added to prevent crashing. Now with model/"view" should events/functions be reordered? Bug: 13585 Change-Id: I2bbba78182317c4fada07b927c05d0c6f4cdc0fe Reviewed-on: https://code.wireshark.org/review/22766 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-08-07Use proper tab order for "file types" in UAT "table".Michael Mann1-41/+66
Directory and File "UAT types" have been using a separately launched dialog, instead of an "editor", so it breaks "tab rules". Create and treat (File) dialog as an editor. Change-Id: I983728abefb0cdd79899468a800328f1b56e2910 Reviewed-on: https://code.wireshark.org/review/22886 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>
2017-07-26Qt: Create models directoryRoland Knall1-0/+217
Following the move for widgets and utils directory, moving models and delegates to the utils directory. Guidelines for this directory are: - Implementation of a model - Implementation of a delegate - Utility class for data storage used by a model Note: additionally all includes affected by this move have been changed to absolute path includes, instead of relative ones. Change-Id: I3bb868af7d3570437682b722a0cd46c906628570 Reviewed-on: https://code.wireshark.org/review/22790 Reviewed-by: Roland Knall <rknall@gmail.com>