Commit Graph

33 Commits

Author SHA1 Message Date
João Valverde e7f439bc2f Convert capture file regex search to PCRE2.
Replace the use of the obsolete GRegex with PCRE2.

Fixes a crash reported in issue #17500.
2022-07-27 11:21:03 +00:00
Gerald Combs 80de95ca71 Qt: Split MainApplication out from WiresharkApplication.
Move WiresharkApplication.{cpp,h} to MainApplication.{cpp,h}. Add back
WiresharkApplication as a thin superclass of MainApplication, similar to
LogsharkApplication. Change all of our wsApp references to mainApp. We
will likely have to change many or most of them back, but that's a
commit for another time.
2022-04-04 09:39:27 -07:00
João Valverde 145ba2e071 Rename a variable that clashes with GLib 2021-06-19 02:34:36 +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
Gerald Combs d2da4c7afb Qt: Use … instead of UTF8_HORIZONTAL_ELLIPSIS in translated strings.
Run

$ gsed -i -e 's/\(tr *(.*".*\)" *UTF8_HORIZONTAL_ELLIPSIS/\1…"/' $( ag -l 'tr *\(.*" *UTF8_HORIZONTAL_ELLIPSIS' )
$ gsed -i -e 's/\(tr *( *\)UTF8_HORIZONTAL_ELLIPSIS *"/\1"…/' $( ag -l 'tr *\( *UTF8_HORIZONTAL_ELLIPSIS *"' )

in ui/qt. As discussed in #16812, the UTF8_ macros were required at one
time because we only allowed ASCII in our source code. However, that
requirement has since been relaxed and Qt's translation framework
doesn't handle concatenating strings and macros very well.
2020-10-01 06:40:14 +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
Stig Bjørlykke f54611d110 Qt: Pop filter syntax in search frame
Pop the filter syntax message in search frame when changing search type
and when hiding the widget to avoid having outdated status messages.

Change-Id: I87c63c070621cff0d5ecebc2fcd41f9d7c02adec
Reviewed-on: https://code.wireshark.org/review/38051
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 14:59:15 +00:00
Martin Mathieson 0162ba730a Enable display filter autocomplete on find packet search.
Bug: 16638
Change-Id: Ifd9c9e4392fdc3d32b2aa4466d5a7f2835893338
Reviewed-on: https://code.wireshark.org/review/37682
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-05 07:46:41 +00:00
Gerald Combs e37a7abf56 Remove duplicate status messages.
Adding back progress titles in g3069129fe5 revealed the fact that we had
duplicate messages in the Qt UI and in file.c. Remove the ones in file.c
in favor of the Qt UI, since the latter are translated.

Change-Id: I5ff8f1bd34e963e9e66c01420ad8c5fe9c2f0caa
Reviewed-on: https://code.wireshark.org/review/36646
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-02 08:13:06 +00:00
Roland Knall 3c8c392b9d Qt: Cleanup push/pop Infos
Currently push pop is propagated by a massive load of signals
which partly are also propagated through parent objects.

This moves the status handling to WiresharkApplication, also
pathlining future moves to move status to different classes or
use additional methods of status information

Change-Id: Ibcb2c98688f1adf40dce1483f336596ef992bb06
Reviewed-on: https://code.wireshark.org/review/35071
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>
2019-11-12 22:03:23 +00:00
Stig Bjørlykke b9be965b27 Qt: Store recently used find packet settings
Store the last used find packet settings in the global recent file,
and load this settings on startup.

Change-Id: I38081311cb06b4f398f4dfb66b659ae7d26ccac2
Reviewed-on: https://code.wireshark.org/review/34512
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-09-13 06:27:29 +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
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Stig Bjørlykke 89ae2826d6 Qt: AccordionFrame users keyPressEvent() fixes
- Declare keyPressEvent() virtual.
- Give keyPressEvent() to parent when done.

