aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/coloring_rules_dialog.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-10-10Qt: Add back pathLabel in some dialogsStig Bjørlykke1-1/+19
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-10Qt: Use regular size buttons on macOSStig Bjørlykke1-0/+2
Use regular size buttons in dialogs on macOS. Change-Id: Iad769190b7f62297343eea4299e3f03ea6be4b1e Reviewed-on: https://code.wireshark.org/review/30099 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-08Qt: Refactor copy from profile widgetStig Bjørlykke1-5/+9
Refactor CopyFromProfile class from Button to Menu to make it usable for existing buttons, both QPushButton and QToolButton. Change-Id: I7d23b4225dbe45f961fb05e73dbb4dd51e6f8ea1 Reviewed-on: https://code.wireshark.org/review/30083 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-10-07Qt: Use ActionRole for the "copy from profile" buttonStig Bjørlykke1-1/+1
The correct role for the newly introduced copy from profile button is ActionRole because it "causes changes to the elements within the dialog". Change-Id: I8613d00c0fdb33f2873e999aea9a54ea1f49dffb Reviewed-on: https://code.wireshark.org/review/30044 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-05Qt: Add copy from another profile for colorfiltersStig Bjørlykke1-4/+45
Add a new button to the Coloring Rules dialog to copy entries from another profile, or system defaults. The "copy from profile" button will also be used for other dialogs. Add a clear all button to easily remove all existing entries before importing or copying from another profile. Change-Id: Ia1e66444731018372b4354164c5a722fd73d403b Reviewed-on: https://code.wireshark.org/review/30008 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-29Qt: Show "unknown colorfilters" warning when opening the dialogStig Bjørlykke1-11/+11
Show the warning about unknown colorfilters being disabled when opening the "Coloring Rules..." dialog to make the user aware of this before starting editing the rules. The user may have corrected the filter and enabled it while having the dialog open, and then this warning would be misleading. Change-Id: Ic7f10495e5561bc2fea413c89cf9ebd187c8f113 Reviewed-on: https://code.wireshark.org/review/29909 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-16Windows: Make sure more native dialogs handle HiDPI.Gerald Combs1-3/+3
Add a WiresharkFileDialog class, which is a thin wrapper around a few QFileDialog functions that sets per-monitor v2 DPI awareness before showing native dialogs and resets the awareness context afterward. Use it where we call QFileDialog::getXXX. Change-Id: Ib711a70aa94b693a2515804a729f666ea7fbd673 Reviewed-on: https://code.wireshark.org/review/27568 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-03-04coloring rules dialogue: remove unused signalMartin Kaiser1-2/+0
View / Coloring Rules... shows this warning 12:02:26.401 Main Warn QObject::connect: No such signal ColoringRulesModel::dragDropComplete() in ../ui/qt/coloring_rules_dialog.cpp:61 12:02:26.401 Main Warn QObject::connect: (receiver name: 'ColoringRulesDialog') Remove the unused signal. Change-Id: Id42c249ac9252269eb31e4971e62e927a28c88ed Reviewed-on: https://code.wireshark.org/review/26239 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2018-02-14Convert coloring rules dialog to use model.Michael Mann1-268/+152
Change-Id: I12a465b5451bdbaea871828329d48fda3627fca3 Reviewed-on: https://code.wireshark.org/review/25372 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@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-10-22Add "Apply as filter" button to Coloring Rules DialogMichael Mann1-0/+12
Add a button to apply currently selected color as the display filter. Bug: 14100 Change-Id: Ife3edeb577075f1fe30b649a5655ef5887684d8a Reviewed-on: https://code.wireshark.org/review/24012 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-15Rename ui_util.h -> ws_ui_util.hPeter Wu1-1/+1
In preparation for possibly using AUTOUIC in CMake which treats "ui_*.h" files specially, rename ui_util.h. No other changes. Change-Id: Id026572c000b713ff0e9388dc7fff8d81d4df73e Reviewed-on: https://code.wireshark.org/review/23916 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-26Qt: Move utils to separate utils directoryRoland Knall1-1/+1
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-11Qt: Move all utility widgets to widgets subdirectoryRoland Knall1-2/+2
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-06Qt: Add convenience function and cleanupRoland Knall1-1/+1
Add a convenience function for the displayfilter combobox and clean up some code. On Linux, the AltModifier does not work as it is being used by xDMs to move the window around. Setting it to Shift. Change-Id: I1ee9638c1cf37f40dc21f19c4e0860adc4629d4e Reviewed-on: https://code.wireshark.org/review/22529 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-02-21Qt: Handle cancel in import coloring rulesStig Bjørlykke1-4/+6
Change-Id: I450cfc41d19c0dcb4aa59c0515d8d0834cfee60b Reviewed-on: https://code.wireshark.org/review/20223 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-10-03Be more forgiving about invalid Coloring Rules.Gerald Combs1-5/+7
In ColoringRulesDialog: Only check a rule's display filter if that rule is enabled. This keeps us from disabling the OK button when we shouldn't. Adjust the "Your coloring rules file contains unknown rules" dialog text and buttons for accuracy. In color_filters.c: Don't try to compile disabled filters in color_filters_apply. Don't warn about disabled and invalid filters in read_filters_file. Bug: 12814 Change-Id: I7143bf8e7a6162d296f1e93769344b69763195c8 Reviewed-on: https://code.wireshark.org/review/17823 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-07-29Don't discard unknown coloring rules.Gerald Combs1-1/+1
When processing the colorfilters file, keep and disable unknown coloring rules instead of skipping over and discarding them. This should hopefully keep people from losing the standard "Checksum Errors" rule (and it's less rude in general). Change-Id: I21796c25045d9dbf7612238ce3d27b613f1ec75f Reviewed-on: https://code.wireshark.org/review/16673 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-06-20Add display filter completion suggestions to color filters.Michael Mann1-1/+2
Change-Id: I84d890b55c72e4427ceb2d64e4a7888c07c030f5 Reviewed-on: https://code.wireshark.org/review/16024 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-08Apply the prefix operator to iterators.Jaap Keuter1-1/+1
Prefix operators are supposed to be more efficient with iterators, so lets use them instead of postfix operators. Change-Id: I3090e4954c5cb67db47c88e2874b1a8ac52aa2cd Reviewed-on: https://code.wireshark.org/review/15546 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-28Qt: Add dialog geometry restoreStig Bjørlykke1-4/+3
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-01-01No need for toolkit-dependent color initialization.Guy Harris1-22/+1
We're not allocating colors ourselves in GTK+ (and haven't been doing so since at least 1.12), and all color_t values are valid colors, so we don't need any toolkit-specific processing to fill in a color_t. While we're at it, catch read errors when reading color filter files. Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b Reviewed-on: https://code.wireshark.org/review/12985 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01Get rid of the "pixel" member of a color_t.Guy Harris1-1/+0
Now that we're letting GTK+/GDK allocate colors behind the scenes, if it allocates them at all, there's no reason to save the allocated color in the toolkit-independent color value. Change-Id: I99df32bd6b07924f41f3d855d2ddecb3dc8d5201 Reviewed-on: https://code.wireshark.org/review/12983 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28Refactor GUI dependencies out of color_filters.[ch] and move it to epan ↵Michael Mann1-17/+55
directory. This also moved color.h into color_filters.h Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e Reviewed-on: https://code.wireshark.org/review/12831 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-13Qt: Coloring Rules dialog fixups.Gerald Combs1-5/+14
Insert new rules at the top. This matches the GTK+ UI behavior. Recolor the packet list when we press "OK". Add a "to do" item about setting the filter column width. Change-Id: I2a9e58fe8642a89f12e1c34622b96613f3ec4c05 Reviewed-on: https://code.wireshark.org/review/11781 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-11-11Qt: fix cursor position when editing coloring rules names or filtersPascal Quantin1-11/+0
A call to setText will set the cursor to the end of the box. As far as I can tell, this call is useless so let's remove it. Bug: 11689 Change-Id: I40aee48745a9107331a017070a715a075106974a Reviewed-on: https://code.wireshark.org/review/11727 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-05Move utf8_entities.h to wsutilJoão Valverde1-1/+1
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0 Reviewed-on: https://code.wireshark.org/review/10786 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-07Finish removal of Q_UNUSED.Joerg Mayer1-2/+1
Todo: qcustomplot via upstream Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf Reviewed-on: https://code.wireshark.org/review/9547 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-06-25Qt: use <> for including the generated ui_*.h filesMartin Kaiser1-1/+1
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-05Qt: Add the capture and display filter dialog.Gerald Combs1-1/+0
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-04-26Include "config.h" first, even before <glib.h>, as is done in other files.Guy Harris1-3/+3
Also move system and GLib includes before Wireshark includes. Change-Id: I6636c9fdafb69b6dcf297d4c2632f5e8448e1d93 Reviewed-on: https://code.wireshark.org/review/8207 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-13Qt: More #include → forward declarations.Gerald Combs1-0/+5
Change-Id: Ib6de71f801cd3053374b6c867370acd594dcd396 Reviewed-on: https://code.wireshark.org/review/7089 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-02-07Add the profile name to the Coloring Rules window title.Gerald Combs1-1/+3
Matches GTK+ behavior. Change-Id: I3dedb1532b5e14cc18a3ff34fd5be89438912834 Reviewed-on: https://code.wireshark.org/review/7012 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-07WSUG: Update the Packet Colorization section.Gerald Combs1-1/+1
Change-Id: I0f880293bd185e202d230f0db1a6bc4cbe6cfbfb Reviewed-on: https://code.wireshark.org/review/7011 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-07Qt: Fix coloring rules reordering.Gerald Combs1-0/+1
Change-Id: I8bf36fffb3e3fc19c10c5f07db951cc5a4253556 Reviewed-on: https://code.wireshark.org/review/6998 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-07Qt: Add the Coloring Rules dialog.Gerald Combs1-0/+440
Merge in the old ColorDialog which was a placeholder for color_filter_add_cb. Change-Id: I48d188509f480b8514122b4011ac9d8790fcca10 Reviewed-on: https://code.wireshark.org/review/6996 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>