Commit Graph

477 Commits

Author SHA1 Message Date
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
Paul Offord d1cb746822 plugin_if: Add function to get capture file info
This is an enhancement to allow a plugin to obtain capture file
and other status information via a simple plugin_if call

Added GTK port to this revision

Bug: 11968
Change-Id: Ibcf4e8b43c6f3b48e971fa4020a07cc273234fb8
Reviewed-on: https://code.wireshark.org/review/13103
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-15 11:39:58 +00:00
Stig Bjørlykke 8572c6abe7 Qt: Separate window titles with Em dash on OS X
The window titles on OS X are usually separated by Em dash,
so use this when appending prefs.gui_window_title.

Change-Id: Ice46179fc872eefc7662b42052b428eabf1b6d61
Reviewed-on: https://code.wireshark.org/review/13256
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-14 07:28:43 +00:00
Stig Bjørlykke 91c166867d Qt: Add back setWindowFilePath
With support for prepend and append to the window title.

Change-Id: I2215a080b85d36ceb47495bbb94617743fc3f83e
Reviewed-on: https://code.wireshark.org/review/13031
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-14 07:27:36 +00:00
Michael Mann c62547b951 Refactor "Follow Stream" functionality on all GUI interfaces.
Create a "registration" system for Follow functionality so most of the work can be abstracted into a dissector and GUI can just be responsible for "display".
This also removes the global variables in follow.c to open up multithreading possibilities.

TCP, UDP and HTTP all have the same "tap interface" for Follow functionality (passing a tvb with byte data to "follow"). SSL still has it's own behavior, so Follow structures have to take that into account.

TShark through the Follow registration now has support for HTTP.

The only thing possibly missing is dynamic menu generation to further reduce explicit knowledge of Follow "type" (and rely on registration)

Bug: 11988
Change-Id: I559d9ee1312406ad0986d4dce9fa67ea2103b339
Reviewed-on: https://code.wireshark.org/review/13161
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-12 15:08:18 +00:00
Stig Bjørlykke da798683de Qt: Refactor testCaptureFileClose
Cleanup arguments and simplify code for button texts.

Change-Id: Ie505650889212082e088a525f4b82e62b9177b0d
Reviewed-on: https://code.wireshark.org/review/13180
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-12 14:20:25 +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
Stig Bjørlykke 2440f534b1 Qt: Fix testCaptureFileClose without packets
In MainWindow::testCaptureFileClose() we must always stop a running
capture if closing, even if not having any packets, because
cf_close() will fail (assert) if still in progress.

This fixes an issue (crash) when closing the application with
a running capture without packets.

This also fixes restarting current capture without packets, both
with and without "Confirm unsaved capture files".

Bug: 11981
Change-Id: Id0655fcc799682a4f45c855bc2e76386dffc35a5
Reviewed-on: https://code.wireshark.org/review/13121
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-10 19:23:19 +00:00
Gerald Combs 308b653da2 Qt: Queue up redissection.
Make the WiresharkApplication::packetDissectionChanged →
MainWindow::redissectPackets connection queued rather than direct.
redissectPackets eventually calls update_progress_dlg, which processes
UI events.

This should keep the profile dialog from destroying itself prematurely
in a nested event loop when the user hits "OK".

Bug: 11979
Change-Id: I7276e08c1911708c3aca5ff05ab6a40bfc336add
Reviewed-on: https://code.wireshark.org/review/13134
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-01-08 21:44:48 +00:00
Alexis La Goutte 936359053a Qt: Add gui.prepend_window_title option
Bug: 11102
Change-Id: I659b6be4652a65542c217370e01340e4696c0e31
Reviewed-on: https://code.wireshark.org/review/12653
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-29 18:01:27 +00:00
Alexis La Goutte 6c42a103e8 Qt: Add support of gui.window_title
Ping-Bug: 11102
Bug: 11691
Change-Id: I7b1673ffafcda644f4905265061ba11733dd91d3
Reviewed-on: https://code.wireshark.org/review/12650
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-29 18:00:47 +00:00
Alexis La Goutte f145108f5e Qt: Remove usage of setWindowFilePath
Change-Id: I29591709d88d1858e44c753d09e4a29d0f28ce53
Reviewed-on: https://code.wireshark.org/review/12781
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-29 18:00:14 +00:00
Michael Mann ea2a3ac402 Initialize Qt info_data_t structure in constructor.
GTK and TShark should already have structure initialized to 0 because they are global variables.

Change-Id: I43a38c58f32967d201ddf78e450b2483f28f8bd6
Reviewed-on: https://code.wireshark.org/review/12847
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-23 18:22:38 +00:00
Stig Bjørlykke 8bd135366e Added HAVE_LIBPCAP guards
The info_data struct is only when HAVE_LIBPCAP.

Change-Id: I30a3f974cbe3c1474bfe288b222f5871d674bada
Reviewed-on: https://code.wireshark.org/review/12846
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-23 12:11:21 +00:00
Roland Knall 35ee09e0f0 capture_info: Fix initialization of packet counter
g_hash_table_destroy will crash, if it is called on
 non-initialized memory. For some reason, this does not happen
 with other glib lists (e.g. GList seems to guard cleanly).

 This change initializes at the earliest possible time the
 packet counter hash with NULL

Change-Id: Ice66652fc9639d10b49d006ecbe80efe3f41e2ff
Reviewed-on: https://code.wireshark.org/review/12841
Reviewed-by: Roland Knall <rknall@gmail.com>
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-23 11:35:25 +00:00
Michael Mann 39bdeb2706 Confirm discarding data before restarting capture.
Modify existing MainWindow::testCaptureFileClose() to handle restart scenario.

Bug: 9605
Change-Id: Ie57624ca482b050745474f5e1c61343f60292a42
Reviewed-on: https://code.wireshark.org/review/12733
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-21 13:26:30 +00:00
Stig Bjørlykke e73fc7e51e Qt: Removed applyRecentColumnWidths from recentFilesRead
Adjusting column widths from recent settings is only needed
when columns has changed.

Don't recreate the columns when changing timestamp options or
name resolution, only reset columns.

Change-Id: I4c9a9f63c34542935dd282188d98b2b5b013c5f3
Reviewed-on: https://code.wireshark.org/review/12579
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-13 18:50:53 +00:00
Pascal Quantin afaf929d0d Qt: various fixes to VoIP calls / RTP player windows
- Flush any remaining tapped packets before emitting captureFileRetapFinished().
  This ensures that all packets have been treated before returning from retapPackets().
- Remove VoIP tap listeners when captureFileRetapFinished() is emitted.
  This avoid summing stats each time the RTP player is opened, leading to wrong
  information in VoIP calls window
- Change voip_calls_tapinfo_t redraw member from a boolean to bitmap so as to identify
  which tap should call the tapinfo->tap_draw() callback. This allows fixing a race condition
  where the RTP player can be empty in Qt UI
- Reset some more statistics in voip_calls_reset_all_taps()

Change-Id: Ie7681702c81d338185c1813f2d340a437edf3a04
Reviewed-on: https://code.wireshark.org/review/12474
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: Anders Broman <a.broman58@gmail.com>
2015-12-09 16:54:33 +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 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
Alexis La Goutte 78d664ce7e main_window: fix no previous prototype for function 'plugin_if_mainwindow_gotoframe' [-Wmissing-prototypes]
Change-Id: I2ac9d2250e8553b4cbd4146f931b618424dffdf5
Reviewed-on: https://code.wireshark.org/review/12304
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: 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>
2015-11-30 20:49:57 +00:00
Guy Harris cc9e444b4e We *do* use setWindowModified; remove the XXX comment saying to do so.
Change-Id: I00ffc4c787681a6bf2c84da9e44b3b3a33c0cec5
Reviewed-on: https://code.wireshark.org/review/12039
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-22 18:48:06 +00:00
Stig Bjørlykke 358615019b Qt: Added translate for "Capturing from ".
Change-Id: Ibd7b47169229395e5468ee2422c3dab7abe36413
Reviewed-on: https://code.wireshark.org/review/12022
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-22 14:51:46 +00:00
Stig Bjørlykke a02fc3b094 Qt: Set normal window icon when capture file closed.
Also rename and use setDefaultWindowTitle() to set the window title
back to "The Wireshark Network Analyzer".

