Commit Graph

92 Commits

Author SHA1 Message Date
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
Guy Harris e33f160de6 g_string_append_printf() returns nothing.
svn path=/trunk/; revision=40676
2012-01-23 22:23:37 +00:00
Guy Harris bb98263aa4 Have wtap_file_extension_default_string() return the extension in the
sense of "what follows the last . in the file name", i.e. not including
the ".".

svn path=/trunk/; revision=40674
2012-01-23 21:57:45 +00:00
Guy Harris 340d882fba All valid file types should have file type strings (and, currently, they
all do); get rid of the test for a null return from
wtap_file_type_string().)

If wtap_get_file_extensions_list() returns NULL, include the file type
in the list of filters, and use "*.*" as the filter.  That way the list
of filters will include all file types, even if you can't really ask
only for files of that type (actually, you can't really ask only for
files of *any* type unless you're running under a desktop environment
where file types are specified by, for example, looking for magic
numbers, as there's no guarantee that, for example, a pcap file will
have an extension at all, given that it might come from a command-line
tool that doesn't default to any extension).

svn path=/trunk/; revision=40650
2012-01-22 11:37:33 +00:00
Guy Harris 7b9deb699a We already added the separator *if* we needed it; don't add it again.
svn path=/trunk/; revision=40643
2012-01-21 23:50:06 +00:00
Guy Harris cc4bae5159 Well, yeah, you can leave the list of patterns out, but then they don't
show up in the UI, and they appear to show up in the UI in the Windows
apps I've seen, so I guess Windows apps put the list of patterns into
the description.

svn path=/trunk/; revision=40642
2012-01-21 23:48:03 +00:00
Guy Harris d494beebcf Fix calls to g_string_free() (added so as not to leak memory).
svn path=/trunk/; revision=40641
2012-01-21 23:45:15 +00:00
Guy Harris d19dba2c76 At least according to the Microsoft documentation, you don't duplicate
the list of patterns; see what happens.

svn path=/trunk/; revision=40640
2012-01-21 23:44:19 +00:00
Guy Harris 1831fc8106 What you get from wtap_get_file_extensions_list() are extensions, not
patterns; add the "*.".

svn path=/trunk/; revision=40639
2012-01-21 23:23:18 +00:00
Guy Harris 73b8659ae4 Fix print call.
svn path=/trunk/; revision=40638
2012-01-21 23:09:40 +00:00
Guy Harris 34d26e6ee0 Append the trailing ), don't overwrite the string.
svn path=/trunk/; revision=40637
2012-01-21 22:07:49 +00:00
Guy Harris f478979299 Add missing variable.
svn path=/trunk/; revision=40624
2012-01-21 11:28:02 +00:00
Guy Harris e4a193fe5e Replace wtap_file_extensions_string() with a routine that returns a
GSList of extensions for a file type, including extensions for the
compressed versions of those file types that we can read.

svn path=/trunk/; revision=40623
2012-01-21 08:59:21 +00:00
Guy Harris fe2d4368d9 New include file needs to be included.
svn path=/trunk/; revision=40567
2012-01-18 20:55:55 +00:00
Guy Harris b423352edf Just include it from the current directory.
svn path=/trunk/; revision=40537
2012-01-16 02:17:03 +00:00
Guy Harris 821166ff8b Another fix for the move of the win32 directory.
svn path=/trunk/; revision=40536
2012-01-16 02:16:30 +00:00
Guy Harris 0db1b9ae17 Make the win32 directory a subdirectory of the ui directory.
svn path=/trunk/; revision=40531
2012-01-16 01:26:46 +00:00