Commit Graph

142 Commits

Author SHA1 Message Date
Guy Harris 4624549a99 From Mark C. Brown: allow the file type for the merge operation to be
specified in the GUI.

svn path=/trunk/; revision=12326
2004-10-17 02:53:26 +00:00
Guy Harris 727ad67453 Remove the fixed maximum number of subranges in a range_t; dynamically
allocate them to be large enough.

Add checks that the numbers in the range fit in a guint32.

Check the validity of a range before saving or printing, and report
errors in an alert box.

Clean up white space.

svn path=/trunk/; revision=12320
2004-10-16 23:32:24 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Ulf Lamping 636317d3a6 Fix a minor bug only with GTK2.4: if have a problem while saving a file (e.g. filename already exists) will lead to an unresponding file dialog. The fix will close the dialog, which isn't the best solution, but I don't see a better one.
svn path=/trunk/; revision=11943
2004-09-08 19:26:36 +00:00
Guy Harris f06c1b5fb0 The packet range stuff knows about capture_file structures, so it's
really more of an Ethereal/Tethereal component than a libethereal
component (nothing else in libethereal knows about capture files); move
it back out of libethereal.  (The range stuff doesn't; we leave it in
libethereal.)

svn path=/trunk/; revision=11898
2004-09-04 20:02:11 +00:00
Guy Harris 478ba9a691 Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";
they should ultimately be split into files with routines that handle
ranges, which are just subsets of [0,2^32), and packet ranges, which are
subsets of the packet list, possibly specified by a range.

Move them into epan, so they can be used by, for example, utilities that
handle ranges, such editcap.

svn path=/trunk/; revision=11890
2004-09-04 00:53:16 +00:00
Ulf Lamping 5e32dc06eb added a preference setting, to be able to change the preview timeout in the file open dialog (as requested by Ronnie Sahlberg).
svn path=/trunk/; revision=11859
2004-08-31 09:22:57 +00:00
Ulf Lamping 50b29ff07d Split the preview function into a prepare and a do part, to be able to do some experiments about the preview timeout things.
As the FileChooser dialog (GTK2.4) doesn't seem to let pass other GTK events (even with calling gtk_main_iteration()), it's not possible to change the preview behaviour to be more keen. To get a mechanism to update the preview independant from the dialog workings, we would need to start a new thread/task, which is too much effort for this IMHO.

So we might use the more simple approach of setting the timeout by a preference setting.

svn path=/trunk/; revision=11856
2004-08-31 08:18:10 +00:00
Gerald Combs c8235fae25 Move the file-reloading code from gtk/file_dlg.c to file.c.
svn path=/trunk/; revision=11823
2004-08-25 03:01:32 +00:00
Gerald Combs 76fd761686 As suggested by Guy: Have mark_frame() do nothing if the frame has
already been marked and have unmark_frame() do likewise.  Don't mess
with the marked frame count in mark_all_frames().

Be a little more paranoid about the marked frame count in other places.

svn path=/trunk/; revision=11775
2004-08-19 14:35:55 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Guy Harris b67a0f92d2 Move color_filters.c and color_filters.h up to the top-level directory,
as they're now (theoretically) toolkit-independent (modulo changes that
might be required to the code to update filter lists when a new filter
is read in).

svn path=/trunk/; revision=11500
2004-07-24 01:29:12 +00:00
Ulf Lamping bfd6ace52e renamed filter_prefs to filter_dlg, as the filter settings are (well, for a long time) no longer part of the preferences dialog.
svn path=/trunk/; revision=11436
2004-07-19 21:42:01 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris fd262f1b97 From Daniel Thompson: add additional message/alert box options to
display "Save", "Continue without Saving", and "Cancel", for the "do you
want to save?" messages.

svn path=/trunk/; revision=11372
2004-07-13 07:15:45 +00:00
Guy Harris 9cff51ea78 Include <unistd.h>, if available, to declare "close()".
svn path=/trunk/; revision=11278
2004-06-30 07:12:25 +00:00
Ulf Lamping 24527148ab close temporary merge output file, if merging failed
svn path=/trunk/; revision=11275
2004-06-30 05:49:30 +00:00
Ulf Lamping 19c7f04794 avoid using tmpnam() for security reasons.
instead of giving the merge stuff a filename,
give it an already opened file descriptor

svn path=/trunk/; revision=11273
2004-06-29 20:59:24 +00:00
Jörg Mayer 4bbb32eaaa The patch to fix the race condition introduced by using tmpnam replaced
insecure code by not-working code.  As I currently lack the time to fix
this properly until Monday as the earliest possible date I undo the patch.

Please note that Ethereal should not be used on multiuser systems with
untrusted users until a proper fix has been applied.

svn path=/trunk/; revision=11263
2004-06-29 03:27:52 +00:00
Ulf Lamping bf6103638f minor bugfix for merge dialog: use the correct handle for resizing
svn path=/trunk/; revision=11259
2004-06-28 15:09:26 +00:00
Jörg Mayer 0195deceae tmpnam() really should not be used for security reasons.
Replace it where used and update README.developer accordingly.

