Commit Graph

65 Commits

Author SHA1 Message Date
Gerald Combs d84577fe1a Yell at the user less.
Our user-facing messages should have a helpful (or at the very least
neutral) tone. In English, exclamation points are neither. Replace a
bunch of them with periods.

Change-Id: I29c3b2f84c25e06aae5b559860224559053a0378
Reviewed-on: https://code.wireshark.org/review/20189
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>
2017-02-20 16:53:17 +00:00
Peter Wu f8dc2346df Qt: fix memleak of PointList in interface statistics
The list of points (for interface traffic statistics) is part of the
interface tree model/view. Remove the pointer indirection to simplify
cleanup and avoid leaking a PointList.

Note that the SparkLineDelegate is used in two different places
(CaptureInterfacesDialog and InterfaceTreeModel).

Change-Id: I5fef7dadd44fdf58c07844fee269f509c712a36f
Reviewed-on: https://code.wireshark.org/review/19606
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 13:41:09 +00:00
Dario Lombardo 7849d29b24 Qt: make parameter unused when SHOW_BUFFER_COLUMN is undefined.
Change-Id: I87843f61d4c98fea90e49088f3d56df5aa801e58
Reviewed-on: https://code.wireshark.org/review/17946
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-03 09:29:59 +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
Roland Knall f8b32e5b4e checkAPIs.pl: Avoid false positive in header
This avoids the text index being identified as shadow variable

Bug:12956
Change-Id: I5565c5807e2c7d317d6849deeba9edd63c069397
Reviewed-on: https://code.wireshark.org/review/17953
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-09-27 22:06:17 +00:00
Gerald Combs 86bf0357fe Remove old Qt code.
Our minimum version has been 4.7 for a while. Remove dead
QT_VERSION_CHECK code.

Change-Id: Ia003c1aa4275eefdda707975774d886643ff1538
Reviewed-on: https://code.wireshark.org/review/16888
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-08-06 07:29:55 +00:00
Dario Lombardo 240f60577d Qt: add initializer (CID 1230901).
Change-Id: Ie7874ef90ce14978adb2c62f208dbcc2a636d3cf
Reviewed-on: https://code.wireshark.org/review/16289
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-04 22:11:20 +00:00
Gerald Combs 23d1fed59f Qt: Fix "applicable" capture interface behavior.
In the Capture Interfaces dialog, make sure we have exactly one of a
"not applicable" dash or a checkbox. Otherwise if your interface falsely
reports that it supports monitor mode you might end up with both.

Change-Id: I9b256f1ef0e8ff32626e7f2b526130f3c110d142
Reviewed-on: https://code.wireshark.org/review/15761
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-07 15:39:35 +00:00
Gerald Combs 4b216aea94 Qt: Use checkboxes in the capture options dialog.
Switch from enabled/disabled comboboxes to checkboxes. This requires
less clicking on the user's part and less translating.

Draw em dashes instead of "n/a" for non-applicable items, and use
the disabled palette when drawing them.

Change-Id: Ic97b6d44734b679bbeee00e9c2a322e7b8a67247
Reviewed-on: https://code.wireshark.org/review/15661
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:36:57 +00:00
Gerald Combs 99f4ccb7a0 Qt: Use a standard "Start" button in Capture Options.
QDialogButtonBox does a fine job of creating and managing buttons.
Instead of creating our own "Start" button, just rename the "OK" button.
This matches what we do elsewhere, e.g. in the Extcap Options dialog.

Change-Id: I3c5eec1f01925f7b82c4e7360d685acbe4bb2fea
Reviewed-on: https://code.wireshark.org/review/15653
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-05-31 22:09:05 +00:00
Gerald Combs 7f2de76c63 Qt: Monitor mode fixups.
When we update the monitor mode setting for an interface, update its
link type list.

Start filling in interface columns from a common function instead of
multiple places.

Rename some member function names to match
https://www.wireshark.org/docs/wsdg_html_chunked/ChUIQt.html#_coding_practices_and_naming_conventions

Bug: 11364
Change-Id: I26ac7e9719863169b62069e49ebf17ed97fbe516
Reviewed-on: https://code.wireshark.org/review/15583
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-05-31 19:27:45 +00:00
Stig Bjørlykke e13976339b Qt: Check for selected interface in filterEdited()
Add a check for selected filters in filterEdited() to avoid a
out-of-bounds index into ui->interfaceTree->selectedItems().

