Commit Graph

101 Commits

Author SHA1 Message Date
Gerald Combs f2dce23b40 Qt+macOS: Add /Volumes to the file dialog sidebar.
/Volumes is hidden on macOS, which means that it doesn't show up in Qt's
non-native file dialog. Add a constructor to WiresharkFileDialog that
adds /Volumes to the file dialog sidebar. Make CaptureFileDialog and
ExportDissectionDialog subclasses of WiresharkFileDialog.

Bug: 13840
Change-Id: I4d7da3948b203eb11fb64fa056eb42a448edf914
Reviewed-on: https://code.wireshark.org/review/35201
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-26 05:37:37 +00:00
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Roland Knall b3f240dbf8 Qt: Multiselection in PacketList
This implements multi-selection for the PacketList. It
allows multiple lines to be selected, and either drag/drop
them to a text editor or use Ctrl/Cmd+C to copy the content
to a clipboard.

Opening the context menu disables the selection, and it
does not change the underlying currently selection. This is
done on purpose, as multi-selection is a copy-task only
functionality at this point

Export & Print work as expected, exporting just the selected
items. Same goes for the copy menu, which has the additional
entries for copying the list elements

Bug: 14612
Change-Id: I77960aa1ab1d172a21abfa469baac0cd57f9f9d9
Reviewed-on: https://code.wireshark.org/review/35073
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 12:20:29 +00:00
Guy Harris 90073ab488 Remove more hardcoding of ".gz" as the suffix for compressed files.
Use the libwiretap APIs to get lists of all compressed file suffixes or
to get the compressed file suffix for a given compression type.

(The net effect is the same, as the only compression type supported is
gzip, but if any compression types are added in the future, that code
won't need to be changed.)

Change-Id: I7de3b764604d50c4c60b6f20dd16ee87fc00e5b2
Reviewed-on: https://code.wireshark.org/review/30734
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-20 07:07:32 +00:00
Guy Harris 2f17546932 Fix a comment to reflect reality.
Change-Id: I789b3993dbf07805bed2f8cde70b3ded4b5bc9f9
Reviewed-on: https://code.wireshark.org/review/30727
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-19 22:31:13 +00:00
Guy Harris c055d32d10 Ensure that fixFilenameExtension() is used only when writing a file.
It *should* never happen, but just make sure of that by calling it only
for "open for writing" ("save") dialogs.

Change-Id: I1813f31537c0aa4efdf08c1622db9cb9e7f5ae83
Reviewed-on: https://code.wireshark.org/review/30726
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-19 22:28:43 +00:00
Guy Harris a1372f6d01 Use an enum for compression types in various interfaces.
This:

1) means that we don't have to flag the compression argument with a
comment to indicate what it means (FALSE doesn't obviously say "not
compressed", WTAP_UNCOMPRESSED does);

2) leaves space in the interfaces in question for additional compression
types.

(No, this is not part 1 of an implementation of additional compression
types, it's just an API cleanup.  Implementing additional compression
types involves significant work in libwiretap, as well as UI changes to
replace "compress the file" checkboxes with something to indicate *how*
to compress the file, or to always use some other form of compression).

Change-Id: I1d23dc720be10158e6b34f97baa247ba8a537abf
Reviewed-on: https://code.wireshark.org/review/30660
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-16 09:20:36 +00:00
Stig Bjørlykke a1f95b6458 Qt: Add plural translations
Add plural translations in capture file dialog preview.
Reworded text for "error after X records(s)" to use same format
as similar messages.

Change-Id: I7b2c8811a9c0c0f76587c5aad1a648a1b969f37a
Reviewed-on: https://code.wireshark.org/review/27412
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-05-09 07:40:19 +00:00
Peter Wu 4d2844ccec Qt: do not further modify filename from Save dialog
Let the Save dialog fixup the extension on accepting the dialog.
Otherwise it is possible that files are silently overwritten without
prompting. Additionally, if a user decides to save a pcapng file as
"foo.pcap", do not try to rename it to "foo.pcap.pcapng".

This change is limited to macOS and Linux because Windows uses a
different file dialog. Tested with both macOS and Linux.

Bug: 14600
Change-Id: Ie0bc1f579766a04f0aad96dcd5daba3fffef9764
Reviewed-on: https://code.wireshark.org/review/27188
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 10:24:47 +00:00
Peter Wu 552ef8b1f4 Qt: improve extension selection in Save As dialog
The default Qt behavior for extension adjustment is quite bad. When the
file type filter is changed, the extension always becomes "gz" because
"pcap.gz" happens to be the first extension in the list. It also did not
check that the last suffix is actually a valid extension (e.g.
"capture.2018.01" became "capture.2018.gz").

