Commit Graph

120 Commits

Author SHA1 Message Date
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
Gerald Combs 1afe288c8c More packet detail context menu items.
Add the wiki and field reference items to the packet detail context
menu. Add the "Go To Linked Packet" item in the Go menu and packet
detail context menu. Use "Linked Packet" instead of "Packet Reference"
and "Corresponding Packet". Remove more pending item comments.

Change-Id: I66c40f71738f0996690f4818a546520ea0747088
Reviewed-on: https://code.wireshark.org/review/9841
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-01 01:07:23 +00:00
Gerald Combs 17320173f8 Add an application-wide style sheet.
Use it to work around poorly drawn splitters on OS X.

Change-Id: Ic8e7331b1ba37fe783312b4460961f361297c7f0
Reviewed-on: https://code.wireshark.org/review/9798
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-27 15:48:01 +00:00
Michael Mann cdeae7e72b Add a "heuristic dissectors" tab to the Enable Protocols dialog.
This allows for a global place to enable/disable all heuristic dissectors.  This removes the need for individual dissector preferences, but those will be removed at a later date.  The more important part is the epan code to save/restore the enabled state of the heuristic dissector.  The GTK dialog was more for quickly testing the feature (there was already some GTK code in place that started the heuristic dialog tab)

Change-Id: Ie10687505c27a4456c49d5c4c69a5fc5f6394275
Ping-Bug:11152
Reviewed-on: https://code.wireshark.org/review/9508
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-07-14 11:28:55 +00:00
Gerald Combs a8faa04234 Qt: Add dynamic menu support.
Generalize the dynamic menu code and make it possible to connect
multiple types of actions to their corresponding slots.

Change-Id: Ib915ad5a666310e2a6e366fada006336820d1653
Reviewed-on: https://code.wireshark.org/review/9568
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-09 00:05:51 +00:00
Gerald Combs e91ca72a44 Qt: Add initial Lua support.
Add a FunnelStatistics class, which is the main interface between the Qt
UI and the Funnel API.

Add FunnelTextDialog, which implements the text_window, ProgDlg, menu,
and other routines. Add FunnelStringDialog, which implements dlg_new.

We currently only support "Tools" menu items (MENU_TOOLS_UNSORTED, aka
REGISTER_TOOLS_GROUP_UNSORTED). Add a disabled placeholder to the
"Tools" menu in case we don't load any scripts.

Use "struct progdlg" instead of needlessly casting to
funnel_progress_window_t.

To do:
- Add support for MENU_STAT_UNSORTED, MENU_STAT_GENERIC, etc.
- Make the firewall config generator a Lua script?
- Add FunnelGraphDialog? It seems like it would be useful to
  make QCustomPlot accessible to Lua scripts.

Ping-Bug: 9845
Change-Id: Iefff02e9032ed1853666f7902509ed08b431e7a7
Reviewed-on: https://code.wireshark.org/review/9523
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-07-07 20:49:30 +00:00
Michal Labedzki c5ec50ed1d Add missing C++ header
This fixes:
ui/qt/wireshark_application.cpp:588:5: error: 'sort' is not a member of 'std'
     std::sort(sgi_list.begin(), sgi_list.end(), qActionLessThan);

Change-Id: I70058f0fcbabb0279bed5c62d09d55d88bda0fd4
Reviewed-on: https://code.wireshark.org/review/9492
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-07-04 15:31:21 +00:00
Gerald Combs fdb85029fd Add ServiceResponseTimeDialog.
Add ServiceResponseTimeDialog as a subclass of TapParameterDialog,
similar to StatsTreeDialog. Add initial plumbing for statistics menu
items and command line invocation.

Don't append "..." to menu item names. Don't add menu icons. In each
case this avoids repetitive UI clutter.

Change-Id: I463b95c93090160bb81d2e80b16aad389dc0bd6c
Reviewed-on: https://code.wireshark.org/review/8864
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:09:13 +00:00
Peter Wu 5ab45709d6 gtk,qt: Fix minor buffer underrun
Avoid accessing the first byte before an empty dirname. No idea why this
was not triggered before. Reproduced with an empty Wireshark profile and
wireshark and wireshark-qt.

Caught with ASAN.

Change-Id: I44f8fdab03ad0f24e663df63a1c54567996a3dfc
Reviewed-on: https://code.wireshark.org/review/9037
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-22 22:54:19 +00:00
Gerald Combs 2156413bf9 Qt: Column preference fixes.
Don't call redrawVisiblePackets in PacketList::sectionResized. Otherwise
we trigger the crash in bug 11179. Call recent_set_column_width instead.

Clean up the slots called when column preferences change and when recent
column widths change.

Update our column visibility in redrawVisiblePackets.

Use recent_get_column_width when writing the recent file. columnWidth
doesn't return a valid value when we're not visible.