svn path=/trunk/; revision=11235
2004-06-25 07:04:03 +00:00
Ulf Lamping 5c061e582e if more than one file is (drag and) dropped into the program,
merge them together into a new temporary file
(and notice the user by a simple_dialog about it)

svn path=/trunk/; revision=11205
2004-06-21 16:45:07 +00:00
Ulf Lamping 527ad5b35d use the "correct" resize function for the file selection dialog
svn path=/trunk/; revision=11202
2004-06-21 05:48:15 +00:00
Ulf Lamping 2c59ab145d bugfix: handle NULL pointer correct,
if gtk_file_chooser_get_filename returned NULL

svn path=/trunk/; revision=11197
2004-06-20 18:36:16 +00:00
Ulf Lamping c5bae1f7e3 preference setting, so "ask for unsaved capture files" can be switched off
svn path=/trunk/; revision=11196
2004-06-20 15:57:11 +00:00
Ulf Lamping f098b90832 preview: add 3 seconds timeout, and show the information got so far.
This will prevent getting the preview information take a lot of time for
*very* long capture files. However, on a Pentium-M 1.6 even a 35MB
capture file will not timeout in this 3 second interval.

svn path=/trunk/; revision=11192
2004-06-20 09:35:51 +00:00
Guy Harris 1d2413f4a3 Include <string.h> to declare "strlen()".
Make "cf_name" a "const gchar *", as, at least in GTK+ 2.x, a "const
gchar *" is assigned to it.  (If it's just a "gchar *" being assigned to
it, declaring it a "const gchar *" does no harm.)

svn path=/trunk/; revision=11190
2004-06-20 07:28:02 +00:00
Guy Harris 894c4e445c Make the elapsed time value an "unsigned int" (if the stop time is
before the start time, due to packet time stamp bogosity, neither a
signed value nor an unsigned value will give a sensible answer, and it
doesn't need to be a "long" as the capture's unlikely to span more than
2^32-1 seconds, again modulo packet time stamp bogosity).  That
eliminates some format item vs. value warnings.

Make the packet count an "unsigned int" (it can't be negative, and we're
unlikely to have more than 2^32-1 packets - and, if we are, it should be
made a guint64).  That eliminates some more format item vs. value
warnings.

Initialize "start_time" and "stop_time" to 0, so that we handle files
with no packets (and so that we don't get uninitialized variable
warnings).

Display the file size with PRIu64, after casting it to "guint64" (that
way we handle file sizes if they're "unsigned int", "unsigned long", or
a 64-bit type on ILP64 platforms (it's 64 bits in BSDs derived from
4.4BSD, even on ILP64 platforms).

Mark the first argument to "file_open_entry_changed()" as unused.

Don't use G_CONST_RETURN, as it's not defined by GLib 1.2[.x].

Get rid of an unused variable.

Clean up white space.

svn path=/trunk/; revision=11189
2004-06-20 03:05:57 +00:00
Ulf Lamping 915f02d0f5 add preview information to the open and merge dialog boxes
svn path=/trunk/; revision=11187
2004-06-19 10:48:06 +00:00
Ulf Lamping fa46f7a6db merge: bugfixes and code cleanup
svn path=/trunk/; revision=11175
2004-06-18 07:41:21 +00:00
Ulf Lamping 0657cbad2e added some tooltips, minor code cleanup
svn path=/trunk/; revision=11174
2004-06-18 05:58:30 +00:00
Guy Harris 25fc80c257 Use an adverb to modify a verb.
svn path=/trunk/; revision=11173
2004-06-17 22:42:40 +00:00
Guy Harris 6f9b4384d5 Include <string.h> to declare "strdup()".
svn path=/trunk/; revision=11172
2004-06-17 22:41:29 +00:00
Ulf Lamping bd3aea8d04 add Merge functionality to Ethereal in an experimental state.
Copied and sligthly modified merge.c from mergecap.c
(needs a lot of code cleanup, though)

svn path=/trunk/; revision=11171
2004-06-17 21:53:26 +00:00
Ulf Lamping 14bf83c340 add details for doxygen, various code cleanups as a result of this
svn path=/trunk/; revision=11052
2004-06-01 17:33:37 +00:00
Ulf Lamping 8d121bfb92 use gtk_window_set_default_size() instead of WIDGET_SET_SIZE() for the dialogs,
as WIDGET_SET_SIZE() will prevent the user from shrinking the dialog,
and gtk_window_set_default_size() will not

svn path=/trunk/; revision=11021
2004-05-27 19:59:50 +00:00
Ulf Lamping 7d37fc9d23 more code cleanup from dialog things:
changed window_xy (dialog) function calling in a lot of gtk files
cleanup of file selection code
cleanup in dlg_utils/file_dlg/ui_util
Please report any problems!!!

svn path=/trunk/; revision=11003
2004-05-26 03:49:24 +00:00
Guy Harris 8774b55cbb Get rid of static forward declaration of "toggle_captured_cb()", as it's
no longer defined here.

svn path=/trunk/; revision=10669
2004-04-23 03:22:10 +00:00
Ulf Lamping 50533286e2 oops, forgotten to test with GTK1...
svn path=/trunk/; revision=10666
2004-04-22 21:40:48 +00:00
Ulf Lamping 3b86a98d53 seperated common packet range code from the save and the print dialog,
and put it into new range_utils files. This will avoid:
a) duplicate code in save and print dialog and
b) yet another code duplication for future dialogs (export, ...)

