Commit Graph

15 Commits

Author SHA1 Message Date
Dario Lombardo 0557fe1446 Qt: fix compilation without pcap.
Change-Id: Ia0fe79157f21fd0b1c0e5195c902ae07c55ca253
Reviewed-on: https://code.wireshark.org/review/21343
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-25 23:14:00 +00:00
Max Dmitrichenko ba3fbc5adb memory leak: Qt code doesn't pass 'parent' argument to some Qt class constructors
found with valgrind

Change-Id: I2d73bd50a6f0e13b1817c8a518189c0e56558f72
Reviewed-on: https://code.wireshark.org/review/21227
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-20 11:24:20 +00:00
Peter Wu 601fe5e351 Qt: propagate selection from main screen to dialog
Ensure that the selection in main screen is updated on refreshing
interfaces (InterfaceFrame::interfaceListChanged). Add additional
patches to ensure that selection changes from the main screen propagate
to the dialog and be careful to avoid infinite recursions.

Life of a signal for InterfaceFrame:

    ui->interfaceTree->selectionModel emits selectionChanged
    -> slot InterfaceFrame::interfaceTreeSelectionChanged
      -> emits InterfaceFrame::itemSelectionChanged
        -> slot MainWelcome::interfaceSelected
           -> emits MainWelcome::interfacesChanged
              -> slot CaptureInterfacesDialog::interfaceSelected
                 (updats dialog selection)

Life of a signal for CaptureInterfacesDialog:

    ui->interfaceTree emits itemSelectionChanged
    -> slot CaptureInterfacesDialog::interfaceSelected
       (emission of next signal because sender is ui->interfaceTree)
       -> emits CaptureInterfacesDialog::interfacesChanged
          -> slot InterfaceFrame::updateSelectedInterfaces
             (updates main screen selection)

This should probably be updated to model/view with shared selection
model in the future.

Change-Id: Ibb32c201a92bd2f1310523b3e6e63b03209c9ce4
Reviewed-on: https://code.wireshark.org/review/20487
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-29 15:16:56 +00:00
Stig Bjørlykke f190a92bc2 Qt: Disable "Show hidden interfaces"
Disable the "Show hidden interface" option until bug 13354 is fixed
because it's not possible to capture from hidden interfaces yet.

Ping-Bug: 13354
Change-Id: I428c2698485f0c7c2d9a8ab8408d7129af5fecf1
Reviewed-on: https://code.wireshark.org/review/20528
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-15 08:44:12 +00:00
Roland Knall 9d47bf9939 InterfaceList: Add check for remote interface
Add a check, to allow the filtering of remote only interfaces. Also
add the necessary options to the type menu.

Change-Id: Ib82519362454094f64abf1cbe6d7bc917990d7ac
Reviewed-on: https://code.wireshark.org/review/19438
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-12-27 11:55:51 +00:00
Roland Knall ca2dc538ff InterfaceList: Make storing preferences optional
If multiple proxy models are used, not all should change
the preferences if types are being displayed or hidden. Only
the main list should have that option.

Change-Id: I8617e402b6608eda98d7ecc0167cd0ccc3c43eaa
Reviewed-on: https://code.wireshark.org/review/18470
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-10-26 09:19:11 +00:00
Roland Knall 3fb32662a8 InterfaceList: Add button to toggle hidden interfaces
Add a button to the context menu, to allow for easy display of hidden
interfaces, and make that a storable preference

Change-Id: I8df5562b3ce8119b0ed38f9893c1879127f40c47
Reviewed-on: https://code.wireshark.org/review/18005
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-10-20 15:50:44 +00:00
Roland Knall e68247e1fd InterfaceTree: Change foreach to const_iterator
Change all occurences of the foreach macro to while loops with
const_iterator for performance reasons

Change-Id: I1cd378696136b3d6cc100b9bfff95295baa2ff83
Reviewed-on: https://code.wireshark.org/review/18286
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-19 07:44:48 +00:00
Roland Knall 81904c70a8 InterfaceList: Change Buttons to combobox
Change the buttons to a combobox selector, and move that selector
to the right of the capture filter box.

Bug: 12971
Change-Id: Ib85d51cca128ed76eb08886e92660ede51d5982f
Reviewed-on: https://code.wireshark.org/review/18186
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-10-17 14:43:22 +00:00
Roland Knall 4f6ed3852d Interface List: Fix display of zero entries
If WS is started with zero entries, no text is being displayed, and
pushing a button does not yield the display of the list. This fixes
it.

Change-Id: I70b0637e5f95e805b54780afb7eb2e43b3e5f21c
Reviewed-on: https://code.wireshark.org/review/18180
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Roland Knall <rknall@gmail.com>
2016-10-13 11:53:46 +00:00
Roland Knall d58da8ec90 Interface View/Model: Correct column ordering
This orders the columns correctly in the sequence the developer
has intended when adding them with setColumns. Also it allows for
disabling and inverting the filtering by type, as well as query
additional roles instead of only Qt::DisplayRole from the tree model.

Change-Id: I90469e8e3f3caa50debb3c839590d42719a6fb10
Reviewed-on: https://code.wireshark.org/review/18096
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-07 14:31:30 +00:00
Roland Knall a50bed094b Interface List: Allow column filtering in model
This change allows for the definition of columns to be shown
to the enduser if instanting the proxy model. The tree model
will allways transport ALL data, and it is the job of the proxy
model to determine which data is actually shown.

Additionally, this removes the final definitions of the global
interface array from interface_frame as well as sort_filter, so
that knowledge about the inner workings of the interface list
is contained to interface_tree_model

Change-Id: Ib34b150066ee344ad0d18bec1d90826eb0fa28b2
Reviewed-on: https://code.wireshark.org/review/18039
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-10-03 17:06:03 +00:00
Roland Knall 53523a739c Interface List: Fix build for no PCAP builds
This is a fix for building without libpcap. Also, changing _U_
to Q_UNUSED for the tree_model

Change-Id: I38a992731a3d3c4062ffab3cca0049cf08050794
Reviewed-on: https://code.wireshark.org/review/18019
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-02 18:18:34 +00:00
Roland Knall fea4d585ed Interface List: Hide button for only one interface
If only one interface type exists, the button row is being hidden.

Change-Id: Ieed9c363ab1ebc4bc15d0e09bceeb79a04d6e76e
Reviewed-on: https://code.wireshark.org/review/18017
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-10-02 17:56:54 +00:00
Roland Knall 99097dd3c6 Interface List: Change display to view/model
This changes the underlying model of the main interface tree.
Because of that, we can resort to a view/model approach, enlisting
the global interfaces list as only data source.

The interface list works identical to the old list, but allows
for filtering of the displayed interfaces by type. Only types, which
are present and whose interfaces are not hidden, are being displayed
for selection.

Change-Id: If8475b227daa026dc0ad3d25bc7fe050d5bf2ac3
Reviewed-on: https://code.wireshark.org/review/17940
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-01 13:18:51 +00:00