Commit Graph

66 Commits

Author SHA1 Message Date
Gerald Combs 8b4b8154a4 The CommDlg_OpenSave_GetFilePath macro fetches the path+name of the most
recently selected file in the current file dialog. This isn't the proper
routine to use when trying to figure out the save/export file name. We
have to dig through the OPENFILENAME struct instead. Fixes bug 8224.

#Backport 1.10

svn path=/trunk/; revision=49765
2013-06-04 18:07:59 +00:00
Guy Harris b1ecd8d217 Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types.  Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.

Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it.  Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.

svn path=/trunk/; revision=48690
2013-04-01 21:17:50 +00:00
Guy Harris 82a602d697 Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.

Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.

Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.

Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.

Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types.  (That's currently true, but we don't want to
wire that in as being forever true.)

svn path=/trunk/; revision=48689
2013-04-01 20:36:42 +00:00
Gerald Combs 9f1fd13e9a Use topic_action instead of topic_cb for the Windows file dialogs. Move
the common Qt help code to wireshark_application.cpp.

svn path=/trunk/; revision=45594
2012-10-16 19:47:43 +00:00
Gerald Combs 403e6dc86a Move common SSL key export routines to ui/ssl_key_export.[ch]. Make the
exported keys a gchar *. Implement SSL key exports in the Qt UI. Remove
some no-longer-necessary packet-ssl*.h includes.

Change lastOpenDir().absolutePath() to .canonicalPath(). Get rid of the
"Export As PostScript" action.

svn path=/trunk/; revision=45589
2012-10-16 18:14:16 +00:00
Gerald Combs 419f851e34 Fix Windows compilation problems from r45513. #ifdef out some non-Windows
code.  Get rid of a few uses of the global cfile.

svn path=/trunk/; revision=45514
2012-10-13 00:18:46 +00:00
Gerald Combs 18b10390da Move a couple of enums to the common UI directory. Remove an unused
definition.

svn path=/trunk/; revision=45440
2012-10-09 23:51:30 +00:00
Gerald Combs b28da10eec Fix Qt compilation on Windows. Check the user-supplied range syntax
and provide instant feedback in the Win32 file dialog similar to the Qt
code. Tango-ize some colors. Escape a backslash in QtShark.pro.

svn path=/trunk/; revision=45430
2012-10-09 15:34:40 +00:00
Gerald Combs 445148ac0e Add a PacketRangeGroupBox widget. Use it to implement "Export Selected
Packets". Not yet tested on Windows. "Ignore Packet" hasn't been
implemented so we can't test that either.

Create a SyntaxLineEdit widget from the QLineEdit code in
DisplayFilterEdit. Use it in the file import and export dialogs and the
PacketRangeGroupBox widget. This lets us provide instant feedback
instead of popping up an error dialog.

Expand the Tango color list based on
http://emilis.info/other/extended_tango .

Rearrange QtShark.pro to (hopefully) work better with Qt Creator.

svn path=/trunk/; revision=45405
2012-10-08 20:01:59 +00:00
Pascal Quantin e835a6f205 Fix crash when exporting packet dissection as plain text on Windows (regression introduced in r45333)
svn path=/trunk/; revision=45378
2012-10-08 09:22:46 +00:00
Gerald Combs 71ed773862 Add a capture_file * element to packet_range_t and pass it explicitly in
packet_range_init(). Get rid of global cfile references in
packet-range.c. C++-ize packet-range.h. Shuffle some includes around.

svn path=/trunk/; revision=45333
2012-10-05 18:52:42 +00:00
Gerald Combs bdd98d63cd Fix compilation on Windows. Add back and fix function definitions,
fix doxygen d ocumentation, other fixes.

svn path=/trunk/; revision=45298
2012-10-03 19:45:05 +00:00
Gerald Combs bcd2cea774 Unify the GTK+ and Win32 versions of "Export Specified Packets". Add a
shared "file_add_extension" routine. We no longer support _MSC_VER <
1400 so get rid of some clutter. Add a gzip checkbox to the Win32 export
packets dialog. Windows code hasn't yet been tested (and is likely
broken). I'll fix it shortly.

svn path=/trunk/; revision=45296
2012-10-03 19:24:14 +00:00
Gerald Combs f60693dbea Fix error checking logic.
svn path=/trunk/; revision=45144
2012-09-25 23:29:47 +00:00
Gerald Combs e9d4c115b5 Fix compilation on Windows.
svn path=/trunk/; revision=45106
2012-09-24 17:44:11 +00:00
Gerald Combs 25eab1c383 Unify some of the GTK+ and Win32 "Save As" code and behavior. This will
likely break compilation on Windows. I'll take care of it shortly.

