Commit Graph

166 Commits

Author SHA1 Message Date
Guy Harris 77cad8561c Move the filter file reading code to libui.
It doesn't belong in libwireshark, as it doesn't affect dissection, but
it *does* belong in libui, as it's helper code for the UIs.

Change-Id: I8a5e0640a299a08e9ec1917dd253197438ebfdbc
Reviewed-on: https://code.wireshark.org/review/20974
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 04:25:52 +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
Guy Harris 23a7890b6a Pull the code to save enabled/disabled lists into libwireshark.
It's identical in the GTK+ and Qt UIs, and it should just be done in
libwireshark.

Rename some routines to just speak of enabled_and_disabled_lists, so we
don't have to say enabled_and_disabled_protos_and_heuristic_dissectors
or something such as that.

Clean up indentation.

Change-Id: Ief2e612d9e1b60d8d0123b6bd3409dce5faf6495
Reviewed-on: https://code.wireshark.org/review/20970
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 02:00:37 +00:00
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in
libwsutil, and rename files and routines appropriately, as they don't
only handle errors any more.

Have a routine read_enabled_and_disabled_protos() that reads all the
files that enable or disable protocols or heuristic dissectors, enables
and disables them based on the contents of those files, and reports
errors itself (as warnings) using the new "report a warning message"
routine.  Fix that error reporting to report separately on the disabled
protocols, enabled protocols, and heuristic dissectors files.

Have a routine to set up the enabled and disabled protocols and
heuristic dissectors from the command-line arguments, so it's done the
same way in all programs.

If we try to enable or disable an unknown heuristic dissector via a
command-line argument, report an error.

Update a bunch of comments.

Update the name of disabled_protos_cleanup(), as it cleans up
information for disabled *and* enabled protocols and for heuristic
dissectors.

Support the command-line flags to enable and disable protocols and
heuristic dissectors in tfshark.

Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df
Reviewed-on: https://code.wireshark.org/review/20966
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08 20:40:08 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Peter Wu d464d9cb5c Revert "Qt: call cleanup from destructor in WiresharkApplication."
Calling cleanup() twice (via exit signal and via destructor) results in a
use-after-free on exit via write_profile_recent.

This reverts commit e47f9fbeb0.

Change-Id: Ic3ca0742c03a345fd8cb7f3f782942872a3057f5
Reviewed-on: https://code.wireshark.org/review/20273
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-25 23:08:45 +00:00
Dario Lombardo e47f9fbeb0 Qt: call cleanup from destructor in WiresharkApplication.
This allow the correct cleanup routine to be called both when user
exits and when application exits by itself (like in WIRESHARK_QUIT_AFTER_CAPTURE=1).

Change-Id: I88e468bde029b4247ac90616f3aba0065a2b8e00
Reviewed-on: https://code.wireshark.org/review/20210
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-22 13:58:10 +00:00
Roland Knall 6dce310305 extcap: Reduce number of scans and storage
Reduce the number of storage arrays and the number
of necessary loads. Also include cleaner methods for
reloading the interfaces and cleanly reload if asked by
the overall system

Change-Id: I529465ec2593d40c955c6cdeaf3a85e3021c0596
Reviewed-on: https://code.wireshark.org/review/20230
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-02-22 13:40:33 +00:00
Gerald Combs a5a8fce06e Qt: Warn the user about DBAR 1.8 on Windows.
At startup, dig through the registry looking for shell extensions. If
any of them match known Dell Backup and Recovery DLL names and the DLL
version matches 1.8.*.*, show the user a warning dialog.

This is a bit extreme but I'm not sure what else to do. Dell is a popular
computer manufacturer and bug reports keep trickling in.

Change-Id: I6d1bd6c56850279356570154d231b07facb30cff
Bug: 12036
Ping-bug: 12701
Ping-bug: 13414
Reviewed-on: https://code.wireshark.org/review/16861
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-16 16:58:12 +00:00
Stig Bjørlykke c01cdd4e47 Qt: Reset Default profile support
Add support for resetting the Default profile by deleting it in
the Profile Dialog.  All profile files will be deleted and all
other files will be kept.

