Commit Graph

117 Commits

Author SHA1 Message Date
João Valverde 84f963dfa2 Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
João Valverde 133bebb18b Qt: Fix build with Qt version < 5.14 2023-01-21 12:14:07 +00:00
João Valverde 39124f2f8f Fix Personal Extcap folder path
The personal extcap folder $XDG_CONFIG_DIR/wireshark on Linux is
inconsistent with the global extcap folder (lib/wireshark/extcap)
and personal plugins folder (.local/lib/wireshark/plugins) and also
the configuration folder should not contain architecture-specific files.

The extcap personal folder is changed from:

    .config/wireshark/extcap

to:

    .local/lib/wireshark/extcap
2023-01-20 22:30:26 +00:00
João Valverde d7427e73af Qt: Fix capitalization of About->Folder characterization
Capitalize Lua as a proper name.

Uncapitalize "Extcap Paths" for consistency.
2023-01-20 14:55:23 +00:00
João Valverde c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
João Valverde 2ab291b3b2 GUI: Ship license + acknowledgements as Qt resource 2023-01-19 19:14:32 +00:00
Pau Espin 0c7e8ce9a5 ui: Fix Qt deprecation messages
Related: https://gitlab.com/wireshark/wireshark/-/issues/18358
2022-09-21 16:29:10 +02:00
Gerald Combs 55de00662d Qt: Clean a couple of context menus.
Set the Qt::WA_DeleteOnClose property on our packet list header and
about dialog context menus.
2022-09-12 20:16:23 +00:00
João Valverde 5a430097b0 About: Reformat and expand some text. 2022-08-03 09:10:07 +00:00
João Valverde 2c4557d7ad About: Tweak a sentence about the project
Uncapitalize Open Source Software. Prefer the well established umbrella
term "free and open source software". Add specifics about the license
version.

Most references use an hyphen with "open-source". Do that as well.
2022-08-02 00:26:24 +00:00
João Valverde a97e1ee581 About: Make clipboard info a close copy of dialog info
To maintain familiarity and keep to expectations do an exact copy.

The last sentence to check the man page is an exception because it
is an addenda and recognizing that this clipboard information will
be used mostly in bug reports, it might get annoying.
2022-08-02 00:26:24 +00:00
João Valverde b8ec3199ab Convert Acknowledgements to markdown and update GUI
Move Acknowledgements to a separate file to enable some code
simplification and improve maintenance and discoverability
for acknowlegements.

Convert the Acknowledgements file to Github flavored markdown
and display it in rich text using QTextBrowser.

Add Acknowledgements.md to NSIS installer
2022-08-02 00:09:29 +00:00
João Valverde 35f3fe1b1d Qt: Enable About->License external hyperlinks
Replace QTexteEdit with QTextBrowser and enable external
hyperlinks.
2022-07-27 16:30:48 +00:00
João Valverde d2b6b89b94 Update license file structure and GUI display
Add the text of the GPLv2 in HTML, taken from the FSF website,
and use rich text to display the license in the GUI.

Move the introductory note about the GPL from the COPYING
license text file to the README.

Remove various other license callouts at the end of the COPYING file
as unnecessary and unhelpful. This information is present in
each source file, where it belongs.
2022-07-21 19:10:06 +00:00
João Valverde c5b47cb839 Qt: Remove some bogus entries from Authors list
Some lines in Acknowledgements are mistakenly matching the regular
expression to capture authors and email addresses, resulting in
bogus authors entries.

Stop matching authors after we reach the Acknowledgements section.
This matches the structure of the AUTHORS-SHORT file and fixes the
bogus entries.
2022-06-15 06:46:50 +01:00
John Thacker e1a6913a2b qt: Ignore gcc 12.1 optimization bug with Qt
The Qt implicit casts from QByteArray to QString all use
size = -1, meaning to the end of the string.

This causes gcc 12.1 with -O2 to produce a very dubious stringop-overread
warning, by computing both sides of a branch even when it shouldn't:

/usr/include/qt5/QtCore/qstring.h:706:69: error: ‘size_t strlen(const char*)’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  706 |         return fromUtf8_helper(str, (str && size == -1) ? int(strlen(str)) : size);
      |                                                               ~~~~~~^~~~~

There's also a similar error with QByteArray.constData(), even though
isEmpty() should return True when the QByteArray is NULL.
(Adding isNull() prevents the warning but is redundant.)