Bug: 11179.
Change-Id: I34ab93d944b341e42129a1c8ff94ba8f7ad4f5fc
Reviewed-on: https://code.wireshark.org/review/8457
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-14 15:37:35 +00:00
Gerald Combs 04f6b557b7 Add a comment.
Change-Id: I82d31ce4435f1c136e158a007c9d4507e47a73a6
Reviewed-on: https://code.wireshark.org/review/7743
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-19 00:02:11 +00:00
Michal Labedzki e6f3da96f8 Qt: Fix recent files threads
Fix crash and memory leak. Please not that
Recent File Status objects and threads still
continously grow and shrink memory usage, but do not
grow continuously.

Bug: 10893
Change-Id: Icc8b7fefd6572b902ac81d22e5f7b16e304fcf16
Reviewed-on: https://code.wireshark.org/review/7699
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-18 08:51:55 +00:00
Michal Labedzki 4e82b9c7de Qt: Start address resolver timer
Change-Id: Ic3de3db089f25d9fdfd6100f916b3960e52046f0
Reviewed-on: https://code.wireshark.org/review/7715
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-03-17 22:00:43 +00:00
Gerald Combs 30ed6a1d72 Qt: Apply recent settings.
Add PacketList::applyRecentColumnWidths which set the packet list
column widths from our recent settings. Make sure it gets called at
startup and when we change profiles.

Save the packet list header state so that we can restore it when we
reset the model (i.e. freezing and thawing) and load a new capture file.
Save the state when the user resizes a column. As a side effect this
works around a weird bug that adjusts the width of column 1 at an
inopportune time.

Add a profileChanging signal so that we can save the main window geometry
in each profile.

Get rid of MainWindow::configurationProfileChanged. It was unused.

Apply saved pane widths and heights. Note that we might want to add a
separate pair of recent settings for the Qt panes.

Use the last opened directory in the capture file dialog.

Git rid of some unneeded Q_UNUSEDs while we're here.

Bug: 10953
Change-Id: I812aff59818cf0b4d1598b580627d32728d2e9d7
Reviewed-on: https://code.wireshark.org/review/7247
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-24 09:58:03 +00:00
Gerald Combs 6e88978fd9 Qt: More #include → forward declarations.
Change-Id: Ib6de71f801cd3053374b6c867370acd594dcd396
Reviewed-on: https://code.wireshark.org/review/7089
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-02-13 02:31:16 +00:00
Gerald Combs c34ded4ae2 Qt/C++: Change a bunch of includes to forward declarations.
In theory this this should reduce compilation times. On my particular
system it makes no difference but hopefully it will elsewhere.

Change-Id: I570177d3ca4eec691c82d46b4dbbce74092aac1d
Reviewed-on: https://code.wireshark.org/review/7060
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-02-10 19:59:43 +00:00
Gerald Combs e76e14074e Qt: Fix library path reset.
g9a3676a reset the Qt library path *after* wsApp was instantiated, which
is too late. Do so before QCoreApplication has a chance to do anything
we might regret.

Change-Id: Ibbdb69d1b7c0ea4bf1042e98a5bb5deba13e954e
Reviewed-on: https://code.wireshark.org/review/6864
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-30 23:37:18 +00:00
Gerald Combs 9a3676accb Qt: Clear our library path at startup on Windows.
I recently rebuilt my Windows development VM and discovered that I could
no longer run Wireshark executables from wireshark.org. Trying to do so
failed with the following error:

----
This application failed to start because it could not find or load the
Qt platform plugin "windows".

Available platform plugins are: minimal, offscreen, windows, windows.

Reinstalling the application may fix this problem.
----

As it turns out there are two issues. According to
http://doc.qt.io/qt-5/windows-deployment.html The search path
for Qt plugins is hard-coded into the QtCore library. Dependency
Walker confirmed this, showing that Qt5Core.dll tried to load
C:\Qt\5.3\msvc2013_64_opengl\plugins\platforms\qwindows.dll instead of
C:\Program Files\Wireshark\platforms\qwindows.dll.

The second issue is that the Qt online installer only uses the major
and minor version, e.g. C:\Qt\5.3. This means that you can end up with
Qt 5.3.0, .1, .2, or .3 depending on *when* you run the installer.