svn path=/trunk/; revision=45105
2012-09-24 17:04:50 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Gerald Combs 3e05236eff Add gzip support to the Win32 "Save As" dialog. Don't crash in the Win32
merge dialog if we cancel. Adjust the size and location of the controls
in the Win32 open and merge file templates.

svn path=/trunk/; revision=45014
2012-09-19 23:06:39 +00:00
Gerald Combs f764eabb67 Combine some of the the Windows and non-Windows merge code and make it
behave the same on each platform. This might break the non-Windows builds.
I'll test & fix any problems shortly.

svn path=/trunk/; revision=44859
2012-09-10 21:27:49 +00:00
Gerald Combs 6f55c03852 Fix compilation warnings.
svn path=/trunk/; revision=44489
2012-08-14 16:01:47 +00:00
Gerald Combs 6791192b97 Don't overwrite preview item labels.
svn path=/trunk/; revision=44173
2012-07-31 22:12:41 +00:00
Gerald Combs 5fc656ee46 Add a preview to the common file dialog. Adjust the win32 file dialog
preview logic slightly.

svn path=/trunk/; revision=44080
2012-07-27 21:43:02 +00:00
Gerald Combs b0a562b82d Remove the filename from the Win32 file dialog preview. It's already
shown in two places and there's no reason to show it in a third.

Use CommDlg_OpenSave_GetFilePath instead of CommDlg_OpenSave_GetSpec so
that previews work properly for folders.

svn path=/trunk/; revision=43877
2012-07-21 01:14:08 +00:00
Gerald Combs 281e18d636 Move most of file_open_cmd to gtk_open_file. Make gtk_open_file
and win32_open_file behave similarly. _snwprintf is "banned". Use
StringCchPrintf instead. Tested on Windows. I'll test on OS X shortly.

svn path=/trunk/; revision=43756
2012-07-16 20:46:13 +00:00
Gerald Combs c7c73e44b5 MSDN says DIALOG resources are obsolete. Use DIALOGEXes instead. We aren't
adding extra controls to the save dialog any more so remove its template.

svn path=/trunk/; revision=43676
2012-07-11 21:25:42 +00:00
Anders Broman 0696f30690 From Michael Mann:
GUI use external name resolver proliferation

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7380

svn path=/trunk/; revision=43615
2012-07-09 01:36:54 +00:00
Anders Broman c19583b72c From Michael Mann:
Generic preferences implementation - Printing and Name Resolution.

svn path=/trunk/; revision=43579
2012-07-06 04:48:36 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris 16f582176b In the Windows capture file "Save As" dialog code, do the same sort of
checks for the inability to save comments that we do for UN*X.  This
should fix bug 7222, although the UI isn't currently as nice, as the
dialog boxes are Windows dialog boxes and we don't set the button labels
to reflect the actual choices being offered to the user.  (We may be
able to do that by using template resources to construct the message
boxes.)

svn path=/trunk/; revision=43444
2012-06-23 08:18:14 +00:00
Anders Broman 4e5f1e9914 MAke it compile by adding discard_comments = FALSE
svn path=/trunk/; revision=43394
2012-06-20 04:42:55 +00:00
Guy Harris 2bd813507a Export a wtap_dump_can_write_encaps() routine from Wiretap; it takes a
file type and a GArray of encapsulation types and returns TRUE if a
capture with all those encapsulation types can be written to a file in
that file type and FALSE otherwise.  Use it where appropriate.

svn path=/trunk/; revision=43315
2012-06-17 16:44:09 +00:00
Guy Harris a877e3e9d5 Reflect change to wtap_get_savable_file_types.
svn path=/trunk/; revision=43302
2012-06-17 01:50:52 +00:00
Guy Harris 92f38021bf See if this fixes the include problem.
svn path=/trunk/; revision=42857
2012-05-25 21:58:10 +00:00
Guy Harris 3ccf517f37 Fix some build problems.
svn path=/trunk/; revision=42856
2012-05-25 21:52:50 +00:00
Guy Harris 6014035703 Use GTK+'s GtkMessageDialog for the questions we ask in the process of
saving files, and run it modal (which we're already doing with the
GtkFileChooserDialog); this means less callback-based state machine
stuff, simplifying the code paths a bit.

If we're saving a file before closing it, don't bother reloading it
after saving it.

svn path=/trunk/; revision=42855
2012-05-25 21:25:55 +00:00
Guy Harris 73888ed977 We have to tell cf_save_packets() whether to save them in compressed
form; say "don't" for now.

svn path=/trunk/; revision=42817
2012-05-24 02:30:43 +00:00
Guy Harris b655197a9d In the "Save As" and "Export Specified Packets" code path, do a "safe
save" if the destination file exists.

Don't forbid overwriting an existing file in either of those cases (we
still forbid overwriting the current capture file) - the GUI asks the
user whether they want to do the overwrite, and allows them to cancel
out of it - and don't remove the file before writing to it (doing so
makes the save *un*safe).

