Commit Graph

24 Commits

Author SHA1 Message Date
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 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 85a7938925 Qt+tools: Fix most of our lupdate warnings.
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog
2021-01-18 16:56:20 +00:00
Gerald Combs 511fa081df Qt: Handle dark mode in syntax highlighting.
Add ColorUtils::contrastingTextColor, which chooses an appropriate text
color from the current application palette for a given background.

Use it in SyntaxLineEdit and FontColorPreferencesFrame for each state
background color.

Fixes #15840.
2020-10-06 19:24:59 +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 cbdfc13ecc Qt: Selected item preference updates.
The styling of the color selection buttons in the color preferences is
such that it's impossible to tell if they're disabled or enabled. Hide
and show them instead as needed.

Rename combo box items based on feedback here at SharkFest.

Bug: 15775
Change-Id: I22b384aca56fee73957f5842349efae218b2dd09
Reviewed-on: https://code.wireshark.org/review/33566
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-06-12 17:10:35 +00:00
Paul Zander 53dfec9b99 Qt: Configure the selection color via the preferences
The active selection color and inactive selection color can be configured via Edit / Preferences / Font and Colors
There are 3 styles that can be used for the selection color:
Default: legacy behavior
Flat: Use background and foreground color with no gradient.
Gradient: Use background and foreground color with a gradient.

Bug: 14714
Change-Id: Ieca293bb9830d2c5702949d0459d1d6f679e41e4
Reviewed-on: https://code.wireshark.org/review/27701
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-05-25 11:07:01 +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
Michael Mann d239da264c Convert preference dialog to use more models.
Convert Advanced view and Modules view to use a single base model,
loading the preferences once and then filter and display what they
need with QSortFilterProxyModel derived classes.

Convert the PreferencePane "types" to just strings.  This allows
a more straightforward relationship between the "special" modules
that need custom widgets for preference manipulation and it also
removes dependency on preferences_dialog.h for many files.

Change-Id: I091deb3061564aa4d1564e9ca1c792715961b083
Reviewed-on: https://code.wireshark.org/review/25134
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-04 21:20:59 +00:00
Gerald Combs d089cca16b Qt: Miscellaneous translation hints.
Add QT_TR_NOOP and comments in a few places.

Change-Id: I77c964a4be463aa61de73fdd6af43623edc55474
Reviewed-on: https://code.wireshark.org/review/25051
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-29 14:15:21 +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
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
Peter Wu 9c3d81adde Officially require Qt 4.8 or newer
Since v2.3.0rc0-1002-g1cd2255, Qt 4.8 became mandatory, reflect this in
the version requirements. This will not affect a lot of distributions
(RHEL and SLES only had Qt 4.6).

For a more complete list of supported platforms, see
https://wiki.wireshark.org/Development/Support_library_version_tracking

While at it, correct some other minimum versions in documentation.

Change-Id: I11f2dfba72c75429f6838404a81ed3b3dc302d5f
Reviewed-on: https://code.wireshark.org/review/18314
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-20 05:03:07 +00:00
Joerg Mayer 0619ed241c Finish removal of Q_UNUSED.
Todo: qcustomplot via upstream

Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf
Reviewed-on: https://code.wireshark.org/review/9547
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-07 22:17:22 +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 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
Peter Wu cd14ff3288 qt: use qstring_strdup
Replaces the more verbose `g_strdup(foo.toUtf8().constData())` by
`qstring_strdup(foo)`. While at it, plug a minor memleak in
MainWindow dialogs.

Change-Id: I32b53f972b4e3998ac9beabd98647a381b7b42e3
Reviewed-on: https://code.wireshark.org/review/5531
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-01 01:13:54 +00:00
Alexis La Goutte 020d0f8963 Qt: Fix when build with Qt < 4.8.0
StyleName is not available in Qt < 4.8

Change-Id: Icbfcef7c62b124ce67f1a02ed928a96233ae2d9d
Reviewed-on: https://code.wireshark.org/review/3508
Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com>
2014-08-09 14:15:25 +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 2d006a2d57 Use the valid/invalid/deprecated backround color preferences.
svn path=/trunk/; revision=50709
2013-07-17 21:55:38 +00:00
Gerald Combs 19df8230aa Add filter color preferences to the Qt UI similar to r50203. Fixes bug
5413.

svn path=/trunk/; revision=50706
2013-07-17 20:58:56 +00:00
Alexis La Goutte 91c482d3d6 Add Some missing text to translate
svn path=/trunk/; revision=49270
2013-05-13 20:23:35 +00:00
Alexis La Goutte 8afb6106f2 Fix [ 68%] Building CXX object ui/qt/CMakeFiles/qtui.dir/font_color_preferences_frame.cpp.o ui/qt/font_color_preferences_frame.cpp: In member function ‘void FontColorPreferencesFrame::updateWidgets()’: ui/qt/font_color_preferences_frame.cpp:84:54: error: ‘class QFont’ has no member named ‘styleName’ make[2]: *** [ui/qt/CMakeFiles/qtui.dir/font_color_preferences_frame.cpp.o] Erreur 1 make[1]: *** [ui/qt/CMakeFiles/qtui.dir/all] Error 2
StyleName is not available in Qt < 4.8
disable this line for the moment (maye be add if QTVERSION > 4.8 ?)

svn path=/trunk/; revision=47409
2013-02-01 09:21:38 +00:00
Gerald Combs 2dff8d7605 Add font and color preferences. Unfortunately Qt doesn't have a color
picker widget so we're back to popping up dialogs. Move the contents of
monospace_font.{cpp,h} to wireshark_application.{cpp,h}.

Pango and Qt use completely different string representations for fonts.
Add a separate gui.qt.font_name preference so that they don't clobber
each other.

svn path=/trunk/; revision=47240
2013-01-24 01:10:12 +00:00