svn path=/trunk/; revision=10665
2004-04-22 21:31:09 +00:00
Guy Harris f76d50c881 Add another wrapper routine, "file_selection_set_extra_widget()", to set
the "extra options" portion of a file selection dialog, and use it
rather than #if'ed code.

svn path=/trunk/; revision=10512
2004-03-29 22:55:13 +00:00
Guy Harris 29c644691b Make "file_selection_new()" take as its second argument an
Ethereal-defined indication of the action (open vs. save), regardless of
whether we're building for GTK+ >= 2.4 or not; we just ignore the
argument in pre-2.4 GTK+.

Use "file_selection_new()" rather than #if'ed code to use it or
"gtk_file_chooser_dialog_new()"  for GTK+ >= 2.4 and
"gtk_file_selection_new()" or it for pre-2.4 GTK+.

Add a "file_selection_set_current_folder()" routine that does the
appropriate thing depending on whether we're GTK+ >= 2.4 or not, and use
that rather than #if'ed code to use
"gtk_file_chooser_set_current_folder()" or
"gtk_file_selection_set_filename()".

svn path=/trunk/; revision=10511
2004-03-29 22:40:58 +00:00
Ulf Lamping 6af5992f02 minor code cleanup, including removed MSVC warnings
svn path=/trunk/; revision=10509
2004-03-27 12:18:40 +00:00
Olivier Abad cd19c5baf8 Use the new GtkFileChooserDialog when built with gtk+ 2.4
svn path=/trunk/; revision=10502
2004-03-27 11:16:58 +00:00
Ulf Lamping c9ea03f55a added dfilter string syntax check to various places
svn path=/trunk/; revision=10252
2004-02-27 19:07:20 +00:00
Ulf Lamping d50cbeb79a bugfix: use last_open_dir for the recent file,
instead of the somewhat duplicated value in the recent struct

svn path=/trunk/; revision=10077
2004-02-17 14:49:11 +00:00
Guy Harris 90cf9a6b7b The HIG's and/or GUI toolkit documentation for:
Mac OS X

	GNOME

	Qt

	KDE

	Windows

all indicate that {message,alert} boxes are modal, at least for the
window to which they apply.  (Presumably the idea is that not forcing
the user to pay attention to the alert box, and allowing more than one
alert box to be up for a given window, causes more problems than not
letting the user do stuff to that window in order to figure out what the
underlying problem is or figure out what to do to fix it - the message
should be sufficient, in most if not all cases, to let you know what the
problem is.)

Make "simple_dialog()" unconditionally make the alert box modal, and get
rid of ESD_TYPE_MODAL.  XXX - we need to make it possible to make an
alert box modal for a given window, rather than just the top-level
window.

svn path=/trunk/; revision=10051
2004-02-12 22:24:28 +00:00
Guy Harris 2e4e229739 Get rid of the "Question" alert box type - rename it to "Confirmation",
as that seems to be the name used in the GNOME HIG, at least.  Make it
use the Warning icon (that's what the GNOME HIG says - and it's also
what's used for the equivalent on Windows), and use it for the "Save
current capture?" alert boxes.

svn path=/trunk/; revision=10030
2004-02-11 03:55:48 +00:00
Guy Harris c7fd1b2b13 Add a routine to be used to put up alert boxes for invalid display
filter expressions; use that in a number of places, so we use the same
alert box.  (More work is needed to figure out the right way to handle
some other "dfilter_compile()" failures.)

Use the error message from the display filter as the primary error, as
that's the message that tells you what the underlying problem is.  (The
GNOME HIG says "In most situations the user should only need the primary
text to make a quick decision", so the primary text should tell you
what's wrong with the filter, not just that it's invalid.  If there are
messages from the display filter code that don't give enough
information, or are a bit cryptic, such as "Unexpected end of filter
string," those should be fixed in the display filter code.)

Improve the error used if an empty filter is used for "find frame".

svn path=/trunk/; revision=10025
2004-02-11 00:55:28 +00:00
Guy Harris 372e6b2da0 Add some comments about the types of alert boxes you get with the
simple_dialog routines (which are really just message box/alert box
routines).

Add some macros for combinations of buttons (corresponding to
combinations that some GUI toolkits, which only support some
combinations, allow).

svn path=/trunk/; revision=9977
2004-02-04 01:10:37 +00:00