Attempt to do a save of an unedited temporary file by just moving the
file on Windows as well as on UN*X - ws_rename() will remove the target
if necessary on Windows (and won't do it as a separate operation before
attempting the rename), so it behaves like ws_rename() on UN*X (which is
just a wrapper around rename()).

svn path=/trunk/; revision=42816
2012-05-24 02:16:53 +00:00
Guy Harris 322c827a42 Fix comparison of file extension with extensions for the file type -
compare extension with extension, not dot-plus-extension with extension.

Skip unnecesary test.

Clean up white space.

svn path=/trunk/; revision=42803
2012-05-23 03:27:34 +00:00
Guy Harris e6a57c8e93 In Windows, in the Save As and Export Selected Packets dialog, append
the default extension for the file type iff

	the file type we're using has a list of extensions;

	the file has no extension or it has one but it's not one of the
	ones in the list.

*Don't* expect a file extension to be at most 5 characters plus the dot
- the extension for pcap-ng, our default capture file type, is "pcapng",
and that's 6 characters!

svn path=/trunk/; revision=42800
2012-05-23 03:05:17 +00:00
Guy Harris 26974768dd No packet range stuff for the "Save As" dialog.
svn path=/trunk/; revision=42799
2012-05-23 01:06:51 +00:00
Guy Harris 07835ce129 Do the "Save As always saves the entire capture, Export Specified
Packets saves specified packets" stuff for Windows.

svn path=/trunk/; revision=42794
2012-05-22 22:39:30 +00:00
Anders Broman 743b2fb52e cf_save -> cf_save_as
svn path=/trunk/; revision=42781
2012-05-22 12:35:49 +00:00
Jeff Morriss 89cfdc3559 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -
make Save-As/Displayed/All-Packets save not only the displayed packets but
also any other packets needed (e.g., for reassembly) to fully dissect the
displayed packets.

This works only for the "All packets" case; choosing only the Selected packet,
the Marked packets, or a range of packets would require actually storing which
packets depend on which (too much memory) or going through the packet list many
times (too slow).  Also, this behavior is always the case: you can't save the
displayed packets without their dependencies (I don't see why this would be
desirable).

So far this is done for SCTP and things using the reassembly routines (TCP has
been tested).

The Win32 dialog was modified but hasn't been tested yet.

One confusing aspect of the UI is that the Displayed count in the Save-As
dialog does not match the number of displayed packets.  (I tried renaming the
button "Displayed + Dependencies" but it looked too big.)  The tooltip tries
to explain this and the fact that this works only in the All-Packets case;
suggestions for improvement are welcome.


Implementation details:

Dissectors (or the reassembly code) can list frames which were needed to
build the current frame's tree.  If the current frame passes the display
filter then each listed frame is marked as "depended upon" (this takes up the
last free frame_data flag).

When performing a Save-As/Displayed/All-Packets then choose packets which
passed the dfilter _or_ are depended upon.

svn path=/trunk/; revision=41216
2012-02-28 03:19:49 +00:00
Guy Harris a127e69037 build_file_save_type_list() isn't called if there are no savable file
types.

svn path=/trunk/; revision=40690
2012-01-24 09:29:02 +00:00
Guy Harris c3d2108e32 Only free the file extensions list if there is one to free.
svn path=/trunk/; revision=40689
2012-01-24 09:18:06 +00:00
Guy Harris 313d2c583a Don't free the list of savable file types in build_file_save_type_list()
- we use it later, and we're freeing it later.

svn path=/trunk/; revision=40688
2012-01-24 08:20:37 +00:00
Guy Harris cbd9a418f1 Fix warnings.
svn path=/trunk/; revision=40687
2012-01-24 08:09:33 +00:00
Guy Harris e21727258c Use wtap_get_savable_file_types() for the Win32 file save dialog.
svn path=/trunk/; revision=40686
2012-01-24 05:55:00 +00:00
Guy Harris 7a3653b9c8 Don't treate WTAP_FILE_UNKNOWN as a real file type.
svn path=/trunk/; revision=40679
2012-01-24 00:48:48 +00:00
Guy Harris 3b1f82d063 In the table of capture file types, have:
a field that gives the default extension for the file type,
	*without* a leading "." (i.e., just the extension, not the "."
	that separates it from the rest of the file name), which is NULL
	if there are no known extensions;

	a field that gives a semicolon-separated list of *other*
	extensions, without "*." or ".", which is NULL if there are no
	known extensions or there are no known extensions other than the
	default.

Rename wtap_file_extension_default_string() to
wtap_default_file_extension() (matches the name of the field).

svn path=/trunk/; revision=40678
2012-01-23 23:17:03 +00:00