Improvements:
- Respect the "compression" checkbox when adjusting the filename.
- Replace the extension only if it is a known one, append otherwise.
- Use a better default extension (from "wtap_default_file_extension").

Affects only macOS and Linux since Windows has its own native dialog.
See also https://bugreports.qt.io/browse/QTBUG-67993

Bug: 14600
Change-Id: I8cd0788f2abac0c6d7e29490b1ebb381f5a926d0
Reviewed-on: https://code.wireshark.org/review/27186
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 10:24:07 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +00:00
Guy Harris b577bff1ae In some dialogs, have *no* auto-default buttons on macOS.
In macOS dialogs, there's a default button, which is the button that
Enter/Return activates, and that Enter/Return *always* activates,
*regardless* of what button has the input focus.  To activate the button
that has the input focus, you use the space bar.

To implement that, we need to disable auto-default on all buttons,
including the Cancel button.

Put in a comment explaining all this.

We may want to do this in all alert boxes, and possibly all dialogs with
buttons.

Change-Id: I214dd2870a9720ea705d8db39adc5b6af2003fb1
Reviewed-on: https://code.wireshark.org/review/26629
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-25 02:15:50 +00:00
Peter Wu 56425fce7c Qt: allow keyboard navigation in Unsaved packets dialog
Currently the "Continue without Saving" button is visually highlighted
in the "Unsaved packets..." dialog, but pressing Enter triggers "Save"
instead. Even after changing button focus with arrow or tab keys,
pressing Enter will not confirm the action (but Spacebar does).
Restore the expected behavior for Linux and Windows, but preserve the
fix for macOS since (for which this was originally added).

Bug: 14531
Change-Id: Ic20fc5809b55949f6fd960bcb32618a4fa7fd1e9
Fixes: v2.3.0rc0-2672-gb0335359e5 ("Qt: Give discard button focus (but not as default)")
Reviewed-on: https://code.wireshark.org/review/26511
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-03-18 14:10:41 +00:00
Guy Harris 0b649a0910 Separately count all records and data records.
A file might contain only metadata records, which exist only to provide
information needed to interpret data records; no point in showing them
in record counts.

Put the counts into the structure that we fill in, and rename the
structure and the routine to reflect that it determines statistics other
than just times.

Speak of data records rather than packets; the file might be full of
Sysdig event records but not have any packets in it, for example.

Change-Id: I8553181dca4129736bdae2c0cbba92becc28d6ef
Reviewed-on: https://code.wireshark.org/review/25722
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-10 03:44:10 +00:00
Guy Harris 794596d936 Fix indentation.
Change-Id: I7f19b35032a686dfb2f776e8ff3527366b008331
Reviewed-on: https://code.wireshark.org/review/25718
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 20:36:43 +00:00
Guy Harris 25d90cb13c Put the preview-generation loop into a common routine.
Don't have all the file open dialogs have their own copies.

Change-Id: Icd6f2fd44b081575e6481a134027c90046938c64
Reviewed-on: https://code.wireshark.org/review/25717
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 20:29:08 +00:00
Guy Harris 1f5f63f8ef Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.

Add some record-type checks as necessary.

Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 00:29:51 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Guy Harris 5fcf5b9cc3 Don't assume all packets have time stamps.
We explicitly allow the not to, and, for example, Simple Packet Blocks
in pcapng files don't have time stamps.

Change-Id: I6c8921cf092de7831d0a3d6dab8467388f4e6286
Reviewed-on: https://code.wireshark.org/review/25625
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-06 04:25:06 +00:00
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Guy Harris af0f49e80d Use pcapng as the name of the file format.
At one point, I remember a discussion resulting in the official name of
the next-generation replacement for pcap format being changed to
"pcapng", with no hyphen.

Make Wireshark reflect that.

Change-Id: Ie66fb13a0fe3a8682143106dab601952e9154e2a
Reviewed-on: https://code.wireshark.org/review/25214
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-09 00:38:51 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
Following the move for widgets directory, moving utils
to the utils directory. Guidelines for this directory are:

 - Generic use but not a widget
 - Utility functionality used by many classes
 
 Note: additionally all includes affected by this move have been changed
 to absolute path includes, instead of relative ones.

Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b
Reviewed-on: https://code.wireshark.org/review/22602
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:11:55 +00:00
Guy Harris e52c95c6c8 Move UI-only stuff out of libwireshark.
Packet ranges are used only in the UI; move the packet range stuff into
libui.

