Commit Graph

42 Commits

Author SHA1 Message Date
Eugène Adell 6759377b93 TCP: Overriding of the automatic SEQ Analysis 2022-11-01 10:01:35 +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
Roland Knall 4e11aa1829 Qt: Show Preference key in the tooltip 2022-02-03 23:15:41 +00:00
j.novak@netsystem.cz 6c9cb8f3fa Prefs/Extcap: Added support for password which is never stored on the disk 2021-12-30 16:03:15 +00:00
Tomasz Moń e51a0cb4f4 Qt: Use QRegularExpression instead of QRegExp
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-26 09:10:42 +00:00
Joerg Mayer 5bb7e1606b Fix some of the compile errors when compiling with Qt6
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-11-24 10:31:16 +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
Tomasz Moń f67eccedd9 Qt: Do not spin unnecessary additional event loops
Show the dialogs asynchronously so no new event loops are created. This
not only simplifies stack traces (reduces the nesting level) but also
prevents hard to debug problems (eg. Bug 15743) from happening.

Change-Id: I85821a1403839a5baca504b40efce0ede2f1e0cb
Reviewed-on: https://code.wireshark.org/review/34646
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-10-01 03:53:46 +00:00
Gerald Combs 099e5dddf2 Qt: Switch module preferences to new-style signals and slots.
Switch ModulePreferencesScrollArea to compile time signals and slots.

Change-Id: Ic984c4a0b4538925f97e648695f4dcdc2699675c
Reviewed-on: https://code.wireshark.org/review/31127
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-19 19:51:58 +00:00
Gerald Combs 75be0027d0 Qt: Open our preference dialogs via "clicked" signals.
In ModulePreferencesScrollArea we create QPushButtons that open modal
UAT and file dialogs. Open them via the "clicked" signal instead of
the "pressed" signal. "clicked" is a general activation signal that
fires after the mouse button has been clicked+released or a keyboard
event. "pressed" fires before "released" and can be problematic in
some cases.

Bug: 15366
Change-Id: Icb353d86ae0a4b4b97e5f63df791ec562070756d
Reviewed-on: https://code.wireshark.org/review/31123
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-19 18:13:35 +00:00
Gerald Combs 62999cc677 Windows: Make sure more native dialogs handle HiDPI.
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-05-16 04:22:20 +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 830adb2a02 Qt: rework routine in module_preferences_scroll_area.
This removes a check that confuses clang and generates a false poritive.

Change-Id: Ib28b88b40e16ad300ba6d3df8334bd752a4fa7f1
Reviewed-on: https://code.wireshark.org/review/26171
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-03-07 10:43:49 +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
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
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-26 10:11:55 +00:00
Roland Knall ee699eb720 Qt: Move all utility widgets to widgets subdirectory
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-11 21:30:29 +00:00
Ahmad Fatoum b478df61f5 Qt: Provide both file save and open preferences
This is a breaking change.

prefs_register_filename_preference hasn't been differentiating
between files to be saved and ones to be opened.

On GTK, a neutral dialog is used, so no problems there.
On Qt, a save dialog has been always used, even in dissectors that
were reading configuration files without modification.

prefs_register_filename_preference now takes an argument to indicate
whether UI could be a save dialog with a warning on overwriting
a file, or whether it's a general purpose open file dialog.

Qt now does this. Previously no warning was shown on overwriting a file,
so it may be used for opening files too without irritating the user.
This has been changed, as non-destructive reads should now use
the open dialog.

Dissectors were changed accordingly.

Change-Id: I9087fefa5ee7ca58de0775d4fe2c0fdcfa3a3018
Reviewed-on: https://code.wireshark.org/review/21086
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-17 10:51:10 +00:00
Michael Mann 21a3b8cc71 Internalize struct preference
Move "struct preference" into prefs.c, essentially creating a "private"
structure to handle preferences. The 2 motivating factors were:
1. Better memory management so that clients/users of API don't have to worry
about it.
2. Hide the ugliness of the union stuff and make it transparent to the API.