Change-Id: Ifa87d1a9b9140de4f256effdfca8485f65e2f839
Reviewed-on: https://code.wireshark.org/review/12025
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-22 14:49:37 +00:00
Stig Bjørlykke 13297438d9 Lua: Disable Reload Lua Plugins while reading file.
Hide the menu item if built without Lua.

Change-Id: I316cddd55064da590eb4167b495a7fb00a41581f
Reviewed-on: https://code.wireshark.org/review/11931
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-11-18 07:18:50 +00:00
Gerald Combs 7518a74dbb Qt: Fix a merge crash.
Update the logic in ui/qt/main_window.cpp:mergeCaptureFile to match
ui/gtk/capture_file_dlg.c:file_merge_cmd. This ensures that we don't try
to use a stale (and freed) read filter.

Call cf_set_rfcode in both.

Bug: 11718
Change-Id: I6da65e428bff39e907f45992bac7337880c02ce9
Reviewed-on: https://code.wireshark.org/review/11895
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-17 09:40:39 +00:00
Stig Bjørlykke 2dc3b98cca Qt: Removed obsolete comments.
Change-Id: I7c0905b38a668a7a6dcaeee6ec16761c9b5c0a55
Reviewed-on: https://code.wireshark.org/review/11901
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-17 07:39:40 +00:00
Alexis La Goutte d3f68e5766 Qt: avoid crash when use Go Next/Previous Conversation
Only enable this menu when there is a packet

Change-Id: I750f2af6e9f565afce83a5e84394cc96b3b071f9
Reviewed-on: https://code.wireshark.org/review/11868
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-17 07:35:14 +00:00
Pascal Quantin 4224aab345 Qt: do not clear display filter when merging files
The merge file dialog box contains a read filter, not a display filter.

Bug: 11713
Change-Id: Iff160e552e0440ea4c626d54d834d32f38dc54c2
Reviewed-on: https://code.wireshark.org/review/11875
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-16 20:40:08 +00:00
Gerald Combs 661c9771f6 Qt: Add go to next + previous packet in conversation.
Add "Go→Next Packet in Conversation" and "Go→Previous Packet in
Conversation" menu items. Make sure the shortucts ("Ctrl+." and
"Ctrl+,") don't get switched to "Cmd+." and "Cmd+," on OS X. "Cmd+," is
already taken by the preferences dialog.

Change-Id: Iab9c7f60fdcf55f12c055b4d0948019bf667ebc9
Reviewed-on: https://code.wireshark.org/review/11771
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>
2015-11-13 09:43:24 +00:00
Gerald Combs 757fe65474 Qt: Freeze+thaw the main window during nested operations.
As noted in main_window.cpp:

// Our event loop becomes nested whenever we call update_progress_dlg, which
// includes several places in file.c. The GTK+ UI stays out of trouble by
// showing a modal progress dialog. We attempt to do the equivalent below by
// disabling parts of the main window. At a minumum the ProgressFrame in the
// main status bar must remain accessible.

Move the freeze+thaw code from captureFileRetapStarted and
captureFileRetapFinished to its own set of member functions. Call them
when we {,un}mark and {,un}ignore packets and note that we should
probably call them elsewhere. Disable mark and ignore actions when we
freeze and restore their states when we thaw.

Bug: 11681
Change-Id: I6f015f7f5f6c98cd48ace2c87f43f48efe51a88b
Reviewed-on: https://code.wireshark.org/review/11690
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-11-11 05:28:10 +00:00
Gerald Combs 47172e7d51 Qt: Start adjusting icon sizes dynamically.
In the main toolbar get our initial icon size using the PM_SmallIconSize
pixel metric. On Windows this varies directly with the system text
magnification setting.

Pinging bug 11675 since we still need to adjust the icon sizes in the
filter edits, progress frame, status bar, and likely other places.

Ping-Bug: 11675
Change-Id: I53a78627ce850bd6dbd4628da481badee63a1208
Reviewed-on: https://code.wireshark.org/review/11605
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-11-08 19:51:25 +00:00
Gerald Combs d02104c9a6 Qt: Check for a sane window geometry.
On Windows (and probably X11) it's possible to set an offscreen window
geometry. Add a rect_on_screen function to qt_ui_utils and use it as a
sanity check in MainWindow::loadWindowGeometry.

If this doesn't work well (e.g. if we end up with dueling Qt and GTK+
geometries) we might want to create separate Qt and GTK+ preferences.

Bug: 11568
Change-Id: Icde1181671770356e87f07d584894ec3148e1bd2
Reviewed-on: https://code.wireshark.org/review/11584
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-11-05 23:39:58 +00:00
Martin Kaiser eafc94c9ac [Qt recent files menu] make sure that the "Clear Menu" item is retranslated
this item is created along with the list of recent files
it looks like our only option to update its translation is to rebuild the
list of recent files

Change-Id: If740571fb9c939d65ca4f1f432aadf22c38dcb27
Reviewed-on: https://code.wireshark.org/review/11462
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>
2015-11-03 12:21:36 +00:00
Gerald Combs 81bf8edc52 Update the taskbar icon when we start a capture.
Call both QMainWindow::setWindowIcon and QGuiApplication::setWindowIcon
when we switch between normal and capture icons. The former sets the
window title bar icon and the latter (depending on your OS and Qt version)
sets the taskbar or dock icon.

Change-Id: Ida523d423bef4df44696f6cd75208986c8787d0f
Reviewed-on: https://code.wireshark.org/review/11414
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-29 20:50:13 +00:00
Gerald Combs f449dcd8a5 Qt: Add the ability to add filter expressions.
Add a "+" icon to the display filter toolbar which allows the addition
of a new filter expression button. (Hopefully this will be the last main
window UI change before 2.0.)

Change-Id: I52bf56bf699dddb7b387b9f4de1bf8b35eb3c4ce
Reviewed-on: https://code.wireshark.org/review/11375
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-29 19:00:34 +00:00
Gerald Combs 9f8d00c174 Add preferences for related packets and the scroll bar minimap.
Add gui.packet_list_show_related and gui.packet_list_show_minimap.
Show_related enables and disables the related packet delegate.
Show_minimap enables and disables the minimap. Start calling it the
"intelligent scroll bar" since that's the best suggestion for a name
I've seen so far.

Leave them out of the Appearance preference pane for now.

Change-Id: I5869c446fda5c8e62d6b1e49a74d63ba3b117b0f
Reviewed-on: https://code.wireshark.org/review/11332
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-27 23:28:56 +00:00
Gerald Combs e70a23f49d Qt: Add a filter expression item to the display filter edit menu.
Add an item to the display filter bookmark menu which opens the filter
expression preferences. We also need an expression editor frame similar
to the column editor frame, but hopefully this will suffice until that
exists.

Change-Id: If4c159bb769f0f8e7f89db55f1c6fd7c0bf65c87
Reviewed-on: https://code.wireshark.org/review/11315
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-27 19:28:19 +00:00
Gerald Combs 08e44b8b43 Convert SIP statistics to the stat tap API.
It looks like this one fell through the cracks because it dynamically
registered itself via register_tap_listener_gtksipstat and wasn't listed
in the "/Telephony/" path in main_menubar.c.

Ping-Bug: 11638
Change-Id: I4c82b36d204207c81e82a19efce98b6a091351ca
Reviewed-on: https://code.wireshark.org/review/11293
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-27 15:21:12 +00:00
Michal Labedzki ae1c81d6bb Qt: Add switch between Capture and FileFormat
You can switch now between Capture mode and FileFormat of it.
This works only if there is MIME FileFormat dissector of opened file.