Don't pass a print_args_t structure to libwireshark packet-printing
routines, just pass the few parameters they need.  Move the declaration
of print_args_t into file.h.

Change-Id: Icff5991eea7d7d56f33b4716105895263d275bcf
Reviewed-on: https://code.wireshark.org/review/21308
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-24 03:38:21 +00:00
Stig Bjørlykke 3053d7c0c1 Qt: Remove unused argument in Size string
Change-Id: I4c09092aba986c4fe224a46cac23d70bc5915aa6
Reviewed-on: https://code.wireshark.org/review/20923
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>
2017-04-05 08:00:19 +00:00
Stig Bjørlykke 795b459443 Qt: Pluralize packet count in Size string
Change-Id: Ifb23f4d558aa30df4ec436e42a4e23b23c2af110
Reviewed-on: https://code.wireshark.org/review/20566
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>
2017-03-17 07:19:17 +00:00
Stig Bjørlykke b0335359e5 Qt: Give discard button focus (but not as default)
Set focus to the discard button in the "Unsaved packet" and
"Unsaved comments" dialogs to enable spacebar for discard and
enter for save.

Bug: 13363
Change-Id: I576b02c4e3f0964aef56a0f1c06ed57c6ba683bf
Reviewed-on: https://code.wireshark.org/review/20485
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>
2017-03-12 07:15:19 +00:00
Michael Mann 1a57d81042 Rename packet-range.[ch] to packet_range.[ch]
The check*.pl scripts presume that files with the prefix "packet-"
are dissector files and therefore have different rules than other
files.  Rather than trying to clarify that more with additional
directory information, just make any non-dissector file with
"packet-" filename prefix conform if it fails a "dissector specific"
check from the scripts.

Change-Id: I7cb52e1fad4ea62320492bb690904260f958aeb4
Reviewed-on: https://code.wireshark.org/review/19304
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-16 17:28:50 +00:00
Binh Trinh ee47d8c8db Qt: Fix bug in capture file dialog introduced by HideNameFilterDetails
Restore File->Save As and File->Export Specified Packets functionalities broken by commit c711bc6457.

Change-Id: I5d246d296979b5e509a90569094d672083b06b9b
Reviewed-on: https://code.wireshark.org/review/17783
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-09-19 16:17:35 +00:00
Gerald Combs c711bc6457 Qt: Shorten capture file dialog name filters.
In the capture file dialog's "Files of type" combobox separate out the
wildcards we display from the ones that are applied. Set the
HideNameFilterDetails option and for "All Files" and "All Capture Files"
leave the option hidden.

For other options print the wildcard list twice so that it's both
displayed and applied. Go even further and filter out ".gz" wildcards in
the displayed list since they're effectively duplicates of their
uncompressed counterparts.

Based on Dario's work in change 17605.

Bug: 12837
Change-Id: I35de8f31492657e37b12ca4c8de5ed9e79d2e2f8
Reviewed-on: https://code.wireshark.org/review/17689
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-15 04:10:57 +00:00
Peter Wu 032a6ac3be Fix memleaks in capture file dialog
Tried to poke various fields (including the capture filter field), this
revealed some memleaks.