A few bugs related to preference <-> Decode As integration were fixed
while in the neighborhood.

Change-Id: I509b9a236235d066b139c98222b701475e0ed365
Reviewed-on: https://code.wireshark.org/review/19578
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-01-22 10:43:57 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls
to QVariant conversions with VariantPointer where necessary

Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec
Reviewed-on: https://code.wireshark.org/review/19611
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 16:04:00 +00:00
Michael Mann 165c8b0422 Refactor range preference.
Refactored so that all handling of ranges in struct preference
can be internal to prefs.c

Change-Id: I68577909f9c07b23a16ab3443a523355d4645314
Reviewed-on: https://code.wireshark.org/review/19577
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-01-07 15:35:18 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Gerald Combs 1f633cfc84 Qt: Add html_escape to qt_ui_utils.
Add an html_escape convenience function, which escapes HTML
metacharacters using Qt::escape on Qt4 and QString::toHtmlEscaped on
Qt5. Use it where we were previously using #if QT_VERSION and calling
the API-specific functions.

Change-Id: Ifda3e9634a37fc00bdb46e08d5711f934692fef5
Reviewed-on: https://code.wireshark.org/review/17984
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: Roland Knall <rknall@gmail.com>
2016-09-29 19:41:25 +00:00
Stig Bjørlykke b28cd2dbd7 Qt: Word wrap static text preferences
The preferences static text may be too long for the preferences
dialog width, so set word wrap for this label.

Change-Id: I0828601b39a5e189de707087e317c598576fc3db
Reviewed-on: https://code.wireshark.org/review/17656
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-09-12 09:54:44 +00:00
Guy Harris ec691a9e20 De-canonicalize paths for file and directory path preferences.
Undo Qt's "helpful" canonicalization of paths returned by the file
dialogs to use / as the pathname component separator rather than using
the native pathname component separator.

Bug: 12117
Change-Id: I6077191a2204574ca50f53b5424f7f421db33db3
Reviewed-on: https://code.wireshark.org/review/14109
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-24 05:09:42 +00:00
João Valverde c00420efa2 Move utf8_entities.h to wsutil
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-10-05 14:34:53 +00:00
Peter Wu c647faa8a9 Fix various memleaks
Found by starting Wireshark within an empty profile, opening
Preferences, search for Protocol "IEEE 802.11" (because it has radio
buttons), then close everything again.

Many fixes are trivial, but the various recent_read_* functions in
recent.c were changed to return a boolean such that the result can
always be checked even if errno==0.

QButtonGroup leak was hinted by Clang Static Analyzer, all other
memleaks were found using ASAN/LSan.

Change-Id: Ia73f5d4c09d92f22e72377be59e23342f8ad7211
Reviewed-on: https://code.wireshark.org/review/10776
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-04 15:45:02 +00:00
Pascal Quantin 90062a32b7 Qt: fix applying UINT preferences in base 8 or 16
While we are at it:
- fix a crash when clicking on the cancel button from the preference modification context menu
- redissect the packet list when modifying a preference from the context menu

Bug: 11502
Change-Id: I7269f7093f1f38c46ec7744fd619ab67f31eb4e7
Reviewed-on: https://code.wireshark.org/review/10386
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-09-05 12:55:39 +00:00
Gerald Combs d8d3c52f1e Use an ellipsis character instead of three dots.
The OS X Human Interface Guidelines at

https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/TerminologyWording.html#//apple_ref/doc/uid/20000957-CH15-SW3

says:

"Be sure to create the ellipsis character using the key combination
 Option-; (Option-semicolon). This ensures that an assistive app can
 provide the correct interpretation of the character to a disabled user.
 If you use three period characters to simulate an ellipsis, many
 assistive apps will be unable to make sense of them. Also, three period
 characters and an ellipsis don't look the same because the periods are
 spaced differently than the points of an ellipsis."

