Commit Graph

160 Commits

Author SHA1 Message Date
Developer Alexander 7866f43d82 IO Graph: Add checkbox to prevent automatic rescans
Adds a checkbox 'Automatic Update' to the IO Graph to enable or disable
rescans and recalculation of graph data temporarily. This is useful when
you want to modify settings of multiple graphs without triggering a rescan
with every change of a single setting. This becomes useful for large trace
files in particular.

Rescan or recalculation events are queued while 'Automatic Update' is not
active. Checking 'Automatic Update' triggers the queued updates.

The setting for 'Automatic Update' is stored in a preference.

A german translation for 'Automatic Update' is included.
2021-09-21 12:58:55 +00:00
Chuck Craft a7d927a9e9 prefs_register_protocol_obsolete protocols with only obsolete prefs
Related to #17465 and !3526
2021-07-13 23:12:04 +00:00
Uli Heilmeier fca78f9f1f Prefs: Remove packet_editor option
Since QT UI we have had no more packet editor feature. Therefore we can also
drop the preference to enable it.
2021-06-17 14:47:47 +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
Jirka Novak c1084fe97e RTP Player: Settings for enabling use of disk as temporarly store
New advanced settings are created:
- rtp_player_use_disk1 - controls if decoded samples are stored in
  memory or on disk.
- rtp_player_use_disk2 - controls if dictionary for decoded samples
is stored in memory or on disk.
- documentation updated
2021-04-26 10:57:22 +02:00
Jim Young d42042fcbb Qt: Add checkbox for enabling/disabling packet-list hover_style
At times the presence of the packet-list hover_style colorization can make
it difficult to determine the state of the packet directly under the mouse
cursor. This forces the user to move the mouse cursor away from the
packet-list row to reveal the next colorization state. The packet-list row
colorization style precedence, from highest to lowest, is: hover_style,
Selected, Ignored, Marked and then coloring rules.

This patch adds a new 'Packet List settings:' checkbox option 'Enable
mouse-over colorization'. By default the supporting preference
`gui.packet_list_hover_style.enabled` will be enabled (TRUE). When this
checkbox is disabled, the packet-list hover_style (mouse-over)
colorization will not be used.
2021-04-21 08:36:27 +00:00
Guy Harris 3231a33590 prefs: get rid of unused #define.
epan/prefs.h defines PREFERENCE_GROUPING, but nothing checks it, so
there's no point in defining it; it may have been checked when it was
added, but, if so, it's not checked any more, so remove it.
2021-04-04 21:47:53 +00:00
Guy Harris 1e1f4e6b5f Move more headers outside extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
2021-03-16 02:36:10 -07:00
Michal Ruprich c8246c9973 Moving glib.h out of extern C 2021-02-10 17:49:09 +00:00
Jirka Novak cf9ffd3d83 All RTP dialogs: Added option to specify count of decimal places
Preferences are extended with advanced settings:
gui.decimal_places1 - 2
gui.decimal_places2 - 4
gui.decimal_places3 - 6

rtp_analysis_dialog, rtp_player_dialog and rtp_stream_dialog uses new settings
for formating numbers. Same information in all dialogs uses same settings.
It solves request #15481.

Note: Other UI dialogs can be adapted later.
2021-01-01 12:41:09 +00:00
John Thacker 524a28c4b1 QT/CLI: Move max tree items and depth to prefs
Move the maximum number of tree items and maximum tree depth to
preferences instead of hardcoded values. Refer to issue #12584 for
an example VNC capture where real data exceeds the current limit.
2020-10-23 04:18:36 +00:00
Gerald Combs 9b07412277 Qt: Add a packet diagram view.
Add a new top-level view that shows each packet as a series of diagrams
similar to what you'd find in a networking textook or an RFC.

Add proto_item_set_bits_offset_len so that we can display some diagram
fields correctly.

Bugs / to do:
  - Make this a separate dialog instead of a main window view?
  - Handle bitfields / flags

Change-Id: Iba4897a5bf1dcd73929dde6210d5483cf07f54df
Reviewed-on: https://code.wireshark.org/review/37497
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>
2020-08-10 18:17:50 +00:00
Roland Knall 936a844cc3 Qt: Fix PacketListHeader column
Due to changes in #35206, if you have a lot of columns the display
of all columns may be hindered depending on your screen resolution.

With this change, displaying the column information can be disabled
via a Preferences->Layout checkbox element. Additionaly, the column
information will always be displayed as a tooltip element

Bug: 16317
Change-Id: Ib8c0fc0a84deaca96631270b320f3a530ba87d89
Reviewed-on: https://code.wireshark.org/review/35706
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-01-09 12:32:34 +00:00
Huang Qiangxiong 623b347d1e Protobuf: add dissecting protobuf fields as wireshark fields preferences, etc.
Two enhancements and one fixed bug:

1. Add dissecting protobuf fields as wireshark (header) fields preferences. User
can input the full names of protobuf fields or messages in Filter toolbar for
searching.

2. Add 'protobuf_field' dissector table. Dissector based on protobuf can register
itself to 'protobuf_field' keyed with the full names of fields of BYETS or STRING
types.

3. A bug about search MESSAGE or ENUM type in context is fixed.

4. Another small enhancement is adding prefs_set_preference_effect_fields() which
can mark a preference that affects fields change (triggering FieldsChanged event).

See the linked bug for sample capture file and .proto files.

Ping-Bug: 16209
Change-Id: Ibc3c45a6d596a8bb983b0d847dd6a22801af7e04
Reviewed-on: https://code.wireshark.org/review/35111
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-19 05:04:17 +00:00
Uli Heilmeier 3361109b15 QT/CLI: Remove limit for object export files
Removes the limit to export more than 1000 files with the same name
when exporting objects.
For this a preference name gui.max_export_objects is used.

Bug: 16010
Change-Id: Iefc138ac2617491aad3b6ad5827c9058aed112c7
Reviewed-on: https://code.wireshark.org/review/34339
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-05 22:40:27 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Michael Mann 6db67117b5 Add ability to disable autocomplete suggestions for filter controls.
Add a preference (enabled by default) that can enable/disable the ability for Wireshark to autocomplete display and capture filter controls.

Bug: 14368
Change-Id: Ib2b688bb75c4465dab14a6a635a870d7e5c4fe80
Reviewed-on: https://code.wireshark.org/review/30320
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-22 04:45:59 +00:00
Guy Harris a699fbdf45 Add a mechanism to register aliases for preference modules.
That way, we don't need a chunk of code in epan/prefs.c that knows about
various preference module mappings; individual dissectors can register
aliases as appropriate.

(The Nortel Discovery Protocol never *had* any preferences, even when
it was the SynOptics Network Management Protocol, so there's no need for
it to register an alias.)

Change-Id: I4a718dac6bb06801cc06a6ee5a28d7ed81e67e5d
Reviewed-on: https://code.wireshark.org/review/29914
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-29 03:24:15 +00:00
Guy Harris 09698df0b4 Get rid of some no-longer-supported GUI preferences.
Make them obsolete preferences; if they had any use, it was with the
now-removed GTK+ UI.

Change-Id: I2b514148c8066c5c79cb402493f47a21d3679819
Reviewed-on: https://code.wireshark.org/review/29912
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-29 01:24:27 +00:00
Guy Harris 586ad18159 Get rid of the printing preferences.
They're no longer used by any of the printing code; mark them as
obsolete.

Change-Id: Iceaf14f48f1bd35757a9a158a5348f6202b90fc7
Reviewed-on: https://code.wireshark.org/review/29911
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-29 00:33:20 +00:00
Dario Lombardo 7a07832712 prefs: add the option not to load interfaces on startup.
Change-Id: I2ade0647a8c32b76aebd60117b4317cd005aff91
Reviewed-on: https://code.wireshark.org/review/29854
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-26 17:11:47 +00:00
Peter Wu ad0de0ffbc prefs,ui: properly migrate old filter expressions
When legacy filter expressions preferences are present, be sure to
(1) save the dfilter_buttons file when updating the preferences file and
(2) save the preferences file after updating the dfilter_buttons file.

Without doing (1), the old buttons will be lost. Without (2), restarting
Wireshark will result in duplicate buttons. Only write the files if the
user actually made other changes to avoid breaking profiles by just
opening Wireshark.

Bug: 15114
Bug: 15121
Change-Id: I5b9417c34146c4450526781a20308c9c98fb44a1
Reviewed-on: https://code.wireshark.org/review/29488
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-09-10 09:27:34 +00:00
Stig Bjørlykke 256e32c2eb prefs: Remove prefs.gui_use_pref_save
Remove prefs.gui_use_pref_save from prefs.h.

Change-Id: I347cab214048a41afe2c626c0c12a0f46483c2e2
Reviewed-on: https://code.wireshark.org/review/29401
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-09-02 20:14:19 +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
Michał Łabędzki bded74eb66 Do not use #if* in struct
Do not assume that somebody always includes "config.h" with "epan/prefs.h",
because I do not include that one and I notice a lot of bugs, like:
in one file sizeof(prefs) is 538 but in another is 544...
and of course preferences do not work as expected - order of fields
in the struct was changed. Try to avoid #if in struct.

Remove dependency of config.h for prefs by removing #ifs, because all prefs
should be registered also if not used.

