summaryrefslogtreecommitdiff
path: root/ui/qt/capture_filter_edit.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20memory leak: Qt code doesn't pass 'parent' argument to some Qt class ↵Max Dmitrichenko1-1/+1
constructors found with valgrind Change-Id: I2d73bd50a6f0e13b1817c8a518189c0e56558f72 Reviewed-on: https://code.wireshark.org/review/21227 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-09Pull the error reporting into {read,save}_filter_list.Guy Harris1-12/+1
Change-Id: I4d9582661f2f1728d400eeb2a1b1dea98f32ce7f Reviewed-on: https://code.wireshark.org/review/20982 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09Move the filter file reading code to libui.Guy Harris1-1/+1
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>
2016-11-13Qt: populate Bookmarks menu in capture options dialogPeter Wu1-0/+1
The bookmarks menu is populated for the main window when the appInitialized signal is emitted, this ensures that any preferences are applied. For the Capture Options dialog however, the appInitialized signal is never triggered since the GUI has already started. Just invoke it from the constructor such the menu is populated at least once. Bug: 12986 Change-Id: I04457fd25e52a25714ac471131b90e3a128515d8 Reviewed-on: https://code.wireshark.org/review/18734 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-06Remove old Qt code.Gerald Combs1-26/+0
Our minimum version has been 4.7 for a while. Remove dead QT_VERSION_CHECK code. Change-Id: Ia003c1aa4275eefdda707975774d886643ff1538 Reviewed-on: https://code.wireshark.org/review/16888 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-02-26Qt: Update selected interface filter behavior.Gerald Combs1-14/+45
Change the selected interface behavior in the main window and the capture interfaces dialog to better handle multiple selections. Attempt to document this at the top of interface_tree.cpp. Move the default capture filter code from CaptureFilterEdit to MainWelcome. Add a "conflicting filter" check to CaptureEdit which updates the placeholder text. Handle conflicting filters in the main welcome screen and the capture interfaces dialog. Propagate interface selections and filter updates in the capture interfaces dialog to the main welcome screen. Consolidate some of the interface handling code in InterfaceTree and CaptureInterfacesDialog. Make sure CaptureInterfacesDialog manages the global capture options by device name instead numeric index. Start deprecating prefs.capture_devices_filter and capture_dev_user_cfilter_find. Change some member function names so that they're hopefully more clear and consistent. Ping-Bug: 11886 Change-Id: I63b06dbae29c2c45ee9252092ad54bdcbacae6e6 Reviewed-on: https://code.wireshark.org/review/14129 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-02-25Qt: Emit textEdited from CaptureFilterEdit in more places.Gerald Combs1-1/+12
We should emit textEdited whenever the user changes the text interactively. Do so when the user clicks the clear button or selects a recent filter. We might want to copy this to DisplayFilterEdit. Change-Id: Icf02fead52947fcef6e7e617b0c49bfc9e1aec65 Reviewed-on: https://code.wireshark.org/review/14144 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-01-30Update filter bookmark icons.Gerald Combs1-2/+2
Separate the capture and display filter bookmark icons. Make the capture icon green to match(-ish) the active capture icon. Tested on nice+new and janky+old displays. Change-Id: I6ed532c8a49da50fe2a7de3d8fbd0b1af7623b4a Reviewed-on: https://code.wireshark.org/review/13612 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: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-28Qt: Enable capture filter bookmarksStig Bjørlykke1-9/+149
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-27Allow/Create an option to use "capture filter" labels defined in wireshark ↵Mike781-1/+1
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-08Add a Busy status to SyntaxLineEdit.Gerald Combs1-38/+9
For CaptureFilterEdit it's possible to have an indeterminate state while we're waiting on name resolution. Add a Busy status to SyntaxLineEdit and set the text color to a mix of the normal foreground and background colors (gray on most platforms). Make the Busy state valid so that we don't have to wait on an annoyingly-long name resolution to start capturing. Update the global capture option filters using the main welcome capture filter when we start a capture instead of when we've finished checking the filter syntax. Connect the CaptureFilterEdit returnPressed signal no matter what so that we can start a capture by pressing return in the welcome screen CaptureFilterEdit. Add a fake resolution timeout to the CaptureFilterSyntaxWorker debug code to make testing the different states easier. Bug: 11950 Change-Id: I0cf01c0fbc0dd8065cdf5a91f1d6b224291b1ce6 Reviewed-on: https://code.wireshark.org/review/13110 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-01-05Qt: Show capture filter warningStig Bjørlykke1-1/+1
Change-Id: I080bcb25edcee0c38984cd1a7f7f36a7fd3ff36c Reviewed-on: https://code.wireshark.org/review/13055 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-05Qt: Don't check capture filter for user DLTsStig Bjørlykke1-8/+8
This makes it possible to use a capture filter on an interface with user DLTs (147-162). Bug: 11656 Ping-Bug: 11668 Change-Id: Ie9931b27e8dc8ea239e7e04e26d0ae1cacba50c9 Reviewed-on: https://code.wireshark.org/review/12996 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>
2015-12-11Fix memory leaks in all_ifaces when interface list changesMikael Kanstrup1-0/+1
Valgrind report leaks of several allocations like these: 590 bytes in 50 blocks are possibly lost in loss record 29,818 of 31,670 at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xCB9C8A7: __vasprintf_chk (vasprintf_chk.c:82) by 0xA3D8DCA: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0xA3B846C: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0xA3B850B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0x6F4B51: scan_local_interfaces (iface_lists.c:254) by 0x6EF3D8: iface_mon_handler2 (iface_monitor.c:113) by 0xBE56F1D: ??? (in /lib/libnl-3.so.200.3.0) by 0xBA16F19: ??? (in /usr/lib/libnl-route-3.so.200.3.0) by 0xBE54E5E: nl_cache_parse (in /lib/libnl-3.so.200.3.0) by 0xBE585CA: nl_msg_parse (in /lib/libnl-3.so.200.3.0) by 0x6EF372: iface_mon_handler (iface_monitor.c:123) When the list of network interfaces is updated allocations done for global_capture_opts.all_ifaces elements leak memory. Fixed by introducing a helper function to be used for removing an interface_t element from all_ifaces array. While at it also fixed misc leaks when updating individual allocated records of all_ifaces elements. Change-Id: I035e6936a44edeef2ebe4780931c14cde99e93a4 Reviewed-on: https://code.wireshark.org/review/12209 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
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-09-11Make StockIconToolButton independent.Gerald Combs1-65/+35
A recent set of changes replaced the "dfilter_erase_" images with an "x-filter-clear" stock icon set. Move StockIconToolButton to its own compilation unit. Use it in CaptureFilterEdit and ProgressFrame to load the "x-filter-clear" icon. Bug: 11516 Change-Id: I5d5864d089fb56827d130d493d53e7de6a7c03b5 Reviewed-on: https://code.wireshark.org/review/10475 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-05Qt: Add the capture and display filter dialog.Gerald Combs1-32/+46
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-05-21Fixup capture filter completion logic.Gerald Combs1-1/+7
Don't add the current word to the completion list. Change-Id: Ia475520092f461c9e7b03f82cc3427585e095162 Reviewed-on: https://code.wireshark.org/review/8577 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-20Autocompleting "and" and "or" probably isn't useful.Gerald Combs1-2/+2
Change-Id: Ia16a02a616fd052eeaa9eceff76bc1b20ee8d82e Reviewed-on: https://code.wireshark.org/review/8553 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-20Add capture filter autocompletion.Gerald Combs1-4/+71
Autocomplete on recent and saved capture filters along with the primitives in gencode.l in the libpcap sources. Move common autocomplete code to SyntaxLineEdit. Change-Id: I0931a6775bacf9c917c294befbbdaade51d19b93 Reviewed-on: https://code.wireshark.org/review/8542 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-05-11Use setPlaceholderText in CaptureFilterEdit.Gerald Combs1-2/+7
Matches a recent change in DisplayFilterEdit. Change-Id: I22d0f4a327ecae0e2065302a003037d19162b74d Reviewed-on: https://code.wireshark.org/review/8401 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-10-11Try to fix Qt compilation when libpcap is disabled.Gerald Combs1-0/+4
svn path=/trunk/; revision=52552
2013-08-31Set our connection capture filter in main() similar to the GTK+ version.Gerald Combs1-2/+7
svn path=/trunk/; revision=51621
2013-08-08Add initial capture filter support.Gerald Combs1-0/+354
Add CaptureFilterCombo and CaptureFilterEdit classes, similar to their display filter counterparts. Add a CaptureFilterSyntaxWorker class which runs a syntax check in a background thread similar to the threaded code in capture_dlg.c. Add a bunch of related signal and slot plumbing. Other minor fixups. svn path=/trunk/; revision=51200