Commit Graph

332 Commits

Author SHA1 Message Date
Guy Harris 0212739598 One more cf_merge_files_to_tempfile() call needed to be changed.
Change-Id: Id109e316714fd1c4843f9ffe1b866ec0e5f5c126
Reviewed-on: https://code.wireshark.org/review/19719
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-21 08:24:24 +00:00
Gerald Combs a5fe96e50a Qt: Fixup drag and drop merging.
Make the behavior of MainWindow::dropEvent match the documentation and
dnd_open_file_cmd. If we've been passed a single file, open it. If we've
been passed multiple files, merge them first. Add an is_tempfile
parameter to openCaptureFile.

Add a note about setting the drop description on Windows.

Bug: 12129
Change-Id: I325a4da5a29e940b4efa7654627d8bcafba15b57
Reviewed-on: https://code.wireshark.org/review/19717
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-21 06:50:56 +00:00
Gerald Combs 05fbb4826b Qt: Show merge progress.
Add "file merge" callback plumbing. Use it to display "Merging files" in
the main statusbar.

Make sure we have a usable window pointer when we merge files.

Change-Id: I236b6edb30685f0b06703ab8304bc88ae592f83c
Reviewed-on: https://code.wireshark.org/review/19716
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-01-21 06:50:30 +00:00
Paul Offord cf941613da Fix Access Violation in plugin_if_mainwindow_get_ws_info(...)
Call to plugin_if_get_ws_info when no packets are being displayed
causes an Access Violation in plugin_if_mainwindow_get_ws_info
as the pointer in cf->current_frame is NULL.

Bug: 12973
Change-Id: I33e8fe6f3894963a6f1f1ec9aa9169f85e1e3b18
Reviewed-on: https://code.wireshark.org/review/19659
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-18 15:07:01 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls
to QVariant conversions with VariantPointer where necessary

Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec
Reviewed-on: https://code.wireshark.org/review/19611
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 16:04:00 +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
Роман Донченко 49fcee3fcb Qt: don't append a second extension to save file names
When checking if the file already has one of the possible extensions,
MainWindow::fileAddExtension reuses file_suffix between iterations and
appends to it each time, so it ends up checking for the wrong suffix for all
extensions except the first one. Scope file_suffix to the for loop to
fix that.

Change-Id: Idbc5a619a4793d8c477bfd88305cdb44ea844e13
Reviewed-on: https://code.wireshark.org/review/19123
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-12-07 20:36:43 +00:00
Guy Harris dd98856afc Have separate merge APIs for regular file/temporary file/standard output.
This is similar to what we have for opening a dump file - one API that
uses the file name as specified, one that creates a temporary file and
provides the file name, and one that uses the standard output.

All of those APIs handle closing the output file.

Change-Id: I56beea7be347402773460b9148ab31a8f8bc51e1
Reviewed-on: https://code.wireshark.org/review/19059
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-04 03:12:23 +00:00
Moshe Kaplan 20c57cb298 Enable exporting objects with tshark
A new "--export-object <protocol>,<destdir>" option is added to tshark.

This required refactoring Export Object behavior in all GUIs to give the
export object handling to the dissector, rather than the ui layer.
Included in the refactoring was fixing some serious memory leaks in Qt
Export Object dialog, crash due to memory scope issues in GTK Export
Object dialog, and addition sorting column feature in Qt dialog (set
up by creating a widget to manage the items that were previously
leaking memory)

Bug: 9319
Ping-Bug: 13174
Change-Id: I515d7662fa1f150f672b1476716f347ec27deb9b
Reviewed-on: https://code.wireshark.org/review/18927
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-02 16:07:35 +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
Dario Lombardo af7fc8b7e4 Qt: add fullscreen feature.
The feature activates/deactivates fullscreen mode of Qt UI.
A new menu item has been added as well as a shortcut (F11 or Ctrl+Cmd+F)
according to browsers common shortcut.

Change-Id: I01906b494d0a13ce70d27c00ebbe03e6ec87cbd7
Reviewed-on: https://code.wireshark.org/review/18332
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-23 23:25:49 +00:00
Pascal Quantin a8e727b636 Qt: reenable export packet bytes menu while capturing
Change-Id: I2a3e35ec7c3233e6b32c53a2124b00bbfff8a2e1
Reviewed-on: https://code.wireshark.org/review/17793
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-09-19 07:38:49 +00:00
Pascal Quantin 7a7f020285 Qt: fix file set menus when stopping a capture or opening a capture after startup
Create file_set_dialog_ window at program start so that file set menu entries
are properly populated