Change-Id: I02f71d2e64acf3e0f90c802b1610cc4620727051
Reviewed-on: https://code.wireshark.org/review/27654
Petri-Dish: Michal Labedzki <michal.labedzki@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-21 12:05:26 +00:00
Gerald Combs 1d030928ef Remove some GTK+-only code.
Change-Id: Ic2498c7acd6a1a522be45094148402ee34a6b4d1
Reviewed-on: https://code.wireshark.org/review/26958
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-04-17 03:44:47 +00:00
Gerald Combs 80256442af More PortAudio removal.
Change-Id: Ib56212e09d41fc76494d8186c77541302700104c
Reviewed-on: https://code.wireshark.org/review/26952
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-15 16:49:53 +00:00
Peter Wu c1b7c8f9d2 Qt: ensure field is visible on selection from bytes view
Ensure that a selected field (via selectedFieldChanged) becomes visible
in the packet details view when selected from the bytes view (or when
found via a search).

As making a field always visible seems a desirable feature (and in the
interest of simplifying preferences), enable this by default using the
smarter EnsureVisible hint.

Remove the associated preferences and mark them GTK+ only.

Change-Id: I05a918c1e09135c0b4e10f04024bff092756e55c
Fixes: v2.5.0rc0-2383-g6b2764a41e ("ProtoTree behavior fixes.")
Reviewed-on: https://code.wireshark.org/review/26509
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-18 00:30:49 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Dario Lombardo 22b5ffad86 extcap: add preference to prevent interfaces loading.
Change-Id: Ia5865a40c75e582f28408a0515c5c0b38e43a916
Reviewed-on: https://code.wireshark.org/review/25188
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-09 09:58:48 +00:00
Dario Lombardo e80b40adbe extcap: remove conditional compilation.
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9
Reviewed-on: https://code.wireshark.org/review/25186
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-08 05:50:15 +00:00
João Valverde 995812c5f1 Refactor plugin registration and loading
Put different types of plugins (libwiretap, libwireshark) in different
subdirectories, give libwiretap and libwireshark init routines that
load the plugins, and have them scan the appropriate subdirectories
so that we don't even *try* to, for example, load libwireshark plugins
in programs that only use libwiretap.

Compiled plugins are stored in subfolders of the plugin folders, with
the subfolder name being the Wireshark minor version number (X.Y). There is
another hierarchical level for each Wireshark library (libwireshark, libwscodecs
and libwiretap).

The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}.

Currently we only distribute "epan" (libwireshark) plugins.

Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb
Reviewed-on: https://code.wireshark.org/review/23983
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-14 08:43:57 +00:00
Christopher Maynard ea49c337c5 Include VLAN ID in key for ICMP request/response tracking
Add global preference to allow for "stricter" conversation tracking

Bug: 13518
Change-Id: I166a084c402374fa76dac7bb54f941e2e9c9325a
Reviewed-on: https://code.wireshark.org/review/22842
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-26 21:33:19 +00:00
cheloftus 70996dc669 Qt: add preference to restore display filter after Follow Stream
Added new user preference 'restore_filter_after_following_stream',
defaults to false.
When true, the current display filter is restored after following a stream.

Change-Id: I153107761003658c6d7f1464711da7b3adeb60a8
Reviewed-on: https://code.wireshark.org/review/22455
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-04 03:59:38 +00:00
Stig Bjørlykke 66fff5df49 Qt: Add preference for show file load time in the status bar
This will leave more room for messages on smaller screens.  Set the
default OFF because this is probably only useful for developers.

Group Status Bar settings in the Layout frame.

Change-Id: Iea9a55b6c088aac10ee7680b1e8a882ed00c73be
Reviewed-on: https://code.wireshark.org/review/22824
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-29 05:39:37 +00:00
Stig Bjørlykke 4aae9331bc Qt: Add preference for show selected packet number
The information about the selected packet number is available from
the Number column and from the Frame entry in the Packet Details
so make the entry in the status bar optional.

Also remove duplicate "Packet:" entry, add the UTF8_MIDDLE_DOT
separator and rename the prefix to "Selected Packet:".

Bug: 13902
Change-Id: I0e7ba884bdcbdc87a5738223ef92f52e4ac195e5
Reviewed-on: https://code.wireshark.org/review/22807
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-27 19:29:34 +00:00
Michael Mann 1b7f5d9f79 Convert filter expressions preference data to a UAT.
The filter expressions data was shoved into the preference file in a
very loose, non-arrayed form.  It's much easier to manage in code
(and for users in a separate file) as a UAT.

The GTK GUI was hacked to use the existing UAT dialog rather than
rewrite the pref_filter_expressions.c to support a UAT. Should
be okay since it's deprecated.