Change-Id: I9e98e972775561cfbe731ee1a1b99300d119efc6
Reviewed-on: https://code.wireshark.org/review/10090
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-10-17 09:20:47 +00:00
Martin Mathieson 3221dbf542 LTE RLC graphs - initial version
Change-Id: Ic5f2c353ae1f787ac19cb575a938cb093ff5f6dc
Reviewed-on: https://code.wireshark.org/review/10930
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-10-11 21:59:45 +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
YFdyh000 05e0375659 Remove tr() for setObjectName
Change-Id: I4561ded123df3c2152da543e8a6786cb8b386dd5
Reviewed-on: https://code.wireshark.org/review/10790
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: Michael Mann <mmann78@netscape.net>
2015-10-05 02:57:45 +00:00
Martin Mathieson 32849b2877 LTE RLC Statistics Dialog
Change-Id: Id0af0227a398fd06ba37c23097fa6809db432d0f
Reviewed-on: https://code.wireshark.org/review/10669
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-09-28 16:14:06 +00:00
Martin Mathieson 29be7bf82f LTE MAC Statistics Dialog
Change-Id: I2463fdc0ac209e92d2f2c1abf9da22866d6e22e8
Reviewed-on: https://code.wireshark.org/review/10578
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-09-23 16:20:50 +00:00
Pascal Quantin f2c5dee77c Qt: refresh column content after editing it
Also save the new value in preferences

Change-Id: Ie1a942669ebc2824c999621ecd948425b3b49574
Reviewed-on: https://code.wireshark.org/review/10500
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: Gerald Combs <gerald@wireshark.org>
2015-09-13 18:54:12 +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 2ec5e5484e Add the Telephony→LTE menu.
Add an empty (for now) Telephony→LTE menu ahead of upcoming changes.

Change-Id: Ic6686b653d2fa51f1eb6854ab0952f92d679bccc
Reviewed-on: https://code.wireshark.org/review/10452
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-09 20:13:14 +00:00
Roland Knall 6f1c9fd432 PluginIF: Parent menu and goto frame
The developer may provide a given menu as parent menu for the
 sub menu. If the menu does not exist, the main menu will be used.

 Has been implemented for Qt as well as GTK.

Change-Id: I3f26684862fd0b08f59eeb4d6f4a24ce7dc3d428
Reviewed-on: https://code.wireshark.org/review/9939
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-09-08 11:03:35 +00:00
Stig Bjørlykke 91d863cc16 Qt: Fix use-after-free pattern
This fixes crashes due to use of deallocated memory in:
- Export Packet Dissections
- Merge Capture Files
- Edit Packet Comment

Change-Id: I3dab8c0735eb5e642d6a4580d20bc3c81cf1345b
Reviewed-on: https://code.wireshark.org/review/10392
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-09-08 06:30:02 +00:00
Gerald Combs 628f65a984 Keep focus rects from showing through the welcome screen.
Change-Id: I5785890c70f3a3f6f4ccb0c7b609a19e5d2b88c9
Reviewed-on: https://code.wireshark.org/review/10406
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-06 19:01:57 +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 db2fdfd7ef Fixup the main window tab order.
Make sure the packet list is directly after the display filter edit in
the main window tab order. When we press enter in the display filter
edit, go to the next child in the tab order.

Change-Id: If46e178365dbd59feb5985e9f8fa8b55d004d864
Reviewed-on: https://code.wireshark.org/review/10342
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-01 17:39:04 +00:00
Gerald Combs 377d215e0f Convert the MTP3 stats to new "generic stat API".
Convert both the MTP3 statistics and summary. As with the GSM stats this
is mostly untested.

Change-Id: I7af8d5f21c8161dc95f7f2c710f32364b6f6a431
Reviewed-on: https://code.wireshark.org/review/10338
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-31 23:06:09 +00:00
Gerald Combs f19a173a84 Speed up column sorting.
The GTK+ UI sequentially dissects and caches column strings for all rows
before sorting a column. Do the same in the Qt UI, which can improve
performance considerably.

Don't colorize packets when sorting in the Qt UI unless it's necessary.

When sorting in the Qt UI, let the user cancel the initial packet
dissection.  Note that we'll need to replace std::sort in order to
cancel out of sorting.

Use a pre-allocated and pre-compiled GRexex when we prime columns. Note
that we probably shouldn't parse a regular expression there.

Cache the last result of proto_registrar_get_byname.

Note performance hot spots elsewhere in the code.

To do:

GeoIP in packet-ip.c is pretty slow.

Bug: 11467
Change-Id: Ib34038fee08ef0319261faeffc4eca01e52f4bd3
Reviewed-on: https://code.wireshark.org/review/10275
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-28 02:54:20 +00:00
Gerald Combs 01fb470acd More retapping fixups.
Disable the main file close and reload actions while we're retapping,
otherwise many of our dialogs will crash.

Disable the TapParameterDialog filter entry while we're retapping. This
keeps us from enabling the "Apply" button when we shouldn't.

Don't prematurely disconnect our signals in WiresharkDialog.

Change-Id: Iaf507eb4503b9c296766f109f2b8c71343263982
Reviewed-on: https://code.wireshark.org/review/10274
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-27 21:27:32 +00:00
Stig Bjørlykke 6151946ffe Qt: Fixed some memory leakages
Change-Id: I5bccf706001f9ff41197ed13b1be5a7404ca594f
Reviewed-on: https://code.wireshark.org/review/10251
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-08-27 09:14:29 +00:00
Alexis La Goutte db2692c44c Qt (main_window) fix no previous prototype for '...' [-Wmissing-prototypes]
Change-Id: I43901d37817f9b79d508336253e766d740939e70
Reviewed-on: https://code.wireshark.org/review/10003
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>
2015-08-12 21:04:30 +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 9fd3bcc25e Add an elide mode preference for the Qt packet list.
Change-Id: I081cc1e9b2a0eea7f0a3ef1157561c50beb4c4db
Reviewed-on: https://code.wireshark.org/review/9902
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-06 21:06:34 +00:00
Gerald Combs b7f5eaa524 Convert the GSM MAP stats to new "generic stat API".
Convert both the MAP statistics and summary. As with the GSM A stats
this are mostly untested.

Change-Id: Ibd3a7346b09d1401e78724c0197ec2a38deb97a3
Reviewed-on: https://code.wireshark.org/review/9883
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06 01:59:10 +00:00
Gerald Combs 4d673b24cd Convert Camel tap stats to new "generic stat API".
Migrate the Camel stats similar to the recent BOOTP and H.225
migrations.

Change-Id: If82617068ff4b8fa186899f66dc34a08585f66cb
Reviewed-on: https://code.wireshark.org/review/9865
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-04 19:12:00 +00:00
Gerald Combs d8d3c52f1e Use an ellipsis character instead of three dots.
The OS X Human Interface Guidelines at

https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/TerminologyWording.html#//apple_ref/doc/uid/20000957-CH15-SW3

says:

"Be sure to create the ellipsis character using the key combination
 Option-; (Option-semicolon). This ensures that an assistive app can
 provide the correct interpretation of the character to a disabled user.
 If you use three period characters to simulate an ellipsis, many
 assistive apps will be unable to make sense of them. Also, three period
 characters and an ellipsis don't look the same because the periods are
 spaced differently than the points of an ellipsis."

The Windows desktop applications guidelines has a section on ellipses:

https://msdn.microsoft.com/en-us/library/windows/desktop/dn742478.aspx

but doesn't specify the a single glyph vs three dots.

The GNOME HIG at

https://developer.gnome.org/hig/stable/typography.html.en

says "Take Advantage of Unicode" then specifically says to use U+2026
HORIZONTAL ELLIPSIS.

Remove the ellipsis from "Find Next" and "Find Previous". Neither
requires user interaction.