Bug: 12904
Change-Id: I597067da51808000683b15a19df646857082a867
Reviewed-on: https://code.wireshark.org/review/17785
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-19 04:55:05 +00:00
Pascal Quantin d7a07deb19 Qt: fix some menus activation when stopping a capture
Call MainWindow::setMenusForCaptureFile() once the capture is finished
While we are at it, let's deactivate Export PDU and Export Packet Bytes menus while capturing

Bug: 12071
Bug: 12898
Change-Id: I8ab9d531135790b51cd630d3f548d0c47a4a60a5
Reviewed-on: https://code.wireshark.org/review/17784
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-19 04:53:33 +00:00
Stig Bjørlykke 2cac0473be Qt: Add newly saved files to the recent files
Update the recent files list when saving unsaved capture files.

Change-Id: I469fa1f2ce3216c66de328c0b3558c9f9db115e0
Reviewed-on: https://code.wireshark.org/review/17454
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-09-02 17:47:45 +00:00
Guy Harris f930da87a7 Enable "Save As..." iff cf_can_save_as() returns TRUE.
Currently, cf_can_save() really means "*there's something to save* and
we can write it out"; "Save As..." should be enabled even if there are
no changes to save, in case the user just wants to write the existing
file contents out to a new file and have the new file be the current
file.  That matches the behavior of the GTK+ version.

(We might want to enable "Save" even if there are no changes to save;
some other programs do that, such as the TextEdit, WordPad, KWrite, and
gedit simple text editors.  If so, however, we should make "Save" write
stuff out even if there are no changes to save.

Note, however, that we're a bit different from most "editors", in that
we don't read the entire file into memory - we keep the file open and
read packet data from it, because we want to be able to read files that
won't fit into memory.  That *might* change what we ultimately want to
do with "Save".)

Bug: 12630
Change-Id: I8a2327b5d6ddab7c4f0367f132460b507da38577
Reviewed-on: https://code.wireshark.org/review/16612
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 02:17:25 +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
Guy Harris 5d019cfb13 Make quit_after_cap an item in commandline_param_info_t.
And make the commandline_info structure global, so all the places that
look at quit_after_cap can get at it.

Change-Id: I006329cf8842c655cca36f024570855d1b16e107
Reviewed-on: https://code.wireshark.org/review/16182
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 01:40:39 +00:00
Guy Harris 3f49e897f6 Pull quit_after_cap out of the global capture options.
Really, all the GUI-related options should be pulled out, so they're not
cluttering up dumpcap and tshark.

Change-Id: I0276dee2be48bae3498a819d8c0c2747fe1352e7
Reviewed-on: https://code.wireshark.org/review/16180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 00:21:53 +00:00
Gerald Combs 60cdee9e30 Qt: Handle unhandled filter actions.
Handle FilterAction::ActionColorize and ::ActionFind. Remove
::ActionConversation since it was unused. Assert when we encounter a
missing FilterAction, similar to what we do in other parts of the code.

Bug: 12363
Change-Id: I5c1ecd488e5bdb9700a80fc70ec7c047311054b6
Reviewed-on: https://code.wireshark.org/review/16131
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:10:51 +00:00
Gerald Combs fe6856684b Qt: Fix "-l" behavior.
gbcae998 didn't completely fix the missing "-l" behavior.

Bug: 12311
Change-Id: Iee3c844013ac137e94848aaafca7aeb3de43e080
Reviewed-on: https://code.wireshark.org/review/16128
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-06-24 21:23:11 +00:00
Dario Lombardo 2c8056acdf Qt: quit the UI if WIRESHARK_QUIT_AFTER_CAPTURE is set (offline mode too).
This change is useful to use the offline mode in tests (like fuzzing)
that require the software to quit after the processing of a sample.

Change-Id: I311c642edecf4012dc518c2bf8bca66c97aa1b02
Reviewed-on: https://code.wireshark.org/review/16038
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-23 07:58:29 +00:00
Gerald Combs 300e055ab6 Qt: Use queued signals+slots for filter actions
Many of our dialogs can send an "apply this display filter" signal to
the main window. Applying a display filter in turn creates a nested
event loop via cf_read+update_progress_dlg. If the "apply" signal+slot
is directly connected (which is the default, and which means we're
calling into a function table) we can close the dialog while the signal
is firing, which means we return into a deleted object.

Make all of the filterAction signals+slots queued instead of direct.

