aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/display_filter_edit.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-07-11Qt: Move all utility widgets to widgets subdirectoryRoland Knall1-580/+0
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-2/+2
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-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>
2017-03-04Qt: Apply selected bookmark display filterStig Bjørlykke1-2/+7
When selecting a display filter from the bookmark list this filter should be applied, because that's the most common action for a user. Holding down the the Alt key will only prepare the filter. Change-Id: I567ee8a2a70a3de07fea33fa5763d9efba591de3 Reviewed-on: https://code.wireshark.org/review/20317 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
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-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: Update display filter bookmarks when list changedStig Bjørlykke1-26/+66
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-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-18Qt: Fixup the Display Filter Expression syntax logic.Gerald Combs1-7/+1
In the Display Filter Expression dialog, only disable the OK button when we have an invalid filter. Move the deprecated warning string from DisplayFilterEdit::checkFilter to SyntaxLineEdit::checkDisplayFilter so that we can use it in more places. Change-Id: I938f5f10258f4fd9dd3a33c174dd9958c9634766 Reviewed-on: https://code.wireshark.org/review/13317 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-16Label the filter in the file open dialog as a "read filter".Guy Harris1-25/+30
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-10-27Qt: Add a filter expression item to the display filter edit menu.Gerald Combs1-0/+7
Add an item to the display filter bookmark menu which opens the filter expression preferences. We also need an expression editor frame similar to the column editor frame, but hopefully this will suffice until that exists. Change-Id: If4c159bb769f0f8e7f89db55f1c6fd7c0bf65c87 Reviewed-on: https://code.wireshark.org/review/11315 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-10-05Move utf8_entities.h to wsutilJoão Valverde1-2/+2
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-95/+1
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-09-07Add a URL for the tooltip bug.Gerald Combs1-3/+5
It should be fixed in Qt 5.5.1. Change-Id: I32fa11accdd6bea953341dd6b4914686cacda98e Reviewed-on: https://code.wireshark.org/review/10419 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-07Re-enable display filter editor tooltips.Gerald Combs1-6/+29
Enforce correct "leave" behavior using a timer. Change-Id: I59b8fd08c27fd463363bdda090fb9c24f664d9eb Reviewed-on: https://code.wireshark.org/review/10408 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-09-06Disable display filter tooltips for now.Gerald Combs1-24/+25
Comment out the setToolTip call in DisplayFilterCombo. The function applies to the entire control, but the text only makes sense for the drop-down arrow. Remove the tooltip for the clear button in DisplayFilterEdit. If the purpose of the "X" symbol isn't obvious then we aren't doing our job properly. Comment out the other setToolTip calls in DisplayFilterEdit for now since they interfere with leaveEvents. Add a note about a possible workaround. Change-Id: I055a30b6a5b5e07cebf1fa36e217654d390d34d0 Reviewed-on: https://code.wireshark.org/review/10405 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-06Display filter edit updates.Gerald Combs1-79/+204
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-08-20Make sure we can apply deprecated display filters.Gerald Combs1-3/+3
Deprecated filters are still valid. Update display filter checks to make sure we can apply them. Bug: 11438 Change-Id: Ib5e009c070b40912434e0ffd771203ed1e1ba093 Reviewed-on: https://code.wireshark.org/review/10154 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-20Make empty filter valid in checkFilterStig Bjørlykke1-1/+1
Change-Id: Ia5293a228a7044a4cd01b3b2f62f1d7a8f7747e2 Reviewed-on: https://code.wireshark.org/review/10145 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-18Qt: Syntax check display filter when fields changedStig Bjørlykke1-0/+7
Change-Id: I7179d7918e7958373806fb9627a36554ab4b9ddc Reviewed-on: https://code.wireshark.org/review/10115 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-06-03Add the Display Filter Expression dialog.Gerald Combs1-58/+78
Changes from the GTK+ UI: - The display filter is built on the fly with immediate syntax feedback. - Slightly different layout. - You can search for fields. Make the plain SyntaxLineEdit a bit more plain. Bug: 11128 Change-Id: I06a48cd7b9ba7b9dc193b0199540aede4eb62fa7 Reviewed-on: https://code.wireshark.org/review/8742 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-20Add capture filter autocompletion.Gerald Combs1-138/+5
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-19Autocomplete saved display filters.Gerald Combs1-20/+40
Add saved display filters to the completion list. Fix a complex filter completion bug. Change-Id: I035923882fd8d6232d0b69e464bb1517f261dbd9 Reviewed-on: https://code.wireshark.org/review/8533 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-14Pop the display filter status when it loses focus.Gerald Combs1-0/+7
Change-Id: I7878fd99f8b773f8c550a6d2416e9e2d44abd321 Reviewed-on: https://code.wireshark.org/review/8466 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14Don't complete the current field.Gerald Combs1-2/+4
Change-Id: If2b16783d08d23df427ac9b9c86984245db56d53 Reviewed-on: https://code.wireshark.org/review/8465 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14Fix display filter completion behavior.Gerald Combs1-9/+5
Allow completion for mismatched protocol and filter names. Change-Id: I1d1e6b8f16d4d2d331b915c199f857835dcc1c53 Ping-bug: 11187 Reviewed-on: https://code.wireshark.org/review/8464 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14Add a comment explaining completion misbehavior.Gerald Combs1-0/+5
Note that field name completion won't work correctly if a field's abbrev doesn't match its protocol filter name. Fixing this is left as an exercise for the reader. Change-Id: Ia9b55f20bf58b8252e27506bcce4a0dd71cc199c Reviewed-on: https://code.wireshark.org/review/8460 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-13Try to avoid duplicate display filter completions.Gerald Combs1-11/+23
When adding recent filters to the completion list, skip over items that look like fields and assume they'll be added further down the line. Change-Id: Ief1e7aeebf91504becc2e07ba9cad66a90d8c7f3 Reviewed-on: https://code.wireshark.org/review/8453 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-12Qt: Display filter completion fixes.Gerald Combs1-6/+7
Fixup the logic for adding field names to the list. Connect our completer activation signal to its slot once, not twice. Bug: 11187 Change-Id: Ife1879fe05c870094ee31e59dd62e3004f588bfc Reviewed-on: https://code.wireshark.org/review/8440 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-11Speed up display filter completion.Gerald Combs1-2/+3
Don't loop over non-matching fields. This improves completion performance considerably on Windows (where it was noticeable). Change-Id: I7f526fe960c5c41da5ae847b04be25d65ca42bb1 Reviewed-on: https://code.wireshark.org/review/8418 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-11Qt: Provide a hint about the current display filter field.Gerald Combs1-0/+13
If the field under the DisplayFilterEdit cursor is valid, push its description. In the main window this shows up in the status bar. Change-Id: I7ba1255694941c64aa8cce896283a426b9a69f2c Reviewed-on: https://code.wireshark.org/review/8413 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-11Qt: Add display filter completion.Gerald Combs1-17/+214
Add completion to DisplayFilterEdit. Disable autocompletion in DisplayFilterCombo. New behavior: If we're at the beginning of the entry "recent" display filters appear at the top of the list. Start using QLineEdit::placeholderText while we're here. Bug: 10923 Ping-Bug: 9254 Change-Id: Ic8dd37768abb83d50d4e6c849bb51095fc3742d2 Reviewed-on: https://code.wireshark.org/review/8360 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-4/+2
Have dfilter_compile() take an additional gchar ** argument, pointing to a gchar * item that, on error, gets set to point to a g_malloc()ed error string. That removes one bit of global state from the display filter parser, and doesn't impose a fixed limit on the error message strings. Have fvalue_from_string() and fvalue_from_unparsed() take a gchar ** argument, pointer to a gchar * item, rather than an error-reporting function, and set the gchar * item to point to a g_malloc()ed error string on an error. Allow either gchar ** argument to be null; if the argument is null, no error message is allocated or provided. Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c Reviewed-on: https://code.wireshark.org/review/6608 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-04Qt: Dynamic languagesMichal Labedzki1-0/+22
- get language as soon as possible (before creating any Qt objects) to make all translations working - dynamic list of supported languages - runtime change of GUI language (no need to restart application) - add flags icons support - search for *.qm languages in buildin resources, then data dir called "languages" (main directory in sources or /usr/share/wireshark/languages), then user directory (UNIX: ~/.wireshark/languages); "languages" directory should contains files wireshark_xx.qm where xx is language code (en, en_GB, etc.), and optional xx.svg for flag icon - try to fix some untranslated manually-created UI items (need manual reset text of those components) Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229 Reviewed-on: https://code.wireshark.org/review/5041 Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-04-07Add a Qt I/O Graph dialog.Gerald Combs1-31/+20
For each graph you can set: - Its visibility - A name - A display filter - Color, from a fixed list - Plot style: Line, Impulse, Bar, Stacked Bar, Dot, Square, Diamond - Basic Y Axes (packets/s, bytes/s, bits/s) - Computed Y Axes (SUM, MIN, AVG, MAX) - Smoothing You can pan and zoom using the mouse and keyboard. Clicking on a graph selects the last packet for that interval. If all graphs have the same Y axis a single label is shown, otherwise a legend is shown. The time scale (X axis) can be toggled between relative seconds and the time of day. Graphs can be saved as PDF, PNG, BMP, and JPEG. Settings are "sticky" via the io_graphs UAT. To do: - Minimize graph drawing delays. - Figure out why smoothing differs from GTK+ - Everything else at the top of io_graph_dialog.cpp - Fix empty resets. A fair amount of code was copied from TCPStreamDialog. We might want to subclass QCustomPlot and place the shared code there. Move common syntax checking to SyntaxLineEdit. Move some common code from ui/gtk/io_stat.c to ui/io_graph_item.[ch] and use it in both GTK+ and Qt. Make the io_graph_item_t array allocation in io_stat.c static. The behavior should be identical and this gives us additional compile-time checks. Change-Id: I9a3d544469b7048f0761fdbf7bcf20f44ae76577 Reviewed-on: https://code.wireshark.org/review/435 Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
2014-03-12Fix bug 9866: Qt 'Clearing filters does not seem to affect the packet list'Hadriel Kaplan1-1/+18
Clicking the "X" clear filter button now applies the clearing to the displayed packet list. This commit also adds tooltips for the display filter display filter box's butons. Change-Id: I827020a7705a32a4a9204d22e94942853e25bba6 Reviewed-on: https://code.wireshark.org/review/601 Reviewed-by: Evan Huus <eapache@gmail.com>
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-12-03Include <epan/dfilter/dfilter.h> in files that use display filterGuy Harris1-0/+1
routines. svn path=/trunk/; revision=53772
2013-04-24The porting guide for Qt5 requires that Q_OS_ be used insteadJörg Mayer1-2/+2
of Q_WS_ in Qt4 projects See: http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html svn path=/trunk/; revision=49013
2013-02-06Add Filter Expressions^WButton^WShortcut^WBookmark preferences. Gerald Combs1-5/+12
Add comments noting that - We might want to do something different when the bookmark button is pressed. - The display filters (dfilters file) and gui.filter_expressions preferences should be merged. - Many buttons on Qt4 + OS X + unifiedTitleAndToolBarOnMac makes the main window really wide. Add a qstring_strdup convenience routine. Add "disabled" display filter edit icons. Fix up whitespace and descriptions in a couple of places. svn path=/trunk/; revision=47522
2012-12-15Rename the search type menu items to more accurately reflect what we'reGerald Combs1-3/+1
actually doing and what users are likely to want to do. Rename the search enum values and functions to reflect what we're actually doing and add a comment explaining why making searches more correct might make searching worse. Add a search bar to the Qt main window, thus continuing the War On Gratuitous Dialogs. Clear out any previous temporary label stack items before adding a new one. svn path=/trunk/; revision=46541
2012-12-07Use a different border color on OS X.Gerald Combs1-0/+4
svn path=/trunk/; revision=46458
2012-12-07Set the height of the resize and apply buttons. Simplify some geometry.Gerald Combs1-2/+4
svn path=/trunk/; revision=46453
2012-12-07Properly resize the bookmark button so that the image centers properly.Gerald Combs1-20/+15
Adjust CSS. svn path=/trunk/; revision=46451
2012-12-07Implement the items under "Edit→Copy", "Analyze→Apply as Filter" andGerald Combs1-43/+19
"Analyze→Prepare a Filter". Add a context menu to the protocol tree and fill in the items we've implemented so far. Add an "applyAllPreferences" method and corresponding "preferencesUpdated" signal to wsApp. Use it to set the maximum display filter combo count. Move the packet filtering code from the display filter edit to the main window (which makes more sense and matches what we're doing in the GTK+ version and gets rid of more global cfile references). Try to center the display filter edit button images. Use a different "close" button in the main toolbar. It looks better but is still wrong (on OS X at least). svn path=/trunk/; revision=46434
2012-12-05Fix some C++ abuses that Guy found via LLVM.Gerald Combs1-0/+3
svn path=/trunk/; revision=46408
2012-10-13Reduce variable scopes where possible.Evan Huus1-1/+1
svn path=/trunk/; revision=45518
2012-10-08Add a PacketRangeGroupBox widget. Use it to implement "Export SelectedGerald Combs1-41/+14
Packets". Not yet tested on Windows. "Ignore Packet" hasn't been implemented so we can't test that either. Create a SyntaxLineEdit widget from the QLineEdit code in DisplayFilterEdit. Use it in the file import and export dialogs and the PacketRangeGroupBox widget. This lets us provide instant feedback instead of popping up an error dialog. Expand the Tango color list based on http://emilis.info/other/extended_tango . Rearrange QtShark.pro to (hopefully) work better with Qt Creator. svn path=/trunk/; revision=45405
2012-09-04Add modelines for Qtshark fileAlexis La Goutte1-0/+13
svn path=/trunk/; revision=44766