Change-Id: I795a6db3ee7b2c29e7aba461183e6cc411798b75
Reviewed-on: https://code.wireshark.org/review/20097
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-14 18:15:12 +00:00
Dario Lombardo 9ced31a2d7 filter_list: add cleanup function and call it on exit.
Change-Id: I51d8074cc5a63d4fd3af8852df120d6b4163217f
Reviewed-on: https://code.wireshark.org/review/19942
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10 13:34:56 +00:00
Roland Knall d66ee141af Qt: Signal number of active captures
Adds a signal, which emits the number of active captures

Change-Id: I637106294e331e7fc7607f6fd7704492e22fa7ac
Reviewed-on: https://code.wireshark.org/review/19799
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-26 08:28:29 +00:00
Michael Mann c302812566 Add enabled protocol list for dissectors who are disabled by default
We save a list of dissectors that are disabled through the Enabled Protocols
dialog.  This is because we assume dissectors are enabled by default.

For dissectors that are disabled by default, we have no way to keep them
enabled through the Enabled Protocols dialog.  A dissector that defaults
to being disabled has to be reset to enabled each time Wireshark is launched.

Add a list similar to the disabled list for enabling dissectors that are
disabled by default.
This mostly applies to post-dissectors.

Change-Id: I31a8d97a9fdbc472fe2a8666384e0f8786bb8e9f
Reviewed-on: https://code.wireshark.org/review/19405
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-12-24 02:30:21 +00:00
Gerald Combs 795f4eb106 Qt+Win32: Make software updates more friendly.
Add WinSparkle can_shutdown and shutdown_request callbacks which are
called prior to running the installer. Reject updates when we have
unsaved information. Add notes about possible improvements.

Ping-Bug: 9687
Ping-Bug: 12989
Change-Id: Ia126244b311417aa3105ea8136f186adc2745445
Reviewed-on: https://code.wireshark.org/review/19244
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-12-20 14:18:14 +00:00
Gerald Combs 414c132458 Qt: Handle retranslation events in the main window.
Update most (but not all) of the main status bar text when the user
changes the language setting.

Try to distinguish between recent preferences and recent captures more
clearly.

Change-Id: I5278a503178fe3620a25b185742688f957dc30f4
Ping-Bug: 11307
Reviewed-on: https://code.wireshark.org/review/9575
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-11-10 13:25:20 +00:00
Roland Knall 961b05315d WelcomeUI: Make Open and Capture clickable
Make the texts "Open" and "Capture" clickable, and have them open
the FileOpen and CaptureOptions dialogs respectively

Change-Id: I2a3efbc4cdf160aa0b4efc6496d09228affbff46
Reviewed-on: https://code.wireshark.org/review/18303
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-20 05:09:58 +00:00
Roland Knall 4a4698259c WiresharkApplication: Add signal emitter for Interface Changes
Change-Id: I468ef9462aa91d02c5568cec0d08081a2b3840bb
Reviewed-on: https://code.wireshark.org/review/18269
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-18 14:46:39 +00:00
Gerald Combs ad0a016bd2 Qt+macOS: Fix the default font name.
"SF Mono" is the name of the new monospace font in Sierra. Note that it
appears to have limited availability and that we're outside those
limits.

Fix up a comment.

Change-Id: I97f0077098ea78d4550b58fb92645f4d62342b2e
Reviewed-on: https://code.wireshark.org/review/18168
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-10-13 18:10:29 +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 73a0ee0e41 Qt+macOS: Look for San Francisco Mono
Make San Francisco Mono the default monospace font on macOS. Note that
we should look for Ubuntu Mono on that platform.

Change-Id: I6f563099ae3797a7f73ea595158a2844581fbeec
Reviewed-on: https://code.wireshark.org/review/17867
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-09-27 03:59:43 +00:00
Stig Bjørlykke 4ed3518c05 Qt: Added option to Remove from recent files list
Change-Id: If87e1bf4796d45582bc2490720683e4072971f56
Reviewed-on: https://code.wireshark.org/review/17804
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-19 20:49:01 +00:00
Peter Wu 0332275b16 qt: fix minor memory leaks on exit
Change-Id: I4856b7ce7eec15abe1278e9ba8314be61845347a
Reviewed-on: https://code.wireshark.org/review/17638
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-11 15:36:27 +00:00
Guy Harris df3bf9ca79 Note that not all UN*X file systems are case-sensitive.
Expand a comment to suggest what we should probably do on macOS.