Change-Id: I0e6c28bb8b3a84b242731e2ca96f1a6f6f42c303
Reviewed-on: https://code.wireshark.org/review/9833
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-31 18:55:06 +00:00
Gerald Combs d6f59cd10f Main menu and packet list menu updates.
Enable and disable packet list-relasted menu items in one place. Add
"Colorize Conversation" items to the packet list context menu.

In the GTK+ UI we tend to disable entire menus, which makes their items
inaccessible. Try not to do that in the Qt UI so that menu items are
always visible even if they're disabled.

Remove commented items which are now complete.

Change-Id: I69b878b45334bf88014694b1bf016278fa55a94b
Reviewed-on: https://code.wireshark.org/review/9819
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-29 22:38:43 +00:00
Gerald Combs 01bc31cded Fixup packet list context menu behavior.
Add logic to setMenusForSelectedPacket for setting the enabled states
for the "Apply As" and "Prepare A" actions. Update the PacketList
context menu code to fill in the right filter at the right time.

Exit out of setMenusForSelectedTreeRow if the packet list has focus so
that we don't clobber the enabled states of various actions.

Take the "Apply As" and "Prepare A" context menu titles from their main
window counterparts. Remove actionApply_as_Filter and
actionPrepare_a_Filter.

Remove completed to-do items.

Change-Id: I8f6f538bb7786d8df02a999f3b449dfde640e847
Reviewed-on: https://code.wireshark.org/review/9810
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-27 23:26:04 +00:00
Gerald Combs e30a0ff765 Add manual name address resolution.
Make it an editor frame instead of a dialog similar to the column editor
and prototocol preference editor.

Change-Id: If1a0cdf02dcab0eca98e8d39c94a3c2fe236df5a
Reviewed-on: https://code.wireshark.org/review/9743
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-21 22:43:05 +00:00
Gerald Combs 63edb9904f Add general a busy progress indicator.
Rename CaptureFileProgressFrame to ProgressFrame. It's not limited to
capture files. Add "busy" routines there and in MainStatusBar. Show a
busy indicator while sorting columns.

Use toByteArray().constData instead of .data. I'm not sure if it matters
in our case but it's more correct.

Change-Id: Ibe35fee9b9dd3fabb5ff8ddcc21f6bf59dec4af6
Reviewed-on: https://code.wireshark.org/review/9720
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-20 19:48:43 +00:00
Gerald Combs d2acb04b4c Add the RTP Stream Analysis dialog.
Combine the GTK+ RTP Stream Analysis and RTP Graph Analysis dialogs into
one. Yell at the user less. Disable the Analyze RTP Stream menu item if
we don't have an RTP stream selected.

There are a *lot* of moving parts in this dialog. I've tested with the
few RTP captures I have but it's by no means complete.

"To do" items are listed at the top of rtp_analysis.cpp.

Change-Id: Id503977f069bebc46cc68bc749f0c9cbf4d37bf6
Reviewed-on: https://code.wireshark.org/review/9650
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-16 00:30:14 +00:00
Gerald Combs c305f08921 PacketList column fixes.
Add a columnsChanged slot to PacketList and move the column update code
from redrawVisiblePackets there. Make sure we call
packet_list_model_->recreateVisibleRows, which should fix the behavior
described in bug 11324. Call columnsChanged when we, uh, change columns.

Add a sectionMoved slot to handle column reordering.

Don't rebuild the column list when we update the widgets in the column
preferences frame.  Do enable and disable the "remove" button as needed.

Try to keep the user from removing all of the columns in both the packet
list and column preferences.

Left as an exercise for the reader: The GTK+ UI also fails when you
remove all of the columns via the preferences:

  packet_list.c:377:packet_list_sort_column: assertion failed: (col)

Bug: 11324
Change-Id: Id58cf98e42cbda9aa2fc370ea06b8bcc6098c8ca
Reviewed-on: https://code.wireshark.org/review/9591
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-13 02:36:41 +00:00
Gerald Combs d564ea9bea Qt: Add Colorize Conversation menu items.
Add the "View→Colorize Conversation" menu similar to the GTK+ UI. Add
the "Reset" item under the "Colorize Conversation" menu instead of the
top-level "View" menu. Make sure the "Reset" shortcut is Ctrl+Space even
on OS X. Normally Qt would convert it to Cmd+Space, but that's used by
Spotlight.

Add StockIcon::colorIcon and use it to create filled square icons.

Change-Id: I2af9e26d025cdaf97482422bbb9440e28e18d1ac
Reviewed-on: https://code.wireshark.org/review/9595
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-11 00:41:01 +00:00
Gerald Combs fdd07c4d3a Make sure we uncheck the "Find Packet" action.
Make sure we uncheck the "Find Packet" action when we're done finding
packets. Make the "Go To Packet" action checkable and ensure that it's
properly checked an unchecked as well.

Change-Id: I979cabfd950ec4807ebcd40664b44b600557cf48
Reviewed-on: https://code.wireshark.org/review/9577
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-09 17:33:59 +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 4eca268935 Add SimpleStatisticsDialog.
To do:
- Refactor dynamic menu item placement.

Change-Id: I087de9f2fa3c2ff7dc08e5d54bc9c1b984fdd7b1
Reviewed-on: https://code.wireshark.org/review/9561
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-08 17:01:15 +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
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
Evan Huus 78e71f6f5a Remove the other g_hash_table_contains
Missed a bunch of them in g131f8f0.

Change-Id: I5b1df810a31c26c3ab3cd778f8774519283217c8
Reviewed-on: https://code.wireshark.org/review/9143
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-25 18:56:15 +00:00
Martin Kaiser 534d1d5eae Qt: use <> for including the generated ui_*.h files
this should make Visual Studio pick up the generated include files
from the build directory instead of the source directory (which may
contain lefovers from an in-tree build)

Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b
Reviewed-on: https://code.wireshark.org/review/9129
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 17:11:19 +00:00
Roland Knall acc581081e Plugin Interface: Add GUI callbacks
Rename ext_menubar to a more appropriate plugin_if.

 External menus can be implemented by plugins to present
 additional menus for deep-packet analysis. One side-effect
 of such menus being implemented as plugins is, that they
 are being executed in different threads and therefore can
 only use limited access to the main GUI. Also, there is
 no safe cross-gui (GTK and Qt) way for many features.

 This patch implements a first functionality, by which a
 plugin implemented using ext_menubar can apply a display
 filter to the main view.

 For now the implementation supports filtering, as well as
 saving a preference.

Change-Id: Iffe4caa954bbeb8ce356352de4dae348a50efba9
Reviewed-on: https://code.wireshark.org/review/8773
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 16:23:08 +00:00
Martin Kaiser cb84022296 Qt: fix crashes when Wireshark is closed while running a capture
if we haven't captured any packets yet, don't display a warning about
unsaved changes

make sure that we're not running into a scenario where
MainWindow::testCaptureFileClose() tries to close the capture file at
the same time as the pipe handler who sees an eof on the pipe

cf_has_unsaved_data() should return false if we have a temporary file
that contains no packets

Change-Id: I18d75bd658b85d45dd3313d49e2cd654c6300de5
Reviewed-on: https://code.wireshark.org/review/9109
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 15:55:36 +00:00
Evan Huus 89cc85b5ef Disable "Refresh Interfaces" when capturing
It breaks restarts, and doesn't do anything useful at this point anyways.

Bug: 11176
Change-Id: I6a010becf851fea8690b445874b29b54546fb2e3
Reviewed-on: https://code.wireshark.org/review/9106
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 21:43:13 +00:00
Alexis La Goutte 17c59f5090 Qt: Add Reload button on MainToolBar
Add @2x versions of x-capture-file-reload as well.

Change-Id: I08819cf66903884e0344a4f9bcd891befb582e90
Reviewed-on: https://code.wireshark.org/review/9066
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-24 17:10:01 +00:00
Gerald Combs 1dc608a05e Morph ProgressBar into CaptureProgressFrame.
Switch from a plain QProgressBar to a QFrame with a QProgressBar and a
stop button.