Bug: 12523
Change-Id: Ica331054c0aa52a7f33bd8df1fa65ecd09fdc292
Reviewed-on: https://code.wireshark.org/review/16080
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-23 03:44:54 +00:00
Gerald Combs bcae998048 Qt: Support the -j, -J, and -l command line flags
Add support for -j, -J, and -l. Mark the -m flag deprecated.

Bug: 12546
Change-Id: Ic44b3997840018e5d571aa1813a1646bce11d4a6
Reviewed-on: https://code.wireshark.org/review/16083
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-06-23 03:03:51 +00:00
Michael Mann 92ea29128f Don't close Wireshark (Qt) if user cancels Save on Close.
Bug: 9635
Change-Id: I8c73c839419cd4bcb850824ffb42bf72eed50b19
Reviewed-on: https://code.wireshark.org/review/16076
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-06-22 23:53:23 +00:00
Pascal Quantin 92f4c7c8d2 Add JSON export to Qt/GTK UI
Change-Id: I5ff46a40cdb1f8f41565d2aa54c6f9e61d397e3a
Reviewed-on: https://code.wireshark.org/review/16013
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-20 01:22:57 +00:00
Gerald Combs b8201aef9d Qt: Main window tab behavior.
Make the main window tab order more closely match the GTK+ UI. Draw a
focus rect in the byte view text while we're here.

Change-Id: I04212c14ea7f0d6865b709533246760adc02f45a
Reviewed-on: https://code.wireshark.org/review/15862
Petri-Dish: Anders Broman <a.broman58@gmail.com>
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>
2016-06-13 18:44:26 +00:00
Gerald Combs 502335612c Use separate main geometry settings for Qt and GTK+.
Qt and GTK+ can have wildly different notions about the top-left
position of the main window, particularly in multiple-screen
configurations. For example, on OS X with the following monitor
arrangment:

  g         .---------.
            |         |
            |         |
  q--------.|         |
  |        |`---------'
  |        |
  `--------'

GTK+ positions windows relative to 'g' and Qt positions windows relative
to 'q'. As a result it's easy for one UI to clobber the settings of the
other.

Split the geometry_main_x and geometry_main_y recent settings into Qt
and GTK+ versions.

In the Qt UI, try moving the main window onscreen before falling back to
the default geometry. This keeps us from losing our size settings.

Add a link to a Qt geometry bug.

Change-Id: If7ae0dcc1719e646299ee3bbf1c88743f655c9a0
Ping-Bug: 12389
Reviewed-on: https://code.wireshark.org/review/15775
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-08 03:41:32 +00:00
Gerald Combs 987ff3ee1b Qt: Firewall Rules dialog.
Add the Firewall ACL Rules dialog. Try showing all valid rules for a
given product instead of making the user select from a combobox.  We can
add the combo back easily enough if that's desired.

Add a rule hint field and use it in the Qt and GTK+ UIs.

Bug: 12469
Change-Id: I39dd840e9838f96d7c5e2b4c34662811c21d0386
Reviewed-on: https://code.wireshark.org/review/15689
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-06-01 23:37:25 +00:00
Guy Harris 3fbd397d35 If we're "[Saving] the file and [closing] it", actually *close* it.
Otherwise, if you've modified the file (added, removed, or changed
comments), and you try to close the file or quit, and answer "Save" to
the "save your work?" question, Wireshark tries to clean up the wmem
scopes, but the file scope hasn't been left, and wmem crashes with an
assertion error.