The Windows builders have 5.3.1 installed while my development VM
has 5.3.2. Apparently qwindows.dll is not compatible between these two
versions, hence the startup error. (...so what happens if you can create
a malicious qwindows.dll which *is* compatible on someone's machine?)

This change removes any entries from QCoreApplication::libraryPaths that
don't match our executable path. This shouldn't be an issue in our case
because both the NMake+QMake and CMake environments run windeployqt to
copy in any required DLLs.

If it *is* an issue or if clearing the library path list causes other
problems I can reinstall Qt on the Windows builders into a unique and
obvious path, e.g. C:\Qt-check-your-path-before-you-wreck-your-path\5.3

Change-Id: I1918bc4e520aba32cfcf9f4ccd37bf9255058cbe
Reviewed-on: https://code.wireshark.org/review/6863
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-30 21:11:04 +00:00
Gerald Combs 4556498f33 Qt: Convert more dialogs to WiresharkDialog.
Make the Sequence, IO Graph, Statistics Tree, and VoIP Calls dialogs
subclasses of WiresharkDialog.

Remove "Stats Tree" from Statistics Tree dialog titles. Don't complain
if the user opens more than one instance of the dialog.

Use the applicationName property in WiresharkApplication instead of a
separate variable.

Add a preexisting item to the IO Graph bug list (hovering when the file
is closed clears the graph).

Change-Id: I8411a25305d00b16e0d4a82fa50a9bad5c85b239
Reviewed-on: https://code.wireshark.org/review/6125
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-30 03:34:03 +00:00
Gerald Combs e8ec11fb7e Qt: Add a WiresharkDialog convenience class.
Add WiresharkDialog, a common base class for dialogs centered around
capture files. Make it a parent of Capture File Properties, Traffic
Table, Conversations, and Endpoints.

Rename CaptureFile::read_only_ to file_closed_. Add methods to
WiresharkApplication for generating consistent window titles.

Change-Id: Idc771556d8192e60f85dddc08fc4757698dee257
Reviewed-on: https://code.wireshark.org/review/6097
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-29 01:42:13 +00:00
Alexis La Goutte 91cc34343f Qt (emitAppSignal): Missing break in switch (CID 1159204)
Change-Id: Ia2ba40a4fc284dbf3da8e27edf336a4e27cdb4e3
Reviewed-on: https://code.wireshark.org/review/6000
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-23 13:55:50 +00:00
Gerald Combs 5cdad9fe42 Qt: Add methods to CaptureFile and WiresharkApplication.
Add isValid, fileTitle, and retapPackets methods to CaptureFile. Add
application name and title separator convenience methods to
WiresharkApplication.

Convert traffic tables, conversations, and endpoints to use CaptureFile
directly and to let the user know when the capture file is closed. Set
the file dialog titles while we're here.

Change-Id: I990392786d3833e1e0b3638aa2d34a5ada39fa13
Reviewed-on: https://code.wireshark.org/review/5957
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-22 18:12:31 +00:00
Gerald Combs 9ba9cd83a4 Qt: Add a CaptureFile class.
Wrap the capture_file struct in a QObject which translates cf_cb_* and
capture_cb_* events into signals. Move the global cfile to
capture_file.cpp.

Don't use a void pointer for the capture file struct.

Change-Id: Ic5d5efb4bb1db64aa0247245890e5669b1da723a
Reviewed-on: https://code.wireshark.org/review/5885
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-20 17:39:29 +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
Stig Bjørlykke ea167053ff Improved deregistering fields.
This improvement avoids use of deallocated memory (crash) if using a
deregistered field in display filter, color filter, custom column and
other cases when the field is used as "interesting field".

This functionality is currently used in http, imf and ldap preferences.

Also removed unused proto_registrar_n() as this does not work correctly
after deregistering fields.

Change-Id: I043e3bf7a98bd773c9801e712a012d1eab8a7f94
Reviewed-on: https://code.wireshark.org/review/5161
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-11-10 08:01:12 +00:00
Guy Harris 72c70b6abe Call the default language preference setting "Use system setting".
That more correctly describes it - it doesn't do any form of automatic
detection of anything, it just picks up the system settings from
wherever Qt picks them up.

Change-Id: I62d40719728cc9735e3b8f3e4202b7e61fc3f43b
Reviewed-on: https://code.wireshark.org/review/5165
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-07 00:47:32 +00:00
Michal Labedzki 5025bc258c Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all
  translations working
- dynamic list of supported languages
- runtime change of GUI language (no need to restart application)
- add flags icons support
- search for *.qm languages in buildin resources, then
  data dir called "languages" (main directory in sources or
  /usr/share/wireshark/languages), then user directory
  (UNIX: ~/.wireshark/languages); "languages" directory should contains
  files wireshark_xx.qm where xx is language code (en, en_GB, etc.),
  and optional xx.svg for flag icon
- try to fix some untranslated manually-created UI items
  (need manual reset text of those components)

Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229
Reviewed-on: https://code.wireshark.org/review/5041
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-04 08:21:55 +00:00
Gerald Combs c5e66b172e Qt: Add a set of 2x 24-pixel toolbar icons.
Add a script to create each PNG from its source SVG using Inkscape
(which can conveniently be run from the command line).

Change-Id: Ief7410cf76fb1553ce56f1c6bc1ade03ab5db1d6
Reviewed-on: https://code.wireshark.org/review/4964
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-28 00:40:16 +00:00
Gerald Combs c0cdf9473a Qt: Keep dialogs from blocking tests.
If WIRESHARK_QUIT_AFTER_CAPTURE is set, call exit(0). This keeps us from
emitting the aboutToQuit signal and doing things that might pop up
dialogs.

Change-Id: I6e986b6e7ad824d8b5258e34a12c32869f5b2d34
Reviewed-on: https://code.wireshark.org/review/4421
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-02 17:40:20 +00:00
Gerald Combs 1749e5eace Qt: Adjust X11 font search order.
Liberation Mono appears to be the preferred font nowadays.

Change-Id: Ie953bdb8ba77df6486607dc076daa24225b2f08f
Reviewed-on: https://code.wireshark.org/review/4326
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-26 22:56:28 +00:00