Bug: 12241
Bug: 12245
Change-Id: Ie18fc34a17427dd5330a5a617051cbc061555e0c
Reviewed-on: https://code.wireshark.org/review/14404
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-03-10 11:39:49 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
Add GeometryStateDialog class to handle load and save dialog geometry.
The QDialog class name will be used as window name.  For shared
classes the UAT name or the statistics title or abbr will be used.

Change-Id: I5a019598307fb3861518f41e733de834788184d8
Reviewed-on: https://code.wireshark.org/review/14139
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-28 18:25:50 +00:00
Guy Harris 4d22c44f65 Have the interface list unsorted by default.
That way, they initially show up in pcap's order, putting the preferred
interface at the top.  If the user wants to sort them by some column,
the user can click on the column in question.

Change-Id: I30ac38519c42ae5317d99fdd0a079b030e6af308
Reviewed-on: https://code.wireshark.org/review/14194
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-27 02:52:00 +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
Gerald Combs 7a9bd51e95 Qt: Capture Interfaces dialog geometry updates.
Widen CaptureInterfacesDialog. Manually set some column widths.

Change-Id: I84fd060d83b5f7bc186d79e22d5cc608dfdbd6c5
Reviewed-on: https://code.wireshark.org/review/14148
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-02-26 00:26:33 +00:00
Gerald Combs fd75aa2f3d Qt: Capture and display filter fixups.
In SyntaxLineEdit make sure we emit textEdited when we complete a
previously used filter. In CaptureInterfacesDialog, connect
captureFilterComboBox::activated to filterEdited. These enusre that we
fill in the capture filter column in CaptureInterfacesDialog.

Change-Id: Ibbf7ab223e37f8f73d8ec0289f8c32692a7e17d4
Reviewed-on: https://code.wireshark.org/review/14081
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-02-23 16:44:14 +00:00
Stig Bjørlykke 6e53a06678 Qt: No capture filter bookmarks in capture interfaces list
Change-Id: I4f53758c0fa4448656daac3ad186a6b0e687fc5c
Reviewed-on: https://code.wireshark.org/review/13593
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-29 08:24:36 +00:00
Gerald Combs e57bb1919c Make Qt UI capture filter behavior more closely match the GTK+ UI.
If the user enters a capture filter in the Capture Interfaces dialog and
presses "Start", make sure we copy the filter to the main welcome
screen.

Back out capture filter code from g0ce9ac4. Leave out the code that set
the global capture filter. Move the code that set individual capture
filters to the welcome screen.

Fix multiple interface selection in the welcome screen.

Rename allFilterComboBox in the capture interfaces dialog to
captureFilterComboBox to match the main welcome screen.

If the user starts typing in captureFilterComboBox, make sure the
"Capture Filter" column is visible. Update the "Capture Filter" column
as the user types. Conversely, if the user edits the "Capture Filter"
column, update captureFilterComboBox accordingly.

If we're editing a per-interface filter make sure we commit its contents
before starting capture.

Map our device index directly to each tree item instead of using a
separate map which will no longer be valid any time our sort order
changes (which we do right away in our constructor).

Don't set prefs.capture_devices_filter in the Qt UI. The GTK+ UI doesn't
and doing so can lead to surprising behavior. Note that it's mostly
unused.

Note that we don't multiple selected filters very well.

Ping-Bug: 11886
Change-Id: I3c052f4f464411e2fb8fb7d96b218e1ce2bac3fd
Reviewed-on: https://code.wireshark.org/review/13410
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-01-27 16:13:19 +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
Gerald Combs 8fe1cf77eb Fix capture output options.
Remove the "permanent file" checkbox. We weren't properly checking its
value and it was extraneous. Add placeholder text about temporary files.

Move the filename above the other options. That's where it is in the
GTK+ UI and it's arguably the most important.

When capturing to multiple files the size and duration settings aren't
mutually exclusive.

Change-Id: I1da1d3524e3c2de2361050913281472a172faa3a
Reviewed-on: https://code.wireshark.org/review/13269
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-01-14 05:22:08 +00:00
Stig Bjørlykke ffb51b3afb Qt: Disable configurable interface settings for extcap
Disable promiscuous mode, snaplen, buffer size and monitor mode
settings for extcap interfaces.