Change-Id: Ic18afe5d1b165dbb27b5f0f5ff3ff9a33835a0f4
Reviewed-on: https://code.wireshark.org/review/17470
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-02 20:33:15 +00:00
Gerald Combs 5cf7fcdf0f Qt+Gtk: Fix the -t command line flag.
Add the time format to commandline_param_info_t and apply it when we've
finished application initialization.

Bug: 12489
Change-Id: Ice626198a610567e945a8e53c0c1093797e8208e
Reviewed-on: https://code.wireshark.org/review/16232
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-07-01 02:10:22 +00:00
Gerald Combs 974a530f8e Qt: Conversation and Endpoint dialog performance tweaks.
Generate column text dynamically. This keeps us from having to iterate
over our tree items each time we receive updates.

Set the uniformRowHeights property.

Stop automatically resizing columns after 200 items.

Fixup name resolution behavior. Disable the checkbox if host name
resolution is disabled.

Change-Id: Ib2fef604d6ee9e39a8b1edd72d58d0cb02d3bb64
Reviewed-on: https://code.wireshark.org/review/16110
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:08:57 +00:00
Gerald Combs b47aca5fd1 Minor UI locale updates.
Qt: Call setlocale before commandline_early_options so that we get
proper "-v" output, similar to the GTK+ UI.

GTK+: Call setlocale once at startup.

Bug: 11960
Change-Id: I3c3a196b9d94fc768e1085200891bc8d67e21a08
Reviewed-on: https://code.wireshark.org/review/16132
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: João Valverde <j@v6e.pt>
2016-06-25 15:56:34 +00:00
Guy Harris 232b2de7bb Use "system" for "use system language", and don't try to print a null string.
Add a #define USE_SYSTEM_LANGUAGE for the language string meaning "use
the system setting", and use that instead of hardcoding "system" in
various places.

If "language" is null, don't try to write it to the file with fprintf()
- on *most* systems, that prints "(null)", but on some systems, such as
Solaris, it *crashes*.  Write USE_SYSTEM_LANGUAGE instead.  Check for
"(null)" and treat it as meaning "use the system language".

Map "auto" to "use the system language" as well, for backwards
compatibility.

Change-Id: Iba9be540a5139e9cca8bddd0761ee4cbf0f79a49
Reviewed-on: https://code.wireshark.org/review/15147
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-28 19:34:02 +00:00
Jeff Morriss 93ac8364f1 Remove an unused variable from both the Gtk and Qt UIs.
Change-Id: I4c7c5aeaa1fa452605cf02a5c86dfe161c451f65
Reviewed-on: https://code.wireshark.org/review/14654
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: Jeff Morriss <jeff.morriss.ws@gmail.com>
2016-03-29 17:57:51 +00:00
Gerald Combs 6ed543dbe6 Remove the last remnants of U3 support.
Change-Id: Ide4c177e67a77c5f9495b3b4c0f817f40e6dde30
Reviewed-on: https://code.wireshark.org/review/14425
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-03-11 19:55:57 +00:00
Gerald Combs 4a79cf2e1a Switch from QLibrary to ws_load_library.
From the comments in qlibrary_win.cpp:

// We make the following attempts at locating the library:
[ ... ]
// Windows
// if (absolute)
//     fileName
//     fileName + ".dll"
// else
//     fileName + ".dll"
//     fileName

We were passing "riched20.dll" to QLibrary, which meant that it searched
for "riched20.dll.dll" first.

Switch to ws_load_library, which we use elsewhere and which has much
safer default behavior.

Change-Id: Ic8f0cf5686c9b1856d37e76be4404d6236c076e5
Reviewed-on: https://code.wireshark.org/review/13607
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-01-31 13:49:48 +00:00
Stig Bjørlykke 3c1d05d5a0 Qt: Enable capture filter bookmarks
Update the code handling capture filter bookmarks and enable the
bookmark button and clear button in CaptureFilterEdit().

Disable the apply button (which starts a capture) for now.

Bug: 11836
Change-Id: Ia33cbb8c9bb839be037112eef26daf744c4ea8f8
Reviewed-on: https://code.wireshark.org/review/13568
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-28 21:56:43 +00:00
Stig Bjørlykke 7fdf4ceaa6 Qt: Update display filter bookmarks when list changed
Recreate the display filter bookmarks menu only when the list
has changed, not every time the display filter changes.

