Commit Graph

149 Commits

Author SHA1 Message Date
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
Stig Bjørlykke 0ae19656e1 Qt: Fixed column issues when changing profile.
Always initialize prefs.col_list in pre_init_prefs.
When switching to a profile without a saved 'preferences' file we
have to initialize prefs.col_list to default values to avoid reusing
settings from the profile we leave.
This was introduced in 5012cf84e6

Emit columnsChanged() before preferencesChanged().
This because columnsChanged() rebuilds cap_file_->cinfo which is used
in preferencesChanged() to align columns (and possible other actions).
Doing this in the wrong order will give an inconsistency and a
heap-buffer-overflow if having different number of columns.

Bug: 11493
Change-Id: I5792dfc0ede11b9457b96f092af8da00453787b1
Reviewed-on: https://code.wireshark.org/review/11971
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-20 07:57:25 +00:00
Gerald Combs b05803db4b CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.

We haven't compiled C++ code with -Wshorten-64-to-32 for quite 
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.

Additionally, squelch

----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
        with
        [
            _Iter=QList<QString>::iterator
,            _RanIt=QList<QString>::iterator
,            _Diff=int
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
        .\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
        with
        [
            _RanIt=QList<QString>::iterator
,            _Pr=bool (__cdecl *)(const QString &,const QString &)
        ]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----

in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.

Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
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-10-16 21:32:22 +00:00
Gerald Combs b4a4de78d8 Use buttons to display the main status bar icons.
Use QToolButtons to display the expert indicator and comment icons in
the main status bar. Use the same style sheet hack we use in
ProgressFrame to un-style the buttons.

Make sure we specify the @2x comment icon in our .qrc file so that it's
loaded and used on retina displays. Move the comment and expert .pngs to
the stock icon directory and use StockIcon to load them. Remove
status.qrc since it's no longer used.

Change-Id: I84485b22656f8f9af29ad3c02446ffefb6657ed5
Reviewed-on: https://code.wireshark.org/review/11048
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-10-16 03:52:42 +00:00
Gerald Combs 31aefa4bd9 Fix initialization order.
Change-Id: I5eb59108860c9282d798aedfe40eccf1ee85658d
Reviewed-on: https://code.wireshark.org/review/10805
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-05 16:31:57 +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
Pascal Quantin 4fbfd3eca5 Qt: fix uninitialized members (UNINIT_CTOR) reported by Coverity (CID 1228882)
Change-Id: I1f09fa9a8421e702d2fff963afc899617f2e6222
Reviewed-on: https://code.wireshark.org/review/10794
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-05 11:50:53 +00:00
Gerald Combs 2496aed28e Qt: Don't update the recent list while capturing.
If a recent file is on a network share we'll create traffic which can
show up in the capture.

This doesn't fix the issue entirely, e.g. if you're capturing in one
instance of Wireshark and have another one open. The proper fix in that
case is to switch to QFileSystemWatcher as described at the top of
::WiresharkApplication.

Ping-Bug: 11546
Change-Id: If21f1bb213fe1d862c09b1b2edd78c8baf983461
Reviewed-on: https://code.wireshark.org/review/10774
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-10-05 02:58:28 +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
Gerald Combs b4e972b729 Fix a bunch of leaks found by Valgrind.
Change-Id: I8862ed15d354aee487bacd80ab5fb4918423287e
Reviewed-on: https://code.wireshark.org/review/10487
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-09-11 20:37:09 +00:00
Gerald Combs 0e9389bb47 Display filter edit updates.
Have the bookmark button operate on saved display filters, similar to
the "Filter:" button in the GTK+ UI. Expose the saved display filter
list via a popup menu.

Update the display filter icons. Make the "Apply" button wider. Remove
the old icon assets.

Add a StockIconToolButton class along with note explaining why it's
necessary.

Rename the "Filter Bookmarks" preference to "Filter Shortcuts".
Suggestion for a better name are welcome.

Change-Id: I0082d3f01b017253fa75e51cbff9beb17c41a209
Reviewed-on: https://code.wireshark.org/review/10390
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-09-06 01:43:21 +00:00
Gerald Combs a69a515f28 Add a version check to our splitter styling.
According to https://bugreports.qt.io/browse/QTBUG-43425 the OS X
splitter rendering issue will be fixed in Qt 5.6.

Change-Id: I99e000d96f8f61cd654be3808fd79577bac11d88
Reviewed-on: https://code.wireshark.org/review/10381
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-04 16:30:15 +00:00
Gerald Combs 374439daa1 Don't emit app signals from dialogs.
Emitting PacketDissectionChanged from a dialog on can render the main
window unusable on OS X. A workaround for this was added to the
preferences dialog in g8fc2327. Generalize the workaround and use it
elsewhere.

Fix the "Enabled Protocols" action name while we're here.

Bug: 11361
Bug: 11448
Change-Id: I89e98daaaedc877d3b13b0d33b6f3be033e323d7
Reviewed-on: https://code.wireshark.org/review/10271
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-08-26 22:02:19 +00:00
Guy Harris 2bc6f01977 *More* issues.
Change-Id: Ib415582f4bf2529c412bed329b3ee7daccde29b0
Reviewed-on: https://code.wireshark.org/review/10042
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-15 16:48:09 +00:00
Guy Harris 8368f3b7f0 Update the previously-added comment.
At least with kqueues, NOTE_REVOKE is delivered if the file system
containing the vnode in question is unmounted, and that gets mapped to a
change notification by QFileSystemWatcher, so the right thing should
happen.

I'm not sure whether the right thing happens on Windows.

Change-Id: I1e4c0d510f31f68d574c4d4cf20524666382930f
Reviewed-on: https://code.wireshark.org/review/10039
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-15 03:59:58 +00:00
Guy Harris 463caf8c55 Discuss alternatives to polling all the recent files every 2 seconds.
Somebody asked about repeated SMB traffic when running the Qt Wireshark:

https://ask.wireshark.org/questions/45036/permanent-smb2-traffic-with-1997

and that's due to said polling.  On the main desktop platforms (Windows,
OS X, Linux) we can use QFileSystemWatcher plus, on Windows and OS X,
some additional stuff to check for unmounts (and get FreeBSD as a
freebie, as it works the same as OS X), and avoid timeout-based polling.

Change-Id: I3a1d0110fedcdb442ed09c16dab4bf0cb06ca331
Reviewed-on: https://code.wireshark.org/review/10038
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-15 01:49:49 +00:00
Stig Bjørlykke 5a926946f4 Initialize is_reloading_lua at startup
Change-Id: I211e0f4b86cff1c311d4ae67cbb47de14846144f
Reviewed-on: https://code.wireshark.org/review/9997
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-12 12:52:16 +00:00
Stig Bjørlykke ecc4f756bd Added Reload Lua plugins.
This is initial support for reloading Lua plugins without
restarting the application.

Still todo:
- Deregister FileHandlers
- Support deregister ProtoField with existing abbrev (same_name_hfinfo)
- Add a progress dialog when reloading many plugins
- Search for memory leakages in wslua functions

Change-Id: I48870d8741251705ca15ffe1068613fcb0cb18c1
Reviewed-on: https://code.wireshark.org/review/5028
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 12:09:07 +00:00