The Windows desktop applications guidelines has a section on ellipses:

https://msdn.microsoft.com/en-us/library/windows/desktop/dn742478.aspx

but doesn't specify the a single glyph vs three dots.

The GNOME HIG at

https://developer.gnome.org/hig/stable/typography.html.en

says "Take Advantage of Unicode" then specifically says to use U+2026
HORIZONTAL ELLIPSIS.

Remove the ellipsis from "Find Next" and "Find Previous". Neither
requires user interaction.

Change-Id: I0e6c28bb8b3a84b242731e2ca96f1a6f6f42c303
Reviewed-on: https://code.wireshark.org/review/9833
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-07-31 18:55:06 +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 e08bc0dd62 Don't warn about overwriting filename preferences.
When specifying a filename preference (e.g. the SSL pre-master secret
log filename) don't warn about overwriting the file. Most of the time
we're reading the file and when we're not (e.g. for the SSL debug log)
overwriting it is kind of the point.

Preference descriptions are plain text. We display them in tooltips as
rich text. Convert them accordingly.

Fixup some of the SSL preference descriptions.

Bug: 11010
Change-Id: I4f1b1f3dd270c01648d9dd52ae20381c3c0d2e37
Reviewed-on: https://code.wireshark.org/review/8665
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-28 02:21:33 +00:00
Gerald Combs c280a40443 Qt: Escape ampersands in checkboxes and radio buttons.
Convert "&" to "&&" in checkbox and radio button preference labels so
that they aren't interpreted as shortucts. Fixes

QKeySequence::mnemonic: "Attempt to dissect LCID 1&2 as srb1&2" contains multiple occurrences of '&'

Change-Id: Iacab6f81db01e6eca2cfdbaeda666f2e9c1016ed
Reviewed-on: https://code.wireshark.org/review/7346
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-24 18:35:16 +00:00
Gerald Combs 91e4330394 Qt: Convert more dialog titles.
Change-Id: I9c3e3471a92b7af9347a541bece3d9405d37dce0
Reviewed-on: https://code.wireshark.org/review/6193
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-31 22:48:17 +00:00
Stephen Fisher 10803f2119 Second attempt at putting a description in the preferences page
Change-Id: I6d196486e824c82d29f1c233ef3230ad8619715d
Reviewed-on: https://code.wireshark.org/review/5434
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-11-24 17:28:22 +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
Gerald Combs 2f11c8f1ff Add a bunch of tooltips.
svn path=/trunk/; revision=54081
2013-12-14 00:07:27 +00:00
Gerald Combs a05f55bffc Add a UAT dialog. Make UAT preferences uat_t * instead of void *.
C++-ize the UAT headers.

Add an ElidedLabel widget. Use it in the File Set, Profile, and UAT
dialogs.

Update the Qt README.

svn path=/trunk/; revision=50896
2013-07-25 23:49:47 +00:00
Alexis La Goutte a80ad2f9f2 Add Some missing text to translate
svn path=/trunk/; revision=49271
2013-05-13 20:23:46 +00:00
Gerald Combs d21f62b73b Add a directory name preference type (PREF_DIRNAME) and registration
routine (prefs_register_directory_preference). Add PREF_FILENAME and
PREF_DIRNAME support to the Qt module preferences. Change a couple of
preferences to directory names.

Clean up some names and default settings.

svn path=/trunk/; revision=47573
2013-02-08 18:07:34 +00:00
Gerald Combs 24d67b60ab Add a ModulePreferencesScrollArea widget which builds a scrollable frame
for a preferences module. Use it to fill in the remaining preferences.
Don't show the printing preferences since they're not used here.

Change the titles and tooltips for some of the name resolution
preferences.

Disable the capture preferences if we can't capture. This is different
from the GTK+ version which hides it completely.

Thus concludes the preferences dialog (for the time being).

svn path=/trunk/; revision=47545
2013-02-08 01:16:46 +00:00