Use DIAG_OFF and DIAG_ON to ignore the warning on GCC 12.1 and higher.
Fix #18090.
2022-05-23 12:14: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
Gerald Combs c805c0c16e Qt: Fix an about box signal and use new-style connections.
Fix

 ** (wireshark:77415) 10:53:35.149736 [GUI WARNING] -- QObject::connect: No such signal QComboBox::currentIndexChanged(QString) in ui/qt/about_dialog.cpp:352
 ** (wireshark:77415) 10:53:35.149760 [GUI WARNING] -- QObject::connect:  (sender name:   'cmbType')

Use new-style connections everywhere in about_dialog.cpp.
2022-03-27 18:19:37 +00:00
Gerald Combs f8d3ebe0e2 Qt: Handle qsizetype.
Qt 5.10 added qsizetype, aka an ssize_t and Qt 6 makes extensive use of
it. Add a compatibility typedef and use it where we can. Cast it away
where we can't.
2022-03-25 16:51:55 +00:00
David Perry e2fab18853 wsutil: New API to gather compile/runtime info 2022-02-24 13:27:08 +00:00
David Perry 1e0d117eb7 Specify directory for temporary captures 2022-02-09 14:32:28 +00:00
Tomasz Moń 890555b8bd Qt: Qt6.2 compatibility fixes
Wireshark successfully compiles on Windows with Qt6.2 with following
cmake options:
  -DUSE_qt6=ON -DDISABLE_ERROR=ON

QCustomPlot QT 6.2 patch is taken from QCustomPlot forum post by miccs.
2021-11-29 04:55:12 +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
João Valverde 100876337a Move version_info.[ch] to ui/
Version info is an aspect of UI implementation so move it to
a more appropriate place, such as ui/. This also helps declutter
the top-level.

A static library is appropriate to encapsulate the dependencies
as private and it is better supported by CMake than object libraries.

Also version_info.h should not be installed as a public header.
2021-07-04 10:37:49 +00:00
João Valverde dc7f0b88bb Refactor our logging and extend the wslog API
Experience has shown that:

  1. The current logging methods are not very reliable or practical.
A logging bitmask makes little sense as the user-facing interface (who
would want debug but not crtical messages for example?); it's
computer-friendly and user-unfriendly. More importantly the console
log level preference is initialized too late in the startup process
to be used for the logging subsystem and that fact raises a number
of annoying and hard-to-fix usability issues.

  2. Coding around G_MESSAGES_DEBUG to comply with our log level mask
and not clobber the user's settings or not create unexpected log misses
is unworkable and generally follows the principle of most surprise.
The fact that G_MESSAGES_DEBUG="all" can leak to other programs using
GLib is also annoying.

  3. The non-structured GLib logging API is very opinionated and lacks
configurability beyond replacing the log handler.

  4. Windows GUI has some special code to attach to a console,
but it would be nice to abstract away the rest under a single
interface.

  5. Using this logger seems to be noticeably faster.

Deprecate the console log level preference and extend our API to
implement a log handler in wsutil/wslog.h to provide easy-to-use,
flexible and dependable logging during all execution phases.

Log levels have a hierarchy, from most verbose to least verbose
(debug to error). When a given level is set everything above that
is also enabled.

The log level can be set with an environment variable or a command
line option (parsed as soon as possible but still later than the
environment). The default log level is "message".

Dissector logging is not included because it is not clear what log
domain they should use. An explosion to thousands of domains is
not desirable and putting everything in a single domain is probably
too coarse and noisy. For now I think it makes sense to let them do
their own thing using g_log_default_handler() and continue using the
G_MESSAGES_DEBUG mechanism with specific domains for each individual
dissector.

In the future a mechanism may be added to selectively enable these
domains at runtime while trying to avoid the problems introduced
by G_MESSAGES_DEBUG.
2021-06-11 09:40:28 +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
Chuck Craft 3730eb251f Qt: enable sorting for Help->About tables 2020-11-10 07:52:18 +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
Jeroen Roovers f605e9466b ui: Define plugins_add_description() unconditionally
Since commit 5dfde7ff ("Print extcap plugins with "tshark -G
plugins"."), compiling with -DENABLE_LUA=no -DENABLE_PLUGINS=no fails.
The definition of plugins_add_description() is guarded by HAVE_PLUGINS
|| HAVE_LUA, but that definition is used without such guards for extcap
right below, resulting in:

ui/qt/about_dialog.cpp:137:29: error: 'plugins_add_description' was not
declared in this scope

Fix this by removing the guards around plugins_add_description().