Change-Id: I1eca431a09839906a4b3c902ad85e55bffc71ca8
Reviewed-on: https://code.wireshark.org/review/17648
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-12 01:33:38 +00:00
Guy Harris 4a6dde12d6 Have "All Capture Files" match only capture files.
We support reading some types of files that aren't capture files, in
case we have a dissector for that file format (because, for example,
it's often transported over HTTP).  Don't include them in the set of
files "All Capture Files" matches; you can still look for them as they
have individual entries in the drop-down menu of file type patterns.

Ultimately, there should be Fileshark/TFileshark programs to read those
files - and other file types, and even capture files if the goal is to
look at the file structure rather than at the packets - and *that's* the
program that should offer the ability to load JPEGs and so on.

(No, this does not reduce the "All Capture Files" list down to a level
that makes the problem in bug 12837 go away.  The right way to fix
*that* is to arrange, somehow, that the "All Capture Files" entry not
actually list all the suffixes it matches.)

Change-Id: I705bff5fcd0694c6c6a11892621a195aa7cd0264
Reviewed-on: https://code.wireshark.org/review/17619
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-10 06:45:08 +00:00
Gerald Combs 559bb375c1 Remove name resolution from the file dialogs.
A single name resolution checkbox was added to the file dialog way back
in 2000 in g0f7cf64. At that time it was needed because resolution was
synchronous and could drastically affect your load time. Since then
we've added asynchronous name resolution and more recently made it
mandatory (ge005bc8). We've also added more name resolution checkboxes
and other controls.

Remove the name resolution checkboxes. You can just as easily change
resolution options before or after opening a file and they take up
valuable real estate.

Combine the size and packets in the Qt and Win32 dialogs and
pretty-print the size. Combine the start and elapsed times in the Qt,
Win32, and GTK+ dialogs. This lets us shrink the custom areas of the
file dialogs even further. Make the default file type combo item more
descriptive.

Change-Id: Id770adc0f284a4c7f08ee5a7db84f8435f4bf907
Reviewed-on: https://code.wireshark.org/review/17597
Tested-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-09-09 21:43:01 +00:00
Dario Lombardo 85ed737f7b Qt: add initializer (CID 1159361).
Change-Id: Ib7b66b4e1d600048b8a66b47d035c27ef126da29
Reviewed-on: https://code.wireshark.org/review/16275
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-04 04:48:45 +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
Guy Harris c0b29fcddd Add a #define for the wildcard pattern that matches all files.
It's *.* on Windows, but just * on UN*X; add a header that provides the
definition, and use it instead of hardwiring *.*.

Call the entry "All Files", that being the conventional name, rather
than "Any File", whilst we're at it.

Change-Id: I7c29324fc5b41e93c150e1ec67f1529f171dc6a3
Reviewed-on: https://code.wireshark.org/review/14243
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-01 02:00:25 +00:00
Guy Harris 5f5e9da18b Use *, not *.*, as the wildcard pattern on UN*X.
On Windows, the pattern that matches all files is *.*; *, by itself,
doesn't work, as I remember.  UN*Xes take the pattern a bit more
literally, so if it has a dot in it, it has to match a dot.

Bug: 12203
Change-Id: I11518c29c4ffd73485bad6e49b6dd9cc16bbd0b0
Reviewed-on: https://code.wireshark.org/review/14233
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-29 02:50:07 +00:00
Stig Bjørlykke cb0f530cae Qt: Fix checkSaveAsWithComments() button check
When using QMessageBox with custom buttons, exec() function returns
an opaque value.  Therefore we should use clickedButton() to determine
which button was clicked.

Example in https://wiki.qt.io/Custom_QMessageBox_Buttons

Change-Id: I81824414e31345bb9ea77f72f1b4cdeaa21d2781
Reviewed-on: https://code.wireshark.org/review/13523
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-25 11:37:54 +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
Guy Harris e9dd7c8bd4 Label the filter in the file open dialog as a "read filter".
This matches what the Windows file open dialog says, and also should
help prevent people thinking that it's a display filter, so that you can
clear it and see all the packets in the file.

I leave translations to native speakers.

Bug: 11708
Change-Id: I060816357bf7958d516429d09708a7ce16d609c5
Reviewed-on: https://code.wireshark.org/review/11877
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-16 19:01:12 +00:00
YFdyh000 be187b99c7 Qt: refine some strings for l10n
Change-Id: I460559c99c79c9fd40f284c750d64210fe5de50b
Reviewed-on: https://code.wireshark.org/review/10813
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-06 04:44:41 +00:00
Guy Harris d7f0118a74 Put back closing } accidentally removed in previous commit.
Change-Id: Ic02b0c86e55751a27d5d0417f4f5314def69e794
Reviewed-on: https://code.wireshark.org/review/9550
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-08 05:18:00 +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
Gerald Combs a1eb0aaeb3 Qt: Make sure we can fetch ExportDissectionDialog's layout.
Make sure ExportDissectionDialog is a non-native, funny-looking file
dialog so that we can fetch its layout.

Fix and add some URLs while we're here.

Bug: 11122
Change-Id: Icf62f7a436c7ba27ec20f84e7c1af1a5d7c9b949
Reviewed-on: https://code.wireshark.org/review/8479
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-15 18:14:20 +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 8629aa26ec Qt: Continue using the new window title format.
Update several dialog titles to "Wireshark · <subtile...>".

Change-Id: I64645e913500ecd55a008e1609b46385dafe7de9
Reviewed-on: https://code.wireshark.org/review/6127
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-30 16:37:34 +00:00
Guy Harris a344c9736e Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c.

A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes.  That is in-progress.

Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 10:50:10 +00:00
Guy Harris c0c480d08c Allow wtap_read() and wtap_seek_read() to return non-packet records.
This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest
of Wireshark, but this at least gets the ball rolling.

Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 03:02:32 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00