The list changes when removing an entry from the menu and
when changing the list in the "Manage Display Filters" dialog.

Save the list when removing an entry from the menu.

Change-Id: Icd08e0a80085cca55c0e63177d45abe4902c7c3e
Reviewed-on: https://code.wireshark.org/review/13567
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-28 18:28:30 +00:00
Mike78 ef752689da Allow/Create an option to use "capture filter" labels defined in wireshark GUI from CLI
Move ui/filters.[ch] to filter_files.[ch] because dumpcap is using functionality.

Bug: 8091
Change-Id: I195c82fc023f97d6f331b8718c45a2d83d30faea
Reviewed-on: https://code.wireshark.org/review/5925
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-01-27 13:40:24 +00:00
Uli Heilmeier 7e72253c0e Qt: Detect language on Windows and load qt_xx.qm/qt_xx_XX.qm
Sytem language is reported as xx_XX (e.g. de_DE). As we're only
shipping qt_xx.qm in the Windows installer the langfile is missing.

This commits searches for qt_xx_XX.qm and qt_xx.qm files and loads it.
See also https://wiki.qt.io/How_to_create_a_multi_language_application

Furthermore it fixs commit 137dba6e66f58c0dae371e7fb98d3fdd6dc8c1f4
to load qt_xx.qm in the right way.

Change-Id: Iba9e597a44eb42b867542d1d6ffccc55f824bbe1
Reviewed-on: https://code.wireshark.org/review/13525
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
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>
2016-01-26 16:36:00 +00:00
Uli Heilmeier 88cd6552ea Qt: Load qt_XX.qm to translate Qt Strings
The Windows installation includes the Qt translations files qt_XX.qm
in the installation directory (e.g. C:\Program Files\Wireshark\).

However we've tried to load the files only from the
QLibraryInfo::TranslationsPath (C:\Qt\5.3\msvc2013_64_opengl\translations\).
This path is missing in a normal Windows environment.

Therefore strings like "Ctrl" haven't been translated.

Change-Id: I45bc873fdd95fd0ab5c79e70d9ff062274f899fe
Reviewed-on: https://code.wireshark.org/review/13485
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
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>
2016-01-24 00:02:43 +00:00
Stig Bjørlykke ebdaace002 Lua: Added reload_lua_plugins
This makes it possible to trigger reloading Lua plugins from
within a Lua plugin.  This can be used when having a plugin to
update local plugins from a external source.

Renamed reload() to reload_packets() to clarify what's reloaded,
and added a alias (marked as obsoleted) from reload().

Change-Id: I4e529992af5f651613950329e73718dbda317d2e
Reviewed-on: https://code.wireshark.org/review/13024
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-01-11 07:43:36 +00:00
Guy Harris ee9f102aa9 No need for toolkit-dependent color initialization.
We're not allocating colors ourselves in GTK+ (and haven't been doing so
since at least 1.12), and all color_t values are valid colors, so
we don't need any toolkit-specific processing to fill in a color_t.

While we're at it, catch read errors when reading color filter files.

Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b
Reviewed-on: https://code.wireshark.org/review/12985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 04:15:29 +00:00
Michael Mann 5e4bbcda98 Refactor GUI dependencies out of color_filters.[ch] and move it to epan directory.
This also moved color.h into color_filters.h

Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e
Reviewed-on: https://code.wireshark.org/review/12831
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-28 18:33:41 +00:00
Pascal Quantin bfe73e3ad7 Qt: save custom colors in recent_common file
This allows to save colors across sessions for systems other than
OSX that do not provide a system wide color picker

While we are at it, let's stop reading the recent file twice at startup

Bug: 11888
Change-Id: I69ff14d699d8111fe6a8bdac0157fcd115a60c2b
Reviewed-on: https://code.wireshark.org/review/12659
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-16 06:53:24 +00:00
Peter Wu e3dd3f97f1 Qt: fix memleaks related to interface dialog
Also fix a not-so-problematic recent files "leak" when quitting
Wireshark.