Change-Id: Ieaddfed923ae3782ade28b2f5004b6a34220659a
Fixes: 5dfde7ff83
Reviewed-on: https://code.wireshark.org/review/35852
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-20 07:50:37 +00:00
Dario Lombardo 2060e02021 Qt: don't use monospace fonts for licence dialog.
Authors and licence dialogs were using monospace fonts to resemble
GTK interface. Authors is not monospace anymore. Not using monospace
for license dialog makes the text look more similar to other dialogs
and more readable.

Change-Id: I5a62f0993d579af5b1db7dea351d9a10175a069d
Reviewed-on: https://code.wireshark.org/review/35663
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-06 22:59:35 +00:00
Gerald Combs 17492b8a6b Qt: Use a neutral tone in an error message.
Don't yell at the user.

Change-Id: Ibedb0a1bf7ea13feeaf6fe4f2c78bd7f3d1e65b8
Reviewed-on: https://code.wireshark.org/review/35572
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-12-28 08:04:09 +00:00
dennisschagt b21276d9a0 Qt: Create directories recursively
Bug: 16143
Change-Id: Ibdd888157919315775637eb639158ea2e6cb26f0
Reviewed-on: https://code.wireshark.org/review/35561
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-12-25 22:44:53 +00:00
Gerald Combs e8ef656842 Qt: Remove an unneeded connection.
Fixes

Change-Id: I259e5bea0d0475d1bbb0c584b125a4ea819dda64
12:31:07.342     Main Warn QObject::connect: No such slot AboutDialog::copyToClipboardTriggered() in ../ui/qt/about_dialog.cpp:300
12:31:07.342     Main Warn QObject::connect:  (sender name:   'copyToClipboard')
12:31:07.342     Main Warn QObject::connect:  (receiver name: 'AboutDialog')
Reviewed-on: https://code.wireshark.org/review/35129
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-18 21:23:08 +00:00
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Graham Bloice 81b97d04a9 About Dialog: Add a copy to clipboard button for the version info
Make life a little simpler when asking for the version info on Ask

Change-Id: I51fd8a390398f7e42e3edcc889d9e53dbfd0980c
Reviewed-on: https://code.wireshark.org/review/35104
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-16 23:20:43 +00:00
Roland Knall 0e64e9f3ca extcap: Allow loading of extcap files from personal directory
Allow the storage of extcap plugins in the personal directory and
enable loading from there. It will also take precedence of any
system-wide extcaps with an identical name

Change-Id: Ib88e09a26c4f99cf5e793327f2808c7445c6b1b5
Reviewed-on: https://code.wireshark.org/review/34988
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-05 16:57:09 +00:00
Gerald Combs ac4f3c0f4d macOS: Make Wireshark.app drag-installable.
Create ChmodBPF installer and uninstaller packages using pkgbuild and
productbuild. Place them in Wireshark.app/Resources/Extras.