Add a stop_flag boolean to the capture_file struct.

To do:
- Start adding the progress bar to dialogs.
- Don't complain so loudly when the user stops a capture.

Change-Id: Iedd1d7d79f2044f1a53e4fb22186d25930a3ef03
Reviewed-on: https://code.wireshark.org/review/9029
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-23 06:06:37 +00:00
Gerald Combs 9c28594529 Add a preferences editor frame.
This replaces the single preference editor dialog in the GTK+ UI.

Change-Id: I10e030981e9f7d1ec121811593586b65cf0797c5
Reviewed-on: https://code.wireshark.org/review/8966
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-06-18 00:46:50 +00:00
Gerald Combs 053f792d30 Fix the Qt main window popup behavior.
By default QMainWindow::createPopupMenu shows a checkable list of
toolbars which aren't synced with our actions under the View menu.
Replace it with a version that handles all the main window widgets.

Change-Id: I5f5c23880133e97e815d3bbbf19ea3bacc482096
Reviewed-on: https://code.wireshark.org/review/8958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-17 03:53:33 +00:00
Gerald Combs 26dacfc8c3 Qt: Add protocol preferences menus.
Add protocol preferences in the packet list and packet detail context
menus. Note that we need a PreferencesEditorFrame in the main window for
editing numeric and string preferences. For now we just show the prefs
dialog.

Change-Id: Ice0cc8e9bc25963cc14aa47698f042f2a73088d8
Reviewed-on: https://code.wireshark.org/review/8957
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-06-17 01:25:27 +00:00
Gerald Combs ece4b01f21 Add the wireless toolbar.
Add the wireless toolbar to the Qt UI.

Start adding AirPcap support to ui/80211_utils. Add FCS validation
routines to ws80211_utils.

Move a bunch of AirPcap routines that require epan from caputils to
ui/gtk. They were required for driver key management, which we'll
leave to the AirPcap Control Panel in the Qt UI.

Move frequency-utils to wsutil.

Change-Id: I44446758046621d183f5c2ba9f6526bf01e084f1
Reviewed-on: https://code.wireshark.org/review/8910
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-06-16 03:45:54 +00:00
Gerald Combs 60ab49592b Accept drop events immediately.
Accept drop events before opening our capture file instead after.

Change-Id: I48fe1cd1e3b5e6f7b076aaa0e3a0d035938a5af7
Reviewed-on: https://code.wireshark.org/review/8929
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-15 23:53:27 +00:00
Gerald Combs f661b3c99e Include QUrl.
It's apparently required by Qt4.

Change-Id: Ic5f32b9acd0a244477b7631bff39b3ed5ba86a39
Reviewed-on: https://code.wireshark.org/review/8918
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-14 18:30:31 +00:00
Gerald Combs d42e0f7f12 Qt: Enable Drag and Drop in the main window.
Change-Id: I446163dd9e1a277118caab2f7296a3605cb23fd5
Reviewed-on: https://code.wireshark.org/review/8917
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-14 18:06:35 +00:00
Guy Harris 2e76bb466a Use pid_t on UN*X, and HANDLE on Windows, for the process ID.
This avoids type punning; at least with Xcode 7 beta on El Capitan beta,
that produces warnings that get turned into errors.

Change-Id: I57f47455b9630f359828c07c92a190b5cb33816f
Reviewed-on: https://code.wireshark.org/review/8862
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-10 00:30:57 +00:00
Anders 4e60e8fb39 [MSVC 2015] Use intptr_t for "pointer stored as int" to make MSVC happy.
Change-Id: I5dbbea8527a8bb73b17e5a8a5611c3923d82459c
Reviewed-on: https://code.wireshark.org/review/8852
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-09 14:13:14 +00:00
Gerald Combs ec3f923e3e Add the Display Filter Expression dialog.
Changes from the GTK+ UI:
- The display filter is built on the fly with immediate syntax feedback.
- Slightly different layout.
- You can search for fields.

Make the plain SyntaxLineEdit a bit more plain.

Bug: 11128
Change-Id: I06a48cd7b9ba7b9dc193b0199540aede4eb62fa7
Reviewed-on: https://code.wireshark.org/review/8742
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-06-03 02:27:00 +00:00
Gerald Combs b18309c07f Qt: Update the status bar when saving.
Plumb in more capture file callbacks. Add common functions for setting
the status bar file information. Add and update code to match the GTK+
status bar behavior.

Make sure we update the capture file length when rescanning.

Bug: 10943

Change-Id: Ie84c7a57ee421d57ba3477f8dde3847aaafa1cd1
Reviewed-on: https://code.wireshark.org/review/8594
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-05-23 00:31:08 +00:00
Gerald Combs e9d8769d5b Qt: Don't crash after "Save As".
Rename "stay_closed" to "dont_reopen" to match cf_save_records and its
GTK+ equivalent. Set "dont_reopen" to FALSE when we "Save As", otherwise
we crash on Windows.

Bug: 10904
Change-Id: I4bb10abc230439e10cc55ffbd5595bfbc0a34b6f
Reviewed-on: https://code.wireshark.org/review/8592
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-22 20:05:04 +00:00
Gerald Combs a04a894731 Qt: Stop tapping when the I/O Graph dialog closes.
Add a setCaptureStopFlag function to ProgressBar. Add a stopTapping
function and setCaptureStopFlag signal to CaptureFile. Use the new
plubming to stop tapping when the IO Graph dialog closes.

Bug: 10116
Change-Id: Ic46814eed18933f511d9d1ff37e2e7918741f353
Reviewed-on: https://code.wireshark.org/review/8480
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-05-15 21:48:03 +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 f77e02ccc6 Expert Info dialog.
Show all expert messages in a combined view. Group top-level items by a
(severity, group, protocol) tuple.

Let the user enable and disable messages via a check menu.

Add ProtoTree::goToField and expert_info_t.hf_index. Use them to jump to
what we hope is the afflicted item.

Enable the context menu only if the user has selected a packet item.

Add a free-form search field that matches expert summaries.

This differs from the GTK+ version but hopefully provides a smoother
workflow.

Bug: 10931
Change-Id: Ia12cb7c27cdea1634fa2798fb7e4c1b23bd16ad2
Reviewed-on: https://code.wireshark.org/review/8294
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>
2015-05-08 04:29:59 +00:00
Roland Knall 5727ebe689 extcap: Implement QT extcap options
Implementing a button in the interface list, to bring up
 the extcap options dialog, as well as a dialog, which will
 be generated depending on the selected extcap options.

Change-Id: I1733dc6a8c1a121089a9c353aff10bc4a53e86de
Reviewed-on: https://code.wireshark.org/review/8224
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-05 09:35:10 +00:00
Roland Knall 812d31122a ext_menubar: Change action name to remove warning
on_actionExternalMenu_triggered() triggered a warning, as no menu
 exists on the automatic UI configuration.

Change-Id: Ic3dc4c2c9e4c95ec4bbea01bd53af9a8c831e0d7
Reviewed-on: https://code.wireshark.org/review/8276
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-03 17:14:28 +00:00
Roland Knall eeed4d1121 UI: Implementing menus for plugins
Plugins may utilize the tap interface to provide special tools
 or analysis options, not otherwise available in Wireshark, or
 perhaps not allowed to be distributed freely. Up until now, those
 tools either had to start automatically, or could not be started
 at all, or had to be started separately.

 It should be possible, that those tools may be started using a
 menu entry directly from Wireshark. This interface tries to achieve
 exactly that.

 This interface uses a clean interface, which can be implemented in
 any plugin or dissector. Documentation for this has been added to
 README.plugins.

 Separators are only supported for now in the Qt interface, but
 URLs can now be added as a simple item, and the UI will use the
 same methods used for other URL calls to open them.