Bug: 11865
Change-Id: I20c67815ece99b8e742e36c727f415931b87af1f
Reviewed-on: https://code.wireshark.org/review/13023
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-05 14:46:12 +00:00
Peter Wu e3dd3f97f1 Qt: fix memleaks related to interface dialog
Also fix a not-so-problematic recent files "leak" when quitting
Wireshark.

Change-Id: I8556b07c197f0934f93d6da8c573c47fbd3fc060
Reviewed-on: https://code.wireshark.org/review/12529
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-16 05:43:58 +00:00
Mikael Kanstrup 3120d1f801 Fix memory leaks in all_ifaces when interface list changes
Valgrind report leaks of several allocations like these:
590 bytes in 50 blocks are possibly lost in loss record 29,818 of 31,670
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0xCB9C8A7: __vasprintf_chk (vasprintf_chk.c:82)
   by 0xA3D8DCA: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0xA3B846C: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0xA3B850B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0x6F4B51: scan_local_interfaces (iface_lists.c:254)
   by 0x6EF3D8: iface_mon_handler2 (iface_monitor.c:113)
   by 0xBE56F1D: ??? (in /lib/libnl-3.so.200.3.0)
   by 0xBA16F19: ??? (in /usr/lib/libnl-route-3.so.200.3.0)
   by 0xBE54E5E: nl_cache_parse (in /lib/libnl-3.so.200.3.0)
   by 0xBE585CA: nl_msg_parse (in /lib/libnl-3.so.200.3.0)
   by 0x6EF372: iface_mon_handler (iface_monitor.c:123)

When the list of network interfaces is updated allocations done
for global_capture_opts.all_ifaces elements leak memory. Fixed by
introducing a helper function to be used for removing an interface_t
element from all_ifaces array. While at it also fixed misc leaks when
updating individual allocated records of all_ifaces elements.

Change-Id: I035e6936a44edeef2ebe4780931c14cde99e93a4
Reviewed-on: https://code.wireshark.org/review/12209
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-12-11 10:38:32 +00:00
Peter Wu dde848b3d9 Press Start instead of Manage Interfaces on Enter
In the Capture Interfaces dialog, the default dialog action was
non-existing. Fix Extcap while at it (searched for "YesRole").

Reported on #wireshark at Freenode.

Change-Id: I7920b806a855acc20dcd2081f6b0d58e993b4ac1
Reviewed-on: https://code.wireshark.org/review/12136
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
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: Peter Wu <peter@lekensteyn.nl>
2015-11-25 15:20:40 +00:00
João Valverde c00420efa2 Move utf8_entities.h to wsutil
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0
Reviewed-on: https://code.wireshark.org/review/10786
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 14:34:53 +00:00
Joerg Mayer 0619ed241c Finish removal of Q_UNUSED.
Todo: qcustomplot via upstream

Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf
Reviewed-on: https://code.wireshark.org/review/9547
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-07 22:17:22 +00:00
Pascal Quantin 0953c36ec9 Qt: tweaks to Capture Interfaces dialog
- Add option to stop capture after X files are created
- Increase the max value for number of packets / files / bytes / seconds from 1000 to INT_MAX
- Fix capture name file selection

Change-Id: I9fb8eeaa925e5bd5380bb654686575f41126546a
Reviewed-on: https://code.wireshark.org/review/9162
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-26 18:37:35 +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
Guy Harris c67bc03355 Let capture_dev_user_pmode_find() say "not found".
"Not found" is different from "found, and false".  Have it return a
boolean "did I find the property" indication and, if it did, supply the
property value through a pointer.

Change-Id: Iaa942ea346410b35e512ff1a3821cbf60c88dfd6
Reviewed-on: https://code.wireshark.org/review/7916
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-04 21:03:34 +00:00
Guy Harris 083f6b6e6d Have a #define for whether the capture buffer size can be set.
It can be set if either 1) this is Windows (where we're assumed to be
using WinPcap, which includes calls to set the buffer size) or 2) we
have pcap_create() (in which case we also have pcap_set_buffer_size(),
at least in a normal libpcap release).

Use that rather than testing "defined(_WIN32) ||
defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's
being tested.

Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12
Reviewed-on: https://code.wireshark.org/review/7816
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 03:22:33 +00:00
Guy Harris 1b4120846e Centralize the code to set the active_dlt value for a device.
We were doing it similarly, but not the same, in several places; make a
common routine for it.