Add a path_helper installer and uninstaller which respectively add and
remove /etc/*paths.d/Wireshark.

Remove the PackageMaker and utility-launcher assets and build targets.

Show a message in the main welcome screen if we don't have capture
permissions. Add an link which launches the ChmodBPF installer.

Add a "macOS Extras" item to About → Folders.

Migrate "Read me first" from RTF to Asciidoctor, which lets us add links
and looks like our other documentation.

Rename dmg_set_style.scpt to arrange_dmg.applescript and make it plain
text. Always run it in osx-dmg.sh.

Bug: 6991
Bug: 12593
Bug: 11399
Ping-Bug: 16074
Change-Id: I7b6aa89aae2be522b4141b0d44e8142dec749e90
Reviewed-on: https://code.wireshark.org/review/31047
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 16:26:31 +00:00
Gerald Combs 94f497f929 Qt: Use a lighter link color in dark mode.
Add ColorUtils::themeLinkBrush, which returns a readable link color in
dark mode. Use it in place of existing ...palette().link() calls.

Add ColorUtils::themeLinkStyle, which produces an HTML <style/> block
that lightens the link foreground color in dark mode. Use this to style
links in the about box and in elided labels.

Catch ApplicationPaletteChange events where needed.

Add dark theme / dark mode notes to the WSDG.

Ping-Bug: 15511
Change-Id: I92925bd997f97b155491f55a8c818f03549bc7f4
Reviewed-on: https://code.wireshark.org/review/33704
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-25 20:31:41 +00:00
Gerald Combs 2eb1a0dd61 Use the HTTPS URL for our main site in a few places.
Fixup the encoding of plugins/plugin.rc.in while we're here.

Change-Id: I21b56ce68bc3d84298a846a991c72bf710b9ae8a
Reviewed-on: https://code.wireshark.org/review/33414
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-29 04:00:42 +00:00
Guy Harris 5dfde7ff83 Print extcap plugins with "tshark -G plugins".
This makes it match the "Plugins" tab of the "About" dialog.

While we're at it, use the same code to enumerate extcap plugins in that
dialog.

Change-Id: I50f402a7ab5d83d46baab070d145558ed8f688f4
Reviewed-on: https://code.wireshark.org/review/32589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-26 21:53:20 +00:00
Guy Harris 6c11719c8c Get rid of unnecessary include.
Change-Id: Ie33b8335acd84d32d282ea8eedac3f5d06f2c5d3
Reviewed-on: https://code.wireshark.org/review/32495
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-21 03:08:51 +00:00
Stig Bjørlykke 393b22047b Qt: Add "Show in Finder/Folder" for plugins.
Add a menu item for "Show in Finder/Folder" for plugins in cases where
Wireshark loads plugins from other folders than is listed in "Folders".

Change-Id: I8cc42d9992d885f1ca37f5769d7292bed1584f4b
Reviewed-on: https://code.wireshark.org/review/31270
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-04 12:00:57 +00:00
Stig Bjørlykke c25dbfa8a7 Qt: Pluralize "Copy Row(s)"
Properly pluralize "Copy Row(s)" entry in the popup menu.

Change-Id: Ifc4f9c69ab63d2d2594648db3115087ba51a941f
Reviewed-on: https://code.wireshark.org/review/31269
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-01-01 18:13:44 +00:00
Stig Bjørlykke b28f283f8b Qt: Show Python scripts as links in the about box.
Extcap utilities can be Python scripts. Show the files as URLs and
allow double click to open.

Change-Id: I214caa2683896b89fbe6243562eee9b12d4ae217
Reviewed-on: https://code.wireshark.org/review/31221
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-27 23:04:52 +00:00
Dario Lombardo 2d57a56fa6 Qt: switch about#wireshark label to QTextBrowser.
QTextEdit supports the scrollbar. The drawback of having a scrollbar
is that we need to remove the space (on the right, at least). This change
switches from QLabel to QTextBrowser and removes the empty spaces and the
horizontal layout (not needed anymore). The resulting look is a mix
from the Authors tab and original look.

While on it, the default height has been increased to make room for the full
message (not needing the scrollbar with the defualt message) and the link
to the wireshark site has been made clickable.

Bug: 15375
Change-Id: Id0a10f366c0797c98264d3a1cad58a4dc11467e3
Reviewed-on: https://code.wireshark.org/review/31153
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-22 08:32:26 +00:00
Dario Lombardo ffd5361662 Qt: set properties of about_dialog#label_wireshark in ui file.
Change-Id: I1fde99f9c2f282ec4709a04bcb8dcdf7bbbc72a8
Reviewed-on: https://code.wireshark.org/review/31152
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-21 05:21:15 +00:00
Peter Wu 2584426310 Qt: omit initial empty line in About Dialog / Acknowledgements
Follow the logic in tools/generate_authors.pl for matching the
Acknowledgements section (which looks for a substring match instead of a
literal string.

Change-Id: I42e1553b6820af3fb2d5b9cda0fa0e6e6ca7e729
Reviewed-on: https://code.wireshark.org/review/30432
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-30 16:43:45 +00:00
Michał Łabędzki 41f4c7d071 Fix About->Acknowledgements
Add prefix and postfix "=" to satisfy text splitter to avoid empty text area.

Change-Id: I3c8e4fd4711ea8fcc7bba9583ff3fe5cb06ce4a1
Reviewed-on: https://code.wireshark.org/review/30428
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-10-30 13:14:15 +00:00
Roland Knall 70e340aaaf Qt: Create directories if they should be opened
In the about dialog, create directories within the folders tab
if the user wants them to open and they do not exist yet

Change-Id: Ia95692dabef92392714c329c868abc78e3bcec6e
Reviewed-on: https://code.wireshark.org/review/29782
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-09-25 09:01:16 +00:00
João Valverde 8eddb1650d epan: Remove unnecessary all protocols registration callback
We are exporting a registration function from libwireshark just
to have it passed back as a callback. Seems unnecessary.

Change-Id: I7621005c9be11691d319102326824c5e3520a6f3
Reviewed-on: https://code.wireshark.org/review/29328
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-29 23:22:44 +00:00