(The GTK+ version does the close, so it doesn't have the bug.)

Change-Id: Ie5942e415cfab1907e29b09926a62e2679aca6ee
Reviewed-on: https://code.wireshark.org/review/15598
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-28 18:10:49 +00:00
Guy Harris c85120ea1d Consistently pass C++ Boolean constants to saveCaptureFile().
The second argument is a bool, so pass bool constants.

(The C integer constants presumably get coerced correctly, but we might
as well be clean.)

Change-Id: Ia170b443bb9933a8916d9dc25d7492fc8acf1f22
Reviewed-on: https://code.wireshark.org/review/15596
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-28 03:34:56 +00:00
Gerald Combs c245be94c5 Qt: Make sure we pass along a resizeEvent.
Change-Id: I6bf07058b0a5b53fe862f4ca414602c658cf50dd
Reviewed-on: https://code.wireshark.org/review/15168
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-04-29 23:29:38 +00:00
Gerald Combs 69714b7457 Qt: Add recent items to the OS X dock menu.
Qt 5.2 added QMenu::setAsDockMenu. Use it to add recent items to the
Wireshark dock menu.

Add QWinJumpList code which does something similar. Comment it out
because it does it slowly and not-quite-correctly.

Change-Id: I801b1037b998516eacab695f982d7d6e889bafb6
Reviewed-on: https://code.wireshark.org/review/15166
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-04-29 22:41:20 +00:00
Gerald Combs 3c5a9b10b4 Qt: Display filter toolbar behavior tweaks.
By default GtkToolbar shows overflow items in a menu. QToolBar shows
them in a bigger toolbar. This is a problem for users with lots of
display filter expressions because expanding the display filter toolbar
can make it very tall.

QToolBar can optionally overflow into a menu, but as noted in
https://bugreports.qt.io/browse/QTBUG-2472 there isn't a way do so
directly, e.g. with a setter. Force an overflow menu in the display
filter toolbar by adding a child QToolBar and adding filter expression
actions to it.

While we're here, set the minimum width of the display filter edit to
two-thirds of the width of the main window.

Change-Id: I49cd58397e087f1aa79b5bbce471f827e9804148
Reviewed-on: https://code.wireshark.org/review/15134
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-04-28 17:18:18 +00:00
João Valverde 3db13a7fc9 Link version code statically again
This allows keeping the code-sharing with the static linking.

This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more
external dependencies to wsutil than strictly necessary.

A nice side-effect is that libwsutil no longer depends on version.h.

Follow up to f95976eefc.

Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23
Reviewed-on: https://code.wireshark.org/review/15002
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-21 18:59:56 +00:00
Gerald Combs d6f69751c0 Qt: Make some menu items discoverable (or not).
Enable and disable individual actions instead of their parent menus in
order to keep them discoverable.

Do the opposite for Colorize Conversation items so that we don't make
the user traverse the menu hierarchy unnecessarily.

Change-Id: I81770dbbb2d715a2131eb754fedaaadcc8803da2
Reviewed-on: https://code.wireshark.org/review/14558
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: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-04-15 09:03:01 +00:00
Jiří Engelthaler ef220a7e75 Bring back the hotkey for "w" in "... without saving"
The hotkey was intentionally removed in Ie505650889212082e088a525f4b82e62b9177b0d.
The hotkey is present in GTK version but missing in QT version.

Change-Id: Id54e704cd0398b4f07f00c9d1d298409b90d927b
Reviewed-on: https://code.wireshark.org/review/14845
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-04-07 12:31:50 +00:00
Gerald Combs a2c042471b Qt: Lazily create dialogs.
According to the Visual Studio 2013 profiler here, we spend about 4% of
our startup time creating the Capture Interfaces dialog. Hold off on
doing that until the user wants to see the dialog. Do the same for the
File Set dialog.

While we're here, make sure MainWindow has fewer children when setupUi
is called. setupUi calls connectSlotsByName, which iterates over all
child objects.

Change-Id: I253e6dc5b7e73a6cb7b7036637e336f449449c4a
Reviewed-on: https://code.wireshark.org/review/14732
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-04-02 00:26:26 +00:00
Gerald Combs 6931f581f9 Qt: Make conversation menu items static.
Add a ConversationAction and ColorizeAction classes which respectively
handle conversation filtering and colorization.

Move conversation menu initialization to initConversationMenus and call
it once at startup. This keeps us from leaking quite a bit of memory
each time we select a packet or proto tree item.

Bug: 12044
Change-Id: I32e8cedaba08a419d5da6a7a9db31c910909f450
Reviewed-on: https://code.wireshark.org/review/14516
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-28 16:27:41 +00:00
Jeff Morriss 11324a7257 Push initial directory code up into CaptureFileDialog.
That way each (CaptureFileDialog) user doesn't have to (remember to) check the
preference, etc., to figure out what directory to start in.

Change-Id: Ifa60e1ef9dbd11689a3f72906997cf3ed8ce259c
Reviewed-on: https://code.wireshark.org/review/14550
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>
2016-03-26 01:44:07 +00:00
João Valverde 52dd4fb633 Fix building without extcap enabled
Using cmake -DENABLE_EXTCAP=no or ./configure --without-extcap.

Some documentation fixes too.

Change-Id: Iebf9c843d67e10a32de1a62904de8f88b872ec99
Reviewed-on: https://code.wireshark.org/review/14522
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-21 17:10:21 +00:00
Gerald Combs 070fc33e85 Qt: Update selected interface filter behavior.
Change the selected interface behavior in the main window and the
capture interfaces dialog to better handle multiple selections. Attempt
to document this at the top of interface_tree.cpp.

Move the default capture filter code from CaptureFilterEdit to
MainWelcome. Add a "conflicting filter" check to CaptureEdit which
updates the placeholder text.

Handle conflicting filters in the main welcome screen and the capture
interfaces dialog. Propagate interface selections and filter updates in
the capture interfaces dialog to the main welcome screen.

Consolidate some of the interface handling code in InterfaceTree and
CaptureInterfacesDialog.

Make sure CaptureInterfacesDialog manages the global capture options by
device name instead numeric index.

Start deprecating prefs.capture_devices_filter and
capture_dev_user_cfilter_find.

Change some member function names so that they're hopefully more clear
and consistent.

Ping-Bug: 11886
Change-Id: I63b06dbae29c2c45ee9252092ad54bdcbacae6e6
Reviewed-on: https://code.wireshark.org/review/14129
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-02-26 17:28:04 +00:00
Peter Wu 08c3bbbbb6 qt: show marker when capture file comment has changed
Fixes a missing "*" marker in the title and this warning when the
capture file comment is modified:

    QWidget::setWindowModified: The window title does not contain a '[*]' placeholder

Change-Id: Iea0a63cf8c8f9abd577397c8881f0399d2e798ba
Reviewed-on: https://code.wireshark.org/review/14010
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-02-24 10:04:58 +00:00
Stig Bjørlykke 61f73a3262 Qt: Update AccordionFrame widgets to use common layout
- Use QPushButton for buttons and set the "Find" button as default
  in SearchFrame.
- Use QPushButton for buttons, added a "Packet:" label, and set
  the "Go to packet" button as default in GoToFrame.
- Set Qt::WA_MacSmallSize in OS X for FilterExpressionFrame and
  PreferenceEditorFrame.
- Removed QFrame::StyledPanel and QFrame::Raised from ColumnEditorFrame.
- Update ui files to reflect that AccordionFrame is used for
  AddressEditorFrame, FilterExpressionFrame and PreferenceEditorFrame.

Change-Id: Icfbfff973535317997109a1020dfe24ba932e098
Reviewed-on: https://code.wireshark.org/review/13995
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-02-19 12:16:16 +00:00
Peter Wu 8899e006aa Fix memleaks related to get_dirname
get_dirname may return NULL instead of the original string, so avoid
patterns like get_dirname(strdup(x)). Writing to
cf_path.toUtf8().data() is fine btw, toUtf8() returns new memory.

This fixes two memleak reported by LeakSanitizer via fileset_add_dir and
MainWindow::captureFileReadFinished (both via cf_callback_invoke).

Change-Id: I0f1528763e77e1f55b54b6674c890a9d02302ee8
Reviewed-on: https://code.wireshark.org/review/13691
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04 04:57:30 +00:00
Stig Bjørlykke a7d07e9edc Qt: Check for file changes on Reload
Check if having unsaved changes and offer a save before reload
and reload as file format/capture.

Bug: 12003
Change-Id: Ic4282e0a17a4ec745e729eb93863fc15e7ec611b
Reviewed-on: https://code.wireshark.org/review/13535
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-26 18:14:17 +00:00
Stig Bjørlykke 06e5197867 Qt: Improved testCaptureFileClose dialog texts
Make the "Unsaved packets" dialog question and informative text
use the same layout for all cases.

Added before_what texts when opening another file and closing the
file.  Changed the texts for restarting the capture.

Renamed FileCloseButtons to FileCloseContext to use it for other
checks than just button texts.

Change-Id: I4a39852a1c18e8ffb7fa6b5c800a84500f995bc8
Reviewed-on: https://code.wireshark.org/review/13524
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-26 18:03:45 +00:00
Stig Bjørlykke 720f57d000 ui: Code cleanup
Fixed code layout to use common style in the file.
Mostly whitespace changes.

Change-Id: Id37b57717a9e26248fad07322dff09b1d1f45ac2
Reviewed-on: https://code.wireshark.org/review/13504
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>
2016-01-23 23:15:54 +00:00
Stig Bjørlykke 77046c0c2d Qt: Add some window title variables
Add some variables to be used in custom window title.

%P = profile name
%V = version info

Change-Id: I049717432a4d3523b541bb4f6f882c75abc38ddb
Reviewed-on: https://code.wireshark.org/review/13419
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-21 18:22:05 +00:00
Stig Bjørlykke 56bffba031 Qt: Update window title when preferences changed.
When switching profile the prefs.gui_window_title may have changed
so ensure we update the main window title.

Change-Id: Ic1f9c7ac075d77c60cfbebb20624e597f7eb8449
Reviewed-on: https://code.wireshark.org/review/13418
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-19 18:13:02 +00:00