Have that code check to make sure the DLT_ value in question is actually
supported by the device; if not, pick the first supported DLT_ value, if
any; this keeps it from, for example, picking a bad DLT_ value if your
defaults were set based on monitor mode being on but monitor mode
actually being off, or vice versa.

Change-Id: I1722bfeaf60429bc5c6f665fdea3d466052b13bd
Reviewed-on: https://code.wireshark.org/review/7795
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-23 00:00:42 +00:00
Guy Harris 1fdfee69d6 Patch some memory leaks.
capture_dev_user_descr_find() and capture_dev_user_cfilter_find() return
g_malloc()ated strings; we don't need to g_strdup() them to get a
g_malloc()ated string, and we *do* need to free them if we aren't going
to use them any more.

Document that while we're at it, and give more details for the functions
returning integer user-specified interface parameters as well.

Change-Id: Icf98a48992b1c4168ead54bdc4cc2847da89d665
Reviewed-on: https://code.wireshark.org/review/7745
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-19 00:28:40 +00:00
Guy Harris 096e5231ff Fix parsing of interface properties strings.
The first entry in the list does not have a leading comma, so a strstr()
for ",{ifname}(" will not work.  Instead, use g_strsplit() with a comma
for all of the preferences.

Have common code for all the "uncomplicated" preferences.  Have a
specialized handler for the one "complicated" preference.

Change-Id: I2144a98ab0cb70db56eaaba88175d6e03885de2a
Reviewed-on: https://code.wireshark.org/review/7741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-18 23:58:54 +00:00
Peter Wu 45674b7a04 Qt: fix "Assigned value is garbage or undefined"
Clang Static Analyzer reported that function link_changed uses a garbage
value for "device.links" which is indeed the case when
global_capture_opts.all_ifaces->len == 0.

There seem to be some issues here:
 - When global_capture_opts.all_ifaces->len == 0, then device is
   uninitialized.
 - When no interface name matches, the last entry will always be
   updated.
 - There is duplicate code querying for the interface by name.

This patch addresses the above issues by extracting the interface name
check into a new utility function which returns NULL when a device is
not found. Then the callers (such as link_changed) will check this
value.

While at it, stop storing a copy of (interface_t), use a pointer
instead. This allows for removal of g_array_remove_index followed by
g_array_insert_val.

Verified with clang 3.5.1.

Change-Id: I03e0f179577a23a3f1efdca768e67922273192f0
Reviewed-on: https://code.wireshark.org/review/7145
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-16 02:32:05 +00:00
Gerald Combs 91e4330394 Qt: Convert more dialog titles.
Change-Id: I9c3e3471a92b7af9347a541bece3d9405d37dce0
Reviewed-on: https://code.wireshark.org/review/6193
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-31 22:48:17 +00:00
Michal Labedzki 5025bc258c Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all
  translations working
- dynamic list of supported languages
- runtime change of GUI language (no need to restart application)
- add flags icons support
- search for *.qm languages in buildin resources, then
  data dir called "languages" (main directory in sources or
  /usr/share/wireshark/languages), then user directory
  (UNIX: ~/.wireshark/languages); "languages" directory should contains
  files wireshark_xx.qm where xx is language code (en, en_GB, etc.),
  and optional xx.svg for flag icon
- try to fix some untranslated manually-created UI items
  (need manual reset text of those components)

Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229
Reviewed-on: https://code.wireshark.org/review/5041
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-04 08:21:55 +00:00
Gerald Combs a71f6807b8 Qt: Rework the "Manage Interfaces" dialog.
Convert QTableWidget to QTreeWidget.

It looks like the GTK+ version has a separate set of apply/save buttons
for each tab which *only* operates on that tab. This can result unexpected
behavior which throws away changes if the user updates more than one
tab. Use a single "OK" button that applies all of our changes instead.

Reorder the tabs. Put Local Interfaces first and select it by default.
Always show Remote Interfaces. Disable it on platforms that don't have
PCAP_REMOTE.

Automatically start editing when we add a new pipe. Don't immediately
update pipe interface settings. Wait until we hit "OK" instead.

Rename NewFileDelegate to PathChooserDelegate. Note that we might want
to move it use it elsewhere in the application.

Try switching the user-facing terminology from "Hide" to the more
positive "Show".

Tell the user that we don't save pipe or remote interface settings.

Add a help URL for the "Manage Interfaces" dialog box.