Change-Id: I8556b07c197f0934f93d6da8c573c47fbd3fc060
Reviewed-on: https://code.wireshark.org/review/12529
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>
2015-12-16 05:43:58 +00:00
Stig Bjørlykke bfcd1e6514 Qt: Reset preferences when reloading Lua plugins
Reading configuration files may duplicate some entries, so ensure
we reset preferences before reloading.

Change-Id: I746414cbc10c206ddf47669856f329b9e0202a0d
Reviewed-on: https://code.wireshark.org/review/12496
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-10 14:08:58 +00:00
Jeff Morriss eb9d7ebb20 Qt: store the absolute path names of recent files.
That way you can still open a file you recently opened (which was in your pwd)
even if you happen to change directories (as shell-prompt-dwellers such as
myself are wont to do).

(The Gtk GUI already stores absolute paths.)

Change-Id: If29bcc25d680825c659f8eb4f13b108764029652
Reviewed-on: https://code.wireshark.org/review/12483
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:50:53 +00:00
Mikael Kanstrup 74747489ac qt: Refresh local interface list only when interfaces added/removed
Whenever data is received on the iface monitor socket the list of
local network interfaces is refreshed. No check whether an interface
is really added/removed is done. Changes to network interface options
like promiscous mode flag generate traffic on the iface monitor socket
that not necessarily mean an interface was brought up or down resulting
in an unwanted refresh of local interfaces.

When local interfaces are refreshed selected capture interface(s) get
deselected. This in turn makes "Restart current capture" fail with a no
capture interface selected error.

Fixed by moving the refresh action from socket monitor callback to iface
monitor callback where interface up/down status is known.

Bug: 11834
Change-Id: Iffd39c3240049880b5a8311bc6484f3d1433f387
Reviewed-on: https://code.wireshark.org/review/12317
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-03 19:44:35 +00:00
Stig Bjørlykke d7ddebbfb2 Qt: Update menus with new recent settings when changing profile
Update all View options to new recent settings to reflect the changes.
Also show/hide toolbars and packet panes accordingly.

Change-Id: Idb07bd5c51c01810b1f4467d2401936dc533731b
Reviewed-on: https://code.wireshark.org/review/12405
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>
2015-12-03 14:58:58 +00:00
Stig Bjørlykke 28bb60fd48 Qt: Set timestamp precision when changing profile
Change-Id: I85622a8e2689283017ba038ce61d98e22f1c1af3
Reviewed-on: https://code.wireshark.org/review/12403
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-03 09:34:17 +00:00
Stig Bjørlykke 0102033ca3 Qt: Set main window font when changing profile
The font is part of the preferences.

Change-Id: Ibcdf1c06e92fc43547825b5fea9560e904003081
Reviewed-on: https://code.wireshark.org/review/12386
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-03 04:56:54 +00:00
Stig Bjørlykke 6b7da34b4b Qt: Check display filter when changing profile
The Display Filter Macros may have changed and if a macro is currently
used in the display filter then cf_redissect_packets() will bail
out in an assert if trying to apply an invalid filter.

Change-Id: I842016360672d76d190454ce80ccc7604f2075b3
Reviewed-on: https://code.wireshark.org/review/12388
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-03 04:54:50 +00:00
Stig Bjørlykke a488610dd6 ui: Guard update_local_interfaces with HAVE_LIBPCAP
Change-Id: I276193047e37cf581fd42ccc74ff9131ee4fa055
Reviewed-on: https://code.wireshark.org/review/12377
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-02 12:21:58 +00:00
Stig Bjørlykke 92a2661d94 ui: Update interfaces when when changing profile.
The interfaces preferences are different for each profile so ensure
we update the interface settings when changing profile.

This bug was introduced in version 1.8.0.

Change-Id: Icf22670875e01bab6204c300ddc7fb8aeb3dcecf
Reviewed-on: https://code.wireshark.org/review/12363
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>
2015-12-02 11:33:24 +00:00
Stig Bjørlykke ce9d2ee428 Qt: Redissect packets when changing profile
When changing profile the protocol/dissector preferences may change
so we need to redissect according to new settings.

We should probably have a preferences diff to check if a redissect
is needed, like it is in the preferences dialog.

Bug: 11757
Change-Id: I025bbc7297966986a697f2a6368d9a74e3c1ba72
Reviewed-on: https://code.wireshark.org/review/12156
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-26 07:45:16 +00:00