Change-Id: I170107dafb66f6badaa864d05a9091e5cbbf52c2
Reviewed-on: https://code.wireshark.org/review/7865
Reviewed-by: Roland Knall <rknall@gmail.com>
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>
2015-04-14 04:00:39 +00:00
Pascal Quantin 461666bcd1 Qt: fix maximized state apply
Preferences are not loaded yet when we call MainWindow::loadWindowGeometry()
Anyway, prefs.gui_geometry_save_maximized should only be checked when saving preferences (MainWindow::saveWindowGeometry() method) like what we do in GTK UI

Change-Id: I8eb01a5f4f7672fbf5846bc576584e28f72d5e31
Reviewed-on: https://code.wireshark.org/review/7978
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-04-07 21:03:18 +00:00
Guy Harris ba0b348d28 Show a count in the status bar for all captures.
(I'd have said "for non-update-list-of-packets-in-real-time captures",
but that's too long for the holy Git "first line of the commit message
is a summary" rule.)

For non-update-list-of-packets-in-real-time captures, show a packet
count in the status bar.

Change-Id: I31670770e3772e9f772f0c9a6438fc6d053560aa
Reviewed-on: https://code.wireshark.org/review/7957
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-06 21:56:49 +00:00
Gerald Combs 8664de017f Qt: Constify a bunch of strings.
Change-Id: I601e429408fc042fc5b18a4750d40e260da47f43
Reviewed-on: https://code.wireshark.org/review/7535
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-05 20:17:29 +00:00
Alexis La Goutte 6878122187 Main window (Qt): Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ia8d37b33ee30f09cfe5e0cd00820d84e171deb1c
Reviewed-on: https://code.wireshark.org/review/7494
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-03-02 19:02:43 +00:00
Michal Labedzki 2d4817966e Qt: Automatically scroll the packet list.
Add an "Auto Scroll in Live Capture" action to the Go menu. It's in the
View menu in the GTK+ UI but it seems to make more sense as a navigation
item.

Use a timeout interval for automatic scrolling. I haven't run any tests
to see if this makes a difference but it would seem that the less
drawing we do during a high speed capture the better, particularly for
remote displays.

Update the x-stay-last icons.

Note that we might want to make prefs.capture_auto_scroll a "recent"
setting.

Mark auto_scroll_live and packet_list_check_end GTK+ only.

Bug: 10601
Co-authored-by: Gerald Combs <gerald@wireshark.org>
Change-Id: I645d27c0814f0e4a0d5b01ae68be366847e2522d
Reviewed-on: https://code.wireshark.org/review/7292
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-27 20:27:14 +00:00
Gerald Combs 8ae714da5b Remove a dead assignment found by Clang.
The code in question was copied from ui/gtk/capture_file_dlg.c. The dead
assignment there was removed in 68ceffe.

Change-Id: I605f181b623fbd87ab41505d30a79d7a4fe649df
Reviewed-on: https://code.wireshark.org/review/7419
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-26 18:23:34 +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 ae9cc88c00 Qt: Fix unsaved changes behavior.
Check the return value of testCaptureFileClose in
MainWindow::openCaptureFile and add testCaptureFileClose to
MainWindow::closeEvent. Some of the file opening and closing behavior
still needs to be cleaned up but this should at least keep the user from
losing unsaved data.

Bug: 10944
Change-Id: I7d7b563a6b72f48b41a5a3aff2837655557869ff
Reviewed-on: https://code.wireshark.org/review/7283
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-21 02:06:54 +00:00
Gerald Combs 422ad100aa Qt: Apply the main window geometry directly.
As of g2c00d66 we create the main window after we've read the recent
settings. This means that we can get rid of the property animation
workaround in MainWindow::loadWindowGeometry.

Change-Id: I028061c5bdab9261f9394a1840bcdcb752a4f0c8
Reviewed-on: https://code.wireshark.org/review/7278
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-20 18:34:09 +00:00
Alexis La Goutte 5c60289753 Qt Wireshark - Once a live capture is stopped the title bar persists in reporting "Capturing from interface name"
With Qt Wireshark the title bar persists in reporting "Capturing from <interface name>" even though capturing has stopped.

With GTK Wireshark once a live capture is stopped the title bar is updated to report the interface name(s) used for the unsaved capture file.

Issue reported by Jim Young

Bug:10948
Change-Id: Ia6099f63f82b6610ade5c81af0cf257236f076ec
Reviewed-on: https://code.wireshark.org/review/7050
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-19 15:17:20 +00:00
Gerald Combs b5a3b65f7a Qt: Fix side effects of recent WiresharkDialog changes.
Quit the application when the main window closes. This cleans up any
other top-level windows that might be open.

Don't dereference a NULL pointer when opening the sequence dialog from
the VoIP calls dialog.

Change-Id: I9902d40ead1c5f2e541b6d79f3d957228e4e9687
Reviewed-on: https://code.wireshark.org/review/7107
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-14 00:19:58 +00:00
Gerald Combs 936f685af5 Qt: Allow shift-double-clicking on a frame link.
You can open a new packet window in the GTK+ UI by holding down the
shift key and double-clicking on a frame link in the protocol tree. Add
this behavior to the Qt UI. Document the different ways of opening a new
packet window and update the image.

Change-Id: I55caf6cc8089a6c305fafd47b4870e7c69dbfb10
Reviewed-on: https://code.wireshark.org/review/7101
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13 17:30:26 +00:00
Gerald Combs a0498f177a Qt: Double clicking a packet opens the packet window.
Connect the packet list's doubleClicked signal to the main window's
openPacketDialog slot.

Change-Id: I5bc20c113fb1f22e2257fc1dbdef76c9920e05d0
Reviewed-on: https://code.wireshark.org/review/7092
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13 03:02:47 +00:00
Gerald Combs 931807ea61 Qt: Add the "new packet" window^Wdialog^Wwindow.
Allow persistence across files. Preserve the use of "window" even
though we're really a dialog.

Update ByteViewTab and ProtoTree to support multiple instances.

Remove the need for a cast in frame_data.

Add more forward declarations.

Change-Id: I50d3d9d1455b8ecc158a37218f9e41fe696d5ae2
Reviewed-on: https://code.wireshark.org/review/7086
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-12 23:32:54 +00:00
Gerald Combs b3f3dd8d82 Qt: Fix preference change behavior.
Main window:

Keep track of our current layout and only change it if the preferences
change. This keeps the panes from resizing.

Re-select the current packet if the layout changes so that the proto
tree and byte view aren't left in an invalid state. This fixes a crash
similar to bug 10896.

Search frame:

Get rid of an invalid error message. Update coding style.

I don't think any of these fix bug 10921 since Xiaochuan seems to get a
crash immediately upon opening the dialog.

Change-Id: I0e880a50d3c9ac1c6ae6a01034b05fd2249444f4
Reviewed-on: https://code.wireshark.org/review/6989
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-06 23:23:02 +00:00
Gerald Combs 89e6f4c468 Qt: Add the Protocol Hierarchy statistics dialog.
Change-Id: I6872e323daca4798c638d764873f54c4c0dc0006
Reviewed-on: https://code.wireshark.org/review/6934
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-04 02:06:01 +00:00
Gerald Combs 21dfda65d7 Qt: Remove windowIcon property from our .ui files.
Setting the windowIcon property in foo.ui means we end up with a
setWindowIcon call in ui_foo.h. Along with setting the window title
bar icon, it also sets the taskbar icon on Windows. A 16x16 PNG gives
us a jaggy taskbar icon. (Windows ICO format is supported via a plugin
which might not be available everywhere, otherwise we could try using
a .ico resource.)

Move the setWindowIcon call from ge990d1b to the top of the MainWindow
constructor and enable it everywhere.

Change-Id: I4e9765200bb3676c4faa8e0ab1505ce02fb64870
Reviewed-on: https://code.wireshark.org/review/6762
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-01-23 19:15:29 +00:00
Gerald Combs e990d1b2e8 Try to fix the jaggy taskbar icon.
Possibly related to https://bugreports.qt.io/browse/QTBUG-19441.

Change-Id: Idf7ff8a247f459ce465907760ca0ebeaff2cffa8
Reviewed-on: https://code.wireshark.org/review/6746
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-23 12:14:58 +00:00
Guy Harris cfcbb28671 Clean up ftype-conversion and dfilter error message string handling.
Have dfilter_compile() take an additional gchar ** argument, pointing to
a gchar * item that, on error, gets set to point to a g_malloc()ed error
string.  That removes one bit of global state from the display filter
parser, and doesn't impose a fixed limit on the error message strings.

Have fvalue_from_string() and fvalue_from_unparsed() take a gchar **
argument, pointer to a gchar * item, rather than an error-reporting
function, and set the gchar * item to point to a g_malloc()ed error
string on an error.

Allow either gchar ** argument to be null; if the argument is null, no
error message is allocated or provided.

Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c
Reviewed-on: https://code.wireshark.org/review/6608
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 10:22:59 +00:00
Deon van der Westhuysen 7d43836b3a QT: stats_tree plug-ins not added to statistics menu
Wireshark Qt does not add plug-ins that register with stats_tree_register_plugin() to the statistics menu in the ui (like the gtk version does).

This patch dynamically adds all registered stats_tree plug-ins to the statistics menu.

Bug: 9528
Change-Id: I99f9415502ca9f7121d494c856861edc1a762079
Signed-off-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-on: https://code.wireshark.org/review/6336
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-01-16 00:27:35 +00:00
Gerald Combs 5fb2f27428 Qt: Add a context menu to the packet list header.
Don't carry over the sort items from the GTK+ UI (for now, at least).
Update some names. Add a column editor frame similar to the "Go to
Packet" and "Search" frames.

Change-Id: I1bd3834a26994de96894d2b7512bce2c19915c77
Reviewed-on: https://code.wireshark.org/review/6277
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>
2015-01-06 15:22:04 +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
Gerald Combs 8076f29fdb Qt: Fix status bar signal.
Change-Id: Ie935269f6cbe9495b95bcc24b45198fbd284fb35
Reviewed-on: https://code.wireshark.org/review/5963
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-22 00:42:15 +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
Gerald Combs 56697c244e Qt: Add name resolution menu items.
Change the text from "Enable for" to "Resolve". Make the tooltips more
descriptive. List them in OSI model order.

Change-Id: Ie671ba9d55c609ce475f1681add0ad7d975f19cd
Reviewed-on: https://code.wireshark.org/review/5737
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-12 20:40:53 +00:00
Gerald Combs e4b0141769 Qt: Obey main toolbar icon preferences.
Remove the preferences for the filter toolbar and mark them GTK+-only.

Change-Id: Ie48b19aee29a1cfcea4c41ca6c08ddbba3102377
Reviewed-on: https://code.wireshark.org/review/5693
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-10 01:51:09 +00:00
Gerald Combs bcaa5d84b1 Qt: Update and rename the summary dialog.
Go back to a single view similar to the GTK+ UI. Apply layouts using Qt
Designer.

Rename the menu item and class to "Capture File Properties". It's not
really a summary if it contains details such as "marked average bits
per second". We might want to move this to a "Properties" item under
the "File" menu similar to other applications.

Add the GTK+ summary icon (for now) to the toolbar and open the
properties dialog on clicking.

Singleton dialogs delenda est[1]. Let the user open as many summaries on
as many capture files as he or she wishes. Also, global cfile delenda
est[2].

Don't blindly include QtGui. Add specific components instead.

Use consistent method names, variable names, and patterns. Try to
document what "consistent" means.

Adjust the way we display some statistics to match the summary bar, e.g.
displayed = captured if we don't have a filter applied.

[1] Not really.
[2] Yes, really.

Change-Id: I11793b1d79dd0c3f70414ac8592b86181da59916
Reviewed-on: https://code.wireshark.org/review/5274
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-09 19:02:41 +00:00
Maarten Bezemer f16376ed7b Fix showing error dialog when calling vsimple_error_message_box()
SimpleDialog requires a parent, when none is provided (as there is no parent available during startup), the error message is queued and displayed after MainWindow is available.
Calling SimpleDialog::exec() directly returns if no parent is set (hence the dialog is not shown)

This resulted in silently ignoring error messages that were shown using vsimple_error_message_box(), as this function did not provide a parent (and the queue messages were not dequeued anymore as the MainWindow was already available)

Change-Id: I2f4c1b4926c196ab40b035161cec530105396537
Reviewed-on: https://code.wireshark.org/review/5519
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-08 01:15:22 +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
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
Pascal Quantin e4c257a169 Qt: fix what seems to be a copy/paste error in MainWindow::loadWindowGeometry() (Coverity CID 1158563)
Change-Id: Iaa2a6367fbb434514751e0ed4f273f883798ce8a
Reviewed-on: https://code.wireshark.org/review/5066
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-03 07:32:29 +00:00
Gerald Combs 1c159818fd Qt: ByteViewText hover information.
When the user hovers over a byte view field, highlight it and show a
description in the status bar.

Add a "byte" status bar context and fix a label stack pop bug.

Keep proto_find_field_from_offset from matching generated items.
Otherwise hovering and selecting finds things like GeoIP entries and
checksum validation information. This affects the GTK+ UI as well.

Change-Id: Ic81c0d8159510a72d30c41f961807d8a48d05e16
Reviewed-on: https://code.wireshark.org/review/4943
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-27 02:05:13 +00:00
Gerald Combs e2bece7733 Qt: Show / hide main widgets.
Remove existing code which uses the visibilityChanged signal. It exists
in QToolbar but not QWidget. Use the actions to drive visibility
instead.

Update MainWindow::layoutPanes to respect "recent" settings.

Move the show / hide actions to the top of the View menu to match GTK+.

Change-Id: I670682e2a094945dbd36c80f43cd14515bbca5a6
Reviewed-on: https://code.wireshark.org/review/4911
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-10-22 17:55:18 +00:00
Gerald Combs 9ddbc8de77 Qt: Fill in time display menu items. Other fixes and updates.
Reselect the current packet when we redraw the packet list.

Don't crash if we try to mark when no frame is selected. Try to
invalidate cached packet list strings when needed. Rename
PacketList::updateAll to redrawVisiblePackets so that its purpose is
more clear. When changing the font size, call redrawVisiblePackets
instead of rebuilding the entire list of visible rows.

Change-Id: I6e7a15067e7063d0efc26082170e1795ae3c0779
Reviewed-on: https://code.wireshark.org/review/4901
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-21 23:32:21 +00:00
Gerald Combs a17067abb1 Qt: Rename the "check for updates" slot.
The "Check for Updates..." action doesn't exist when
QMetaObject::connectSlotsByName is called. Rename
on_actionHelpCheckForUpdates_triggered to checkForUpdates so that we
don't get the warning

QMetaObject::connectSlotsByName: No matching signal for on_actionHelpCheckForUpdates_triggered()

at startup.

Change-Id: Icbd7eb98731023c323212e6ec3d3c98f1321e245
Reviewed-on: https://code.wireshark.org/review/4510
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-06 22:59:40 +00:00
Gerald Combs 798eb97053 Qt: Packet list column sorting.
Sorting behavior should be identical to GTK+.

Pass the correct position to beginInsertRows. Add a list of to-do items
to packet_list.cpp.

Change-Id: Ie6ab4b9f2d780a2af430d0f90529edca5485dada
Reviewed-on: https://code.wireshark.org/review/4481
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-06 21:10:11 +00:00
Gerald Combs ff307c72bc Add more HAVE_LIBPCAP checks.
Change-Id: I82e62f6be03a2ae1617cd5b8e430b73ca8fbe7f8
Reviewed-on: https://code.wireshark.org/review/4385
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-30 20:21:35 +00:00
Gerald Combs ced39b6de8 Qt: Start capture from the command line.
Fill in the capture-related mise en place so that -k and -i work. Get
rid of global_capture_session in ui/qt and make it a member of
MainWindow.

Copy over privilege checking from GTK+.

Move the global capture session struct to MainWindow.

Change-Id: Iab5ec683860a40255a7e1d82e3872ced24fd55cb
Reviewed-on: https://code.wireshark.org/review/4382
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-30 18:44:59 +00:00
Gerald Combs ea6fa049c9 Update the simple dialog code.
Rename simple_dialog_qt.{cpp,h} to simple_dialog.{cpp,h}. Make it a
subclass of QMessageBox. Queue messages at startup similar to GTK+.

Move the GTK+-specific simple_dialog declarations to
gtk/simple_dialog.h.

Don't yell at the user so much. Replace exclamation points with periods.

Change-Id: I1cc771106222d5e06f1f52d67ac29d6dc367cce4
Reviewed-on: https://code.wireshark.org/review/4288
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-25 22:02:43 +00:00
Gerald Combs 31e86998fb Qt: Add zoom and column resize actions.
Plumb signals and slots for changing the text size in the main window.
Remove the bold font code from WiresharkApplication. It was only used in
ByteViewText. Adjust the icons a bit.

Bug: When we change the font preferences the packet list stops drawing
cached strings. I haven't been able to track down the cause.

Change-Id: I609d740c9f26265628fa4b7de1b75b0e56651387
Reviewed-on: https://code.wireshark.org/review/4269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-23 22:32:53 +00:00
Gerald Combs 717ff08f32 Qt: Add the colorization action.
Change-Id: I846a48c35c4ef3bbbcf17d03885acc5be8c9a6b5
Reviewed-on: https://code.wireshark.org/review/4259
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-09-23 14:26:45 +00:00
Gerald Combs d3cd4c4b28 Qt: Re-enable menu icons.
The GNOME HIG says "Where a corresponding toolbar icon exists, a menu
icon should mirror its design." The Windows and OS X HIGs say that you
should use them for common or familiar actions but otherwise avoid
clutter. I think icons in the "File" menu look like crap. Try to strike
a balance.

Use the 16x16 application icon for both the main web site and the wiki
since that's the favicon used on both sites.

Assume that "Reload" isn't used very often and remove it from the
toolbar.

Don't use a menu icon for the about box.

Other minor fixups.

Change-Id: I855211c218d266c2e9ed5acbe05a08750ab6d157
Reviewed-on: https://code.wireshark.org/review/4246
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-09-23 02:42:14 +00:00
Gerald Combs 5d1aafbb36 Qt: Multi-state capture start icon.
Add ".on" versions of the x-capture-start icon along with corresponding
code in the StockIcon constructor to look for ".on" variants and add
them with the QIcon::On state.

Make the plain versions of x-capture-start blue to match the general
application icon. The goal is to make the toolbar and app icon fins blue
when Wireshark is "at rest" and green when it's capturing.

Change-Id: I31f4f9d910fc99c41d7c63bd9a722db1611760c7
Reviewed-on: https://code.wireshark.org/review/4225
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-21 16:45:14 +00:00
Gerald Combs 8576e1c103 Qt: Add stock icons.
The new icons are patterned after the existing capture icons. They could
probably benefit from some adjustments here and there.

Start moving toward icon names and a directory layout compliant with
freedesktop.org's Icon Naming Specification and Icon Theme
Specification. We aren't fully compliant and might never be but anyone
with exposure to FDO icon themes should at least know where everything
is.

Make Capture Start (x-capture-start) the first icon in the toolbar.

Define the Colorize Packets, Auto Scroll, and zoom icons even though the
Qt UI doesn't use them yet.

Leave the Capture Filter, Display Filter, Coloring Rules, Preferences,
and Help icons off for now. The GTK+ toolbar is overly cluttered and I'm
not sure they're necessary.

Try not to break ui/gtk/toolbar_icons.h.

Remove welcome.qrc. I initially added it in case we needed to overlay
the welcome screen with translucent .pngs but that never happened.

To do:

- Move the old GTK+ icons to their own directory.

- Find a better name for the "toolbar" directory. "stock"?

- Make the toolbar configurable.

Change-Id: Ie07592113d307b8db786aedace672312a870fe38
Reviewed-on: https://code.wireshark.org/review/4182
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-20 19:54:04 +00:00
Guy Harris fdff1b3b18 Don't connect to non-existent slots.
(Run-time warning, not compile-time error, alas.)

Change-Id: I002ca132d2c7cbc2cfd802438edb4509ff76bcbc
Reviewed-on: https://code.wireshark.org/review/3155
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-22 00:15:56 +00:00
Guy Harris c7a2c89e40 Rename ifListChanged to localInterfaceListChanged.
That better indicates that it reflects changes to the list of local
interfaces on the system, as supplied by libpcap/WinPcap, not to any
other interface list we maintain, such as lists of remote interfaces, or
the list of non-hidden interfaces.

Change-Id: Idf79b365e07f2e3eaa83c105ae9cd7ace54c435e
Reviewed-on: https://code.wireshark.org/review/3154
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-21 23:30:58 +00:00
Guy Harris 48986f4fb9 Make the Qt version update displays when interfaces appear or disappear.
Change-Id: If1218baaae9dcd93ddb1cea81ac5457f90a57c6c
Reviewed-on: https://code.wireshark.org/review/3152
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-21 19:07:28 +00:00
Guy Harris a3f7d1951d Get rid of #if 0'ed out includes of capture-pcap-util.h.
Change-Id: Ie3678a08ed9b3d46b22e7c59eef74e6e9636ae59
Reviewed-on: https://code.wireshark.org/review/3140
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-20 22:14:26 +00:00
Gerald Combs d1d88f575d Add plumbing for stat commands ("-z ...").
Trigger dialog creation by passing a method name to
QMetaObject::invokeMethod. I'm not entirely sure this is sane but it
seems to work OK. Move getopt processing further down in the main initialization sequence
to more closely match GTK+ and allow for stat command registration.

Change-Id: I5cd5375fa71dbadac69d528b2ba3bb13598dc3f6
Reviewed-on: https://code.wireshark.org/review/2964
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-11 20:52:10 +00:00
Guy Harris 9e6487f247 Move utility routines for capturing into a libcaputils static library.
Some of those routines are used only in dumpcap; others are used in
TShark and Wireshark as well.

Change-Id: I9d92483f2fcff57a7d8b6bf6bdf2870505d19fb7
Reviewed-on: https://code.wireshark.org/review/2841
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 07:25:26 +00:00
Irene Ruengeler f3c5f14bc4 Manage Interfaces
- Add dialog to manage interfaces
- Add and delete pipes
- Hide local interfaces

Change-Id: I08323c306c2ea736f99e57c28e2fe3170a0c2216
Reviewed-on: https://code.wireshark.org/review/2613
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-02 20:56:37 +00:00
Guy Harris ad1391aa4e Move capture.[ch] to libui.
Change-Id: I86e7e781cc9e14abab0374a18b95438529b046f0
Reviewed-on: https://code.wireshark.org/review/2711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 05:38:57 +00:00
Guy Harris b33512b704 Move capture_session.h to capchild; what it declares is defined there.
Change-Id: I8b1407839390b7ac0b45bf6f583c1a509073f002
Reviewed-on: https://code.wireshark.org/review/2709
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 05:09:31 +00:00
Guy Harris df5833723c Move capture_ui_utils.[ch] to libui.
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a
Reviewed-on: https://code.wireshark.org/review/2708
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 01:36:56 +00:00
Alexis La Goutte 11243e3977 Qt: fix loading of language translation
But need always restart to apply change...

Based on http://qt-project.org/wiki/How_to_create_a_multi_language_application


Change-Id: I0f95afb68aa5b125e0707b0af1ce096dab9c29e4
Reviewed-on: https://code.wireshark.org/review/2286
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-17 00:08:51 +00:00