Change-Id: I688cebb4b7b6594878c1398365e79a205f1902d9
Ping-Bug: 13814
Reviewed-on: https://code.wireshark.org/review/22354
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-26 02:44:05 +00:00
Guy Harris 0480a0be81 Put the non-filter part of epan/color_filters.h into wsutil/color.h.
Places that only need color_t, such as certain preferences, don't need
the color filter stuff.

Change-Id: I88fc2858454d04e659b323a8bc28b21d362ca3fb
Reviewed-on: https://code.wireshark.org/review/22060
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-10 02:56:31 +00:00
Gerald Combs 6a37b542e4 Qt+prefs: Add a dark theme check and default colors.
Add prefs_set_gui_theme_is_dark and call it in the WiresharkApplication
constructor. Add a set of dark syntax color defaults.

We could alternatively add a preference for the syntax foreground color,
but that would imply adding a preference for the background color as
well.

Bug: 11131
Bug: 13738
Change-Id: Iefe135ed04e63372ed434c5b9759647c9f4046e3
Reviewed-on: https://code.wireshark.org/review/21827
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>
2017-06-01 08:07:05 +00:00
Peter Wu c9b0e9c813 Report syntax errors in UAT prefs parsing
Add the cause for a syntax error while parsing UATs. Example output:

    $ tshark -ouat:ssl_keys:,
    tshark: Invalid -o flag "uat:ssl_keys:,": ssl_keys:1: No IP address given.
    $ tshark -ouat:unknown:,
    tshark: Invalid -o flag "uat:unknown:,": Unknown preference

Change-Id: I549406c4e31a81d29f487ef47bdb3c22da084947
Reviewed-on: https://code.wireshark.org/review/21748
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-26 17:31:01 +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
Guy Harris ccef2d8860 Make prefs_register_subtree() static too.
It's not used outside epan/prefs.c, and it probably shouldn't be.

Change-Id: I8a10961a33b93db1de982eec264c134f9f3bc66c
Reviewed-on: https://code.wireshark.org/review/21096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 20:44:50 +00:00
Guy Harris 6dd6fc9eff Make prefs_register_module() static.
It's not used outside epan/prefs.c, and it *shouldn't* be used outside
epan/prefs.c - there are other APIs that call it, and handle the details
of picking the right name, title, description, etc..

Change-Id: Ib95b4811d50c2bf1c480f115ee998274252243c9
Reviewed-on: https://code.wireshark.org/review/21095
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 20:06:37 +00:00
Guy Harris 6b3714254d Pull all the "load settings" calls into a epan_load_settings() routine.
That way, nothing using libwireshark needs to know what settings need to
be loaded, they just call epan_load_settings().

Change-Id: I9390e259e286fc4f5acaeaac2767e4c3c4b656af
Reviewed-on: https://code.wireshark.org/review/20983
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 22:40:30 +00:00
Guy Harris 62b342443d Pull the error-reporting code for preference files into read_prefs().
No need to duplicate it in N different programs.

Update comments while we're at it.

Change-Id: I3096cbe5448a19363eff6303bdd54e522dae9336
Reviewed-on: https://code.wireshark.org/review/20973
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 03:03:25 +00:00
Stig Bjørlykke 14e19128dc Qt: Disable pane menu items if not used in layout
If a pane is not used in the layout it should not be possible to show
and hide this from the menu, as this may give unexpected results.

Change-Id: I335168e66e1dffc89992cad480dd7daaea7e9d59
Reviewed-on: https://code.wireshark.org/review/20140
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>
2017-02-16 20:53:22 +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
Roland Knall 9d47bf9939 InterfaceList: Add check for remote interface
Add a check, to allow the filtering of remote only interfaces. Also
add the necessary options to the type menu.

Change-Id: Ib82519362454094f64abf1cbe6d7bc917990d7ac
Reviewed-on: https://code.wireshark.org/review/19438
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-12-27 11:55:51 +00:00
Gerald Combs cbf89c8ed8 Check preference titles and descriptions.
When registering preferences, make sure our titles and descriptions are
valid UTF-8. Make sure our titles are short and only contain printable
characters.

Fix problematic titles and descriptions.

Change-Id: I20d3f93438f2b3c30266f934297feb79897f2ee5
Reviewed-on: https://code.wireshark.org/review/18998
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: Michael Mann <mmann78@netscape.net>
2016-12-01 01:26:39 +00:00
Michael Mann fb9a356e46 Add prefs_get_uint_value and prefs_get_range_value
This allows dissectors to not need to know about the internal preference structure.

Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2
Reviewed-on: https://code.wireshark.org/review/18864
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-11-22 16:47:47 +00:00