Change-Id: If1c05e86a5ab71dd239c025cdb2bcfb1ef484811
Reviewed-on: https://code.wireshark.org/review/24573
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-25 09:30:21 +00:00
Roland Knall d83176ed2e SearchBar - Focus on shortcut instead of closing
If the searchbar is already open focus on the bar and highlight
existing test, instead of closing an already open bar

Change-Id: I4f8ae2e903cb65c0ebca238f3bcc1c62b63b5c3b
Reviewed-on: https://code.wireshark.org/review/22223
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-19 15:23:15 +00:00
Gerald Combs 60cdee9e30 Qt: Handle unhandled filter actions.
Handle FilterAction::ActionColorize and ::ActionFind. Remove
::ActionConversation since it was unused. Assert when we encounter a
missing FilterAction, similar to what we do in other parts of the code.

Bug: 12363
Change-Id: I5c1ecd488e5bdb9700a80fc70ec7c047311054b6
Reviewed-on: https://code.wireshark.org/review/16131
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-06-26 06:10:51 +00:00
Stig Bjørlykke 30d83e089c Qt: Add regex support in Find Packet
Add support for using regular expressions in the Search Frame
when searching in packet list, packet details and packet bytes.

This search is in many cases faster than plain string search.

Change-Id: I2d8a709046f90d7b278fb39547fc4e2e420623bc
Reviewed-on: https://code.wireshark.org/review/13981
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>
2016-02-18 08:06:46 +00:00
Pascal Quantin 75da6960e0 Qt: set focus to text box when opening search frame
Change-Id: Iac932365bc2fa7a5d5102a5f5455ea01daa86590
Reviewed-on: https://code.wireshark.org/review/12236
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-28 07:46:39 +00:00
Martin Kaiser 534d1d5eae Qt: use <> for including the generated ui_*.h files
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-25 17:11:19 +00:00
Gerald Combs 6e88978fd9 Qt: More #include → forward declarations.
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-13 02:31:16 +00:00
Gerald Combs b3f3dd8d82 Qt: Fix preference change behavior.
Main window:

Keep track of our current layout and only change it if the preferences
change. This keeps the panes from resizing.

Re-select the current packet if the layout changes so that the proto
tree and byte view aren't left in an invalid state. This fixes a crash
similar to bug 10896.

Search frame:

Get rid of an invalid error message. Update coding style.

I don't think any of these fix bug 10921 since Xiaochuan seems to get a
crash immediately upon opening the dialog.

Change-Id: I0e880a50d3c9ac1c6ae6a01034b05fd2249444f4
Reviewed-on: https://code.wireshark.org/review/6989
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-06 23:23:02 +00:00
Guy Harris cfcbb28671 Clean up ftype-conversion and dfilter error message string handling.
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>
2015-01-18 10:22:59 +00:00
Michal Labedzki 5025bc258c Qt: Dynamic languages
- 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-11-04 08:21:55 +00:00
Gerald Combs a5cb72fe9e Add a Qt I/O Graph dialog.
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-04-07 20:56:42 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Jörg Mayer 9db6d700cd The porting guide for Qt5 requires that Q_OS_ be used instead
of Q_WS_ in Qt4 projects
See:
http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html

svn path=/trunk/; revision=49013
2013-04-24 11:07:25 +00:00
Evan Huus 2f63301d1f Remove one unneeded initializer and add one missing initializer, as found
by CppCheck.

svn path=/trunk/; revision=46700
2012-12-22 20:53:09 +00:00
Gerald Combs 7cf5334332 Add an AccordionFrame class which can animate showing and hiding (except
when we detect a remote connection). Use it for the "go to" and search
frames. Properly detect remote connections in the splash overlay.

svn path=/trunk/; revision=46591
2012-12-18 17:21:20 +00:00
Gerald Combs 81c2fd6cbe Set SVN properties.
svn path=/trunk/; revision=46542
2012-12-15 01:05:17 +00:00
Gerald Combs 5c2c5aed87 Rename the search type menu items to more accurately reflect what we're
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-15 01:04:39 +00:00