Use the GLib and Qt string functions and classes to split and join
comma-separated preferences. This makes sure capture_dev_user_descr_find
doesn't skip over the first interface. It also keeps the Qt code from
adding a leading comma to our capture preferences.

Add a note about strings to README.qt. Summary: Use QStrings.

For another day:

- If we *do* save remote settings we need to store credentials securely,
  e.g. with CryptProtectData.

- Get rid of the remote settings dialogs. Their controls should fit in the
  remote settings tab.

- Add an extcap tab.

- We need getter/setter functions for global_capture_opts.all_ifaces. We
  iterate over it *way* too much.

Change-Id: Ib7b61972f3ece4325e0230f725e7f2678acbb24b
Reviewed-on: https://code.wireshark.org/review/3873
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-08-29 00:24:02 +00:00
Irene Ruengeler 82d8877b37 Capture Options: Add functionality to options and output tab
Change-Id: I4a2116fe5b7ae3997dd7b0f2693aa511f9d52061
Reviewed-on: https://code.wireshark.org/review/3688
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: Anders Broman <a.broman58@gmail.com>
2014-08-18 11:25:32 +00:00
Alexis La Goutte 39d919b868 Qt: Make buildbot happy
capture_interfaces_dialog.cpp: In member function ‘void CaptureInterfacesDialog::updateStatistics()’:
capture_interfaces_dialog.cpp:483:100: error: operation on ‘points’ may be undefined [-Werror=sequence-point]
             QList<int> *points = points = ti->data(col_traffic_, Qt::UserRole).value<QList<int> *>();

Change-Id: I63afb0f207142d516403968f6a3e988f8ad61d4d
Reviewed-on: https://code.wireshark.org/review/3491
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-08 07:09:02 +00:00
Gerald Combs 4da7570809 Use a QTreeWidget instead of QTableWidget.
Even though Qt's widget naming suggests otherwise, a QTreeWidget is
usually a better choice for tables than QTableWidget. The former gives
you a nice, clean Plain Old Table while the latter gives you something
that looks and acts like a spreadsheet.

In this particular instance using QTreeWidget also gives us the option
of adding sub-items with detailed information. Do so for attached
addresses.

Allow sorting by traffic while we're here. Simplify the column hiding
logic. Make sure the sparkline delegate isn't editable.

Change-Id: Ia36ba2e12c1c0cb86ae5b2154e6afcf6549ae049
Reviewed-on: https://code.wireshark.org/review/3466
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-08 05:57:01 +00:00
Gerald Combs 69d0788875 CompiledFilterOutput dialog fixes and updates.
Apply a layout to the "Compiled Filter Output" dialog. Render the filter
as monospaced text.

Don't add an "expert OK" icon to the list. It doesn't seem to indicate
any sort of status.

Use a "Close" button instead of "OK". According to

http://uxmovement.com/buttons/why-the-ok-button-is-no-longer-okay/

"OK" implies we're going to perform some sort of action.

Add a "Copy" button while we're here.

Change-Id: Ia63f3032916e322fa9f4f2d465140b128b4f8078
Reviewed-on: https://code.wireshark.org/review/3338
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-08-02 00:50:41 +00:00
Gerald Combs f229aeddd2 Our users are not particpants in a comedy sketch.
In way too many places in the GTK+ code we wait for the user to do
something wrong, leap out from behind the bushes, yell "AHA!", and hit
them in the face with a herring^W error dialog.

We really need to not do that. We also shouldn't carry that behavior
over to the Qt UI.

If the user shouldn't press a button it should be disabled. Do so for
the "Compile BPF" and "Start" buttons.

Change-Id: Iad9c15951d5ae640ea82ca74d5f0c26e88bd2554
Reviewed-on: https://code.wireshark.org/review/3156
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-22 00:43:42 +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 d81a34cc24 Have the interface "tree" directly connect to ifListChanged.
Then have the capture interfaces dialog connect only *its* code to
update *its* list of interfaces to ifListChanged, rather than connecting
a routine that then emits interfaceListChanged.

This makes it the responsibility of each widget that displays local
interfaces to connect to the ifListChanged signal.

Change-Id: Iff8e8ca4202c8784eed58c8f05175d986a16baea
Reviewed-on: https://code.wireshark.org/review/3153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-21 23:15:49 +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
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 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 ac5479b4b8 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I781c7eec381d3296d15e666385f549e44f62e3f1
Reviewed-on: https://code.wireshark.org/review/2226
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 06:48:33 +00:00